$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <sdlinput.h>
Public Member Functions | |
SDLInput () | |
virtual void | pushInput (SDL_Event event) |
virtual void | _pollInput () |
virtual bool | isKeyQueueEmpty () |
virtual KeyInput | dequeueKeyInput () |
virtual bool | isMouseQueueEmpty () |
virtual MouseInput | dequeueMouseInput () |
virtual void | processKeyRepeat () |
Static Public Member Functions | |
static Key | convertKeyCharacter (SDL_keysym key) |
Protected Member Functions | |
int | convertMouseButton (int button) |
Protected Attributes | |
std::queue< KeyInput > | mKeyInputQueue |
std::queue< MouseInput > | mMouseInputQueue |
bool | mMouseDown |
bool | mMouseInWindow |
Key | mLastKey |
bool | mIsRepeating |
gcn::SDLInput::SDLInput | ( | ) |
Constructor.
void gcn::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. |
virtual void gcn::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.
Implements gcn::Input.
bool gcn::SDLInput::isKeyQueueEmpty | ( | ) | [virtual] |
Checks whether the key queue is empty or not.
Implements gcn::Input.
KeyInput gcn::SDLInput::dequeueKeyInput | ( | ) | [virtual] |
bool gcn::SDLInput::isMouseQueueEmpty | ( | ) | [virtual] |
Checks whether the mouse queue is empyt or not.
Implements gcn::Input.
MouseInput gcn::SDLInput::dequeueMouseInput | ( | ) | [virtual] |
Dequeues the mouse input queue.
Implements gcn::Input.
void gcn::SDLInput::processKeyRepeat | ( | ) | [virtual] |
Key gcn::SDLInput::convertKeyCharacter | ( | SDL_keysym | key | ) | [static] |
int gcn::SDLInput::convertMouseButton | ( | int | button | ) | [protected] |
Converts a mouse button from SDL to a Guichan mouse button representation.
button | an SDL mouse button. |
std::queue<KeyInput> gcn::SDLInput::mKeyInputQueue [protected] |
std::queue<MouseInput> gcn::SDLInput::mMouseInputQueue [protected] |
bool gcn::SDLInput::mMouseDown [protected] |
bool gcn::SDLInput::mMouseInWindow [protected] |
Key gcn::SDLInput::mLastKey [protected] |
bool gcn::SDLInput::mIsRepeating [protected] |