SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
SystemMetrics.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Core/OSDef.hpp>
4
5namespace Sleak {
6
7/// Snapshot of OS-reported CPU/RAM/GPU usage at the moment of the last Query.
8/// @ingroup debug
10 float CpuUsagePercent = 0.0f;
11 float RamUsageMB = 0.0f;
12 float GpuUsagePercent = 0.0f;
13 float GpuMemoryUsedMB = 0.0f;
14};
15
16/// Polls platform-specific counters (PDH on Windows, /proc on Linux) for CPU/RAM/GPU usage.
17/// @ingroup debug
18class ENGINE_API SystemMetrics {
19public:
20 static void Initialize();
21 static void Shutdown();
22 /// Reads the current CPU/RAM/GPU usage from the OS.
23 static SystemMetricsData Query();
24
25private:
26 static bool s_initialized;
27};
28
29} // namespace Sleak
static SystemMetricsData Query()
Reads the current CPU/RAM/GPU usage from the OS.
Root namespace for everything the engine exposes.
Definition Camera.hpp:10