SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_power.h
1#ifndef SDL3PP_POWER_H_
2#define SDL3PP_POWER_H_
3
4#include <SDL3/SDL_power.h>
5#include "SDL3pp_stdinc.h"
6
7namespace SDL {
37using PowerState = SDL_PowerState;
38
40 SDL_POWERSTATE_ERROR;
41
43 SDL_POWERSTATE_UNKNOWN;
44
46 SDL_POWERSTATE_ON_BATTERY;
47
49 SDL_POWERSTATE_NO_BATTERY;
50
52 SDL_POWERSTATE_CHARGING;
53
55 SDL_POWERSTATE_CHARGED;
56
58
91inline PowerState GetPowerInfo(int* seconds, int* percent)
92{
93 return SDL_GetPowerInfo(seconds, percent);
94}
95
97
98} // namespace SDL
99
100#endif /* SDL3PP_POWER_H_ */
SDL_PowerState PowerState
The basic state for the system's power supply.
Definition SDL3pp_power.h:37
constexpr PowerState POWERSTATE_ON_BATTERY
Not plugged in, running on the battery.
Definition SDL3pp_power.h:45
constexpr PowerState POWERSTATE_UNKNOWN
cannot determine power status
Definition SDL3pp_power.h:42
PowerState GetPowerInfo(int *seconds, int *percent)
Get the current power supply details.
Definition SDL3pp_power.h:91
constexpr PowerState POWERSTATE_CHARGING
Plugged in, charging battery.
Definition SDL3pp_power.h:51
constexpr PowerState POWERSTATE_NO_BATTERY
Plugged in, no battery available.
Definition SDL3pp_power.h:48
constexpr PowerState POWERSTATE_ERROR
error determining power status
Definition SDL3pp_power.h:39
constexpr PowerState POWERSTATE_CHARGED
Plugged in, battery charged.
Definition SDL3pp_power.h:54
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7