Peek for redraw events after each call to SDL_PollEvent.

Since SDL_PollEvent internally pumps events there is is a chance that there will be a redraw event added to the SDL event queue, which could cause a crash if there is a game DRAW event before it in the event queue. This should fix it, but it's not the prettiest of fix and should be rewritten if it works to instead put draw events to the start of the internal event queue after it's been drained.
This commit is contained in:
Andreas Löf 2015-12-02 23:17:57 +13:00
parent 81480d1d77
commit 3a5b122325

View file

@ -295,6 +295,8 @@ void pump()
while(SDL_PollEvent(&temp_event)) {
++poll_count;
#if SDL_VERSION_ATLEAST(2, 0, 0)
peek_for_resize();
if(!begin_ignoring && temp_event.type == SDL_WINDOWEVENT
&& (temp_event.window.event == SDL_WINDOWEVENT_ENTER
|| temp_event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED))