[rcore] Implemented SetWindowMaxSize, SetWindowMinSize, and SetWindowSize#5536
Open
mikeemm wants to merge 3 commits intoraysan5:masterfrom
Open
[rcore] Implemented SetWindowMaxSize, SetWindowMinSize, and SetWindowSize#5536mikeemm wants to merge 3 commits intoraysan5:masterfrom
mikeemm wants to merge 3 commits intoraysan5:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the functions required to limit the window's size, as well as to directly set it (respecting said limits), for the native win32 backend. It behaves like the GLFW implementation (automatic resize upon setting limits that contradict the current window, warning and prevention when setting incompatible limits). It currently does not try to take DPI into account, as DPI doesn't work yet and that part will probably have to be reworked when DPI is tested regardless.
I would've preferred to call CalcWindowSize in SetWindowMax/MinSize so as to not repeat those operations on receiving WM_GETMINMAXINFO, but I didn't figure out a clean way to do it without adding extra variables to CORE.Window. I also set screenMax.width/height to 9999 by default in InitPlatform, as I don't think there's any downsides to doing so since screenMax doesn't seem to be used or retrieved anywhere else and it simplifies the constraint checks significantly; if it's preferable to keep it as 0 by default, I'll change it no problem.
I also removed the TODO inside HandleWindowResize, as I believe the function already modifies the framebuffer's size as requested correctly, unless I'm possibly missing something? Same with WM_APP_UPDATE_WINDOW_SIZE, I don't think this is being used nor is it useful for anything currently, but I could restore it if needed of course.