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
51 class ImguiEditor {
52 public:
53 friend Menubar;
54
55 ImguiEditor(EngineCore* engineCore);
56 ~ImguiEditor();
57 void CreateWindows();
58 void Update();
59 void Render();
60 void PromptAssetPicker(AssetType assetType, AssetPicker::AssetPickerCallback callback);
61 void StartBuild();
62 void ImportFile(const char* folderPathToImportTo = "");
63 ViewportPanel* GetViewportPanel();
64 ImFont* GetFont(FontType type) const;
65 const ImGui::MarkdownConfig& GetMarkdownConfig() const;
66 private:
67 void RenderDockspace();
68 void SetupFonts();
69 void SetupStyles();
70 void SetupColors();
71 bool OnWindowResize(Events::BaseEvent* ev);
72 void PerformResize();
73 private:
74 bool queueResize = false;
75
76 std::array<ImFont*, static_cast<size_t>(FontType::Count)> fonts;
77 ImGui::MarkdownConfig markdownConfig;
78 EngineCore* engineCore = nullptr;
79 ImguiInput* input = nullptr;
80 SceneHeirarchyPanel* sceneHeirarchyPanel = nullptr;
81 AssetBrowserPanel* assetBrowserPanel = nullptr;
82 AssetPicker* assetPicker = nullptr;
83 Settings::UserSettingsWindow* userSettingsWindow = nullptr;
84 Settings::ProjectSettingsWindow* projectSettingsWindow = nullptr;
85 InspectorPanel* inspectorPanel = nullptr;
86 ViewportPanel* viewportPanel = nullptr;
87 ConsolePanel* consolePanel = nullptr;
88 SystemPanel* systemPanel = nullptr;
89 StatsPanel* statsPanel = nullptr;
90 BuildPopup* buildPopup = nullptr;
91 ControlBar* controlBar = nullptr;
92 StatusBar* statusBar = nullptr;
93 Menubar* menubar = nullptr;
94 ImguiRenderer* imguiRenderer = nullptr;
95 TracingPanel* tracingPanel = nullptr;
96 PluginsWindow* pluginsWindow = nullptr;
97
98 std::string imguiIniFile;
99 std::string imguiLogFile;
100 };
101 }
102 }
103}
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:58
Definition BaseEvent.hpp:7
Definition imgui_markdown.h:322