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
OPENGL3D: Make use of the active rect provided by WindowedGraphicsManager #3826
Conversation
Thanks for the fix. Looks like the rect calculation is not accurate. With this change, I can move the mouse "below" and "to the right" of the real screen boundaries on my grim-mouse-squashed branch. |
There seems to be a misalignment between the real cursor and the in-game cursor. I found that if I switch out of the full-screen window, then switch back to it, the cursor is synchronized again, and the boundaries are correct. |
I tried commenting a suggestion instead of adding it as a commit, but I couldn't find how, since part of the change is outside the patch context. If you approve my additional commit, please squash it. Otherwise, please suggest a different fix, apply it and force-push. |
have you tested with SDL1? |
6969815
to
21efe83
Compare
Done, thanks.
Good point. I've pushed an additional fix for SDL 1.2 builds. |
I have two small suggestions. This may simplify compiler work, but except that I think it will produce the same code.
Is there any objections against this PR? |
Looks OK to be merged. However, there were two comments about code readability that may need to be addressed first, so that the code is more readable |
Considering this: Maybe related to this, it would be good in the future to not rely on system cursor. There has been a long-standing issue with missing mouse cursor when the F5 menu is brought up in 3d games on non-windowed OS like Switch and Vita that don’t have a system cursor. Even on my RPi style handheld with Batocera Linux the system mouse cursor is wrongly oriented and unusable. I made a bug here https://bugs.scummvm.org/ticket/13464#ticket This is just a comment to a related issue, please don’t let this slow down any merging of this awesome PR. |
@rsn8887 I agree, system cursor support can be dropped in future. 3d engines don't relay on it. only GUI part. I don't recall if we support cursor in 3d backend currently. it was not never implemented in ResidualVM. |
It's implemented in Android 3D backend but not in OpenGL 3D SDL. |
Is anything blocking this change from being merged? |
This has two main advantages:
It looks like
WindowedGraphicsManager
is able to handle games that support arbitrary resolutions without any additional changes. The important thing is to make sure thatgetWidth()
andgetHeight()
return the correct values whenrecalculateDisplayAreas()
is called.