sdlIsGameController function
Check if the given joystick is supported by the game controller interface.
joystick_index
is the same as the device_index
passed to
SDL_JoystickOpen().
\param joystick_index the device_index of a device, up to SDL_NumJoysticks() \returns SDL_TRUE if the given joystick is supported by the game controller interface, SDL_FALSE if it isn't or it's an invalid index.
\since This function is available since SDL 2.0.0.
\sa SDL_GameControllerNameForIndex \sa SDL_GameControllerOpen
extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index)
Implementation
bool sdlIsGameController(int joystickIndex) {
final sdlIsGameControllerLookupFunction = libSdl2.lookupFunction<
Int32 Function(Int32 joystickIndex),
int Function(int joystickIndex)>('SDL_IsGameController');
return sdlIsGameControllerLookupFunction(joystickIndex) == 1;
}