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

@@ -377,15 +377,17 @@ static void OS2_JoystickDetect(void)
{
}
/***********************************************************/
/* Function to get the device-dependent name of a joystick */
/***********************************************************/
static const char *OS2_JoystickGetDeviceName(int device_index)
{
/* No need to verify if device exists, already done in upper layer */
return SYS_JoyData[device_index].szDeviceName;
}
static const char *OS2_JoystickGetDevicePath(int device_index)
{
return NULL;
}
static int OS2_JoystickGetDevicePlayerIndex(int device_index)
{
return -1;
@@ -779,6 +781,7 @@ SDL_JoystickDriver SDL_OS2_JoystickDriver =
OS2_NumJoysticks,
OS2_JoystickDetect,
OS2_JoystickGetDeviceName,
OS2_JoystickGetDevicePath,
OS2_JoystickGetDevicePlayerIndex,
OS2_JoystickSetDevicePlayerIndex,
OS2_JoystickGetDeviceGUID,