include/SDL_gamecontroller.h
changeset 10213 f97a7faf0b58
parent 9998 f67cf37e9cd4
child 10595 9da2701eeb4a
equal deleted inserted replaced
10212:af95dd343a25 10213:f97a7faf0b58
    91  *      if ( SDL_IsGameController(i) ) {
    91  *      if ( SDL_IsGameController(i) ) {
    92  *          nGameControllers++;
    92  *          nGameControllers++;
    93  *      }
    93  *      }
    94  *  }
    94  *  }
    95  *
    95  *
    96  *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
    96  *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
    97  *  guid,name,mappings
    97  *  guid,name,mappings
    98  *
    98  *
    99  *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
    99  *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
   100  *  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
   100  *  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
   101  *  The mapping format for joystick is:
   101  *  The mapping format for joystick is:
   134 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
   134 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString );
   135 
   135 
   136 /**
   136 /**
   137  *  Get a mapping string for a GUID
   137  *  Get a mapping string for a GUID
   138  *
   138  *
   139  *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
   139  *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
   140  */
   140  */
   141 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
   141 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
   142 
   142 
   143 /**
   143 /**
   144  *  Get a mapping string for an open GameController
   144  *  Get a mapping string for an open GameController
   145  *
   145  *
   146  *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
   146  *  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
   147  */
   147  */
   148 extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
   148 extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
   149 
   149 
   150 /**
   150 /**
   151  *  Is the joystick on this index supported by the game controller interface?
   151  *  Is the joystick on this index supported by the game controller interface?