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

GetCurrentMonitor() - use closest monitor #3472

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

M374LX
Copy link
Contributor

@M374LX M374LX commented Oct 26, 2023

This PR complements #3468 by using the closest monitor when the center of the window is not within any of them (instead of the first one).

It is essentially adapted from https://github.com/libsdl-org/SDL/blob/b29128994e87d82eae4751d65ff38b935ce7d6a2/src/video/SDL_video.c#L1114.

Closes #3456.

@raysan5 raysan5 merged commit 2db7c72 into raysan5:master Oct 27, 2023
12 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 27, 2023

@M374LX Merging the improvement but please note that it adds an extra level of code complexity to care for a very specific situation that probably a very low percentatge of users will face. In raylib I try to give priority to code simplicity over those very specific side cases...

@ghost
Copy link

ghost commented Oct 27, 2023

IMHO this should not have been merged. GLFW will never completely match SDL. Since SDL is implemented now, if the desired funcionality is present there, then the users should use rcore_desktop_sdl instead. Also, this makes simple code a nightmare to maintain.

raysan5 added a commit that referenced this pull request Oct 29, 2023
@raysan5
Copy link
Owner

raysan5 commented Oct 29, 2023

@ubkp I agree this is probably an overengineered solution to a very side case and trying to match another different library, at the cost of an increase in code complexity. Now it's merged, but if any issue arises, this will be reverted.

I'll try to avoid those kind of approaches in the future. raylib is intended to be simple.

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.

[core] GetCurrentMonitor() inconsistency between GLFW and SDL
2 participants