Module power
Available on crate feature
dep_sdl3
only.Expand 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.
Structs§
- SDL_
Power State - The basic state for the system’s power supply.
Constants§
- SDL_
POWERSTATE_ CHARGED - Plugged in, battery charged
- SDL_
POWERSTATE_ CHARGING - Plugged in, charging battery
- SDL_
POWERSTATE_ ERROR - error determining power status
- SDL_
POWERSTATE_ NO_ BATTERY - Plugged in, no battery available
- SDL_
POWERSTATE_ ON_ BATTERY - Not plugged in, running on the battery
- SDL_
POWERSTATE_ UNKNOWN - cannot determine power status
Functions§
- SDL_
GetPower ⚠Info - Get the current power supply details.