src/joystick/SDL_joystick_c.h
changeset 12088 399cc39583cc
parent 11934 a7061d1f4ee4
child 12192 f03ca3ab9b30
     1.1 --- a/src/joystick/SDL_joystick_c.h	Wed Aug 08 15:39:20 2018 -0400
     1.2 +++ b/src/joystick/SDL_joystick_c.h	Thu Aug 09 16:00:17 2018 -0700
     1.3 @@ -23,19 +23,48 @@
     1.4  /* Useful functions and variables from SDL_joystick.c */
     1.5  #include "SDL_joystick.h"
     1.6  
     1.7 +struct _SDL_JoystickDriver;
     1.8 +
     1.9  /* Initialization and shutdown functions */
    1.10  extern int SDL_JoystickInit(void);
    1.11  extern void SDL_JoystickQuit(void);
    1.12  
    1.13 +/* Function to get the next available joystick instance ID */
    1.14 +extern SDL_JoystickID SDL_GetNextJoystickInstanceID(void);
    1.15 +
    1.16  /* Initialization and shutdown functions */
    1.17  extern int SDL_GameControllerInitMappings(void);
    1.18  extern void SDL_GameControllerQuitMappings(void);
    1.19  extern int SDL_GameControllerInit(void);
    1.20  extern void SDL_GameControllerQuit(void);
    1.21  
    1.22 +/* Function to get the joystick driver and device index for an API device index */
    1.23 +extern SDL_bool SDL_GetDriverAndJoystickIndex(int device_index, struct _SDL_JoystickDriver **driver, int *driver_index);
    1.24 +
    1.25 +/* Function to return the device index for a joystick ID, or -1 if not found */
    1.26 +extern int SDL_JoystickGetDeviceIndexFromInstanceID(SDL_JoystickID instance_id);
    1.27 +
    1.28  /* Function to extract information from an SDL joystick GUID */
    1.29  extern void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version);
    1.30  
    1.31 +/* Function to return whether a joystick is a PS4 controller */
    1.32 +extern SDL_bool SDL_IsJoystickPS4(Uint16 vendor_id, Uint16 product_id);
    1.33 +
    1.34 +/* Function to return whether a joystick is a Nintendo Switch Pro controller */
    1.35 +extern SDL_bool SDL_IsJoystickNintendoSwitchPro(Uint16 vendor_id, Uint16 product_id);
    1.36 +
    1.37 +/* Function to return whether a joystick is a Steam Controller */
    1.38 +extern SDL_bool SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_id);
    1.39 +
    1.40 +/* Function to return whether a joystick is an Xbox 360 controller */
    1.41 +extern SDL_bool SDL_IsJoystickXbox360(Uint16 vendor_id, Uint16 product_id);
    1.42 +
    1.43 +/* Function to return whether a joystick is an Xbox One controller */
    1.44 +extern SDL_bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id);
    1.45 +
    1.46 +/* Function to return whether a joystick should be ignored */
    1.47 +extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid);
    1.48 +
    1.49  /* Function to return whether a joystick name and GUID is a game controller  */
    1.50  extern SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid);
    1.51  
    1.52 @@ -46,7 +75,7 @@
    1.53  extern void SDL_GameControllerHandleDelayedGuideButton(SDL_Joystick *joystick);
    1.54  
    1.55  /* Internal event queueing functions */
    1.56 -extern void SDL_PrivateJoystickAdded(int device_index);
    1.57 +extern void SDL_PrivateJoystickAdded(SDL_JoystickID device_instance);
    1.58  extern void SDL_PrivateJoystickRemoved(SDL_JoystickID device_instance);
    1.59  extern int SDL_PrivateJoystickAxis(SDL_Joystick * joystick,
    1.60                                     Uint8 axis, Sint16 value);