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 Menubar& GetMenuBar();
69
70 Settings::UserSettingsWindow* userSettingsWindow = nullptr;
71 Settings::ProjectSettingsWindow* projectSettingsWindow = nullptr;
72 private:
73 void RenderDockspace();
74 void SetupFonts();
75 void SetupStyles();
76 void SetupColors();
77 bool OnWindowResize(Events::BaseEvent* ev);
78 void PerformResize();
79 private:
80 bool queueResize = false;
81
82 std::array<ImFont*, static_cast<size_t>(FontType::Count)> fonts;
83 ImGui::MarkdownConfig markdownConfig;
84 EngineCore* engineCore = nullptr;
85 ImguiInput* input = nullptr;
86 SceneHeirarchyPanel* sceneHeirarchyPanel = nullptr;
87 AssetBrowserPanel* assetBrowserPanel = nullptr;
88 AssetPicker* assetPicker = nullptr;
89 CvarBrowser* cvarBrowser = nullptr;
90 InspectorPanel* inspectorPanel = nullptr;
91 ViewportPanel* viewportPanel = nullptr;
92 ConsolePanel* consolePanel = nullptr;
93 SystemPanel* systemPanel = nullptr;
94 StatsPanel* statsPanel = nullptr;
95 BuildPopup* buildPopup = nullptr;
96 ControlBar* controlBar = nullptr;
97 StatusBar* statusBar = nullptr;
98 Menubar* menubar = nullptr;
99 ImguiRenderer* imguiRenderer = nullptr;
100 TracingPanel* tracingPanel = nullptr;
101 PluginsWindow* pluginsWindow = nullptr;
102
103 std::string imguiIniFile;
104 std::string imguiLogFile;
105 };
106 }
107 }
108}
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