summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-21 20:11:29 +0100
committerNao Pross <naopross@thearcway.org>2019-01-21 20:25:38 +0100
commit8a0f6d6eee6162d1a10b20512e2f2c86a0278a34 (patch)
tree44c8202165566c7206bf6ac44b2febed0919588e /include
parentUpdate wrapsdl2::window to use Renderer instead of Surface (diff)
downloadlibwsdl2-8a0f6d6eee6162d1a10b20512e2f2c86a0278a34.tar.gz
libwsdl2-8a0f6d6eee6162d1a10b20512e2f2c86a0278a34.zip
Add events wrapper
Diffstat (limited to 'include')
-rw-r--r--include/event.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/event.hpp b/include/event.hpp
new file mode 100644
index 0000000..b992852
--- /dev/null
+++ b/include/event.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <optional>
+
+extern "C" {
+#include <SDL2/SDL_events.h>
+}
+
+namespace wrapsdl2 {
+ class event {
+ public:
+ using type = SDL_EventType;
+
+ event(const SDL_Event& e);
+
+ SDL_Event& sdl() { return m_event; }
+
+ private:
+ SDL_Event m_event;
+ };
+
+
+ std::optional<event> poll_event();
+} \ No newline at end of file