Mercurial > sdl-ios-xcode
comparison test/testsprite.c @ 2792:c2d9b1aff59f
Show the grey background first before starting to blit sprites
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 27 Nov 2008 04:51:34 +0000 |
parents | 8c9fa61a521c |
children | 9de326b3099c |
comparison
equal
deleted
inserted
replaced
2791:8133d1d278da | 2792:c2d9b1aff59f |
---|---|
245 while (!velocities[i].x && !velocities[i].y) { | 245 while (!velocities[i].x && !velocities[i].y) { |
246 velocities[i].x = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; | 246 velocities[i].x = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; |
247 velocities[i].y = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; | 247 velocities[i].y = (rand() % (MAX_SPEED * 2 + 1)) - MAX_SPEED; |
248 } | 248 } |
249 } | 249 } |
250 | |
251 /* Clear the background to grey */ | |
250 background = SDL_MapRGB(screen->format, 0xA0, 0xA0, 0xA0); | 252 background = SDL_MapRGB(screen->format, 0xA0, 0xA0, 0xA0); |
253 SDL_FillRect(screen, NULL, background); | |
254 SDL_Flip(screen); | |
251 | 255 |
252 /* Print out information about our surfaces */ | 256 /* Print out information about our surfaces */ |
253 printf("Screen is at %d bits per pixel\n", screen->format->BitsPerPixel); | 257 printf("Screen is at %d bits per pixel\n", screen->format->BitsPerPixel); |
254 if ((screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE) { | 258 if ((screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE) { |
255 printf("Screen is in video memory\n"); | 259 printf("Screen is in video memory\n"); |