Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ConsolePanel.hpp
1#pragma once
2
3#include <deque>
4#include "Common/Logging.hpp"
5
6namespace Grindstone {
7 namespace Events {
8 struct BaseEvent;
9 }
10
11 namespace ECS {
12 class SystemRegistrar;
13 }
14
15 namespace Editor {
16 namespace ImguiEditor {
17 class ImguiRenderer;
18
20 public:
21 ConsolePanel(ImguiRenderer* imguiRenderer);
22 void Render();
23 bool AddConsoleMessage(Grindstone::Events::BaseEvent* ev);
24
26 ConsoleMessage base;
27 std::string lowercaseMessage;
28 uint32_t count;
29
31 ConsoleMessage base,
32 std::string lowercaseMessage,
33 uint32_t count
34 ) : base(base), lowercaseMessage(lowercaseMessage), count(count) {};
35 };
36 private:
37 void RenderTopbar();
38 void RenderMessage(size_t index, EditorConsoleMessage& msg);
39 void FilterSearch();
40 void RenderButton(const char* title, ImTextureID icon, uint8_t severityBit);
41 ImTextureID GetLogSeverityIcon(LogSeverity severity) const;
42 private:
43 bool isShowingPanel = true;
44 std::deque<EditorConsoleMessage> messageQueue;
45 std::vector<EditorConsoleMessage*> filteredMessage;
46 std::string filterText;
47 std::string filterTextLowercase;
48 uint8_t severityFlags;
49 uint64_t sourceFlags;
50
51 ImVec4 selectedColor;
52 ImVec4 selectedHighlightColor;
53 ImVec4 selectedActiveColor;
54
55 ImTextureID consoleErrorIcon;
56 ImTextureID consoleWarningIcon;
57 ImTextureID consoleTraceIcon;
58 ImTextureID consoleInfoIcon;
59 };
60 }
61 }
62}
Definition ConsolePanel.hpp:19
Definition ImguiRenderer.hpp:12
Definition Logging.hpp:53
Definition BaseEvent.hpp:7