Get the player index of an opened joystick.
Defined in <SDL3/SDL_joystick.h>
int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
SDL_Joystick * | joystick | the SDL_Joystick obtained from SDL_OpenJoystick(). |
(int) Returns the player index, or -1 if it's not available.
For XInput controllers this returns the XInput user index. Many joysticks will not be able to supply this information.
It is safe to call this function from any thread.
This function is available since SDL 3.2.0.