Added functions to get the platform dependent name for a joystick or game controller

This commit is contained in:
Sam Lantinga 2022-04-26 14:54:14 -07:00
parent b293888c7d
commit e551384a99
28 changed files with 306 additions and 26 deletions

View file

@ -744,7 +744,6 @@ DARWIN_JoystickDetect(void)
}
}
/* Function to get the device-dependent name of a joystick */
const char *
DARWIN_JoystickGetDeviceName(int device_index)
{
@ -752,6 +751,12 @@ DARWIN_JoystickGetDeviceName(int device_index)
return device ? device->product : "UNKNOWN";
}
const char *
DARWIN_JoystickGetDevicePath(int device_index)
{
return NULL;
}
static int
DARWIN_JoystickGetDevicePlayerIndex(int device_index)
{
@ -1115,6 +1120,7 @@ SDL_JoystickDriver SDL_DARWIN_JoystickDriver =
DARWIN_JoystickGetCount,
DARWIN_JoystickDetect,
DARWIN_JoystickGetDeviceName,
DARWIN_JoystickGetDevicePath,
DARWIN_JoystickGetDevicePlayerIndex,
DARWIN_JoystickSetDevicePlayerIndex,
DARWIN_JoystickGetDeviceGUID,