Hooked up window resize event (not yet implemented in Renderer)
authorIngo Ruhnke <grumbel@gmail.com>
Wed, 30 Jul 2014 18:25:46 +0000 (20:25 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Wed, 30 Jul 2014 18:25:46 +0000 (20:25 +0200)
src/supertux/screen_manager.cpp

index 36fdc11..353f209 100644 (file)
@@ -206,10 +206,16 @@ const Uint8 *keystate =  SDL_GetKeyboardState(NULL); //edited by giby
         quit();
         break;
               
-    //  case SDL_ResizeEvent: //edit by giby
-    //    Renderer::instance()->resize(event.resize.w, event.resize.h);
-    //    MenuManager::recalc_pos();
-    //    break;
+      case SDL_WINDOWEVENT:
+        switch(event.window.type)
+        {
+          case SDL_WINDOWEVENT_RESIZED:
+            Renderer::instance()->resize(event.window.data1,
+                                         event.window.data2);
+            MenuManager::recalc_pos();
+            break;
+        }
+        break;
             
       case SDL_KEYDOWN:
         if (event.key.keysym.sym == SDLK_F10)