Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ImguiEditor.hpp
1#pragma once
2
3#include <vector>
4#include <entt/entt.hpp>
5#include <vulkan/vulkan.h>
6#include <imgui.h>
7
8#include <Common/Event/BaseEvent.hpp>
9#include <Common/Memory/SmartPointers/UniquePtr.hpp>
10#include <Editor/ImguiEditor/AssetPicker.hpp>
11#include "imgui_markdown.h"
12
13namespace Grindstone {
14 class EngineCore;
15
16 namespace Editor {
17 namespace ImguiEditor {
18 enum class FontType {
19 Regular,
20 Bold,
21 Italic,
22 H1,
23 H2,
24 H3,
25 Count
26 };
27
28 class ImguiRenderer;
29
30 namespace Settings {
33 }
34
35 class PluginsWindow;
38 class InspectorPanel;
39 class ViewportPanel;
40 class ConsolePanel;
41 class SystemPanel;
42 class StatsPanel;
43 class BuildPopup;
44 class Menubar;
45 class ImguiInput;
46 class ControlBar;
47 class StatusBar;
48 class AssetPicker;
49 class TracingPanel;
50 class CvarBrowser;
51
52 class ImguiEditor {
53 public:
54 friend Menubar;
55
56 ImguiEditor(EngineCore* engineCore);
57 ~ImguiEditor();
58 void CreateWindows();
59 void Update();
60 void Render();
61 void PromptAssetPicker(AssetType assetType, AssetPicker::AssetPickerCallback callback);
62 void StartBuild();
63 void ImportFile(const char* folderPathToImportTo = "");
64 ViewportPanel* GetViewportPanel();
65 ImFont* GetFont(FontType type) const;
66 const ImGui::MarkdownConfig& GetMarkdownConfig() const;
67 ImguiRenderer& GetImguiRenderer();
68 private:
69 void RenderDockspace();
70 void SetupFonts();
71 void SetupStyles();
72 void SetupColors();
73 bool OnWindowResize(Events::BaseEvent* ev);
74 void PerformResize();
75 private:
76 bool queueResize = false;
77
78 std::array<ImFont*, static_cast<size_t>(FontType::Count)> fonts;
79 ImGui::MarkdownConfig markdownConfig;
80 EngineCore* engineCore = nullptr;
81 ImguiInput* input = nullptr;
82 SceneHeirarchyPanel* sceneHeirarchyPanel = nullptr;
83 AssetBrowserPanel* assetBrowserPanel = nullptr;
84 AssetPicker* assetPicker = nullptr;
85 CvarBrowser* cvarBrowser = nullptr;
86 Settings::UserSettingsWindow* userSettingsWindow = nullptr;
87 Settings::ProjectSettingsWindow* projectSettingsWindow = nullptr;
88 InspectorPanel* inspectorPanel = nullptr;
89 ViewportPanel* viewportPanel = nullptr;
90 ConsolePanel* consolePanel = nullptr;
91 SystemPanel* systemPanel = nullptr;
92 StatsPanel* statsPanel = nullptr;
93 BuildPopup* buildPopup = nullptr;
94 ControlBar* controlBar = nullptr;
95 StatusBar* statusBar = nullptr;
96 Menubar* menubar = nullptr;
97 ImguiRenderer* imguiRenderer = nullptr;
98 TracingPanel* tracingPanel = nullptr;
99 PluginsWindow* pluginsWindow = nullptr;
100
101 std::string imguiIniFile;
102 std::string imguiLogFile;
103 };
104 }
105 }
106}
Definition AssetBrowserPanel.hpp:23
Definition ConsolePanel.hpp:19
Definition ImguiRenderer.hpp:12
Definition InspectorPanel.hpp:15
Definition PluginsWindow.hpp:31
Definition SceneHeirarchyPanel.hpp:28
Definition ViewportPanel.hpp:15
Definition EngineCore.hpp:59
Definition BaseEvent.hpp:7
Definition imgui_markdown.h:322