Hymn to Beauty
C++ 3D Engine
ProfilingWindow.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <GUI/LogView.hpp>
5#include <map>
6#include "FileSelector.hpp"
7
8namespace GUI {
10 public:
12 void Show();
13
15
18 bool IsVisible() const;
19
21
24 void SetVisible(bool visible);
25
26 private:
27 struct ThreadView {
28 std::string name;
29 unsigned int lines;
30 std::vector<std::vector<Profiling::Event>> events;
31 };
32
33 LogView logView;
34
35 void LoadLatest();
36 void FileSelected(const std::string& filename);
37
38 void ParseTimeline();
39 void ParseEvent(ThreadView& threadView, const Profiling::Event& event, unsigned int line);
40
41 void ShowTimeline();
42 void ShowRuler();
43 void ShowThreadNames();
44 void ShowThreads();
45
46 void CalculateStatistics();
47 void ShowStatistics();
48
49 bool visible = false;
50
51 FileSelector fileSelector;
52
53 Profiling::Timeline timeline;
54 double earliestTime;
55 float scale = 100.0f;
56 double pixelsPerSecond;
57 const float rulerHeight = 24.0f;
58 bool resetScroll = false;
59
60 std::vector<ThreadView> threadViews;
61
62 struct EventInfo {
63 std::string name;
64 double totalDuration = 0.0;
65 uint32_t count = 0;
66 };
67 std::vector<std::vector<EventInfo>> statistics;
68 uint32_t frameCount = 0;
69};
70} // namespace GUI
A window where a file can be selected.
Definition: FileSelector.hpp:9
Definition: LogView.hpp:8
Definition: ProfilingWindow.hpp:9
bool IsVisible() const
Get whether the window is visible.
Definition: ProfilingWindow.cpp:50
void SetVisible(bool visible)
Set whether the window should be visible.
Definition: ProfilingWindow.cpp:54
void Show()
Show profiling results.
Definition: ProfilingWindow.cpp:16
A profiling event on the timeline.
Definition: Event.hpp:10
A timeline.
Definition: Timeline.hpp:12
Definition: AssetEditor.hpp:9