Put GLFW in relative mouse mode when the cursor is disabled. (#3874)

This commit is contained in:
Jeffery Myers 2024-03-18 01:12:36 -07:00 committed by GitHub
parent d7ff0175c1
commit 9bb3d9977a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -972,6 +972,9 @@ void EnableCursor(void)
// Set cursor position in the middle
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
if (glfwRawMouseMotionSupported())
glfwSetInputMode(platform.handle, GLFW_RAW_MOUSE_MOTION, GLFW_FALSE);
CORE.Input.Mouse.cursorHidden = false;
}
@ -983,6 +986,9 @@ void DisableCursor(void)
// Set cursor position in the middle
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
if (glfwRawMouseMotionSupported())
glfwSetInputMode(platform.handle, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
CORE.Input.Mouse.cursorHidden = true;
}