Fix initial fullscreen window on OpenGL/Windows

feature/change-sound-driver-ingame
Nimetu 3 years ago
parent de1dba32a2
commit 6727dc00ec

@ -3106,6 +3106,9 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
SetWindowPos(_win, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, flags);
// init window width and height
if (_CurrentMode.Windowed)
{
// TODO: this gives wrong info for initial fullscreen window so limit for windowed only for now
RECT clientRect;
GetClientRect(_win, &clientRect);
_CurrentMode.Width = uint16(clientRect.right-clientRect.left);
@ -3113,6 +3116,14 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
GetWindowRect(_win, &clientRect);
_WindowX = clientRect.left;
_WindowY = clientRect.top;
}
else
{
_CurrentMode.Width = width;
_CurrentMode.Height = height;
_WindowX = 0;
_WindowY = 0;
}
#elif defined(NL_OS_MAC)

Loading…
Cancel
Save