Skip to content

Commit

Permalink
WindowSizeCallback() should not try to handle DPI since already man…
Browse files Browse the repository at this point in the history
…aged by GLFW

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.
  • Loading branch information
SuperUserNameMan committed Jul 8, 2024
1 parent 9764fef commit 647c406
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/platforms/rcore_desktop_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,23 +1664,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
}
Expand Down

0 comments on commit 647c406

Please sign in to comment.