feat: event system

This commit is contained in:
2026-02-25 12:19:59 +01:00
parent 0dd2404881
commit 12dac2fc04
6 changed files with 70 additions and 6 deletions

View File

@@ -5,10 +5,34 @@
#include <stdbool.h>
#include <stddef.h>
enum class EventType {
INPUT,
enum class EventType : unsigned int {
// ----- INPUT -----
INPUT = 1 << 0,
// Mouse
MOUSE = 1 << 1,
MOUSE_MOVED = 1 << 2,
};
constexpr EventType operator|(EventType a, EventType b) {
return static_cast<EventType>(
static_cast<unsigned int>(a) |
static_cast<unsigned int>(b)
);
}
constexpr EventType operator&(EventType a, EventType b) {
return static_cast<EventType>(
static_cast<unsigned int>(a) &
static_cast<unsigned int>(b)
);
}
constexpr EventType operator~(EventType a) {
return static_cast<EventType>(
~static_cast<unsigned int>(a)
);
}
struct Event {
public:
Event();