mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
Added functions to get the platform dependent name for a joystick or game controller
This commit is contained in:
parent
b293888c7d
commit
e551384a99
28 changed files with 306 additions and 26 deletions
|
@ -555,7 +555,6 @@ WINDOWS_JoystickDetect(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* Function to get the device-dependent name of a joystick */
|
||||
static const char *
|
||||
WINDOWS_JoystickGetDeviceName(int device_index)
|
||||
{
|
||||
|
@ -568,6 +567,18 @@ WINDOWS_JoystickGetDeviceName(int device_index)
|
|||
return device->joystickname;
|
||||
}
|
||||
|
||||
static const char *
|
||||
WINDOWS_JoystickGetDevicePath(int device_index)
|
||||
{
|
||||
JoyStick_DeviceData *device = SYS_Joystick;
|
||||
int index;
|
||||
|
||||
for (index = device_index; index > 0; index--)
|
||||
device = device->pNext;
|
||||
|
||||
return device->path;
|
||||
}
|
||||
|
||||
static int
|
||||
WINDOWS_JoystickGetDevicePlayerIndex(int device_index)
|
||||
{
|
||||
|
@ -755,6 +766,7 @@ SDL_JoystickDriver SDL_WINDOWS_JoystickDriver =
|
|||
WINDOWS_JoystickGetCount,
|
||||
WINDOWS_JoystickDetect,
|
||||
WINDOWS_JoystickGetDeviceName,
|
||||
WINDOWS_JoystickGetDevicePath,
|
||||
WINDOWS_JoystickGetDevicePlayerIndex,
|
||||
WINDOWS_JoystickSetDevicePlayerIndex,
|
||||
WINDOWS_JoystickGetDeviceGUID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue