Parcourir la source

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

Lasse Öörni il y a 11 ans
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);
     AdjustWindow(width, height, fullscreen, borderless);
 
 
     if (maximize)
     if (maximize)
+    {
         Maximize();
         Maximize();
+        SDL_GetWindowSize(impl_->window_, &width, &height);
+    }
     
     
     if (fullscreen)
     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();
         CreateWindowIcon();
 
 
         if (maximize)
         if (maximize)
+        {
             Maximize();
             Maximize();
+            SDL_GetWindowSize(impl_->window_, &width, &height);
+        }
         
         
         // Create/restore context and GPU objects and set initial renderstate
         // Create/restore context and GPU objects and set initial renderstate
         Restore();
         Restore();