Allow resizing of testsprite
authorSam Lantinga <slouken@libsdl.org>
Fri, 04 Feb 2011 21:46:38 -0800
changeset 5185 1425cff805f0
parent 5184 d976b67150c5
child 5186 97d0480b420c
Allow resizing of testsprite
test/testsprite.c
--- a/test/testsprite.c	Fri Feb 04 19:50:56 2011 -0800
+++ b/test/testsprite.c	Fri Feb 04 21:46:38 2011 -0800
@@ -172,7 +172,7 @@
     }
 
     numsprites = NUM_SPRITES;
-    videoflags = SDL_SWSURFACE | SDL_ANYFORMAT;
+    videoflags = SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE;
     width = 640;
     height = 480;
     video_bpp = 8;
@@ -297,6 +297,9 @@
         ++frames;
         while (SDL_PollEvent(&event)) {
             switch (event.type) {
+            case SDL_VIDEORESIZE:
+                screen = SDL_SetVideoMode(event.resize.w, event.resize.h, video_bpp, videoflags);
+                break;
             case SDL_MOUSEBUTTONDOWN:
                 SDL_WarpMouse(screen->w / 2, screen->h / 2);
                 break;