gamepad: Replace GetNumMappings/GetMappingByIndex with a single function.
Now it returns an array and optional count, to match other SDL3 APIs.
This commit is contained in:
@@ -311,25 +311,16 @@ extern DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromFile(const char *file);
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the number of mappings installed.
|
||||
*
|
||||
* \returns the number of mappings.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumGamepadMappings(void);
|
||||
|
||||
/**
|
||||
* Get the mapping at a particular index.
|
||||
*
|
||||
* \param mapping_index mapping index
|
||||
* \returns the mapping string. Must be freed with SDL_free(). Returns NULL if
|
||||
* the index is out of range.
|
||||
* \param count On return, set to the number of mappings returned. Can be NULL.
|
||||
* \returns an array of the mapping strings, NULL-terminated. Must be freed with SDL_free().
|
||||
* Returns NULL on error.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC char * SDLCALL SDL_GetGamepadMappingForIndex(int mapping_index);
|
||||
extern DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count);
|
||||
|
||||
/**
|
||||
* Get the gamepad mapping string for a given GUID.
|
||||
|
||||
Reference in New Issue
Block a user