载入中...
搜索中...
未找到
OS.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Module.h"
7
8#include <cstdint>
9#include <string>
10
11namespace eve::os {
12
20public:
23 OS();
25 ~OS() override;
27 [[nodiscard]] Result<void> setVerticalSyncCount(int count) override;
29 [[nodiscard]] int getVerticalSyncCount() const noexcept override { return verticalSyncCount_; }
31 [[nodiscard]] Result<void> setTargetFramesPerSecond(int target) override;
33 [[nodiscard]] int getTargetFramesPerSecond() const noexcept override { return targetFramesPerSecond_; }
35 void limitFrame() override;
36
38 std::string getEngineVersion() const;
39
41 std::string getPlatform() const;
42
47 std::string getOS() const;
48
50 int getProcessorCount() const;
52 int getCPUCacheLineSize() const;
53
55 int getSystemRAM() const;
57 int getProcessMemoryMB() const;
58
60 float getWallTime() const;
61
63 void sleepMilliseconds(int ms);
64
69 std::string getPowerState() const;
71 int getPowerSecondsLeft() const;
73 int getPowerPercent() const;
74
76 std::string getClipboardText() const;
78 void setClipboardText(const std::string &text);
79
81 std::string getGpuName() const;
83 std::string getGpuVendor() const;
85 std::string getGpuDeviceType() const;
87 int getGpuMemoryTotalMB() const;
88private:
89 int verticalSyncCount_ = 0;
90 int targetFramesPerSecond_ = -1;
91 uint64_t lastFrameCounter_ = 0;
92};
93
94} // namespace eve::os
LogicalId target
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::string text
std::uint32_t count
Host-loop frame pacing controlled independently of presentation.
Definition FramePacing.h:14
EVENGINE_API_FOUNDATION public API.
Definition Module.h:46
Move-only operation result carrying either a value or Status.
Definition Result.h:155
OS module — host OS / hardware / wall-clock / clipboard / optional GPU info. Frame timing stays on Ti...
Definition OS.h:19
int getTargetFramesPerSecond() const noexcept override
Returns the target frames per second.
Definition OS.h:33
int getVerticalSyncCount() const noexcept override
Returns the vertical sync count.
Definition OS.h:29
Definition OS.cpp:32