summaryrefslogtreecommitdiff
path: root/src/utils/sdlhelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-08 19:38:59 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-08 19:38:59 +0300
commitf1e48fffe3c224ee81cdc1f85dbd0179b202d457 (patch)
treea180b55377204e85c52a4accf35ecc964f2d2cca /src/utils/sdlhelper.cpp
parent29557a45208b1576e293427090360f6d794ea6b3 (diff)
downloadmv-f1e48fffe3c224ee81cdc1f85dbd0179b202d457.tar.gz
mv-f1e48fffe3c224ee81cdc1f85dbd0179b202d457.tar.bz2
mv-f1e48fffe3c224ee81cdc1f85dbd0179b202d457.tar.xz
mv-f1e48fffe3c224ee81cdc1f85dbd0179b202d457.zip
Split SDL_WaitEventTimeout/SDL_PollEvent into lower level SDL function calls.
Diffstat (limited to 'src/utils/sdlhelper.cpp')
-rw-r--r--src/utils/sdlhelper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp
index 324779898..2e3576578 100644
--- a/src/utils/sdlhelper.cpp
+++ b/src/utils/sdlhelper.cpp
@@ -33,6 +33,7 @@
PRAGMA48(GCC diagnostic push)
PRAGMA48(GCC diagnostic ignored "-Wshadow")
+#include <SDL_events.h>
#include <SDL_syswm.h>
#include <SDL_video.h>
PRAGMA48(GCC diagnostic pop)
@@ -192,4 +193,13 @@ 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_ALLEVENTS) > 0;
+}
+
#endif // USE_SDL2