mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
Added functions to get the platform dependent name for a joystick or game controller
This commit is contained in:
parent
b293888c7d
commit
e551384a99
28 changed files with 306 additions and 26 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue