sdlGamepadConnected function gamepad
Check if a gamepad has been opened and is currently connected.
\param gamepad a gamepad identifier previously returned by SDL_OpenGamepad(). \returns true if the gamepad has been opened and is currently connected, or false if not.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.2.0.
extern SDL_DECLSPEC bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad)
Implementation
bool sdlGamepadConnected(Pointer<SdlGamepad> gamepad) {
final sdlGamepadConnectedLookupFunction = _libSdl
.lookupFunction<
Uint8 Function(Pointer<SdlGamepad> gamepad),
int Function(Pointer<SdlGamepad> gamepad)
>('SDL_GamepadConnected');
return sdlGamepadConnectedLookupFunction(gamepad) == 1;
}