sdl2-2.1.1: Both high- and low-level bindings to the SDL library (version 2.0.3).

Safe HaskellSafe
LanguageHaskell2010

SDL.Power

Contents

Synopsis

Power Status

getPowerInfo :: (Functor m, MonadIO m) => m PowerState Source

Current power supply details.

Throws SDLException if the current power state can not be determined.

See SDL_GetPowerInfo for C documentation.

data PowerState Source

Information about the power supply for the user's environment

Constructors

Battery BatteryState Charge

The user is on a battery powered device. See BatteryState for charge information, and Charge for charge information

Mains

The user is on a device connected to the mains.

UnknownPowerState

SDL could not determine the power for the device.

data BatteryState Source

Information on battery consumption for battery powered devices

Constructors

Draining

The battery is currently being drained.

Charged

The battery is fully charged.

Charging

The device is plugged in and the battery is charging.

data Charge Source

Information about how much charge a battery has.

Constructors

Charge 

Fields

chargeSecondsLeft :: Maybe CInt

How many seconds of battery life is left

chargePercent :: Maybe CInt

The percentage of battery charged