Platform: implement mouse capturing for SDL and GLFW - #419
Conversation
TODO: GLFW has it together with normal/hidden/locked in setCursor() and those options are mutually exclusive, so maybe do it that way instead of setMouseCaptured() like in case of SDL? TODO: while SDL reports move event coordinates outside of the window, GLFW docs in the branch seem to indicate that the mouse position won't change -- would this mean the mouse move events won't get reported?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #419 +/- ##
=======================================
Coverage 72.62% 72.62%
=======================================
Files 364 364
Lines 18971 18971
=======================================
Hits 13778 13778
Misses 5193 5193 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
My understanding is that GLFW already has "disabled" mode where the mouse is locked to the center of the screen and hidden, intended for first person games where you move the mouse to look around and the speed of camera movement should not be limited at all by the window/screen size, whereas the PR you linked to leaves the mouse cursor visible and free to move anywhere, but prevents it from escaping the client area. So, maybe you were looking at the wrong docs or they were copypasted and not edited properly from the "disabled" docs. At a quick glance, I don't see any commits related to that PR in that branch that affect documentation at all. |
|
I know about the disabled/hidden mode and there it's a bit different than this ... from the discussion / branch docs I got the impression that the mouse coordinates would get clamped to the window area, i.e. not changing in any way when outside of the window: glfw/glfw@99b55dd I guess I'll just wait until this materializes. |
Isn't as straightforward as it originally seemed, and I don't want to push something that'd be deprecated right after in favor of a more consistent API.
TODOs:
setCursor()) and those options are mutually exclusive, so maybe do it that way in both instead ofsetMouseCaptured()that's done in case of SDL?