Skip to content

Commit

Permalink
Reduce delay to 1 ms in SDL_WaitEventTimeout() and SDL_WaitEvent()
Browse files Browse the repository at this point in the history
The 10 ms delay effectively caps input polling at 100 Hz and rendering
at 100 FPS if applications use these functions in their event loop. The
delay may also lead to dropped frames even at 60 FPS due if they are
unlucky enough to hit the delay and rendering takes longer than 6 ms.
  • Loading branch information
cgutman committed Nov 3, 2018
1 parent 526b9bd commit 31ee4d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/events/SDL_events.c
Expand Up @@ -728,7 +728,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
/* Timeout expired and no events */
return 0;
}
SDL_Delay(10);
SDL_Delay(1);
break;
default:
/* Has events */
Expand Down

0 comments on commit 31ee4d3

Please sign in to comment.