diff options
Diffstat (limited to 'floormat')
| -rw-r--r-- | floormat/app.hpp | 9 | ||||
| -rw-r--r-- | floormat/events.hpp | 11 |
2 files changed, 12 insertions, 8 deletions
diff --git a/floormat/app.hpp b/floormat/app.hpp index 02f7d24c..9d1ac7e3 100644 --- a/floormat/app.hpp +++ b/floormat/app.hpp @@ -1,4 +1,5 @@ #pragma once +#include "main/sdl-fwd.hpp" namespace Magnum::Math { template<typename T> class Vector2; template<class T> class Nanoseconds; } @@ -35,10 +36,10 @@ struct floormat_app virtual void draw() = 0; virtual z_bounds get_z_bounds() = 0; - virtual void on_mouse_move(const mouse_move_event& event) noexcept = 0; - virtual void on_mouse_up_down(const mouse_button_event& event, bool is_down) noexcept = 0; - virtual void on_mouse_scroll(const mouse_scroll_event& event) noexcept = 0; - virtual void on_key_up_down(const key_event& event, bool is_down) noexcept = 0; + virtual void on_mouse_move(const mouse_move_event& event, const sdl2::EvMove& ev) noexcept = 0; + virtual void on_mouse_up_down(const mouse_button_event& event, bool is_down, const sdl2::EvClick& ev) noexcept = 0; + virtual void on_mouse_scroll(const mouse_scroll_event& event, const sdl2::EvScroll& ev) noexcept = 0; + virtual void on_key_up_down(const key_event& event, bool is_down, const sdl2::EvKey& ev) noexcept = 0; virtual void on_text_input_event(const text_input_event& event) noexcept = 0; //virtual bool on_text_editing_event(const text_editing_event& event) noexcept = 0; virtual void on_viewport_event(const Magnum::Math::Vector2<int>& size) noexcept = 0; diff --git a/floormat/events.hpp b/floormat/events.hpp index 68c2bedd..af3e6248 100644 --- a/floormat/events.hpp +++ b/floormat/events.hpp @@ -14,22 +14,25 @@ enum mouse_button : unsigned char { }; struct mouse_button_event final { - Vector2i position; + Vector2 position; int mods = 0; mouse_button button = mouse_button_none; uint8_t click_count = 0; + bool is_primary : 1 = false; }; struct mouse_move_event final { - Vector2i position; - mouse_button buttons = mouse_button_none; + Vector2 position; int mods = 0; + mouse_button buttons = mouse_button_none; + bool is_primary : 1 = false; }; struct mouse_scroll_event final { Magnum::Vector2 offset; - Vector2i position; + Vector2 position; int mods = 0; + bool is_primary : 1 = false; }; struct text_input_event final { |
