mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-02-04 11:15:57 +01:00
Murad On my system, SDL_GetPowerInfo() returns -1 seconds of battery life left. I have quickly investigated that in my case SDL uses sys interface to get battery data. It tries to read "time_to_empty_now" file which is not always present. However, it is still possible to calculate remaining lifetime using "energy_now" and "power_now" files. This is what my simple patch (included as attachment) tries to accomplish. Best wishes. |
||
---|---|---|
.. | ||
android | ||
emscripten | ||
haiku | ||
linux | ||
macosx | ||
psp | ||
uikit | ||
windows | ||
winrt | ||
SDL_power.c | ||
SDL_syspower.h |