Add joystick count function
This commit is contained in:
parent
7e94363060
commit
8d112ac6c8
|
@ -547,6 +547,15 @@ int get_joystick_number_by_id(SDL_JoystickID id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int get_number_of_joysticks()
|
||||
{
|
||||
int i, n=0;
|
||||
for(i=0; i<MAX_JOYSTICKS; ++i)
|
||||
if(open_joysticks[i].first)
|
||||
++n;
|
||||
return n;
|
||||
}
|
||||
|
||||
static u16 shift_pressed;
|
||||
|
||||
void
|
||||
|
|
|
@ -119,5 +119,6 @@ void
|
|||
process_joystick_device_events();
|
||||
|
||||
int get_joystick_number_by_id(SDL_JoystickID id);
|
||||
int get_number_of_joysticks();
|
||||
|
||||
#endif /* CTRLSSDL_H */
|
||||
|
|
Loading…
Reference in New Issue