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

[SDL3] [Windows 11] SDL_GetDisplayContentScale won't update after SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED #9762

Open
dortamiguel opened this issue May 11, 2024 · 0 comments
Assignees
Milestone

Comments

@dortamiguel
Copy link

dortamiguel commented May 11, 2024

I'm using SDL_GetDisplayContentScale to get the scale I should use for the UI in my game like this:

float scale_factor = SDL_GetDisplayContentScale(SDL_GetDisplayForWindow(window));

In this case scale_factor will be 1.f if the system display scale is at 100% or 2.f if the scale is at 200%

image

If I change this scale while the game is running the SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED event will happen, but the result from SDL_GetDisplayContentScale won't update. If I trigger SDL_EVENT_WINDOW_RESIZED by manually resizing the window it will refresh the scale correctly.

Is this a bug or I'm doing something wrong?

@slouken slouken self-assigned this May 22, 2024
@slouken slouken added this to the 3.2.0 milestone May 22, 2024
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

2 participants