Added SDL_GetGamepadPowerLevel() to get the power level directly from a gamepad

This commit is contained in:
Sam Lantinga committed 2023-07-11 10:20:08 -07:00
1 parent 9885f4d245
commit 2e3404db01
6 files changed
+26 -1

No files matched your search

+1 -1
View File
@@ -389,7 +389,7 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad)
}
}
ctx->battery_level = SDL_GetJoystickPowerLevel(SDL_GetGamepadJoystick(gamepad));
ctx->battery_level = SDL_GetGamepadPowerLevel(gamepad);
if (SDL_GetNumGamepadTouchpads(gamepad) > 0) {
int num_fingers = SDL_GetNumGamepadTouchpadFingers(gamepad, 0);