Hey all
I am trying to fill a rectangle on a surface with SDL_FillRect(). I get the error:
error: cannot convert `SDL_Rect' to `SDL_Rect*' for argument `2' to `int SDL_FillRect(SDL_Surface*, SDL_Rect*, Uint32)'
To make the rectangle, I use:
SDL_Rect playfieldrect;
playfieldrect.w = 24 * 10;
playfieldrect.h = 24 * 20;
playfieldrect.x = (screen->w / 2) - (24 * 5);
playfieldrect.y = (screen->h / 2) - (24 * 10);
To draw the rectangle, I use:
SDL_FillRect( screen, playfieldrect, SDL_MapColor( screen, color[whitea] ) );
Can I convert the SDL_Rect to *SDL_Rect? Cos if I define
playfieldrect as a pointer, I can't edit its properties anymore... I must admit, I don't know much about pointers/references...