18 #include "precompiled.h"
29 m_Joystick(NULL), m_Deadzone(0)
35 bool joystickEnable =
false;
36 CFG_GET_VAL(
"joystick.enable", Bool, joystickEnable);
50 LOGMESSAGE(L
"Found %d joystick(s)", numJoysticks);
52 for (
int i = 0; i < numJoysticks; ++i)
54 #if SDL_VERSION_ATLEAST(2, 0, 0)
66 #if SDL_VERSION_ATLEAST(2, 0, 0)
67 SDL_JoystickClose(stick);
int SDL_JoystickNumAxes(SDL_Joystick *joystick)
int SDL_JoystickEventState(int state)
void Initialise()
Initialises joystick support.
float GetAxisValue(int axis)
Returns current value of the given joystick axis, in the range [-1, +1].
#define CFG_GET_VAL(name, type, destination)
SDL_Joystick * m_Joystick
Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
bool IsEnabled()
Returns true if initialised and the joystick is present and enabled by configuration.
SDL_Joystick * SDL_JoystickOpen(int device_index)
const char * SDL_JoystickName(int device_index)
int SDL_InitSubSystem(Uint32 flags)
#define SDL_INIT_JOYSTICK