diff --git a/src/unifont.ttf b/assets/fonts/unifont.ttf similarity index 100% rename from src/unifont.ttf rename to assets/fonts/unifont.ttf diff --git a/include/Event.hpp b/include/Event.hpp new file mode 100644 index 0000000..537d6e2 --- /dev/null +++ b/include/Event.hpp @@ -0,0 +1,74 @@ +#pragma once + + +namespace vr { + + + class Event { + public: + enum EventType + { + Closed, + Resized, + LostFocus, + GainedFocus, + TextEntered, + KeyPressed, + KeyReleased, + MouseWheelMoved, + MouseWheelScrolled, + MouseButtonPressed, + MouseButtonReleased, + MouseMoved, + MouseEntered, + MouseLeft, + JoystickButtonPressed, + JoystickButtonReleased, + JoystickMoved, + JoystickConnected, + JoystickDisconnected, + TouchBegan, + TouchMoved, + TouchEnded, + SensorChanged, + Count + }; + + EventType type; + + }; + + Closed, + Resized, + LostFocus, + GainedFocus, + TextEntered, + KeyPressed, + KeyReleased, + MouseWheelMoved, + MouseWheelScrolled, + MouseButtonPressed, + MouseButtonReleased, + MouseMoved, + MouseEntered, + MouseLeft, + JoystickButtonPressed, + JoystickButtonReleased, + JoystickMoved, + JoystickConnected, + JoystickDisconnected, + TouchBegan, + TouchMoved, + TouchEnded, + SensorChanged, + Count + + + + + + + + + +} \ No newline at end of file diff --git a/include/Pub_Sub.hpp b/include/Pub_Sub.hpp index 205551b..654a076 100644 --- a/include/Pub_Sub.hpp +++ b/include/Pub_Sub.hpp @@ -119,9 +119,15 @@ public: event_class = Event_Class::SensorEvent; } + else { + std::cout << "Unable to classify sf::Event into Event_Class"; + abort(); + } + // get the bucket containing subscribers to that Event_Class std::vector *event_type_bucket = &subscribers[event_class]; + // Send them the event for (auto s : *event_type_bucket) { s->update(this, e); }