Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controls bad practice #87

Open
Not-Nik opened this issue Mar 7, 2019 · 0 comments
Open

Controls bad practice #87

Not-Nik opened this issue Mar 7, 2019 · 0 comments

Comments

@Not-Nik
Copy link

Not-Nik commented Mar 7, 2019

As written in the docstring of glfwSetCursorPos:

Do not use this function to implement things like camera controls.  GLFW
already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
cursor, transparently re-centres it and provides unconstrained cursor
motion.  See @ref glfwSetInputMode for more information.

One should call glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); instead of glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);. See this page for more information.

P.S. Somehow this doesn't work properly on my Mac so I had to call glfwSetCursorPos even though, but it increased my mouse update speed (before smth like 5 seconds, now definitely more).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant