Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened

This commit is contained in:
Sam Lantinga 2018-03-07 13:30:40 -08:00
parent 9e651b6915
commit a8ac588549
7 changed files with 58 additions and 22 deletions

View file

@ -175,6 +175,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
/**
* Get the mapping of a game controller.
* This can be called before any controllers are opened.
*
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
*/
extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
/**
* Open a game controller for use.
* The index passed as an argument refers to the N'th game controller on the system.