Proper way to achieve mouselook in LWJGL3

Started by orange451, November 24, 2015, 21:32:20

Previous topic - Next topic


Hi :)

I wanted to know what the best way to achieve a firstperson styled "mouselook" in lwjgl3 would be.

Originally, I tried using java.awt's MouseInfo class to get information about the mouse position on the screen. I'd then use glfwSetCursorPos to reset the cursor position. However, since you cannot use java.awt on mac I needed to find another way.

I tried using glfwGetCursorPos() and glfwSetCursorPos() to do mouselook (in the whileloop of the game), However, this also does not work on mac, because glfwSetCursorPos() freezes the mouse for 200-300 ms.

Solved Thanks for Kappa. Here's some documentation on how to do this


The best way to implement mouse look is to use the glfwSetInputMode method to set the GLFW_CURSOR mode to the value GLFW_CURSOR_DISABLED.


Fantastic, thank you! ^^

If anyone comes across this topic, here's the documentation: Link