diff options
Diffstat (limited to 'src/crepe/system/InputSystem.h')
-rw-r--r-- | src/crepe/system/InputSystem.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/crepe/system/InputSystem.h b/src/crepe/system/InputSystem.h index 231aa45..db6b374 100644 --- a/src/crepe/system/InputSystem.h +++ b/src/crepe/system/InputSystem.h @@ -1,7 +1,13 @@ #pragma once +#include <utility> + #include "System.h" + #include "../api/Event.h" +#include "../api/Button.h" +#include "../api/Transform.h" + namespace crepe { class InputSystem : public System { @@ -14,10 +20,13 @@ private: std::pair<int, int> last_mouse_down_position{-1, -1}; MouseButton last_mouse_button = MouseButton::NONE; const int click_tolerance = 5; - bool handle_click(const MouseClickEvent &event); - bool handle_move(const MouseMoveEvent &event); - bool handle_key_press(const KeyPressEvent &event); - bool handle_key_release(const KeyReleaseEvent &event); + void handle_click(const MouseReleaseEvent); + + Transform* find_transform_for_button(Button &button, std::vector<std::reference_wrapper<Transform>> &transforms); + + bool is_mouse_inside_button(const MouseReleaseEvent &event, const Button &button, const Transform &transform); + + void handle_button_press(Button &button, const MouseReleaseEvent &event); }; } // namespace crepe |