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

[bug] Resizing the window breaks HIGHDPI scaling with values from GetScreenWidth() and GetScreenHeight() #4834

Open
NiamhNightglow opened this issue Mar 12, 2025 · 0 comments

Comments

@NiamhNightglow
Copy link
Contributor

WARNING: Please, read this note carefully before submitting a new issue:

It is important to realise that this is NOT A SUPPORT FORUM, this is for reproducible BUGS with raylib ONLY.

There are lots of generous and helpful people ready to help you out on raylib Discord forum or raylib reddit.

Remember that asking for support questions here actively takes developer time away from improving raylib.


Please, before submitting a new issue verify and check:

  • [ x ] I tested it on latest raylib version from master branch
  • [ x ] I checked there is no similar issue already reported
  • [ x ] I checked the documentation on the wiki
  • [ x ] My code has no errors or misuse of raylib

Issue description

Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to raylib Discord server.

The reported values from GetScreenWidth() and GetScreenHeight() are incorrect after resizing the window. Prior to resizing the window you get the dimensions for before you apply DPI scaling. After a resize you get the actual pixel width after applying DPI scaling. This means to account for this you currently need to catch IsWindowResized() and latch the value and apply a scaling factor based on GetWindowScaleDPI() only if the window has been resized.

Environment

Provide your Platform, Operating System, OpenGL version, GPU details where you experienced the issue.
Windows 11, DPI 150%/1.5, default quickstart backend

Issue Screenshot

If possible, provide a screenshot that illustrates the issue. Usually an image is better than a thousand words.
Uhhh.... Idk if a screenshot would help much with this?

Code Example

Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple as possible, just focusing on the experienced issue.
I made a fork here that shows the issue. Just run it and resize the window: https://github.com/NiamhNightglow/raylib-quickstart

@NiamhNightglow NiamhNightglow changed the title [module] Short description of the issue/bug/feature [bug] Resizing the window breaks HIGHDPI scaling with values from GetScreenWidth() and GetScreenHeight() Mar 12, 2025
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

1 participant