forked from ppy/osu-framework
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change SDL event handling to use pump/peep isntead of poll
As recommended in libsdl-org/SDL#4794 (comment). Note that the linked PR itself will also fix this without any changes our side, but we will still get some extra efficiency by refactoring how we are processing events regardless. Should help with high poll rate input devices to some degree.
- Loading branch information
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My suggestion with
do { } while (incoming == events_per_peep);
calls PeepEvents only once if less thanevents_per_peep
events are returned whereas in your case you call PeepEvents at least twice