glfwGetCursorPos returning int values

时间:2016-10-20 18:47:26

标签: java lwjgl glfw

I want to implement an FPS-style mouse look in my lwjgl3 java application. But when I use glfwGetCursorPos to get the cursor position.

But the problem is that glfwGetCursorPos is returning doubles but the decimal places are always zero.

Is there any workaround for that issue?

1 个答案:

答案 0 :(得分:0)

您无法获得更精确的值,因为鼠标位置始终位于一个像素上。

如果你想获得0到1之间的值,你可以通过窗口宽度和窗口高度来测试mouseX和mouseY。