-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Display Scaling issue with glfw/wgpu #8628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What's the value of |
The example code does this: // React to changes in screen size
int width, height;
glfwGetFramebufferSize((GLFWwindow*)window, &width, &height);
if (width != wgpu_swap_chain_width || height != wgpu_swap_chain_height)
{
ImGui_ImplWGPU_InvalidateDeviceObjects();
CreateSwapChain(width, height);
ImGui_ImplWGPU_CreateDeviceObjects();
} To obtain the expected framebuffer size. |
DisplayFramebufferScale: { .x = 1.2, .y = 1.2 } var width: c_int = undefined;
var height: c_int = undefined;
c.glfwGetFramebufferSize(window, &width, &height);
if (width != window_width or height != window_height) {
c.cImGui_ImplWGPU_InvalidateDeviceObjects();
config.width = @intCast(width);
config.height = @intCast(height);
c.wgpuSurfaceConfigure(surface, &config);
_ = c.cImGui_ImplWGPU_CreateDeviceObjects();
} |
Also I dont know if it matters, i have a print statement to print DisplayFramebufferScale after ImGui_Render and it prints 2 times before crashing:
|
can you print for each frame:
|
|
Version/Branch of Dear ImGui:
Version 1.92.0 WIP, Branch: master
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_wgpu.cpp
Compiler, OS:
Linux 6.14.5 (KDE/Wayland) + Clang
Full config/build information:
Details:
Whenever I would draw any widget and tried to draw it using
ImGui_ImplWGPU_RenderDrawData
i would get an error:This problem only exists when Im using higher that 100% display scale. I was using 120%. I noticed that no matter what window size i set the rect would always be 20% larger and when I set the scale back to 100% everything worked perfectly.
Im not sure if this is an error on my part, the glfw + webgpu example is very outdated and i didnt try to follow it perfectly, but i didnt see any code handling display scale in the example.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: