Browse Source

Report correct window size in the screen mode event if maximizing the window on startup. Closes #247.

Lasse Öörni 11 years ago
parent
commit
4d15a2c09b

+ 3 - 0
Source/Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -387,7 +387,10 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
     AdjustWindow(width, height, fullscreen, borderless);
 
     if (maximize)
+    {
         Maximize();
+        SDL_GetWindowSize(impl_->window_, &width, &height);
+    }
     
     if (fullscreen)
     {

+ 3 - 0
Source/Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -395,7 +395,10 @@ bool Graphics::SetMode(int width, int height, bool fullscreen, bool borderless,
         CreateWindowIcon();
 
         if (maximize)
+        {
             Maximize();
+            SDL_GetWindowSize(impl_->window_, &width, &height);
+        }
         
         // Create/restore context and GPU objects and set initial renderstate
         Restore();