From 30f17a0ed464d7f302e7f12dba72f8edde26c615 Mon Sep 17 00:00:00 2001 From: electrolys Date: Sat, 26 Oct 2024 19:02:30 -0500 Subject: [PATCH] Fix relative mouse data being really inconsistent in SDL --- src/platforms/rcore_desktop_sdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 7cbe0354..4797e6dc 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1025,7 +1025,7 @@ void PollInputEvents(void) CORE.Input.Mouse.currentWheelMove.y = 0; // Register previous mouse position - if (platform.cursorRelative) CORE.Input.Mouse.currentPosition = (Vector2){ 0.0f, 0.0f }; + if (platform.cursorRelative) CORE.Input.Mouse.previousPosition = (Vector2){ 0.0f, 0.0f }; else CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; // Reset last gamepad button/axis registered state