From 327154fd428e0798eea544d9f073f8e1293aa158 Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 25 Nov 2024 10:38:18 +0100 Subject: most test working --- src/crepe/system/InputSystem.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/crepe/system/InputSystem.h') 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 + #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 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> &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 -- cgit v1.2.3