#include <InputEngine.h>
Inheritance diagram for peon::InputEngine:
Public Member Functions | |
InputEngine () | |
Constructor. | |
~InputEngine () | |
Destructor. | |
bool | loadEngine (IniConfigReader *pConfig) |
This method loads up and configures our input devices. | |
void | unloadEngine () |
This method just unloads and frees any allocated input devices. | |
Sint16 | getJoyXAxis () |
This method returns the current X axis of the joystick. | |
Sint16 | getJoyYAxis () |
This method returns the current Y axis of the joystick. | |
Static Public Member Functions | |
static InputEngine & | getSingleton (void) |
Override standard Singleton retrieval. | |
static InputEngine * | getSingletonPtr (void) |
Override standard Singleton retrieval. | |
Protected Attributes | |
SDL_Joystick * | m_pJoystick |
handle to the joystick | |
bool | m_bJoystickConnected |
is there a joystick connected? |
This singleton object is a manager "of sorts" for the input devices available on the system.
|
This method returns the current X axis of the joystick.
|
|
This method returns the current Y axis of the joystick.
|
|
Override standard Singleton retrieval.
Reimplemented from peon::ISingleton< InputEngine >. |
|
Override standard Singleton retrieval.
Reimplemented from peon::ISingleton< InputEngine >. |
|
This method loads up and configures our input devices. SDL will automagically create our handles to the keyboard and mouse device, so we're really only talking about initializing a handle to the joystick. I always return true, as I feel the game should not bail just because the joystick was not found/inited properly. Feel free to modify depending upon your game's needs.
|