Greetings!
I tried to implement the missing glfwSetInputMode with the following code:
setInputMode: function(winid, mode, value) {
var win = GLFW.WindowFromId(winid);
if (!win) return;
switch(mode) {
case 0x00033001: // GLFW_CURSOR
{
switch(value) {
case 0x00034001: // GLFW_CURSOR_NORMAL
win.inputModes[mode] = value;
Module['canvas'].exitPointerLock();
break;
case 0x00034002: // GLFW_CURSOR_HIDDEN
console.log("glfwSetInputMode called with GLFW_CURSOR_HIDDEN
value not implemented.");
break;
case 0x00034003: // GLFW_CURSOR_DISABLED
win.inputModes[mode] = value;
Module['canvas'].requestPointerLock();
break;
default:
console.log("glfwSetInputMode called with unknown value
parameter value: " + value + ".");
break;
}
}
break;
case 0x00033002: // GLFW_STICKY_KEYS
console.log("glfwSetInputMode called with GLFW_STICKY_KEYS mode
not implemented.");
break;
case 0x00033003: // GLFW_STICKY_MOUSE_BUTTONS
console.log("glfwSetInputMode called with
GLFW_STICKY_MOUSE_BUTTONS mode not implemented.");
break;
default:
console.log("glfwSetInputMode called with unknown mode parameter
value: " + mode + ".");
break;
}
},
But it is not working for me. I did the exact same call as in SDL and Glut
implementation. I verified that the flow control does indeed get to execute
Module['canvas'].requestPointerLock(); and that both Module['canvas'] and
Module['canvas'].requestPointerLock are not null pointers. So it does
properly call the function, but the browser is not doing anything at all.
Any idea why this is not working?
Thanks!
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.