switch winit size to logical to be dpi independent#947
switch winit size to logical to be dpi independent#947cart merged 2 commits intobevyengine:masterfrom
Conversation
|
I agree that we should create properly sized windows on hi-dpi setups, but I also think we should discuss how DPI is handled from a UX perspective, as that will inform some of these changes. The approach in this pr "creates" new problems because any code that renders something now needs to be DPI-aware (if it doesn't want to be low-res / blurry):
I can think of two paths forward:
(1) Feels like it has fewer "gotchas". Everything is consistent (and usable) by default and individual features need to be "special cased" to support hi dpi. Generally if you do something wrong, worst case scenario things are just blurrier. The downside is that by default users are no longer dealing with the actual resolution, which could cause confusion (especially when building rendering features). |
|
This PR is probably not the complete solution, but I feel this is a good start that is important to have now.
up to now, it's probably mostly an issue around packaging on macOS, and that's another issue that I hope to try my hand at soon (signing the app, placing the assets in the correct folder, icons, ...). There's probably something similar to do on other platforms. And in comes the webGL2 build. having the game change size at runtime according to dpi makes it very hard to embed in a page. I started doing that, and got reports that people were only seing a quarter of the game, as I did the page around based on how it looked on my mac, with a high dpi-smaller window game. Anyway, all this to say that I think having the window always at the same size no matter the dpi is a better default than having the window change size following the dpi. I'm not completely sure how to go on from there to have features "opt in" to hi-dpi support, but that would be cool |
|
Sounds like we're in agreement then. This pr seems like a step in the right direction. I'll probably follow up with swapchain / text fixes soon if nobody else does. |
Currently, when opening a window on a screen with high dpi, the window is smaller than intended.
With this fix, the window has the expected size on all screen.