Skip to content

Commit c8a9ff8

Browse files
committed
Add "al_get_joystick_device_id" to api
1 parent 9766ddb commit c8a9ff8

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

docs/src/refman/joystick.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ handles may become inactive, and vice versa.
131131

132132
See also: [al_reconfigure_joysticks]
133133

134+
## API: al_get_joystick_device_id
135+
136+
Return the device id of the given joystick.
137+
134138
## API: al_get_joystick_name
135139

136140
Return the name of the given joystick.

include/allegro5/joystick.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ AL_FUNC(int, al_get_joystick_num_buttons, (ALLEGRO_JOYSTICK *));
8181
AL_FUNC(const char*, al_get_joystick_button_name, (ALLEGRO_JOYSTICK *, int buttonn));
8282

8383
AL_FUNC(void, al_get_joystick_state, (ALLEGRO_JOYSTICK *, ALLEGRO_JOYSTICK_STATE *ret_state));
84+
AL_FUNC(int, al_get_joystick_device_id, (ALLEGRO_JOYSTICK *));
8485

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

src/joynu.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,19 @@ void al_get_joystick_state(ALLEGRO_JOYSTICK *joy, ALLEGRO_JOYSTICK_STATE *ret_st
300300
new_joystick_driver->get_joystick_state(joy, ret_state);
301301
}
302302

303+
304+
305+
/* Function: al_get_joystick_device_id
306+
*/
307+
int al_get_joystick_device_id(ALLEGRO_JOYSTICK *joy)
308+
{
309+
ASSERT(new_joystick_driver);
310+
311+
return new_joystick_driver->get_device_id(joy);
312+
}
313+
314+
315+
303316
/*
304317
* Local Variables:
305318
* c-basic-offset: 3

0 commit comments

Comments
 (0)