15 SDL_GameController *gamepad;
16 SDL_Joystick *joystick;
19 static unsigned int id_max;
20 EXPORT
static std::list<unsigned int> ids;
53 EXPORT
Gamepad(
unsigned int device_id);
79 EXPORT
void play_rumble(
float magnitude,
unsigned int duration);
unsigned int num_axes
The number of axes the gamepad has.
std::vector< int > buttons_pressed
A list of all buttons currently pressed.
void set_button_state(int button, bool state)
Sets the state of a button.
void set_deadzone(unsigned int deadzone)
Sets a dedzone for all axes.
int get_axis_value(unsigned int axis)
Call this function to get the current value of an axis.
unsigned int deadzone
The axis deadzone.
unsigned int num_buttons
The number of buttons the gamepad has.
Gamepad(unsigned int device_id)
unsigned int id
The gamepad id. When a new gamepad is attached it is assigned the first free ID starting at 0.
unsigned int instance_id
The instance ID of the gamepad as provided by an SDL2 event.
void stop_rumble()
Stops the rumble effect.
void play_rumble(float magnitude, unsigned int duration)
Plays a rumble effect.