mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Replaced GLFW_MOUSE_CURSOR enable with glfwSetCursorMode.
This commit is contained in:
@@ -465,7 +465,7 @@ int main(void)
|
||||
glfwEnable(window, GLFW_STICKY_KEYS);
|
||||
|
||||
// Enable mouse cursor (only needed for fullscreen mode)
|
||||
glfwEnable(window, GLFW_MOUSE_CURSOR);
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
|
||||
// Set callback functions
|
||||
glfwSetWindowSizeCallback(windowSizeFun);
|
||||
|
||||
@@ -309,13 +309,13 @@ void mouse_button_callback(GLFWwindow window, int button, int action)
|
||||
|
||||
if (action == GLFW_PRESS)
|
||||
{
|
||||
glfwDisable(window, GLFW_MOUSE_CURSOR);
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_CAPTURED);
|
||||
locked = GL_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
locked = GL_FALSE;
|
||||
glfwEnable(window, GLFW_MOUSE_CURSOR);
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user