You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm making a 3d FPS game with sokol_app and sokol_gfx, and I use sapp.lock_mouse(true) and sapp.show_mouse(false) to get the correct hidden FPS cursor behavior. However after alt-tabbing out of the app and focusing back it is broken. The mouse is hidden, but it can exit the clipping rectangle and move to another monitor.
I tried to call lock_mouse and show_mouse both only in init_cb or every frame, both approaches don't work in slightly different ways.
Maybe the issue is with my code, I haven't had time to investigate further. But any help is appreciated :)
The text was updated successfully, but these errors were encountered:
floooh
added a commit
to floooh/doom-sokol
that referenced
this issue
May 25, 2024
I seem to remember that this was necessary because there's a Windows routine somewhere in there which has something like a reference counter.
Maybe the same is necessary when going from iconified back to restored.
Btw: I'll be travelling from tomorrow until Thursday, I may not respond during that time.
PS: I should really tackle that higher level "sokol_input.h" header which tracks input events, provides a polling API and takes care of little warts like this that are hard to do right down in sokol_app.h with its "stateless" input events.
Thank you, I'll try that out.
The sokol_input header would be cool, especially if there was also support for gamepads (or have a separate sokol_gamepad which I've seen mentioned)
I'm making a 3d FPS game with sokol_app and sokol_gfx, and I use
sapp.lock_mouse(true)
andsapp.show_mouse(false)
to get the correct hidden FPS cursor behavior. However after alt-tabbing out of the app and focusing back it is broken. The mouse is hidden, but it can exit the clipping rectangle and move to another monitor.I tried to call lock_mouse and show_mouse both only in
init_cb
or every frame, both approaches don't work in slightly different ways.Maybe the issue is with my code, I haven't had time to investigate further. But any help is appreciated :)
The text was updated successfully, but these errors were encountered: