From 3156c0e0cb9cf8980361b9a15b630ca0ccd3e95a Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 4 Dec 2017 00:47:20 +1100 Subject: [PATCH] [client] corrected event processing SDL_WaitEvent is useless as it runs in 10ms increments, which is way too slow for high rate of input applications. --- client/main.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/client/main.c b/client/main.c index 7087e1f8..bb645c97 100644 --- a/client/main.c +++ b/client/main.c @@ -587,15 +587,9 @@ int eventThread(void * arg) while(state.running) { SDL_Event event; - if (!SDL_WaitEventTimeout(&event, 1000)) + if (!SDL_PollEvent(&event)) { - const char * err = SDL_GetError(); - if (err[0] != '\0') - { - DEBUG_ERROR("SDL Error: %s", err); - state.running = false; - break; - } + usleep(1000); continue; }