| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | struct _SDL_GameController; |
| | | typedef struct _SDL_GameController SDL_GameController; |
| | | |
| | | typedef enum |
| | | { |
| | | SDL_CONTROLLER_TYPE_UNKNOWN = 0, |
| | | SDL_CONTROLLER_TYPE_XBOX360, |
| | | SDL_CONTROLLER_TYPE_XBOXONE, |
| | | SDL_CONTROLLER_TYPE_PS3, |
| | | SDL_CONTROLLER_TYPE_PS4, |
| | | SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO |
| | | } SDL_GameControllerType; |
| | | |
| | | typedef enum |
| | | { |
| | |
| | | extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); |
| | | |
| | | /** |
| | | * Get the type of a game controller. |
| | | * This can be called before any controllers are opened. |
| | | */ |
| | | extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); |
| | | |
| | | /** |
| | | * Get the mapping of a game controller. |
| | | * This can be called before any controllers are opened. |
| | | * |
| | |
| | | extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); |
| | | |
| | | /** |
| | | * Return the SDL_GameController associated with a player index. |
| | | */ |
| | | extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); |
| | | |
| | | /** |
| | | * Return the name for this currently opened controller |
| | | */ |
| | | extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); |
| | | |
| | | /** |
| | | * Return the type of this currently opened controller |
| | | */ |
| | | extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); |
| | | |
| | | /** |
| | | * Get the player index of an opened game controller, or -1 if it's not available |
| | |
| | | extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); |
| | | |
| | | /** |
| | | * Set the player index of an opened game controller |
| | | */ |
| | | extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); |
| | | |
| | | /** |
| | | * Get the USB vendor ID of an opened controller, if available. |
| | | * If the vendor ID isn't available this function returns 0. |
| | | */ |