SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL3pp_power.h
1
2
3#ifndef SDL3PP_POWER_H_
4#define SDL3PP_POWER_H_
5
6#include <SDL3/SDL_power.h>
7#include "SDL3pp_stdinc.h"
8
9namespace SDL {
39using PowerState = SDL_PowerState;
40
44constexpr PowerState POWERSTATE_ERROR = SDL_POWERSTATE_ERROR;
45
49constexpr PowerState POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN;
50
54constexpr PowerState POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY;
55
59constexpr PowerState POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY;
60
64constexpr PowerState POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING;
65
69constexpr PowerState POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED;
70
72
105inline PowerState GetPowerInfo(int* seconds, int* percent)
106{
107 return SDL_GetPowerInfo(seconds, percent);
108}
109
111
112} // namespace SDL
113
114#endif /* SDL3PP_POWER_H_ */
SDL_PowerState PowerState
The basic state for the system's power supply.
Definition SDL3pp_power.h:39
constexpr PowerState POWERSTATE_ON_BATTERY
Not plugged in, running on the battery.
Definition SDL3pp_power.h:54
constexpr PowerState POWERSTATE_UNKNOWN
cannot determine power status
Definition SDL3pp_power.h:49
PowerState GetPowerInfo(int *seconds, int *percent)
Get the current power supply details.
Definition SDL3pp_power.h:105
constexpr PowerState POWERSTATE_CHARGING
Plugged in, charging battery.
Definition SDL3pp_power.h:64
constexpr PowerState POWERSTATE_NO_BATTERY
Plugged in, no battery available.
Definition SDL3pp_power.h:59
constexpr PowerState POWERSTATE_ERROR
error determining power status
Definition SDL3pp_power.h:44
constexpr PowerState POWERSTATE_CHARGED
Plugged in, battery charged.
Definition SDL3pp_power.h:69
the main namespace where all SDL3pp public functions and types live
Definition SDL3pp_assert.h:7