SDLInput Class Reference

#include <sdlinput.h>

List of all members.


Detailed Description

SDL implementation of Input.

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

Constructor & Destructor Documentation

SDLInput::SDLInput (  ) 

Constructor.

Definition at line 62 of file sdlinput.cpp.


Member Function Documentation

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.

Parameters:
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.

Parameters:
button an SDL mouse button.
Returns:
a Guichan 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.

Parameters:
event an SDL event with a key to convert.
Returns:
a key value.
See also:
Key

Definition at line 228 of file sdlinput.cpp.


Member Data Documentation

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.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5