| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Power
Description
SDL power management routines.
There is a single function in this category: SDL_GetPowerInfo().
This function is useful for games on the go. This allows an app to know if it's running on a draining battery, which can be useful if the app wants to reduce processing, or perhaps framerate, to extend the duration of the battery's charge. Perhaps the app just wants to show a battery meter when fullscreen, or alert the user when the power is getting extremely low, so they can save their game. The basic state for the system's power supply.
These are results returned by SDL_GetPowerInfo().
Since: 3.2.0
Synopsis
- newtype SDL_PowerState = SDL_PowerState {}
- pattern SDL_POWERSTATE_ERROR :: SDL_PowerState
- pattern SDL_POWERSTATE_UNKNOWN :: SDL_PowerState
- pattern SDL_POWERSTATE_ON_BATTERY :: SDL_PowerState
- pattern SDL_POWERSTATE_NO_BATTERY :: SDL_PowerState
- pattern SDL_POWERSTATE_CHARGING :: SDL_PowerState
- pattern SDL_POWERSTATE_CHARGED :: SDL_PowerState
Documentation
newtype SDL_PowerState Source #
- C declaration
enum SDL_PowerState, defined atSDL3/SDL_power.h 56:14
Constructors
| SDL_PowerState | |
Instances
pattern SDL_POWERSTATE_ERROR :: SDL_PowerState Source #
error determining power status
- C declaration
SDL_POWERSTATE_ERROR, defined atSDL3/SDL_power.h 58:5
pattern SDL_POWERSTATE_UNKNOWN :: SDL_PowerState Source #
cannot determine power status
- C declaration
SDL_POWERSTATE_UNKNOWN, defined atSDL3/SDL_power.h 59:5
pattern SDL_POWERSTATE_ON_BATTERY :: SDL_PowerState Source #
Not plugged in, running on the battery
- C declaration
SDL_POWERSTATE_ON_BATTERY, defined atSDL3/SDL_power.h 60:5
pattern SDL_POWERSTATE_NO_BATTERY :: SDL_PowerState Source #
Plugged in, no battery available
- C declaration
SDL_POWERSTATE_NO_BATTERY, defined atSDL3/SDL_power.h 61:5
pattern SDL_POWERSTATE_CHARGING :: SDL_PowerState Source #
Plugged in, charging battery
- C declaration
SDL_POWERSTATE_CHARGING, defined atSDL3/SDL_power.h 62:5
pattern SDL_POWERSTATE_CHARGED :: SDL_PowerState Source #
Plugged in, battery charged
- C declaration
SDL_POWERSTATE_CHARGED, defined atSDL3/SDL_power.h 63:5