From 80623a20ccc231d16744691833ae10e935b8cb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Gon=C3=A7alves=20=28Ulukyn=29?= Date: Sat, 18 Dec 2021 20:35:23 +0000 Subject: [PATCH] Merge branch '31-wrong-fullscreen-resolution-in-opengl-win' into 'main/gingo-test' Fix initial fullscreen window on OpenGL/Windows See merge request ryzom/ryzom-core!31 --- .../3d/driver/opengl/driver_opengl_window.cpp | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 35dc433a8..68ad77a6a 100644 --- a/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -3105,13 +3105,24 @@ 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 - RECT clientRect; - GetClientRect(_win, &clientRect); - _CurrentMode.Width = uint16(clientRect.right-clientRect.left); - _CurrentMode.Height = uint16(clientRect.bottom-clientRect.top); - GetWindowRect(_win, &clientRect); - _WindowX = clientRect.left; - _WindowY = clientRect.top; + 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); + _CurrentMode.Height = uint16(clientRect.bottom-clientRect.top); + 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)