Skip to content

[rcore] Implemented SetWindowMaxSize, SetWindowMinSize, and SetWindowSize#5536

Open
mikeemm wants to merge 3 commits intoraysan5:masterfrom
mikeemm:win32_resizing
Open

[rcore] Implemented SetWindowMaxSize, SetWindowMinSize, and SetWindowSize#5536
mikeemm wants to merge 3 commits intoraysan5:masterfrom
mikeemm:win32_resizing

Conversation

@mikeemm
Copy link
Contributor

@mikeemm mikeemm commented Feb 7, 2026

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.

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.

1 participant