From ea82f6cff532fb059d5c31cc2bebc971b90d0893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Higor=20Eur=C3=ADpedes?= Date: Fri, 22 Aug 2014 19:58:47 -0300 Subject: [PATCH] (SDL) Use SDL_PeepEvents instead of SDL_PollEvent --- gfx/sdl_gfx.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gfx/sdl_gfx.c b/gfx/sdl_gfx.c index 11b25db4a6..0dc70e3526 100644 --- a/gfx/sdl_gfx.c +++ b/gfx/sdl_gfx.c @@ -299,16 +299,14 @@ error: static void check_window(sdl_video_t *vid) { SDL_Event event; - while (SDL_PollEvent(&event)) - { - switch (event.type) - { - case SDL_QUIT: - vid->quitting = true; - break; - default: - break; + SDL_PumpEvents(); + while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_QUITMASK)) + { + if (event.type == SDL_QUIT) + { + vid->quitting = true; + break; } } }