载入中...
搜索中...
未找到
FrameStatsPanel.hpp
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <mutex>
6#include <string>
7
8namespace eve::dev {
9
24public:
25 static FrameStatsPanel& instance();
26
29
30 void setVisible(bool on);
31 bool isVisible() const;
32 void toggleVisible();
33
38 void sample(float dtSeconds);
39
41 void setEntityCount(int count);
42 void clearEntityCount();
43
44 float fps() const;
45 float frameMs() const;
46 int entityCount() const;
47 bool hasEntityCount() const;
48
50 std::string format() const;
51
52 void drawImGui();
53
54 using ImGuiDrawer = void (*)(FrameStatsPanel& panel);
55 static void setImGuiDrawer(ImGuiDrawer fn);
56
57private:
58 template <typename>
59 friend struct Immortal;
60 FrameStatsPanel() = default;
61
62 mutable std::mutex mu_;
63 bool visible_ = false;
64 float lastDt_ = 0.f;
65 float emaFps_ = 0.f;
66 int entityCount_ = -1;
67};
68
69} // namespace eve::dev
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::uint32_t count
Lightweight FPS / frame-time overlay for DevTools (0.6 closeout).
FrameStatsPanel(const FrameStatsPanel &)=delete
void(*)(FrameStatsPanel &panel) ImGuiDrawer
FrameStatsPanel & operator=(const FrameStatsPanel &)=delete
SettlementPipeline::Stage fn
Process-immortal singleton holder for DevTools objects.
Definition Immortal.hpp:19