16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

perf window

This commit is contained in:
milek7
2019-03-27 23:13:51 +01:00
parent aa8d66e5da
commit 803bf23715
7 changed files with 134 additions and 8 deletions

45
widgets/perfgraphs.h Normal file
View File

@@ -0,0 +1,45 @@
#include "uilayer.h"
class perfgraph_panel : public ui_panel
{
std::array<float, 400> history;
size_t pos = 0;
enum timers_e {
gfx_total = 0,
gfx_color,
gfx_shadows,
gfx_reflections,
gfx_swap,
gfx_gui,
sim_total,
sim_dynamics,
sim_events,
sim_ai,
mainloop_total,
TIMER_MAX
};
float max = 50.0f;
timers_e current_timer = mainloop_total;
std::vector<std::string> timer_label =
{
"gfx_total",
"gfx_color",
"gfx_shadows",
"gfx_reflections",
"gfx_swap",
"gfx_gui",
"sim_total",
"sim_dynamics",
"sim_events",
"sim_ai",
"mainloop_total"
};
public:
perfgraph_panel();
void render_contents() override;
};