include/SDL_joystick.h
changeset 10934 380eae4f5059
parent 10870 b158d18e06d0
child 11581 49393a9dffe4
     1.1 --- a/include/SDL_joystick.h	Thu Mar 09 15:12:19 2017 -0800
     1.2 +++ b/include/SDL_joystick.h	Thu Mar 09 16:09:16 2017 -0800
     1.3 @@ -71,6 +71,13 @@
     1.4      Uint8 data[16];
     1.5  } SDL_JoystickGUID;
     1.6  
     1.7 +/**
     1.8 + * This is a unique ID for a joystick for the time it is connected to the system,
     1.9 + * and is never reused for the lifetime of the application. If the joystick is
    1.10 + * disconnected and reconnected, it will get a new ID.
    1.11 + *
    1.12 + * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
    1.13 + */
    1.14  typedef Sint32 SDL_JoystickID;
    1.15  
    1.16  typedef enum
    1.17 @@ -145,6 +152,13 @@
    1.18  extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
    1.19  
    1.20  /**
    1.21 + *  Get the instance ID of a joystick.
    1.22 + *  This can be called before any joysticks are opened.
    1.23 + *  If the index is out of range, this function will return -1.
    1.24 + */
    1.25 +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
    1.26 +
    1.27 +/**
    1.28   *  Open a joystick for use.
    1.29   *  The index passed as an argument refers to the N'th joystick on the system.
    1.30   *  This index is not the value which will identify this joystick in future