WindowSizeCallback() should not try to handle DPI since already managed by GLFW (#4143)
Some checks are pending
Android / build (arm64) (push) Waiting to run
Android / build (x86_64) (push) Waiting to run
CMakeBuilds / Windows Build (push) Waiting to run
CMakeBuilds / Linux Build (push) Waiting to run
Linux / build (i386, i386, /user/bin, 32) (push) Waiting to run
Linux / build (x86_64, amd64, /user/bin, 64) (push) Waiting to run
Linux Examples / build (push) Waiting to run
macOS / build (push) Waiting to run
WebAssembly / build (push) Waiting to run
Windows / build (i686, pe-i386, 32, mingw-w64) (push) Waiting to run
Windows / build (x64, x64, 64, msvc16) (push) Waiting to run
Windows / build (x86, Win32, 32, msvc16) (push) Waiting to run
Windows / build (x86_64, pe-x86-64, 64, mingw-w64) (push) Waiting to run
Windows Examples / build (push) Waiting to run

If `FLAG_WINDOW_HIGHDPI` is set, `InitPlatform()` will aks GLFW to handle resize window content area based on the monitor content scale using : ` glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); `

So `WindowSizeCallback()` does not have to handle it a second time.
This commit is contained in:
SuperUserNameMan 2024-07-09 09:23:14 +02:00 committed by GitHub
parent fa03246d0e
commit 174313acbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1669,23 +1669,9 @@ static void WindowSizeCallback(GLFWwindow *window, int width, int height)
if (IsWindowFullscreen()) return;
// Set current screen size
#if defined(__APPLE__)
CORE.Window.screen.width = width;
CORE.Window.screen.height = height;
#else
if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
{
Vector2 windowScaleDPI = GetWindowScaleDPI();
CORE.Window.screen.width = (unsigned int)(width/windowScaleDPI.x);
CORE.Window.screen.height = (unsigned int)(height/windowScaleDPI.y);
}
else
{
CORE.Window.screen.width = width;
CORE.Window.screen.height = height;
}
#endif
// NOTE: Postprocessing texture is not scaled to new size
}