sdlHasJoystick function

bool sdlHasJoystick()

Return whether a joystick is currently connected.

\returns true if a joystick is connected, false otherwise.

\since This function is available since SDL 3.1.3.

\sa SDL_GetJoysticks

extern SDL_DECLSPEC bool SDLCALL SDL_HasJoystick(void)

Implementation

bool sdlHasJoystick() {
  final sdlHasJoystickLookupFunction = libSdl3
      .lookupFunction<Uint8 Function(), int Function()>('SDL_HasJoystick');
  return sdlHasJoystickLookupFunction() == 1;
}