sdlJoystickGetAttached function

bool sdlJoystickGetAttached(
  1. Pointer<SdlJoystick> joystick
)

Get the status of a specified joystick.

\param joystick the joystick to query \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_JoystickClose \sa SDL_JoystickOpen

extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick)

Implementation

bool sdlJoystickGetAttached(Pointer<SdlJoystick> joystick) {
  final sdlJoystickGetAttachedLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlJoystick> joystick),
      int Function(Pointer<SdlJoystick> joystick)>('SDL_JoystickGetAttached');
  return sdlJoystickGetAttachedLookupFunction(joystick) == 1;
}