sdlGetJoystickVendorForId function

int sdlGetJoystickVendorForId(
  1. int instanceId
)

Get the USB vendor ID of a joystick, if available.

This can be called before any joysticks are opened. If the vendor ID isn't available this function returns 0.

\param instance_id the joystick instance ID. \returns the USB vendor ID of the selected joystick. If called with an invalid instance_id, this function returns 0.

\since This function is available since SDL 3.1.3.

\sa SDL_GetJoystickVendor \sa SDL_GetJoysticks

extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorForID(SDL_JoystickID instance_id)

Implementation

int sdlGetJoystickVendorForId(int instanceId) {
  final sdlGetJoystickVendorForIdLookupFunction = libSdl3.lookupFunction<
      Uint16 Function(Uint32 instanceId),
      int Function(int instanceId)>('SDL_GetJoystickVendorForID');
  return sdlGetJoystickVendorForIdLookupFunction(instanceId);
}