-
Arguments in function
Heres some objects I have setup in SDL:
Code:
SDL_Surface* screen;
SDL_Surface* tiles;
SDL_Rect src, dest;
Heres an example of passing these into a function:
Code:
SDL_BlitSurface(tiles , &src , screen , &dest);
I want to write a function that accepts these arguments, but I'm not sure how to write it.
As you can see I don't know what to put for the parameters 'src' and 'dest':
Code:
DoSomething(SDL_Surface *tiles, src, SDL_Surface *screen, dest)
Could someone quickly tell me how I should do this? Thanks.
-
Looks like SDL_Rect *src and SDL_Rect *dest to me...
-
Yeah, thats what I tried at first but it would not work at the time. I just realized that I declared these:
Code:
SDL_Surface* screen;
SDL_Surface* tiles;
SDL_Rect src, dest;
As globals, so I don't even have to pass them in. Maybe that was what caused the problem in the first place. I don't know.
-
If they're declared as pointers, then you would need &dst and &src