diff --git a/src/SDL2.cs b/src/SDL2.cs index 1262b71..fd609a6 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -6012,6 +6012,38 @@ namespace SDL2 #endregion + #region SDL_power.h + + /// + /// The basic state for the system's power supply. + /// + public enum SDL_PowerState + { + SDL_POWERSTATE_UNKNOWN = 0, + SDL_POWERSTATE_ON_BATTERY, + SDL_POWERSTATE_NO_BATTERY, + SDL_POWERSTATE_CHARGING, + SDL_POWERSTATE_CHARGED + } + + /// + /// Get the current power supply details. + /// + /// Seconds of battery life left. You can pass a NULL here if + /// you don't care. Will return -1 if we can't determine a + /// value, or we're not running on a battery. + /// Percentage of battery life left, between 0 and 100. You can + /// pass a NULL here if you don't care. Will return -1 if we + /// can't determine a value, or we're not running on a battery. + /// The state of the battery (if any). + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_PowerState SDL_GetPowerInfo( + out int secs, + out int pct + ); + + #endregion + #region SDL_cpuinfo.h ///