aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/EventData.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-14 13:52:56 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-14 13:52:56 +0100
commitdbe779ca850ec0bf5d9b5066a7a6df44f3762e4d (patch)
treefe87bdbf86017ee1ee5fe75d89f599f5ae8a5be1 /src/crepe/facade/EventData.h
parentc17233b10bd8e35bead60c5f44bb8a14836d755f (diff)
make format
Diffstat (limited to 'src/crepe/facade/EventData.h')
-rw-r--r--src/crepe/facade/EventData.h89
1 files changed, 44 insertions, 45 deletions
diff --git a/src/crepe/facade/EventData.h b/src/crepe/facade/EventData.h
index d0ca07f..a7526b4 100644
--- a/src/crepe/facade/EventData.h
+++ b/src/crepe/facade/EventData.h
@@ -3,53 +3,52 @@
#include "../types.h"
namespace crepe {
//! EventType enum for passing eventType
- enum EventType {
- NONE = 0,
- MOUSE_DOWN,
- MOUSE_UP,
- MOUSE_MOVE,
- MOUSE_WHEEL,
- KEY_UP,
- KEY_DOWN,
- SHUTDOWN,
- WINDOW_MINIMIZE,
- WINDOW_MAXIMIZE,
- WINDOW_FOCUS_GAIN,
- WINDOW_FOCUS_LOST,
- WINDOW_MOVE,
- WINDOW_RESIZE,
- WINDOW_EXPOSE,
- };
+enum EventType {
+ NONE = 0,
+ MOUSE_DOWN,
+ MOUSE_UP,
+ MOUSE_MOVE,
+ MOUSE_WHEEL,
+ KEY_UP,
+ KEY_DOWN,
+ SHUTDOWN,
+ WINDOW_MINIMIZE,
+ WINDOW_MAXIMIZE,
+ WINDOW_FOCUS_GAIN,
+ WINDOW_FOCUS_LOST,
+ WINDOW_MOVE,
+ WINDOW_RESIZE,
+ WINDOW_EXPOSE,
+};
- //! Struct for storing key data.
- struct KeyData {
- Keycode key = Keycode::NONE;
- bool key_repeat = false;
- };
+//! Struct for storing key data.
+struct KeyData {
+ Keycode key = Keycode::NONE;
+ bool key_repeat = false;
+};
- //! Struct for storing mouse data.
- struct MouseData {
- MouseButton mouse_button = MouseButton::NONE;
- ivec2 mouse_position = {-1, -1};
- int scroll_direction = -1;
- float scroll_delta = INFINITY;
- ivec2 rel_mouse_move = {-1, -1};
- };
+//! Struct for storing mouse data.
+struct MouseData {
+ MouseButton mouse_button = MouseButton::NONE;
+ ivec2 mouse_position = {-1, -1};
+ int scroll_direction = -1;
+ float scroll_delta = INFINITY;
+ ivec2 rel_mouse_move = {-1, -1};
+};
- //! Struct for storing window data.
- struct WindowData {
- ivec2 move_delta;
- ivec2 resize_dimension;
- };
-
- //! EventData struct for passing event data from facade
- struct EventData {
- EventType event_type = EventType::NONE;
- union {
- KeyData key_data;
- MouseData mouse_data;
- WindowData window_data;
- } data;
+//! Struct for storing window data.
+struct WindowData {
+ ivec2 move_delta;
+ ivec2 resize_dimension;
+};
- };
+//! EventData struct for passing event data from facade
+struct EventData {
+ EventType event_type = EventType::NONE;
+ union {
+ KeyData key_data;
+ MouseData mouse_data;
+ WindowData window_data;
+ } data;
+};
} // namespace crepe