feat: event system
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user