galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Laptop.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_PLATFORM_LAPTOP_HPP_
9#define GALAXY_PLATFORM_LAPTOP_HPP_
10
11#include <cstdint>
12
13#include <SDL3/SDL_power.h>
14
16
17#ifdef GALAXY_WIN_PLATFORM
18extern "C"
19{
20 // http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
21 // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
22
23 inline __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
24 inline __declspec(dllexport) std::uint32_t NvOptimusEnablement = 0x00000001;
25}
26#elif
27{
28 inline int AmdPowerXpressRequestHighPerformance = 1;
29 inline std::uint32_t NvOptimusEnablement = 0x00000001;
30}
31#endif
32
33namespace galaxy
34{
35 namespace laptop
36 {
44 [[nodiscard]]
45 int get_battery_remaining(const bool percent = true) noexcept;
46
52 [[nodiscard]]
53 SDL_PowerState get_battery_status() noexcept;
54 } // namespace laptop
55} // namespace galaxy
56
57#endif
SDL_PowerState get_battery_status() noexcept
Get battery status.
Definition Laptop.cpp:25
int get_battery_remaining(const bool percent) noexcept
Get remaining battery charge of a laptop.
Definition Laptop.cpp:16
Application.hpp galaxy.