#ifndef DEF_XCONTROLLER_H #define DEF_XCONTROLLER_H #include "SDL.h" #include #include using namespace std; #define EventHandlerArg void(* handler)(SDL_Event*) #define EventHandler void(*)(SDL_Event*) class xController{ public: xController(); ~xController(); // called in scheduling void handleEvent(SDL_Event* event); // manage handlers void attachEvent(SDL_EventType t, EventHandlerArg); void detachEvent(SDL_EventType t); private: // event handlers map _handlers; // thread safety mutex _mutex; }; #endif