Sam Clegg
Sam Clegg
Sorry where are the above code snippets from? is that code from inside of Qt or from your project? I though that goal here was to be able to call...
> I try another ways to solve the problem. `emscripten_request_pointerlock` doesn't work with Qt but this code works: > > ```c++ > EM_JS(void, requestPointerLock, (), { > document.body.requestPointerLock(); > >...
Oh wait.. did you try passing true as the second argument (`deferUntilInEventHandler`) to `emscripten_request_pointerlock` ?
> > Oh wait.. did you try passing true as the second argument (`deferUntilInEventHandler`) to `emscripten_request_pointerlock` ? > > I tried. The mouse pointer is not locked. It prints -1...
You should be able to set a breakpoint in devtools once you have your app running in chrome. You should be able to then step through the `emscripten_request_pointerlock` in devtools.
> I have tried to replace the second argument of `emscripten_request_pointerlock` from `true` to `false` Why? Leaving it as `true` and having `EMSCRIPTEN_RESULT_DEFERRED` seems like it is working as intended?...
You said in https://github.com/emscripten-core/emscripten/issues/22133#issuecomment-2196602440 that is returns EMSCRIPTEN_RESULT_DEFERRED.. which would be the correct/working/expected result I think.
In deferred mode you don't want to be calling `requestPointerLock` during the call itself. Instead the call to `requestPointerLock` is "deffered" until later when will succeed. Does the differed mode...
Wow, thats very cool. Thanks for working on that. Is there anything we need to change on the emscripten side or can this issue be closed now?
> I think the issue should remain open. Emscripten itself doesn't seem to impose any limitation itself, but: > > * Emscripten should provide an OpenMP runtime itself, without requiring...