#include <SDLTranslator.h>
Public Member Functions | |
Device (const GameController &joy, SDL_Joystick *opened) | |
This initializes the conversion structures from a base game controller definition. | |
virtual | ~Device () |
Axis * | getAxis (unsigned int id) const |
Hat * | getHat (unsigned int id) const |
Press * | getButton (unsigned int id) const |
Motion * | getBall (unsigned int id) const |
std::string | getName () const |
Private Attributes | |
tInputIndex< Axis > | m_axes |
tInputIndex< Hat > | m_hats |
tInputIndex< Press > | m_buttons |
tInputIndex< Motion > | m_balls |
SDL_Joystick * | m_opened_sdl_joy |
Definition at line 226 of file SDLTranslator.h.
cmil::SDL::SDLControllers::Device::Device | ( | const GameController & | joy, | |
SDL_Joystick * | opened | |||
) |
This initializes the conversion structures from a base game controller definition.
Definition at line 453 of file SDLTranslator.cpp.
00453 : 00454 m_axes(joy.m_axes), 00455 m_hats(joy.m_hats), 00456 m_buttons(joy.m_buttons), 00457 m_balls(joy.m_balls), 00458 m_opened_sdl_joy(opened) 00459 {};
virtual cmil::SDL::SDLControllers::Device::~Device | ( | ) | [inline, virtual] |
Definition at line 230 of file SDLTranslator.h.
References m_opened_sdl_joy.
00230 { 00231 if(SDL_WasInit(SDL_INIT_JOYSTICK)) 00232 if(m_opened_sdl_joy) 00233 SDL_JoystickClose(m_opened_sdl_joy); 00234 }
Axis* cmil::SDL::SDLControllers::Device::getAxis | ( | unsigned int | id | ) | const [inline] |
Definition at line 236 of file SDLTranslator.h.
References m_axes.
00236 { 00237 return m_axes.getData(id); 00238 }
Motion* cmil::SDL::SDLControllers::Device::getBall | ( | unsigned int | id | ) | const [inline] |
Definition at line 248 of file SDLTranslator.h.
References m_balls.
00248 { 00249 return m_balls.getData(id); 00250 }
Press* cmil::SDL::SDLControllers::Device::getButton | ( | unsigned int | id | ) | const [inline] |
Definition at line 244 of file SDLTranslator.h.
References m_buttons.
00244 { 00245 return m_buttons.getData(id); 00246 }
Hat* cmil::SDL::SDLControllers::Device::getHat | ( | unsigned int | id | ) | const [inline] |
Definition at line 240 of file SDLTranslator.h.
References m_hats.
00240 { 00241 return m_hats.getData(id); 00242 }
std::string cmil::SDL::SDLControllers::Device::getName | ( | ) | const [inline] |
SDL_Joystick* cmil::SDL::SDLControllers::Device::m_opened_sdl_joy [private] |