mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-27 17:29:17 -05:00
Put GLFW in relative mouse mode when the cursor is disabled. (#3874)
This commit is contained in:
@ -972,6 +972,9 @@ void EnableCursor(void)
|
|||||||
// Set cursor position in the middle
|
// Set cursor position in the middle
|
||||||
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
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;
|
CORE.Input.Mouse.cursorHidden = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -983,6 +986,9 @@ void DisableCursor(void)
|
|||||||
// Set cursor position in the middle
|
// Set cursor position in the middle
|
||||||
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
|
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;
|
CORE.Input.Mouse.cursorHidden = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user