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

@@ -142,7 +142,6 @@ static void PSP_JoystickDetect(void)
}
#if 0
/* Function to get the device-dependent name of a joystick */
static const char *PSP_JoystickName(int idx)
{
if (idx == 0) return "PSP controller";
@@ -151,12 +150,16 @@ static const char *PSP_JoystickName(int idx)
}
#endif
/* Function to get the device-dependent name of a joystick */
static const char *PSP_JoystickGetDeviceName(int device_index)
{
return "PSP builtin joypad";
}
static const char *PSP_JoystickGetDevicePath(int device_index)
{
return NULL;
}
static int PSP_JoystickGetDevicePlayerIndex(int device_index)
{
return -1;
@@ -304,6 +307,7 @@ SDL_JoystickDriver SDL_PSP_JoystickDriver =
PSP_NumJoysticks,
PSP_JoystickDetect,
PSP_JoystickGetDeviceName,
PSP_JoystickGetDevicePath,
PSP_JoystickGetDevicePlayerIndex,
PSP_JoystickSetDevicePlayerIndex,
PSP_JoystickGetDeviceGUID,