include/SDL_joystick.h
changeset 6707 70eeb7e3ec2f
parent 6690 9548c8a58103
child 6738 b408d5a406a3
equal deleted inserted replaced
6706:b9f5fb1e78b5 6707:70eeb7e3ec2f
    60 
    60 
    61 /* The joystick structure used to identify an SDL joystick */
    61 /* The joystick structure used to identify an SDL joystick */
    62 struct _SDL_Joystick;
    62 struct _SDL_Joystick;
    63 typedef struct _SDL_Joystick SDL_Joystick;
    63 typedef struct _SDL_Joystick SDL_Joystick;
    64 
    64 
       
    65 /* A structure that encodes the stable unique id for a joystick device */
       
    66 typedef struct {
       
    67 	Uint8 data[16];
       
    68 } JoystickGUID;
       
    69 
    65 typedef int SDL_JoystickID;
    70 typedef int SDL_JoystickID;
    66 	
    71 
       
    72 
    67 /* Function prototypes */
    73 /* Function prototypes */
    68 /**
    74 /**
    69  *  Count the number of joysticks attached to the system right now
    75  *  Count the number of joysticks attached to the system right now
    70  */
    76  */
    71 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
    77 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
    91  *  Return the name for this currently opened joystick.
    97  *  Return the name for this currently opened joystick.
    92  *  If no name can be found, this function returns NULL.
    98  *  If no name can be found, this function returns NULL.
    93  */
    99  */
    94 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
   100 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick);
    95 	
   101 	
    96 /* A structure that encodes the stable unique id for a joystick device */
       
    97 typedef struct
       
    98 {
       
    99 	Uint8 data[16];
       
   100 } JoystickGUID;
       
   101 
       
   102 /**
   102 /**
   103  *  Return the GUID for the joystick at this index
   103  *  Return the GUID for the joystick at this index
   104  */
   104  */
   105 extern DECLSPEC JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
   105 extern DECLSPEC JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
   106 
   106 
   117 /**
   117 /**
   118  *  convert a string into a joystick formatted guid
   118  *  convert a string into a joystick formatted guid
   119  */
   119  */
   120 extern DECLSPEC JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
   120 extern DECLSPEC JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
   121 
   121 
   122 
   122 /**
   123 /**
   123  *  Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
   124  *  Returns 1 if the joystick has been opened and currently connected, or 0 if it has not.
   124  */
   125  */
   125 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick);
   126 extern DECLSPEC int SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick);
   126 
   127 
   127 /**
   128 /**
   128  *  Get the instance ID of an opened joystick.
   129  *  Get the device index of an opened joystick.
       
   130  */
   129  */
   131 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick);
   130 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick);
   132 
   131 
   133 /**
   132 /**
   134  *  Get the number of general axis controls on a joystick.
   133  *  Get the number of general axis controls on a joystick.