Polyphase Game Engine
Loading...
Searching...
No Matches
DebugResourcesWidget.h
Go to the documentation of this file.
1#pragma once
2
4
5class Text;
6class ProgressBar;
7class Quad;
8
10{
11public:
12
14
15 virtual void Create() override;
16 virtual void Tick(float deltaTime) override;
17 virtual void EditorTick(float deltaTime) override;
18 virtual void PreRender() override;
19
20 void SetShowMultipleRAM(bool show);
21 void SetShowFPS(bool show);
22 void SetShowVRAM(bool show);
23
24private:
25
26 struct ResourceRow
27 {
28 Text* mLabel = nullptr;
29 ProgressBar* mBar = nullptr;
30 Text* mValue = nullptr;
31 };
32
33 void RebuildLayout();
34 void UpdateRow(ResourceRow& row, float value, float maxValue, const char* suffix);
35 void UpdateMetrics(float deltaTime);
36
37 ResourceRow mRAMRow;
38 ResourceRow mVRAMRow;
39 ResourceRow mRAM1Row;
40 ResourceRow mRAM2Row;
41 ResourceRow mFPSRow;
42
43 bool mShowMultipleRAM = true;
44 bool mShowFPS = true;
45 bool mShowVRAM = true;
46 bool mLayoutDirty = true;
47 float mUpdateTimer = 0.0f;
48 float mFpsAccum = 0.0f;
49 uint32_t mFpsSamples = 0;
50 static constexpr float sUpdateInterval = 0.5f;
51
52 float mRowHeight = 22.0f;
53 float mLabelWidth = 50.0f;
54 float mValueWidth = 80.0f;
55 float mPadding = 4.0f;
56
57 Quad* mBackground = nullptr;
58};
Definition Canvas.h:9
Definition DebugResourcesWidget.h:10
virtual void PreRender() override
Definition DebugResourcesWidget.cpp:151
virtual void EditorTick(float deltaTime) override
Definition DebugResourcesWidget.cpp:142
virtual void Create() override
Definition DebugResourcesWidget.cpp:15
void SetShowVRAM(bool show)
Definition DebugResourcesWidget.cpp:228
void SetShowFPS(bool show)
Definition DebugResourcesWidget.cpp:219
virtual void Tick(float deltaTime) override
Definition DebugResourcesWidget.cpp:133
DECLARE_NODE(DebugResourcesWidget, Canvas)
void SetShowMultipleRAM(bool show)
Definition DebugResourcesWidget.cpp:210
Definition ProgressBar.h:10
Definition Quad.h:20
Definition Text.h:24