sdlJoystickGetDeviceInstanceId function

int sdlJoystickGetDeviceInstanceId(
  1. int deviceIndex
)

Get the instance ID of a joystick.

This can be called before any joysticks are opened.

\param device_index the index of the joystick to query (the N'th joystick on the system \returns the instance id of the selected joystick. If called on an invalid index, this function returns -1.

\since This function is available since SDL 2.0.6.

extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index)

Implementation

int sdlJoystickGetDeviceInstanceId(int deviceIndex) {
  final sdlJoystickGetDeviceInstanceIdLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Int32 deviceIndex),
      int Function(int deviceIndex)>('SDL_JoystickGetDeviceInstanceID');
  return sdlJoystickGetDeviceInstanceIdLookupFunction(deviceIndex);
}