Hi,
is anybody using the emscripten pointerlock functions and noticed any problems that pointer lock doesn't activate when emscripten_request_pointerlock() is called from within a mouse button event handler? I definitely had this working in old SDK versions (2 years ago or so, for instance see here:
https://floooh.github.io/oryol-samples/wasm/BulletPhysicsBasic.html), but with the current SDK version it looks like I always get a EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED result even though I'm sure I'm calling it from within an event handler type which doesn't require deferred execution (specifically: on left mouse button down).
I'm requesting pointer-lock like this:
emscripten_request_pointerlock(canvas_name, false);
I'm now working around the problem by not calling emscripten_request_pointerlock() and emscripten_exit_pointerlock() but instead use my own EM_JS() functions, this appears to work fine (called from the same place where I called the emscripten API functions).
The pointerlockchange_callback works fine though.
Cheers,
-Floh.