/* Return the SDL_GameController associated with a player index.  */
SDL_GameController* SDL_GameControllerFromPlayerIndex(int player_index)
/* Return the SDL_GameController associated with a player index.  */
SDL_GameController* SDL_GameControllerFromPlayerIndex(int player_index)
{
    SDL_Joystick *joystick = SDL_JoystickFromPlayerIndex(player_index);
    if (joystick) {
        return SDL_GameControllerFromInstanceID(joystick->instance_id);
    }
    return NULL;
}