mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 00:18:28 +00:00
Added SDL_GetGamepadPowerLevel() to get the power level directly from a gamepad
This commit is contained in:
@@ -2778,6 +2778,16 @@ const char * SDL_GetGamepadSerial(SDL_Gamepad *gamepad)
|
||||
return SDL_GetJoystickSerial(joystick);
|
||||
}
|
||||
|
||||
SDL_JoystickPowerLevel SDL_GetGamepadPowerLevel(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
if (joystick == NULL) {
|
||||
return SDL_JOYSTICK_POWER_UNKNOWN;
|
||||
}
|
||||
return SDL_GetJoystickPowerLevel(joystick);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return if the gamepad in question is currently attached to the system,
|
||||
* \return 0 if not plugged in, 1 if still present.
|
||||
|
Reference in New Issue
Block a user