2025-11-23 21:50:57 +01:00
|
|
|
module;
|
|
|
|
|
|
|
|
|
|
#include <SDL3/SDL.h>
|
|
|
|
|
|
|
|
|
|
export module wrappers.sdl.events;
|
|
|
|
|
|
|
|
|
|
export namespace sdl
|
|
|
|
|
{
|
|
|
|
|
// Simple alias for SDL_Event union
|
|
|
|
|
using Event = SDL_Event;
|
2025-11-26 02:07:27 +01:00
|
|
|
|
|
|
|
|
// Alias for EventType enum
|
|
|
|
|
using EventType_t = SDL_EventType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Wrapper for the SDL_EventType enum.
|
|
|
|
|
*
|
|
|
|
|
* We're using a namespace here to emulate an enum-like interface, without having to copy the entire enum.
|
|
|
|
|
* More constants can be added on demand.
|
|
|
|
|
*/
|
|
|
|
|
namespace EventType
|
|
|
|
|
{
|
|
|
|
|
constexpr EventType_t Quit = SDL_EVENT_QUIT;
|
|
|
|
|
constexpr EventType_t KeyDown = SDL_EVENT_KEY_DOWN;
|
|
|
|
|
constexpr EventType_t KeyUp = SDL_EVENT_KEY_UP;
|
|
|
|
|
constexpr EventType_t MouseMotion = SDL_EVENT_MOUSE_MOTION;
|
|
|
|
|
constexpr EventType_t MouseButtonUp = SDL_EVENT_MOUSE_BUTTON_UP;
|
|
|
|
|
constexpr EventType_t MouseButtonDown = SDL_EVENT_MOUSE_BUTTON_DOWN;
|
|
|
|
|
}
|
2025-11-23 21:50:57 +01:00
|
|
|
}
|