Skip to content

Commit

Permalink
Add "al_get_joystick_device_id" to api
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkOates committed Mar 23, 2023
1 parent 7ae7527 commit db1db3f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/refman/joystick.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ handles may become inactive, and vice versa.

See also: [al_reconfigure_joysticks]

## API: al_get_joystick_device_id

Return the device id of the given joystick.

## API: al_get_joystick_name

Return the name of the given joystick.
Expand Down
1 change: 1 addition & 0 deletions include/allegro5/joystick.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ AL_FUNC(int, al_get_joystick_num_buttons, (ALLEGRO_JOYSTICK *));
AL_FUNC(const char*, al_get_joystick_button_name, (ALLEGRO_JOYSTICK *, int buttonn));

AL_FUNC(void, al_get_joystick_state, (ALLEGRO_JOYSTICK *, ALLEGRO_JOYSTICK_STATE *ret_state));
AL_FUNC(int, al_get_joystick_device_id, (ALLEGRO_JOYSTICK *));

AL_FUNC(ALLEGRO_EVENT_SOURCE *, al_get_joystick_event_source, (void));

Expand Down
13 changes: 13 additions & 0 deletions src/joynu.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,19 @@ void al_get_joystick_state(ALLEGRO_JOYSTICK *joy, ALLEGRO_JOYSTICK_STATE *ret_st
new_joystick_driver->get_joystick_state(joy, ret_state);
}



/* Function: al_get_joystick_device_id
*/
int al_get_joystick_device_id(ALLEGRO_JOYSTICK *joy)
{
ASSERT(new_joystick_driver);

return new_joystick_driver->get_device_id(joy);
}



/*
* Local Variables:
* c-basic-offset: 3
Expand Down

0 comments on commit db1db3f

Please sign in to comment.