Yes dest is created in drawimg and it is passed into SDL_BlitSurface, but it isn't a pointer or reference, right? If it were a pointer I think the declaration would look something like this:
Code:
void DrawIMG(SDL_Surface *img, int x, int y) {
SDL_Rect* dest = new SDL_Rect;
dest.x = x;
dest.y = y;
SDL_BlitSurface(img, NULL, screen, &dest);
}
If it were a reference I think it would look something like this:
Code:
void DrawIMG(SDL_Surface *img, int x, int y) {
SDL_Rect& dest; //**
dest.x = x;
dest.y = y;
SDL_BlitSurface(img, NULL, screen, &dest);
}
)I'm not totally sure if that is how you declare a reference, but I know there would be a & in there somewhere if it was being declared as a reference)
Seeing as how it is declared like this:
SDL_Rect dest;
as opposed to the examples above it doens't look like a pointer or reference, thus it doesn't make sense to use a & in this line of code:
SDL_BlitSurface(img, NULL, screen, &dest);
Ok, I sure hope we understand each other because I want to get this little thing sorted out.