Removed pointless check for screen mode change, as we are creating the window for...
authorIngo Ruhnke <grumbel@gmail.com>
Thu, 31 Jul 2014 06:26:21 +0000 (08:26 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Thu, 31 Jul 2014 06:26:21 +0000 (08:26 +0200)
src/video/gl/gl_renderer.cpp

index 950ee40..21ab41a 100644 (file)
@@ -630,43 +630,39 @@ GLRenderer::apply_video_mode(const Size& size, bool fullscreen)
   }
   else
   {
-    // Only change video mode when its different from the current one
-    if (screen_size != size || fullscreen_active != fullscreen)
-    {
-      int flags = SDL_WINDOW_OPENGL;
+    int flags = SDL_WINDOW_OPENGL;
 
-      if (fullscreen)
-      {
-        flags |= SDL_WINDOW_FULLSCREEN;
-      }
-      else
-      {
-        flags |= SDL_WINDOW_RESIZABLE;
-      }
+    if (fullscreen)
+    {
+      flags |= SDL_WINDOW_FULLSCREEN;
+    }
+    else
+    {
+      flags |= SDL_WINDOW_RESIZABLE;
+    }
 
-      window = SDL_CreateWindow("SuperTux",
-                                SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
-                                size.width, size.height,
-                                flags);
-      if (!window)
-      {
-        std::ostringstream msg;
-        msg << "Couldn't set video mode " << size.width << "x" << size.height << ": " << SDL_GetError();
-        throw std::runtime_error(msg.str());
-      }
-      else
-      {
-        glcontext = SDL_GL_CreateContext(window);
-        screen_size = size;
+    window = SDL_CreateWindow("SuperTux",
+                              SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
+                              size.width, size.height,
+                              flags);
+    if (!window)
+    {
+      std::ostringstream msg;
+      msg << "Couldn't set video mode " << size.width << "x" << size.height << ": " << SDL_GetError();
+      throw std::runtime_error(msg.str());
+    }
+    else
+    {
+      glcontext = SDL_GL_CreateContext(window);
+      screen_size = size;
         
-        PHYSICAL_SCREEN_WIDTH = size.width;
-        PHYSICAL_SCREEN_HEIGHT = size.height;
+      PHYSICAL_SCREEN_WIDTH = size.width;
+      PHYSICAL_SCREEN_HEIGHT = size.height;
 
-        SCREEN_WIDTH = size.width;
-        SCREEN_HEIGHT = size.height;
+      SCREEN_WIDTH = size.width;
+      SCREEN_HEIGHT = size.height;
         
-        fullscreen_active = fullscreen;
-      }
+      fullscreen_active = fullscreen;
     }
   }
 }