-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SDL_GetDesktopDisplayMode() behavior with High DPI modes is inconsistent across platforms #6038
Comments
I'm not sure on the expectations of An example of our usage to find the DPI scale ratio: |
@cgutman, have you tried setting the new hint SDL_HINT_WINDOWS_DPI_SCALING? That's intended to make Windows in line with the other platforms in how it handles coordinates and DPI scaling. |
Enabling |
Adding iOS to the mix: #5290 Personally I wouldn't be opposed to a function like |
This also sounds good to me, though I think a function like that should also have a flag or hint to configure whether the returned resolution should include a notch area or not on iPhones/Macs that have them. Right now, there's no easy way to get the best notchless native resolution on a notched Mac in SDL2. |
There is a task to add a separate API for this in #3243 |
This is fixed in SDL3's recent commits. |
FYI, there's a plan to add the notch information as a separate task in #3243. |
SDL_GetDesktopDisplayMode()
returns different results for the same display when using DPI scaling on various platforms.On Windows, it returns the true display resolution, ignoring any DPI scaling. On macOS and Wayland, it returns a resolution that includes the DPI scaling factor.
For example, with a 3840x2160 display configured to run at 200% scaling,
SDL_GetDesktopDisplayMode()
would return:I'm not sure which result is actually what we want, but we should probably be consistent either way. Depending on which way we go,
SDL_GetUnscaledDesktopDisplayMode()
orSDL_GetScaledDesktopDisplayMode()
would be nice to have the other option available.Additionally, it would be nice to have a
SDL_GetNativeDisplayMode()
for cases where the application just wants to know the native screen resolution (which might not be the desktop display mode).The text was updated successfully, but these errors were encountered: