23 #ifndef SDL_POWER_DISABLED
26 #include "../../core/windows/SDL_windows.h"
33 SYSTEM_POWER_STATUS status;
37 if (!GetSystemPowerStatus(&status))
41 }
else if (status.BatteryFlag == 0xFF) {
43 }
else if (status.BatteryFlag & (1 << 7)) {
45 }
else if (status.BatteryFlag & (1 << 3)) {
48 }
else if (status.ACLineStatus == 1) {
59 const int pct = (
int) status.BatteryLifePercent;
60 const int secs = (
int) status.BatteryLifeTime;
63 *percent = (pct > 100) ? 100 : pct;
65 if (secs != 0xFFFFFFFF) {
SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *, int *, int *)
SDL_PowerState
The basic state for the system's power supply.