Browse Source

Fix camera initial position

pull/4657/head
asdqwe 1 week ago
parent
commit
41c1a4d99e
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/platforms/rcore_desktop_glfw.c

+ 3
- 0
src/platforms/rcore_desktop_glfw.c View File

@ -1017,6 +1017,9 @@ void EnableCursor(void)
// Disables cursor (lock cursor) // Disables cursor (lock cursor)
void DisableCursor(void) 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); glfwSetInputMode(platform.handle, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
// Set cursor position in the middle // Set cursor position in the middle

Loading…
Cancel
Save