-
Notifications
You must be signed in to change notification settings - Fork 55
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
High DPI drawing #100
Comments
This is one of those things that I did not think about just yet. Notan will adapt the viewport to avoid the hassle of different DPIs, but I have done nothing with the drawing API. Probably I could try to add a HighDPI mode to the However, I am open to suggestions, what do you think will be a good approach? |
There is another option, disable the HighDPI https://github.com/Nazariglez/notan/blob/develop/crates/notan_winit/src/window.rs#L95. Not sure how it will look, right now it doesn't work because winit is not applying correctly this (I checked the code there diagonally). I will fix and send a PR but I am not sure if this is what you're looking for. Related: |
I'm no expert in these matters, but one approach is for high dpi drawing to be used automatically when in a high dpi environment. That way, it's transparent to the user. I believe this is how Macroquad handles it. Of course, when it comes to texture clarity, the user will still need to provide 2x-sized textures and scale them down. |
I think that I'm going to do this in three steps:
Let's keep this issue open for now. |
Thank you for working on it! |
Pinning this blocker here to be able to check it without find in the winit repository: rust-windowing/winit#2322 |
Half of this is already done: #122
I am thinking about adding a Though this should have a way to disable it in case the user wants to manage High DPI in their own way, I may add to the All of this is me just thinking loud. |
This issue is stale because it has been open for 60 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. Do not hesitate to open a new issue if you need it. |
It seems that Notan provides a high dpi window. For example ,on my iMac there are 2x as many physical pixels as logical pixels, which is great. However, the drawing shapes and text appears to be in normal/logical pixels, making them look low-res, so to speak. Placing shapes/text with logical coordinates is fine, but the appearance doesn't seem to be high dpi. Is this correct and intended? Is there a way to "turn on" high dpi drawing?
One workaround, as least for text, seems to be drawing at twice the needed font size and applying a scale of 0.5. That's very awkward though, and messes up the positioning.
I know dpi matters can get complicated, but I'm trying to understand Notan's approach.
The text was updated successfully, but these errors were encountered: