From ad035edfacf18214b46a4739244e21b63db41ed1 Mon Sep 17 00:00:00 2001 From: Asdqwe Date: Sun, 5 Jan 2025 08:30:43 -0300 Subject: [PATCH] Fix camera initial position (#4657) --- src/platforms/rcore_desktop_glfw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 0076ccb0d923..dba821ddd312 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1017,6 +1017,9 @@ void EnableCursor(void) // Disables cursor (lock cursor) void DisableCursor(void) { + // Reset mouse position within the window area before disabling cursor + SetMousePosition(CORE.Window.screen.width, CORE.Window.screen.height); + glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED); // Set cursor position in the middle