Skip to content
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

Dear imgui renders in low resolution on a hdpi / retina display #1562

Open
gilbertfrancois opened this issue Nov 22, 2023 · 7 comments
Open

Comments

@gilbertfrancois
Copy link
Contributor

I'd like to report a minor issue. The Dear imgui UI does not render in high definition on retina displays. The fonts look significantly more "jaggy" than in other applications. Given that the font is tiny by design, it is quite hard to read. The old interface, using Qt, handled the hdpi resolution well.

I noticed that the info.plist already contains the

<key>NSHighResolutionCapable</key>
<string>True</string>

tag. I saw an open issue on the dear imgui repo. It looks like some people found a solution, but the topic is not closed yet. I guess it is not easy to solve.

ocornut/imgui#3757

system:
os: macOS 14
cpu: Apple Silicon M2

Screenshot 2023-11-21 at 22 35 19

Figure 1: On the left: Standard macOS app in hdpi. On the right: Part of imgui interface, rendered in low resolution.

@Steveneska
Copy link

Same issue on Windows (I have a 2560x1600 pixels screen resolution), switching to full screen makes it even more noticeable as the font does not render well in high DPI. And it looks like Imgui ignores the console font and console font size settings as well.

@MBilderbeek
Copy link
Member

Same issue on Windows (I have a 2560x1600 pixels screen resolution), switching to full screen makes it even more noticeable as the font does not render well in high DPI. And it looks like Imgui ignores the console font and console font size settings as well.

You can now separately set the ImGui font and font size.

Is the rendering also better now?

@Steveneska
Copy link

Steveneska commented Feb 18, 2024

Just got the latest build to try setting the font and it seems that this setting only works when in windowed mode:
Screenshot 2024-02-18 234709

Switching to fullscreen will render unaliased characters. Unfortunately I couldn't take a screenshot of it directly. But I've noticed that pressing PrtSc (the print screen key) to open the Sniping tool on Windows or pressing the Windows key to invoke the OS UI would then render aliased characters in the OpenMSX menu or any tool window opened in the emulator, just like in windowed mode, as shown below:
Screenshot 2024-02-18 234808

@MBilderbeek
Copy link
Member

MBilderbeek commented Feb 18, 2024

Just got the latest build to try setting the font and it seems that this setting only works when in windowed mode:

OK, so are you saying that the font setting only works in windowed mode? Or do you mean the anti-aliasing only works in windowed mode?

@Steveneska
Copy link

Just got the latest build to try setting the font and it seems that this setting only works when in windowed mode:

OK, so are you saying that the font setting only works in windowed mode? Or do you mean the anti-aliasing only works in windowed mode?

The anti-aliasing seems to only work in windowed mode.

Another issue I didn't mention earlier is that the mouse cursor will just vanish in fullscreen mode but reappear and stay available when in windowed mode.

  • So for example once the menu bar fades out in fullscreen mode, it's impossible to invoke it again unless you return to windowed mode first.
  • If setting grab input, the mouse cursor will also not reappear when releasing the grab in fullscreen mode.
  • Currently, the mouse cursor will be displayed in fullscreen mode if you open the menu bar before switching modes or if you had a menu bar option selected or hovered. But even in that case, once you close the menu bar and it fades out, the mouse will be gone too.

@MBilderbeek
Copy link
Member

It's a bit of a tricky combination. In fullscreen, you don't want to see the host cursor. But on the other hand, you need that cursor to control the menu. So, at full screen, the cursor will appear when it (invisibly) reaches the menu bar at the top. Just move up blindly and the menu will activate and the cursor will be shown.

If you have a suggestion on how to improve things, please put it under a new issue. It's not related to hdpi displays.

@MBilderbeek
Copy link
Member

Coming back to fullscreen: I think at fullscreen, the image is just scaled up by hardware. There's no more detailed rendering, the application 'window' is the same size. That may explain what you see in full screen, i.e. the image not being as sharp as in windowed mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants