void animation(SDL_Rect* nubz){
nubz.x += 32;
nubz.y = 0;
nubz.w = 32;
nubz.h = 32;
}
// this next stuff is in main
SDL_Rect rect1; // Pos in image
rect1.x=200;
rect1.y=200;
SDL_Rect rect2;
animation(rect2);
SDL_BlitSurface(image1,&rect2,buffer,&rect1); // draws the image
\main.cpp||In function 'void animation(SDL_Rect*)':|
\main.cpp|11|error: request for member 'x' in 'nubz', which is of non-class type 'SDL_Rect*'|
\main.cpp|12|error: request for member 'y' in 'nubz', which is of non-class type 'SDL_Rect*'|
\main.cpp|13|error: request for member 'w' in 'nubz', which is of non-class type 'SDL_Rect*'|
\main.cpp|14|error: request for member 'h' in 'nubz', which is of non-class type 'SDL_Rect*'|
\main.cpp||In function 'int SDL_main(int, char**)':|
\main.cpp|70|error: cannot convert 'SDL_Rect' to 'SDL_Rect*' for argument '1' to 'void animation(SDL_Rect*)'|
\main.cpp|74|warning: comparison between signed and unsigned integer
i gues my problem is "SDL_Rect*" in "animation" but without the "*"
it wont do anithing.
i got no other idea how to do it outside main...