sdlAttachVirtualJoystick function

int sdlAttachVirtualJoystick(
  1. Pointer<SdlVirtualJoystickDesc> desc
)

Attach a new virtual joystick.

\param desc joystick description, initialized using SDL_INIT_INTERFACE(). \returns the joystick instance ID, or 0 on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_DetachVirtualJoystick

extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc)

Implementation

int sdlAttachVirtualJoystick(Pointer<SdlVirtualJoystickDesc> desc) {
  final sdlAttachVirtualJoystickLookupFunction = libSdl3.lookupFunction<
      Uint32 Function(Pointer<SdlVirtualJoystickDesc> desc),
      int Function(
          Pointer<SdlVirtualJoystickDesc> desc)>('SDL_AttachVirtualJoystick');
  return sdlAttachVirtualJoystickLookupFunction(desc);
}