aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-01-11 10:50:19 -0500
committerClyne Sullivan <tullivan99@gmail.com>2017-01-11 10:50:19 -0500
commit76a8dfce1c91c8536c940b53883eaf0ed7bd769a (patch)
tree311c5e1588eb1f8bd1bf5559eb6134edda4517bc /include
parentf800dbc034e7a70a613bab8cd9d147be4f6e88b6 (diff)
more windows stuff
Diffstat (limited to 'include')
-rw-r--r--include/events.hpp7
-rw-r--r--include/ui.hpp7
2 files changed, 13 insertions, 1 deletions
diff --git a/include/events.hpp b/include/events.hpp
index 2daae56..1f06544 100644
--- a/include/events.hpp
+++ b/include/events.hpp
@@ -16,6 +16,13 @@ class World;
/// INPUT EVENTS
//////////////////////////
+struct MainSDLEvent {
+ MainSDLEvent(SDL_Event e)
+ : event(e) {}
+
+ SDL_Event event;
+};
+
struct MouseScrollEvent {
MouseScrollEvent(int sd = 0)
: scrollDistance(sd) {}
diff --git a/include/ui.hpp b/include/ui.hpp
index 519d259..67c1010 100644
--- a/include/ui.hpp
+++ b/include/ui.hpp
@@ -44,8 +44,13 @@ SDL_Keycode getControl(int index);
#include <entityx/entityx.h>
-class InputSystem : public entityx::System<InputSystem> {
+class InputSystem : public entityx::System<InputSystem>, public entityx::Receiver<InputSystem> {
public:
+ inline void configure(entityx::EventManager &ev) {
+ ev.subscribe<MainSDLEvent>(*this);
+ }
+
+ void receive(const MainSDLEvent& event);
void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;
};