$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

gcn::SDLInput Class Reference

#include <sdlinput.h>

Inheritance diagram for gcn::SDLInput:

gcn::Input

List of all members.


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< KeyInputmKeyInputQueue
std::queue< MouseInputmMouseInputQueue
bool mMouseDown
bool mMouseInWindow
Key mLastKey
bool mIsRepeating

Detailed Description

SDL implementation of Input.

Constructor & Destructor Documentation

gcn::SDLInput::SDLInput (  ) 

Constructor.


Member Function Documentation

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.

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

Returns:
true if the key queue is empty.

Implements gcn::Input.

KeyInput gcn::SDLInput::dequeueKeyInput (  )  [virtual]

Dequeues the key input queue.

Returns:
a KeyInput object.
See also:
KeyInput

Implements gcn::Input.

bool gcn::SDLInput::isMouseQueueEmpty (  )  [virtual]

Checks whether the mouse queue is empyt or not.

Returns:
true if the mouse queue is empty.

Implements gcn::Input.

MouseInput gcn::SDLInput::dequeueMouseInput (  )  [virtual]

Dequeues the mouse input queue.

Returns:
a MouseInput object.
See also:
MouseInput

Implements gcn::Input.

void gcn::SDLInput::processKeyRepeat (  )  [virtual]

Key gcn::SDLInput::convertKeyCharacter ( SDL_keysym  key  )  [static]

Converts an SDL keysym to a Key object.

Parameters:
key an SDL keysym
Returns:
a Key object.

int gcn::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 button.


Member Data Documentation

std::queue<KeyInput> gcn::SDLInput::mKeyInputQueue [protected]

bool gcn::SDLInput::mMouseDown [protected]

bool gcn::SDLInput::mIsRepeating [protected]


The documentation for this class was generated from the following files:
(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.