sdlGameControllerGetAttached function

bool sdlGameControllerGetAttached(
  1. Pointer<SdlGameController> gamecontroller
)

Check if a controller has been opened and is currently connected.

\param gamecontroller a game controller identifier previously returned by SDL_GameControllerOpen() \returns SDL_TRUE if the controller has been opened and is currently connected, or SDL_FALSE if not.

\since This function is available since SDL 2.0.0.

\sa SDL_GameControllerClose \sa SDL_GameControllerOpen

extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller)

Implementation

bool sdlGameControllerGetAttached(Pointer<SdlGameController> gamecontroller) {
  final sdlGameControllerGetAttachedLookupFunction = libSdl2.lookupFunction<
          Int32 Function(Pointer<SdlGameController> gamecontroller),
          int Function(Pointer<SdlGameController> gamecontroller)>(
      'SDL_GameControllerGetAttached');
  return sdlGameControllerGetAttachedLookupFunction(gamecontroller) == 1;
}