]> git.lizzy.rs Git - irrlicht.git/commitdiff
CIrrDeviceWin32: readd fullscreen using borderless maximized window
authorsfan5 <sfan5@live.de>
Tue, 15 Jun 2021 16:14:10 +0000 (18:14 +0200)
committersfan5 <sfan5@live.de>
Tue, 15 Jun 2021 16:52:38 +0000 (18:52 +0200)
source/Irrlicht/CIrrDeviceWin32.cpp

index e0037b028b78c769f0c0f961dc083132eff0433d..09fb7ab1ddf2d50d9a521b20652cbcb1b49ac369 100644 (file)
@@ -1416,8 +1416,24 @@ bool CIrrDeviceWin32::switchToFullScreen()
        if (!CreationParams.Fullscreen)\r
                return true;\r
 \r
-       // To be filled...\r
-       return true;\r
+       // No border, title bar, etc. is already set up through getWindowStyle()\r
+       // We only set the window size to match the monitor.\r
+\r
+       MONITORINFO mi;\r
+       mi.cbSize = sizeof(mi);\r
+       if (GetMonitorInfo(MonitorFromWindow(HWnd,MONITOR_DEFAULTTOPRIMARY),&mi))\r
+       {\r
+               UINT flags = SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_FRAMECHANGED;\r
+               SetWindowPos(HWnd, HWND_TOP, mi.rcMonitor.left, mi.rcMonitor.top,\r
+                       mi.rcMonitor.right - mi.rcMonitor.left,\r
+                       mi.rcMonitor.bottom - mi.rcMonitor.top, flags);\r
+       }\r
+       else\r
+       {\r
+               CreationParams.Fullscreen = false;\r
+       }\r
+\r
+       return CreationParams.Fullscreen;\r
 }\r
 \r
 \r