-
Notifications
You must be signed in to change notification settings - Fork 90
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
Best way to support HiDPI/Retina displays? #18
Comments
Interesting project! Dear ImGui itself just generates triangles and textures, independently of the card protocol below. So in order to be tested & evaluated, it provides all sorts of platform adaptation, including your current project. It should provide all the information you need for such adaptation (keys & mouse events, display...). |
@dfeneyrou Thanks! And yes, I referenced the example you linked for #21 In general, I see both this issue and #19 as independent of MacOS. In this issue, I'm asking about high density displays, which are common irrespective of platform. In order to support such hardware properly, In #19 I discovered that keyboard modifier state seems to be passed to but ignored in most functions in |
…er to add another backend if needed
The 2 commits above should make a step in the right direction. About the Mac OS port, this comment is interesting: ocornut/imgui#3757 (comment)
|
Interesting; thanks! I'll take another look at this soon. |
Closing because too old, and I do not have MacOS to work on it. |
I'm in the early stages of trying to write a platform layer for MacOS for the viewer as a learning project (I've never written one before). I've had some early success but am wondering about the best way to handle a non unity framebuffer scale.
If I don't try to account for it at all, I get this:
(although the mouse coordinate system is in the upper left quadrant)
If I add
io.DisplayFramebufferScale = ImVec2(2.0, 2.0);
under this https://github.com/dfeneyrou/palanteer/blob/main/server/viewer/vwPlatform.cpp#L333 as a test, I get this:Note how many of the UI elements are clipped and smaller or larger than they should be.
My main questions are:
osGetWindowSize(_displayWidth, _displayHeight);
to instead beosGetWindowSize(_displayWidth, _displayHeight, _fbScaleX, _fbScaleY);
is the appropriate way to get the scale factors into the cross-platform portion of the codebase?The text was updated successfully, but these errors were encountered: