Voltray Engine Docs
Loading...
Searching...
No Matches
Dockspace.h
Go to the documentation of this file.
1
13#pragma once
14#include <vector>
15#include <utility>
16#include <array>
17#include "../UI/Panel.h"
18#include <imgui.h>
19
20namespace Editor::Components
21{
31
32 {
33 public:
49 enum class Region
50 {
51 Left = 0,
52 Right,
53 Bottom,
54 Top,
55 Center
56 };
64 static void RegisterPanel(const char *name, Editor::Panel *panel, Region defaultRegion);
65
71 static void Begin();
72
78 static void End();
79
85 static void SaveLayout(const char *filename);
86
92 static void LoadLayout(const char *filename);
93
100 static void Reset();
101
102 private:
103 struct PanelInfo
104 {
105 const char *name;
106 Editor::Panel *panel;
107 Region region;
108 };
109 static bool s_Initialized;
110 static std::vector<PanelInfo> s_Panels;
111 // ImGuiIDs for each region in the order of Region enum
112 static std::array<ImGuiID, 5> s_Regions;
113 };
114}
Manages the dockable layout system for the editor interface.
Definition Dockspace.h:32
Region
Definition Dockspace.h:50
static void SaveLayout(const char *filename)
Save the current dockspace layout configuration to a file.
Definition Dockspace.cpp:78
static void End()
Finalize the dockspace for the current frame.
Definition Dockspace.cpp:73
static void LoadLayout(const char *filename)
Load a previously saved dockspace layout configuration from a file.
Definition Dockspace.cpp:84
static void Begin()
Initialize and begin a new dockspace frame.
Definition Dockspace.cpp:28
static void RegisterPanel(const char *name, Editor::Panel *panel, Region defaultRegion)
Register a panel to be managed by the dockspace.
Definition Dockspace.cpp:18
static void Reset()
Reset the dockspace layout to default settings on the next Begin() call.
Definition Dockspace.cpp:23
Base class for all UI panels in the editor.
Definition Panel.h:19
Represents the Inspector panel component in the Editor.
Definition Console.cpp:7