mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Added functions to get the platform dependent name for a joystick or game controller
This commit is contained in:
@@ -1732,6 +1732,20 @@ SDL_GameControllerNameForIndex(int device_index)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the implementation dependent path of a controller
|
||||
*/
|
||||
const char *
|
||||
SDL_GameControllerPathForIndex(int device_index)
|
||||
{
|
||||
ControllerMapping_t *pSupportedController = SDL_PrivateGetControllerMapping(device_index);
|
||||
if (pSupportedController) {
|
||||
return SDL_JoystickPathForIndex(device_index);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the type of a game controller.
|
||||
*/
|
||||
@@ -2294,6 +2308,15 @@ SDL_GameControllerName(SDL_GameController *gamecontroller)
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GameControllerPath(SDL_GameController *gamecontroller)
|
||||
{
|
||||
if (!gamecontroller)
|
||||
return NULL;
|
||||
|
||||
return SDL_JoystickPath(SDL_GameControllerGetJoystick(gamecontroller));
|
||||
}
|
||||
|
||||
SDL_GameControllerType
|
||||
SDL_GameControllerGetType(SDL_GameController *gamecontroller)
|
||||
{
|
||||
|
Reference in New Issue
Block a user