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

[RCORE} Correclty handle window size on resize in auto-scaled HIGHDPI environment #4836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JeffM2501
Copy link
Contributor

This PR fixes the issue reported in #4834
When we get a resize event from the platform, we are just setting the screen size to the raw data returned by the event.
But if the user enabled the HIGHDPI flag on startup, we scaled the render and window size by the DPI scale. This means that on startup you get one set of sizes for the window, but after a resize, you swap from emulated unscaled values up to scaled values, and GetScreenSize no longer matches the viewport size.

This PR unscales the screen size on resize for the 3 desktop platforms so that the screen size stays in the same 'unscaled' space as the viewport.

@NiamhNightglow
Copy link
Contributor

I just pulled this branch and tested it in my copy of the quickstart, and this does appear to resolve the issues I was seeing with the GetScreenSize functions not returning the scaled values. The values remained scaled when I built my game with this version even with the FLAG_WINDOW_HIGHDPI flag set after rescaling the window.

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

Successfully merging this pull request may close these issues.

2 participants