sdlJoystickOpen function

Pointer<SdlJoystick> sdlJoystickOpen(
  1. int deviceIndex
)

Open a joystick for use.

The device_index argument refers to the N'th joystick presently recognized by SDL on the system. It is NOT the same as the instance ID used to identify the joystick in future events. See SDL_JoystickInstanceID() for more details about instance IDs.

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

\param device_index the index of the joystick to query \returns a joystick identifier or NULL if an error occurred; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_JoystickClose \sa SDL_JoystickInstanceID

extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index)

Implementation

Pointer<SdlJoystick> sdlJoystickOpen(int deviceIndex) {
  final sdlJoystickOpenLookupFunction = libSdl2.lookupFunction<
      Pointer<SdlJoystick> Function(Int32 deviceIndex),
      Pointer<SdlJoystick> Function(int deviceIndex)>('SDL_JoystickOpen');
  return sdlJoystickOpenLookupFunction(deviceIndex);
}