____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

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.

Definition at line 73 of file sdlinput.h.


Constructor & Destructor Documentation

gcn::SDLInput::SDLInput (  ) 

Constructor.

Definition at line 64 of file sdlinput.cpp.

References mIsRepeating, mMouseDown, and mMouseInWindow.


Member Function Documentation

void gcn::SDLInput::pushInput ( SDL_Event  event  )  [virtual]

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.

Definition at line 95 of file sdlinput.h.

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.

Definition at line 71 of file sdlinput.cpp.

References mKeyInputQueue.

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

Dequeues the key input queue.

Returns:
a KeyInput object.
See also:
KeyInput

Implements gcn::Input.

Definition at line 76 of file sdlinput.cpp.

References GCN_EXCEPTION, and mKeyInputQueue.

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.

Definition at line 91 of file sdlinput.cpp.

References mMouseInputQueue.

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

Dequeues the mouse input queue.

Returns:
a MouseInput object.
See also:
MouseInput

Implements gcn::Input.

Definition at line 96 of file sdlinput.cpp.

References GCN_EXCEPTION, and mMouseInputQueue.

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.

Parameters:
button an SDL mouse button.
Returns:
a Guichan button.

Definition at line 203 of file sdlinput.cpp.

References GCN_EXCEPTION, gcn::MouseInput::LEFT, gcn::MouseInput::MIDDLE, gcn::MouseInput::RIGHT, gcn::MouseInput::WHEEL_DOWN, and gcn::MouseInput::WHEEL_UP.

Referenced by pushInput().


Member Data Documentation

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

Definition at line 128 of file sdlinput.h.

Referenced by dequeueKeyInput(), isKeyQueueEmpty(), processKeyRepeat(), and pushInput().

Definition at line 129 of file sdlinput.h.

Referenced by dequeueMouseInput(), isMouseQueueEmpty(), and pushInput().

bool gcn::SDLInput::mMouseDown [protected]

Definition at line 131 of file sdlinput.h.

Referenced by pushInput(), and SDLInput().

Definition at line 132 of file sdlinput.h.

Referenced by pushInput(), and SDLInput().

Definition at line 133 of file sdlinput.h.

Referenced by processKeyRepeat(), and pushInput().

bool gcn::SDLInput::mIsRepeating [protected]

Definition at line 134 of file sdlinput.h.

Referenced by processKeyRepeat(), pushInput(), and SDLInput().


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

Generated on Sat Feb 21 00:28:26 2009 for Bos Wars by  doxygen 1.5.6