Skip to content

Commit

Permalink
don't assume DRM supports high DPI
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffM2501 committed May 19, 2024
1 parent cfeab63 commit 3387817
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rlImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ static void ImGuiNewFrame(float deltaTime)
{
ImGuiIO& io = ImGui::GetIO();


Vector2 resolutionScale = GetWindowScaleDPI();

#ifndef PLATFORM_DRM
if (IsWindowFullscreen())
{
Expand All @@ -111,17 +114,15 @@ static void ImGuiNewFrame(float deltaTime)
io.DisplaySize.x = float(GetScreenWidth());
io.DisplaySize.y = float(GetScreenHeight());
}
#else
io.DisplaySize.x = float(GetScreenWidth());
io.DisplaySize.y = float(GetScreenHeight());
#endif

Vector2 resolutionScale = GetWindowScaleDPI();

#if !defined(__APPLE__)
if (!IsWindowState(FLAG_WINDOW_HIGHDPI))
resolutionScale = Vector2{ 1,1 };
#endif
#else
io.DisplaySize.x = float(GetScreenWidth());
io.DisplaySize.y = float(GetScreenHeight());
#endif

io.DisplayFramebufferScale = ImVec2(resolutionScale.x, resolutionScale.y);

Expand Down

0 comments on commit 3387817

Please sign in to comment.