Cogs.Core
InspectorGuiRenderer.h
1#pragma once
2
3#include <vector>
4#include "../CustomRenderer/ImguiRenderer.h"
5
6namespace Cogs
7{
8 namespace Core
9 {
10 typedef std::function<void(Context* context, bool* show)> Inspector;
11
12
14 {
15 public:
16 void initialize(class Context * context, class IRenderer * renderer);
17
18 COGSCORE_DLL_API void beginRender(class Context * context, class IRenderer* renderer);
19 void renderTimes(Context * context);
20 void render(class Context * context, class IRenderer* renderer);
21 COGSCORE_DLL_API void endRender(class Context * context, class IRenderer* renderer);
22
23 void cleanup(class Context * context, class IRenderer* renderer);
24
25 COGSCORE_DLL_API void registerInspector(const std::string& name, Inspector inspector);
26
27 ImguiRenderer * getImguiRenderer() { return imguiRenderer; }
28
29 private:
30 ImguiRenderer* imguiRenderer = nullptr;
31 ImGuiContext* imguiContext = nullptr;
32
34 {
35 const std::string name;
36 Inspector inspector;
37 bool show;
38 };
39 std::vector<RegisteredInspector> inspectors;
40
41 // Timer variables
42 float frameTime = 0.0f;
43 float frameFPS = 0.0f;
44 float cogsTime = 0.0f;
45 float cogsFPS = 0.0f;
46 float preRenderTime = 0.0f;
47 float presentTime = 0.0f;
48 float cpuTime = 0.0f;
49 float cpuFps = 0.0f;
50 float idleTime = 0.0f;
51
52 float frameMin = 10000;
53 float frameMax = 0;
54
55 float cogsMin = 10000;
56 float cogsMax = 0;
57
58 // Timed updates to timer text (Update text maximum 8 times a second to make it readable)
59 Timer delta_timer;
60 static constexpr float delta_update = 0.125f;
61 float delta_akk = delta_update;
62
63 uint8_t visualizationMode = 0;
64
65 bool showAboutCogs = false;
66 bool showRenderingStatsInspector = false;
67 bool showTextureInspector = false;
68 bool showShadowMapInspector = false;
69 bool showEntityInspector = false;
70 bool showFontInspector = false;
71 bool showVariableInspector = false;
72 bool showInputInspector = false;
73 bool showModelInspector = false;
74 bool showMeshInspector = false;
75 bool showMaterialInspector = false;
76 bool showMaterialInstanceInspector = false;
77 bool showResourceInspector = false;
78 bool showScriptInspector = false;
79 bool showScriptConsole = false;
80 bool showProfiler = false;
81 bool showPipelineInspector = false;
82 bool showPermutationInspector = false;
83 bool showAssetInspector = false;
84 bool showAssetQueueInspector = false;
85 bool showBoundsInspector = false;
86 bool showBufferInspector = false;
87 bool showEngineInspector = false;
88 bool showExampleGui = false;
89 bool showGammaDebugger = false;
90 bool showTaskManagerInspector = false;
91 };
92 }
93}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Renderer interface used by the engine to control registered renderer instances.
Definition: IRenderer.h:154
Old timer class.
Definition: Timer.h:37
Contains all Cogs related functionality.
Definition: FieldSetter.h:23