Hello. I am making a small space invaders game, and until I make some
graphics, I am just using solid colored blocks. Below I have included my
drawing functions (just a few lines). The problem is that it is very
flickery. I have initialized SDL with the ASYNCBLIT (which enables
vsync???). Anything I’m missing or any help at all.
void Game_Display () {
/* Display the player */
SDL_FillRect (MainSurface, &player.collision, SDL_MapRGB
(MainSurface->format, 100, 0, 0));
/* Update the screen */
SDL_UpdateRects (MainSurface, numRects, updateRects);
}
void Game_UnDisplay() {
int i;
for (i = 0; i < numRects; i++)
SDL_FillRect (MainSurface, &updateRects[i], SDL_MapRGB
(MainSurface->format, 0, 0, 0));
SDL_UpdateRects (MainSurface, numRects, updateRects);
}
Game_UnDisplay is called, then the player moves, then the screen is redrawn.
- Mik Mifflin
dogansmoobs at ctel.net