sdlOpenJoystick function

Pointer<SdlJoystick> sdlOpenJoystick(
  1. int instanceId
)

Open a joystick for use.

The joystick subsystem must be initialized before a joystick can be opened for use.

\param instance_id the joystick instance ID. \returns a joystick identifier or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_CloseJoystick

extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id)

Implementation

Pointer<SdlJoystick> sdlOpenJoystick(int instanceId) {
  final sdlOpenJoystickLookupFunction = libSdl3.lookupFunction<
      Pointer<SdlJoystick> Function(Uint32 instanceId),
      Pointer<SdlJoystick> Function(int instanceId)>('SDL_OpenJoystick');
  return sdlOpenJoystickLookupFunction(instanceId);
}