table of contents
SDL_GetGamepadPowerInfo(3) | SDL3 FUNCTIONS | SDL_GetGamepadPowerInfo(3) |
NAME¶
SDL_GetGamepadPowerInfo - Get the battery state of a gamepad.
HEADER FILE¶
Defined in SDL3/SDL_gamepad.h
SYNOPSIS¶
#include "SDL3/SDL.h"
SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, int *percent);
DESCRIPTION¶
You should never take a battery status as absolute truth. Batteries (especially failing batteries) are delicate hardware, and the values reported here are best estimates based on what that hardware reports. It's not uncommon for older batteries to lose stored power much faster than it reports, or completely drain when reporting it has 20 percent left, etc.
FUNCTION PARAMETERS¶
RETURN VALUE¶
( SDL_PowerState ) Returns the current battery state.
AVAILABILITY¶
This function is available since SDL 3.1.3.
SDL 3.1.6 | Simple Directmedia Layer |