Fix initial fullscreen window on OpenGL/Windows

merge-requests/31/head
Nimetu 3 years ago
parent 568d8ab895
commit 013aad73d2

@ -3105,6 +3105,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);
@ -3112,6 +3115,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