sdlOpenJoystick function joystick

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.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

\sa SDL_CloseJoystick

extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id)

Implementation

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