SDL clear function,
Moderators - Reputation: 10655
Posted 20 September 2006 - 05:19 AM
Replace 0 with any combination of SDL_MapRGB(SDL_GetVideoSurface()->format,r,g,b) for different colours.
Replace NULL with the address of a SDL_Rect structure to control how much of the surface to fill. NULL means "fill the entire surface".
Disadvantages, it might be slow. If you can just clear the backgrounds under the sprites that are moving that can be much faster. Depends on the kind of game you have really, as to what you can do.