summaryrefslogtreecommitdiff
path: root/src/utils/sdl2helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/sdl2helper.cpp')
-rw-r--r--src/utils/sdl2helper.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp
index 7648ccc2b..da5b15e41 100644
--- a/src/utils/sdl2helper.cpp
+++ b/src/utils/sdl2helper.cpp
@@ -30,6 +30,7 @@
PRAGMA48(GCC diagnostic push)
PRAGMA48(GCC diagnostic ignored "-Wshadow")
+#include <SDL_events.h>
#include <SDL_syswm.h>
PRAGMA48(GCC diagnostic pop)
@@ -194,4 +195,14 @@ void SDL::WaitThread(SDL_Thread *const thread)
SDL_WaitThread(thread, nullptr);
}
+bool SDL::PollEvent(SDL_Event *event)
+{
+ SDL_PumpEvents();
+ return SDL_PeepEvents(event,
+ 1,
+ SDL_GETEVENT,
+ SDL_FIRSTEVENT,
+ SDL_LASTEVENT) > 0;
+}
+
#endif // USE_SDL2