test/testoverlay2.c
changeset 753 b14fdadd8311
parent 673 63419da96d13
child 886 05c551e5bc64
--- a/test/testoverlay2.c	Wed Dec 10 12:32:38 2003 +0000
+++ b/test/testoverlay2.c	Wed Dec 10 12:35:56 2003 +0000
@@ -275,6 +275,7 @@
     SDL_Event event;
     Uint32 lastftick;
     int paused=0;
+    int resized=0;
     int i;
     int fps=12;
     int fpsdelay;
@@ -505,6 +506,10 @@
                      screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE);
                      overlayrect.w=event.resize.w;
                      overlayrect.h=event.resize.h;
+                     if (paused)
+                     {
+                         resized=1;
+                     }
                      break;
                 case SDL_KEYDOWN:
                      if (event.key.keysym.sym == SDLK_SPACE)
@@ -526,9 +531,9 @@
             }
         }
 
-        if (!paused)
+        if ((!paused)||(resized))
         {
-            if ((SDL_GetTicks()-lastftick)>fpsdelay)
+            if (((SDL_GetTicks()-lastftick)>fpsdelay)||(resized))
             {
                 lastftick=SDL_GetTicks();
 
@@ -552,10 +557,17 @@
                 }
 
                 SDL_DisplayYUVOverlay(overlay, &overlayrect);
-                i++;
-                if (i==10)
+                if (!resized)
                 {
-                    i=0;
+                    i++;
+                    if (i==10)
+                    {
+                        i=0;
+                    }
+                }
+                else
+                {
+                    resized=0;
                 }
             }
         }