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