test/testoverlay2.c
changeset 753 b14fdadd8311
parent 673 63419da96d13
child 886 05c551e5bc64
     1.1 --- a/test/testoverlay2.c	Wed Dec 10 12:32:38 2003 +0000
     1.2 +++ b/test/testoverlay2.c	Wed Dec 10 12:35:56 2003 +0000
     1.3 @@ -275,6 +275,7 @@
     1.4      SDL_Event event;
     1.5      Uint32 lastftick;
     1.6      int paused=0;
     1.7 +    int resized=0;
     1.8      int i;
     1.9      int fps=12;
    1.10      int fpsdelay;
    1.11 @@ -505,6 +506,10 @@
    1.12                       screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE);
    1.13                       overlayrect.w=event.resize.w;
    1.14                       overlayrect.h=event.resize.h;
    1.15 +                     if (paused)
    1.16 +                     {
    1.17 +                         resized=1;
    1.18 +                     }
    1.19                       break;
    1.20                  case SDL_KEYDOWN:
    1.21                       if (event.key.keysym.sym == SDLK_SPACE)
    1.22 @@ -526,9 +531,9 @@
    1.23              }
    1.24          }
    1.25  
    1.26 -        if (!paused)
    1.27 +        if ((!paused)||(resized))
    1.28          {
    1.29 -            if ((SDL_GetTicks()-lastftick)>fpsdelay)
    1.30 +            if (((SDL_GetTicks()-lastftick)>fpsdelay)||(resized))
    1.31              {
    1.32                  lastftick=SDL_GetTicks();
    1.33  
    1.34 @@ -552,10 +557,17 @@
    1.35                  }
    1.36  
    1.37                  SDL_DisplayYUVOverlay(overlay, &overlayrect);
    1.38 -                i++;
    1.39 -                if (i==10)
    1.40 +                if (!resized)
    1.41                  {
    1.42 -                    i=0;
    1.43 +                    i++;
    1.44 +                    if (i==10)
    1.45 +                    {
    1.46 +                        i=0;
    1.47 +                    }
    1.48 +                }
    1.49 +                else
    1.50 +                {
    1.51 +                    resized=0;
    1.52                  }
    1.53              }
    1.54          }