From 1906f1eddf5220f6324471ebf4929f229115d2bb Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:37:04 -0300 Subject: [PATCH] Fix SetMousePosition() for SDL (#3580) --- src/platforms/rcore_desktop_sdl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 58b337ff..4a3195d8 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -941,6 +941,8 @@ int SetGamepadMappings(const char *mappings) // Set mouse position XY void SetMousePosition(int x, int y) { + SDL_WarpMouseInWindow(platform.window, x, y); + CORE.Input.Mouse.currentPosition = (Vector2){ (float)x, (float)y }; CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; }