shithub: cstory

Download patch

ref: a392034fd6d0cc2df3baaf637da5668634d7d34a
parent: 1582af91cff8435c5bea684b39f2f4a43f58ad7f
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Jul 12 20:19:27 EDT 2020

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.

--- a/src/Backends/Platform/SDL2.cpp
+++ b/src/Backends/Platform/SDL2.cpp
@@ -165,7 +165,7 @@
 
 bool Backend_SystemTask(bool active)
 {
-	if (SDL_PollEvent(NULL) || !active)
+	while (SDL_PollEvent(NULL))
 	{
 		SDL_Event event;