MoveMouse?

Monkey Forums/Monkey Programming/MoveMouse?

JaviCervera(Posted March) [#1]
I am making a first person game in Monkey-X and gles20 for PC, and in order to implement free mouse look, I need to center the mouse on the screen every frame, because if not the camera stops rotating when the mouse pointer reaches the screen limits.

But I have been looking into the mojo module, and I could not find a MoveMouse function to implement this. Isn't this supported in Monkey-X? Aren't there any way to implement an FPS camera then?


Soap(Posted March) [#2]
You need to use native GLFW functions. You check the offset of the cursor when it's moved, and then set it back to center. There are other functions which would probably be useful to you too and if you have questions you'll probably want to search google for glfw+term.

The native code is different if you use GLFW2 or GLFW3 target versions.
2
glfwSetMousePos(x,y);
3
glfwSetCursorPos http://www.glfw.org/docs/3.0/group__input.html#ga04b03af936d906ca123c8f4ee08b39e7

If you don't know how native externs work check diddy or bono for native imports I think they have examples of them.