public sealed class WindowsPowerInfoBattery and battery saver, from GetSystemPowerStatus.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The reason this exists is one byte. SystemStatusFlag is the user having turned battery saver on, which is the strongest statement a user can make that they want a lower frame rate, and SDL does not report it. The rest of the structure is what SDL already reads and is read here too rather than delegated, because reading three fields of a structure that has already been filled in is cheaper than the call that would fill it in again.
Thermal state is not answered here, and that is not an omission. Windows has no user-mode API for thermal pressure — no counterpart to NSProcessInfo's thermalState or Android's PowerManager. What exists is a WMI thermal-zone temperature that most laptops do not populate, and a power-setting notification for "the machine is about to shut down", which is a different question asked too late. So Thermal is whatever the portable implementation says, which is Nominal, and a Windows title that wants to scale quality reads frame time.
Fields and properties (5)
public PowerSource SourceWhere power is coming from.
public float? BatteryLevelHow full the battery is, [0, 1], or if there is no battery or the platform will not say.
public TimeSpan? EstimatedTimeRemainingHow long the platform thinks the battery will last, or if it does not estimate.
public ThermalState ThermalWhat the portable implementation says. See the remarks on this class.
public bool IsLowPowerModeWhether the user has asked the OS to save power.
Methods (1)
public WindowsPowerInfo(IPowerInfo fallback)Battery and battery saver, from GetSystemPowerStatus.
Used by (1)
- WindowsPlatformSupplementVixen.Platform.Windows