module lib.sdl2.power

Code Map

module lib.sdl2.power;


enum SDL_POWERSTATE_UNKNOWN;
enum SDL_POWERSTATE_ON_BATTERY;
enum SDL_POWERSTATE_NO_BATTERY;
enum SDL_POWERSTATE_CHARGING;
enum SDL_POWERSTATE_CHARGED;

//! \brief The basic state for the system's power supply.
alias SDL_PowerState = i32;

//! \brief Get the current power supply details.
fn SDL_GetPowerInfo(secs: i32*, pct: i32*) SDL_PowerState;
alias SDL_PowerState

\brief The basic state for the system's power supply.

fn SDL_GetPowerInfo(secs: i32*, pct: i32*) SDL_PowerState

\brief Get the current power supply details.

\param secs 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.

\param pct 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.

\return The state of the battery (if any).