changeset 5188:1425cff805f0

Allow resizing of testsprite
author Sam Lantinga <slouken@libsdl.org>
date Fri, 04 Feb 2011 21:46:38 -0800
parents d976b67150c5
children 97d0480b420c
files test/testsprite.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;