diff options
author | sfan5 <sfan5@live.de> | 2021-06-15 18:14:10 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-06-15 18:52:38 +0200 |
commit | c84d8acff9b089aaf0fb407542f95e8ff8e5dd60 (patch) | |
tree | 11491efbb70e2a7084a49c0280ea087d7990f2eb | |
parent | 02b8fc1ab60dca29036819d5f6f384b6cbde505d (diff) | |
download | irrlicht-c84d8acff9b089aaf0fb407542f95e8ff8e5dd60.tar.xz |
CIrrDeviceWin32: readd fullscreen using borderless maximized window
-rw-r--r-- | source/Irrlicht/CIrrDeviceWin32.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index e0037b0..09fb7ab 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -1416,8 +1416,24 @@ bool CIrrDeviceWin32::switchToFullScreen() if (!CreationParams.Fullscreen)
return true;
- // To be filled...
- return true;
+ // No border, title bar, etc. is already set up through getWindowStyle()
+ // We only set the window size to match the monitor.
+
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfo(MonitorFromWindow(HWnd,MONITOR_DEFAULTTOPRIMARY),&mi))
+ {
+ UINT flags = SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_FRAMECHANGED;
+ SetWindowPos(HWnd, HWND_TOP, mi.rcMonitor.left, mi.rcMonitor.top,
+ mi.rcMonitor.right - mi.rcMonitor.left,
+ mi.rcMonitor.bottom - mi.rcMonitor.top, flags);
+ }
+ else
+ {
+ CreationParams.Fullscreen = false;
+ }
+
+ return CreationParams.Fullscreen;
}
|