mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-18 15:51:44 +00:00
Added functions to get the platform dependent name for a joystick or game controller
This commit is contained in:
@@ -854,13 +854,18 @@ JoystickByDevIndex(int device_index)
|
||||
return item;
|
||||
}
|
||||
|
||||
/* Function to get the device-dependent name of a joystick */
|
||||
static const char *
|
||||
LINUX_JoystickGetDeviceName(int device_index)
|
||||
{
|
||||
return JoystickByDevIndex(device_index)->name;
|
||||
}
|
||||
|
||||
static const char *
|
||||
LINUX_JoystickGetDevicePath(int device_index)
|
||||
{
|
||||
return JoystickByDevIndex(device_index)->path;
|
||||
}
|
||||
|
||||
static int
|
||||
LINUX_JoystickGetDevicePlayerIndex(int device_index)
|
||||
{
|
||||
@@ -1846,6 +1851,7 @@ SDL_JoystickDriver SDL_LINUX_JoystickDriver =
|
||||
LINUX_JoystickGetCount,
|
||||
LINUX_JoystickDetect,
|
||||
LINUX_JoystickGetDeviceName,
|
||||
LINUX_JoystickGetDevicePath,
|
||||
LINUX_JoystickGetDevicePlayerIndex,
|
||||
LINUX_JoystickSetDevicePlayerIndex,
|
||||
LINUX_JoystickGetDeviceGUID,
|
||||
|
Reference in New Issue
Block a user