mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-18 17:28:13 +00:00
Added SDL_JoystickGetXInputUserIndex()
This commit is contained in:
@@ -322,6 +322,7 @@ SDL_JoystickOpen(int device_index)
|
||||
}
|
||||
|
||||
joystick->guid = driver->GetDeviceGUID(device_index);
|
||||
joystick->userid = -1;
|
||||
|
||||
if (joystick->naxes > 0) {
|
||||
joystick->axes = (SDL_JoystickAxisInfo *) SDL_calloc(joystick->naxes, sizeof(SDL_JoystickAxisInfo));
|
||||
@@ -1556,4 +1557,12 @@ SDL_JoystickPowerLevel SDL_JoystickCurrentPowerLevel(SDL_Joystick * joystick)
|
||||
return joystick->epowerlevel;
|
||||
}
|
||||
|
||||
int SDL_JoystickGetXInputUserIndex(SDL_Joystick * joystick)
|
||||
{
|
||||
if (!SDL_PrivateJoystickValid(joystick)) {
|
||||
return -1;
|
||||
}
|
||||
return joystick->userid;
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
Reference in New Issue
Block a user