sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

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

Documentation

newtype SDL_PowerState Source #

C declaration
enum SDL_PowerState, defined at SDL3/SDL_power.h 56:14

Constructors

SDL_PowerState 

Fields

Instances

Instances details
Storable SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Generic SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Associated Types

type Rep SDL_PowerState 
Instance details

Defined in SDL3.Sys.Bindgen.Power

type Rep SDL_PowerState = D1 ('MetaData "SDL_PowerState" "SDL3.Sys.Bindgen.Power" "sdl3-bindgen-sys-0.0.1.0-inplace" 'True) (C1 ('MetaCons "SDL_PowerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))
Read SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Show SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Eq SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Ord SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Prim SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

CEnum SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Associated Types

type CEnumZ SDL_PowerState 
Instance details

Defined in SDL3.Sys.Bindgen.Power

SequentialCEnum SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

HasFFIType SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Associated Types

type FFIType SDL_PowerState 
Instance details

Defined in SDL3.Sys.Bindgen.Power

ReadRaw SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

StaticSize SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

WriteRaw SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

HasCField SDL_PowerState "unwrap" Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Associated Types

type CFieldType SDL_PowerState "unwrap" 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Methods

offset# :: Proxy# SDL_PowerState -> Proxy# "unwrap" -> Int #

ty ~ CInt => HasField "unwrap" SDL_PowerState ty Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Methods

hasField :: SDL_PowerState -> (ty -> SDL_PowerState, ty) #

ty ~ CInt => HasField "unwrap" (Ptr SDL_PowerState) (Ptr ty :: Type) Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

Methods

getField :: Ptr SDL_PowerState -> Ptr ty #

type Rep SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

type Rep SDL_PowerState = D1 ('MetaData "SDL_PowerState" "SDL3.Sys.Bindgen.Power" "sdl3-bindgen-sys-0.0.1.0-inplace" 'True) (C1 ('MetaCons "SDL_PowerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))
type CEnumZ SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

type FFIType SDL_PowerState Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

type CFieldType SDL_PowerState "unwrap" Source # 
Instance details

Defined in SDL3.Sys.Bindgen.Power

pattern SDL_POWERSTATE_ERROR :: SDL_PowerState Source #

error determining power status

C declaration
SDL_POWERSTATE_ERROR, defined at SDL3/SDL_power.h 58:5

pattern SDL_POWERSTATE_UNKNOWN :: SDL_PowerState Source #

cannot determine power status

C declaration
SDL_POWERSTATE_UNKNOWN, defined at SDL3/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 at SDL3/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 at SDL3/SDL_power.h 61:5

pattern SDL_POWERSTATE_CHARGING :: SDL_PowerState Source #

Plugged in, charging battery

C declaration
SDL_POWERSTATE_CHARGING, defined at SDL3/SDL_power.h 62:5

pattern SDL_POWERSTATE_CHARGED :: SDL_PowerState Source #

Plugged in, battery charged

C declaration
SDL_POWERSTATE_CHARGED, defined at SDL3/SDL_power.h 63:5