Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/platforms/rcore_desktop_glfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,7 @@ void EnableCursor(void)

if (glfwRawMouseMotionSupported()) glfwSetInputMode(platform.handle, GLFW_RAW_MOUSE_MOTION, GLFW_FALSE);

CORE.Input.Mouse.cursorHidden = false;
CORE.Input.Mouse.cursorLocked = false;
}

Expand All @@ -1083,6 +1084,7 @@ void DisableCursor(void)

if (glfwRawMouseMotionSupported()) glfwSetInputMode(platform.handle, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);

CORE.Input.Mouse.cursorHidden = true;
CORE.Input.Mouse.cursorLocked = true;
}

Expand Down
7 changes: 5 additions & 2 deletions src/platforms/rcore_desktop_rgfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,9 @@ void EnableCursor(void)

// Set cursor position in the middle
SetMousePosition(CORE.Window.screen.width/2, CORE.Window.screen.height/2);
RGFW_window_showMouse(platform.window, true);
CORE.Input.Mouse.cursorHidden = false;
ShowCursor();

CORE.Input.Mouse.cursorLocked = true;
}

// Disables cursor (lock cursor)
Expand All @@ -853,6 +854,8 @@ void DisableCursor(void)
RGFW_disableCursor = true;
RGFW_window_mouseHold(platform.window, RGFW_AREA(0, 0));
HideCursor();

CORE.Input.Mouse.cursorLocked = true;
}

// Swap back buffer with front buffer (screen drawing)
Expand Down
11 changes: 4 additions & 7 deletions src/platforms/rcore_desktop_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,13 +1242,7 @@ void EnableCursor(void)
{
SDL_SetRelativeMouseMode(SDL_FALSE);

#if defined(USING_VERSION_SDL3)
// NOTE: SDL_ShowCursor() has been split into three functions:
// SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()
SDL_ShowCursor();
#else
SDL_ShowCursor(SDL_ENABLE);
#endif
ShowCursor();

CORE.Input.Mouse.cursorLocked = false;
}
Expand All @@ -1258,6 +1252,9 @@ void DisableCursor(void)
{
SDL_SetRelativeMouseMode(SDL_TRUE);

HideCursor();

platform.cursorRelative = true;
CORE.Input.Mouse.cursorLocked = true;
}

Expand Down