From a392034fd6d0cc2df3baaf637da5668634d7d34a Mon Sep 17 00:00:00 2001 From: Clownacy <Clownacy@users.noreply.github.com> Date: Mon, 13 Jul 2020 00:19:27 +0100 Subject: [PATCH] Fix input lag in SDL2 backend If you spam keyboard inputs, they'll eventually lag behind. This was caused by improperly porting the WinAPI logic to SDL2 and CSE2's fancy backend-abstraction system. --- src/Backends/Platform/SDL2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Backends/Platform/SDL2.cpp b/src/Backends/Platform/SDL2.cpp index ccda4c6c..268f28f3 100644 --- a/src/Backends/Platform/SDL2.cpp +++ b/src/Backends/Platform/SDL2.cpp @@ -165,7 +165,7 @@ void PlaybackBackend_EnableDragAndDrop(void) bool Backend_SystemTask(bool active) { - if (SDL_PollEvent(NULL) || !active) + while (SDL_PollEvent(NULL)) { SDL_Event event;