diff options
| author | Jeffery Myers <[email protected]> | 2024-03-18 01:12:36 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-18 09:12:36 +0100 |
| commit | 9bb3d9977af16d12f24618d92c74004902fcfb39 (patch) | |
| tree | ad3837faa2026c8492b983cd824e9ad5ab942d75 /src | |
| parent | d7ff0175c163febc14ac65730cd4b30a13ee1473 (diff) | |
| download | raylib-9bb3d9977af16d12f24618d92c74004902fcfb39.tar.gz raylib-9bb3d9977af16d12f24618d92c74004902fcfb39.zip | |
Put GLFW in relative mouse mode when the cursor is disabled. (#3874)
Diffstat (limited to 'src')
| -rw-r--r-- | src/platforms/rcore_desktop.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index 29c85156..619c9dc9 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -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; } |
