mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 23:10:58 +00:00
Added SDL_JoystickGetXInputUserIndex()
This commit is contained in:
parent
4d4e18c4bb
commit
9987ca69f3
6 changed files with 18 additions and 0 deletions
|
@ -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: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue