Generalized the XInput user index into a player index

This commit is contained in:
Sam Lantinga 2018-10-25 16:53:14 -07:00
parent 222a3ed235
commit 678ba78382
18 changed files with 138 additions and 18 deletions

View file

@ -204,6 +204,13 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
/**
* Get the player index of an opened game controller, or -1 if it's not available
*
* For XInput controllers this returns the XInput user index.
*/
extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
/**
* Get the USB vendor ID of an opened controller, if available.
* If the vendor ID isn't available this function returns 0.