#include <sdlinput.h>
Definition at line 127 of file sdlinput.h.
Public Member Functions | |
SDLInput () | |
Constructor. | |
virtual void | pushInput (SDL_Event event) |
Pushes an SDL event. | |
virtual void | _pollInput () |
Polls all input. | |
virtual bool | isKeyQueueEmpty () |
virtual gcn::KeyInput | dequeueKeyInput () |
virtual bool | isMouseQueueEmpty () |
virtual gcn::MouseInput | dequeueMouseInput () |
Protected Member Functions | |
int | convertMouseButton (int button) |
Converts a mouse button from SDL to a Guichan mouse button representation. | |
int | convertKeyCharacter (SDL_Event event) |
Converts an SDL event key to a key value. | |
Protected Attributes | |
std::queue< gcn::KeyInput > | mKeyInputQueue |
std::queue< gcn::MouseInput > | mMouseInputQueue |
bool | mMouseDown |
bool | mMouseInWindow |
SDLInput::SDLInput | ( | ) |
void SDLInput::pushInput | ( | SDL_Event | event | ) | [virtual] |
Pushes an SDL event.
It should be called at least once per frame to update input with user input.
event | an event from SDL. |
Definition at line 108 of file sdlinput.cpp.
virtual void SDLInput::_pollInput | ( | ) | [inline, virtual] |
Polls all input.
It exists for input driver compatibility. If you only use SDL and plan sticking with SDL you can safely ignore this function as it in the SDL case does nothing.
Definition at line 149 of file sdlinput.h.
bool SDLInput::isKeyQueueEmpty | ( | ) | [virtual] |
Definition at line 68 of file sdlinput.cpp.
gcn::KeyInput SDLInput::dequeueKeyInput | ( | ) | [virtual] |
Definition at line 73 of file sdlinput.cpp.
bool SDLInput::isMouseQueueEmpty | ( | ) | [virtual] |
Definition at line 88 of file sdlinput.cpp.
gcn::MouseInput SDLInput::dequeueMouseInput | ( | ) | [virtual] |
Definition at line 93 of file sdlinput.cpp.
int SDLInput::convertMouseButton | ( | int | button | ) | [protected] |
Converts a mouse button from SDL to a Guichan mouse button representation.
button | an SDL mouse button. |
Definition at line 212 of file sdlinput.cpp.
int SDLInput::convertKeyCharacter | ( | SDL_Event | event | ) | [protected] |
Converts an SDL event key to a key value.
event | an SDL event with a key to convert. |
Definition at line 228 of file sdlinput.cpp.
std::queue<gcn::KeyInput> SDLInput::mKeyInputQueue [protected] |
Definition at line 181 of file sdlinput.h.
std::queue<gcn::MouseInput> SDLInput::mMouseInputQueue [protected] |
Definition at line 182 of file sdlinput.h.
bool SDLInput::mMouseDown [protected] |
Definition at line 184 of file sdlinput.h.
bool SDLInput::mMouseInWindow [protected] |
Definition at line 185 of file sdlinput.h.