aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndy <drumsetmonkey@gmail.com>2016-10-26 07:32:25 -0400
committerAndy <drumsetmonkey@gmail.com>2016-10-26 07:32:25 -0400
commit8eb1625aea5ccaa07414e699e784440a94277ab0 (patch)
treeb09234eef1f5524c7711096fe61953500d6d5925 /include
parentd7884127950260dd0f1b24aee0bfe64d847f990c (diff)
Scaling work
Diffstat (limited to 'include')
-rw-r--r--include/events.hpp8
-rw-r--r--include/window.hpp6
2 files changed, 13 insertions, 1 deletions
diff --git a/include/events.hpp b/include/events.hpp
index 7f70c04..5cd8040 100644
--- a/include/events.hpp
+++ b/include/events.hpp
@@ -47,4 +47,12 @@ struct BGMToggleEvent {
World *world;
};
+struct WindowResizeEvent {
+ WindowResizeEvent(int w, int h)
+ : x(w), y(h) {}
+
+ int x;
+ int y;
+};
+
#endif // EVENTS_HPP_
diff --git a/include/window.hpp b/include/window.hpp
index d168a54..364ac8f 100644
--- a/include/window.hpp
+++ b/include/window.hpp
@@ -5,7 +5,9 @@
#include <SDL2/SDL.h>
-class WindowSystem : public entityx::System<WindowSystem> {
+#include <events.hpp>
+
+class WindowSystem : public entityx::System<WindowSystem>, public entityx::Receiver<WindowSystem> {
private:
SDL_Window *window;
SDL_GLContext glContext;
@@ -15,7 +17,9 @@ public:
void die(void);
+ void configure(entityx::EventManager &ev);
void update(entityx::EntityManager &en, entityx::EventManager &ev, entityx::TimeDelta dt) override;
+ void receive(const WindowResizeEvent&);
};
#endif // WINDOW_HPP_