Lightweight FPS / frame-time overlay for DevTools (0.6 closeout). 更多...
#include <FrameStatsPanel.hpp>
Public 类型 | |
| using | ImGuiDrawer = void(*)(FrameStatsPanel &panel) |
Public 成员函数 | |
| FrameStatsPanel (const FrameStatsPanel &)=delete | |
| FrameStatsPanel & | operator= (const FrameStatsPanel &)=delete |
| void | setVisible (bool on) |
| bool | isVisible () const |
| void | toggleVisible () |
| void | sample (float dtSeconds) |
| Feed one frame duration in seconds (must be finite and > 0). Updates EMA FPS and last frame milliseconds. | |
| void | setEntityCount (int count) |
| Optional entity / actor count shown in the overlay; negative clears. | |
| void | clearEntityCount () |
| float | fps () const |
| float | frameMs () const |
| int | entityCount () const |
| -1 when unset | |
| bool | hasEntityCount () const |
| std::string | format () const |
One-line summary for logs / scripts, e.g. 60.1 fps | 16.6 ms | 128 entities. | |
| void | drawImGui () |
静态 Public 成员函数 | |
| static FrameStatsPanel & | instance () |
| static void | setImGuiDrawer (ImGuiDrawer fn) |
友元 | |
| template<typename > | |
| struct | Immortal |
详细描述
Lightweight FPS / frame-time overlay for DevTools (0.6 closeout).
Call sample(dtSeconds) once per frame (typically from load.nut when --debug is on). Optional setEntityCount lets games expose ECS size. ImGui drawing is registered by the host (ImGuiHostPanels.cpp) so EVDevTools does not include imgui.h.
Script API (eve run --debug): eve.dev.stats.sample(dt) / setEntityCount(n) / clearEntityCount() eve.dev.stats.fps() / frameMs() / entityCount() / format() eve.dev.stats.setVisible / isVisible / toggleVisible / draw
在文件 FrameStatsPanel.hpp 第 23 行定义.
成员类型定义说明
◆ ImGuiDrawer
| using eve::dev::FrameStatsPanel::ImGuiDrawer = void (*)(FrameStatsPanel& panel) |
在文件 FrameStatsPanel.hpp 第 54 行定义.
构造及析构函数说明
◆ FrameStatsPanel()
|
delete |
成员函数说明
◆ clearEntityCount()
| void eve::dev::FrameStatsPanel::clearEntityCount | ( | ) |
在文件 FrameStatsPanel.cpp 第 46 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ drawImGui()
| void eve::dev::FrameStatsPanel::drawImGui | ( | ) |
在文件 FrameStatsPanel.cpp 第 83 行定义.
◆ entityCount()
| int eve::dev::FrameStatsPanel::entityCount | ( | ) | const |
◆ format()
| std::string eve::dev::FrameStatsPanel::format | ( | ) | const |
One-line summary for logs / scripts, e.g. 60.1 fps | 16.6 ms | 128 entities.
在文件 FrameStatsPanel.cpp 第 71 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ fps()
| float eve::dev::FrameStatsPanel::fps | ( | ) | const |
在文件 FrameStatsPanel.cpp 第 51 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ frameMs()
| float eve::dev::FrameStatsPanel::frameMs | ( | ) | const |
在文件 FrameStatsPanel.cpp 第 56 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ hasEntityCount()
| bool eve::dev::FrameStatsPanel::hasEntityCount | ( | ) | const |
在文件 FrameStatsPanel.cpp 第 66 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ instance()
|
static |
◆ isVisible()
| bool eve::dev::FrameStatsPanel::isVisible | ( | ) | const |
在文件 FrameStatsPanel.cpp 第 23 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi() , 以及 toggleVisible().
◆ operator=()
|
delete |
◆ sample()
| void eve::dev::FrameStatsPanel::sample | ( | float | dtSeconds | ) |
Feed one frame duration in seconds (must be finite and > 0). Updates EMA FPS and last frame milliseconds.
在文件 FrameStatsPanel.cpp 第 30 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ setEntityCount()
| void eve::dev::FrameStatsPanel::setEntityCount | ( | int | count | ) |
Optional entity / actor count shown in the overlay; negative clears.
在文件 FrameStatsPanel.cpp 第 41 行定义.
引用了 count.
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
◆ setImGuiDrawer()
|
static |
在文件 FrameStatsPanel.cpp 第 81 行定义.
引用了 fn.
◆ setVisible()
| void eve::dev::FrameStatsPanel::setVisible | ( | bool | on | ) |
在文件 FrameStatsPanel.cpp 第 18 行定义.
被这些函数引用 eve::dev::DevTool::exposeScriptApi() , 以及 toggleVisible().
◆ toggleVisible()
| void eve::dev::FrameStatsPanel::toggleVisible | ( | ) |
在文件 FrameStatsPanel.cpp 第 28 行定义.
引用了 isVisible() , 以及 setVisible().
被这些函数引用 eve::dev::DevTool::exposeScriptApi().
友元及相关函数文档
◆ Immortal
|
friend |
在文件 FrameStatsPanel.hpp 第 59 行定义.
该类的文档由以下文件生成:
- src/engine/devtools/FrameStatsPanel.hpp
- src/engine/devtools/FrameStatsPanel.cpp