You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SDL2 Backends/examples does not detect system scale factor properly #8756
The following backends keep the scale factor at 1 on my system (display settings have it set to 2):
imgui_impl_glfw.cpp+imgui_impl_vulkan.cpp: FontScaleDpi=1.000, crisp but tiny text
imgui_impl_glfw.cpp+imgui_impl_opengl2.cpp: FontScaleDpi=1.000, crisp but tiny text
The following backends set the scale factor correctly on my system:
imgui_impl_glfw.cpp+imgui_impl_opengl3.cpp: FontScaleDpi=2.000, crisp text
imgui_impl_sdl3.cpp+imgui_impl_opengl3.cpp: FontScaleDpi=2.000, crisp text
imgui_impl_sdl3.cpp+imgui_impl_sdlgpu3.cpp: FontScaleDpi=2.000, crisp text
imgui_impl_sdl3.cpp+imgui_impl_sdlrenderer3.cpp: FontScaleDpi=2.000, crisp text
imgui_impl_sdl3.cpp+imgui_impl_vulkan.cpp: FontScaleDpi=2.000, text rendering corrupted due to issue #8755
The following backends set the scale factor strangely:
imgui_impl_sdl2.cpp+imgui_impl_opengl2.cpp: FontScaleDpi=2.881, blurry text
imgui_impl_sdl2.cpp+imgui_impl_opengl3.cpp: FontScaleDpi=2.881, blurry text
imgui_impl_sdl2.cpp+imgui_impl_sdlrenderer2.cpp: FontScaleDpi=2.881, blurry text
Screenshots/Video:
As the examples were used and the issue is scale factor, this would not provide much if any insight. If screenshots are desired I can post some.
changed the title [-]Imgui does not detect system scale factor properly with certain backends[/-][+]Backends/examples does not detect system scale factor properly[/+]on Jun 29, 2025
This seems the same as #8921 but this provides some additional information so I can recoup things between them. Thanks!
Your GLFW version is 3310 (3.3.1) so it has the glfwGetWindowContentScale(), glfwGetMonitorContentScale().
(1) Could you clarify if this is on X11 or Wayland?
(2)
The following backends set the scale factor correctly on my system
FYI out of clarify, none of the backends are ever setting style.FontScaleDpi.
It's only ever set in the main.cpp of each example, but the GLFW+OpenGL2 and GLFW+Vulkan examples forgot to set it until now (pushed fixes now: 9f13684, cd476b2), hence the 1.0f value for those two, and value should be consistent per Platform Backend and unrelated to the Renderer backend.
Thanks for confirming that those numbers are all based on examples btw.
(3)
So the only issue left is seemingly the SDL2 backend:
imgui_impl_sdl2.cpp+imgui_impl_opengl2.cpp: FontScaleDpi=2.881, blurry text
imgui_impl_sdl2.cpp+imgui_impl_opengl3.cpp: FontScaleDpi=2.881, blurry text
imgui_impl_sdl2.cpp+imgui_impl_sdlrenderer2.cpp: FontScaleDpi=2.881, blurry text
Could you confirm the following values:
value of float main_scale = ImGui_ImplSDL2_GetContentScaleForDisplay(0);
value of io.DisplayFrameBufferScale after calling ImGui_ImplSDL2_NewFrame()
What puzzles me is that there's no specific reason for FontScaleDpi=2.881 to output blurry text. The font will big much bigger, but should not be blurry (unless maybe io.DisplayFrameBufferScale is severely wrecked).
changed the title [-]Backends/examples does not detect system scale factor properly[/-][+]SDL2 Backends/examples does not detect system scale factor properly[/+]on Sep 15, 2025
Activity
[-]Imgui does not detect system scale factor properly with certain backends[/-][+]Backends/examples does not detect system scale factor properly[/+]Examples: GLFW+Vulkan: Fixed not applying content scale. (#8921, #8756)
ocornut commentedon Sep 12, 2025
Hello,
Sorry for my late answer.
This seems the same as #8921 but this provides some additional information so I can recoup things between them. Thanks!
Your GLFW version is 3310 (3.3.1) so it has the
glfwGetWindowContentScale(),glfwGetMonitorContentScale().(1) Could you clarify if this is on X11 or Wayland?
(2)
FYI out of clarify, none of the backends are ever setting
style.FontScaleDpi.It's only ever set in the main.cpp of each example, but the GLFW+OpenGL2 and GLFW+Vulkan examples forgot to set it until now (pushed fixes now: 9f13684, cd476b2), hence the 1.0f value for those two, and value should be consistent per Platform Backend and unrelated to the Renderer backend.
Thanks for confirming that those numbers are all based on examples btw.
(3)
So the only issue left is seemingly the SDL2 backend:
Could you confirm the following values:
float main_scale = ImGui_ImplSDL2_GetContentScaleForDisplay(0);io.DisplayFrameBufferScaleafter callingImGui_ImplSDL2_NewFrame()What puzzles me is that there's no specific reason for FontScaleDpi=2.881 to output blurry text. The font will big much bigger, but should not be blurry (unless maybe
io.DisplayFrameBufferScaleis severely wrecked).d235j commentedon Sep 12, 2025
It has been a while, but I most likely was running Wayland. I'll retest when I have a chance.
[-]Backends/examples does not detect system scale factor properly[/-][+]SDL2 Backends/examples does not detect system scale factor properly[/+]Examples: Win32+Vulkan, GLFW+Metal: Fixed not applying content scale. (…