test/testsprite.c
changeset 663 8bedd6d61642
parent 587 f00ccf8d8edc
child 753 b14fdadd8311
--- a/test/testsprite.c	Mon Jul 28 01:47:55 2003 +0000
+++ b/test/testsprite.c	Mon Aug 04 00:52:42 2003 +0000
@@ -54,10 +54,6 @@
 
 void MoveSprites(SDL_Surface *screen, Uint32 background)
 {
-#if DEBUG_FLIP
-    static int t = 0;
-#endif
-
 	int i, nupdates;
 	SDL_Rect area, *position, *velocity;
 
@@ -90,15 +86,19 @@
 
 #if DEBUG_FLIP
     {
-        Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
-        SDL_Rect r;
-        r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
-        r.y = 0;
-        r.w = 20;
-        r.h = screen->h;
+	if ( (screen->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF ) {
+            static int t = 0;
+
+            Uint32 color = SDL_MapRGB (screen->format, 255, 0, 0);
+            SDL_Rect r;
+            r.x = (sin((float)t * 2 * 3.1459) + 1.0) / 2.0 * (screen->w-20);
+            r.y = 0;
+            r.w = 20;
+            r.h = screen->h;
         
-        SDL_FillRect (screen, &r, color);
-        t+=2;
+            SDL_FillRect (screen, &r, color);
+            t+=2;
+        }
     }
 #endif