Switch to a custom event system, where SDL pumps into

To do this we needed to take ThreadVariant out of love.thread, and move it to common.
This also changes event names, instead of 1/2-letter abbreviations, full names!
This commit is contained in:
Bart van Strien
2011-12-13 17:50:38 +01:00
parent 91fefbd1ee
commit 083dd11185
13 changed files with 508 additions and 512 deletions
+2 -19
View File
@@ -51,28 +51,12 @@ namespace sdl
**/
void pump();
/**
* Checks if there are messages in the queue.
*
* @param message The next message in the queue, if the return value is true.
* @return True if there a message was found, false otherwise.
**/
bool poll(Message & message);
/**
* Waits for the next event (indefinitely). Useful for creating games where
* the screen and game state only needs updating when the user interacts with
* the window.
**/
bool wait(Message & message);
/**
* Push a message onto the event queue.
*
* @param message The message to push onto the queue.
* @return True on success, false if the queue was full.
**/
bool push(Message & message);
Message *wait();
/**
* Clears the event queue.
@@ -81,8 +65,7 @@ namespace sdl
private:
bool convert(SDL_Event & e, Message & m);
bool convert(Message & m, SDL_Event & e);
Message *convert(SDL_Event & e);
static EnumMap<love::keyboard::Keyboard::Key, SDLKey, love::keyboard::Keyboard::KEY_MAX_ENUM>::Entry keyEntries[];
static EnumMap<love::keyboard::Keyboard::Key, SDLKey, love::keyboard::Keyboard::KEY_MAX_ENUM> keys;