galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Editor.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_UI_EDITOR_HPP_
9#define GALAXY_UI_EDITOR_HPP_
10
11#include <SDL3/SDL_events.h>
12
15
16namespace galaxy
17{
21 class Editor final : public Panel
22 {
23 public:
27 Editor();
28
32 ~Editor();
33
39 void handle_events(const SDL_Event& events) noexcept;
40
44 void render();
45
49 void draw() override;
50
51 private:
55 void begin_dock();
56
60 void end_dock();
61
65 void draw_menubar();
66
67 private:
72
77
82 };
83} // namespace galaxy
84
85/*
86public:
87using Tasks = meta::vector<std::move_only_function<void(void)>>;
88
89private:
90void exit();
91
92void new_project();
93
94void load_project(const std::string& path);
95void save_project(bool save_as = false);
96void export_project();
97
98
99void draw_game_controls();
100void short_cuts();
101void show_loadproject();
102void render_exporter() const;
103
104void recursively_zip_assets(struct zip_t* zip, const std::filesystem::path& path);
105
106void set_state_game();
107void set_state_editor();
108void set_state_game_and_editor();
109
110void set_input_game();
111void set_input_editor();
112
113private:
114// game data independant from editor.
115nlohmann::json m_backup;
116
117EditorState m_state;
118
119// tools.
120platform::Subprocess m_ldtk;
121platform::Subprocess m_bfxr;
122
123// popup controls.
124bool m_show_new = false;
125bool m_show_exit = false;
126bool m_show_about = false;
127bool m_show_export = false;
128
129// random editor data.
130ImVec2 m_padding;
131Tasks m_tasks;
132std::filesystem::path m_current_project_path;
133async::Timer<false> m_autosave;
134graphics::Camera m_editor_camera;
135bool m_use_hand_cursor = false;
136ImVec2 m_imgui_mouse_delta = {0.0f, 0.0f};
137Selected m_selected;
138
139// panels
140LogConsole m_log_console;
141LuaConsole m_lua_console;
142Viewport m_viewport;
143CodeEditor m_code_editor;
144AssetPanel m_asset_panel;
145ScenePanel m_scene_panel;
146EntityPanel m_entity_panel;*/
147
148#endif
Panel for editing engine settings.
Editor()
Constructor.
Definition Editor.cpp:18
void handle_events(const SDL_Event &events) noexcept
Process events in the editor.
Definition Editor.cpp:29
ConfigPanel m_config_panel
Config panel for manipulating engine settings.
Definition Editor.hpp:71
void end_dock()
Finish rendering the editor dock.
Definition Editor.cpp:107
void render()
Render the editor to the screen.
Definition Editor.cpp:42
ScenePanel m_scene_panel
Scene panel for managing scenes.
Definition Editor.hpp:76
void draw() override
Draw the ImGui widgets to ImGui buffers.
Definition Editor.cpp:52
void begin_dock()
Start rendering the editor dock.
Definition Editor.cpp:102
void draw_menubar()
Draw the editor menubar.
Definition Editor.cpp:117
Popup m_hotkeys
Hotkey info.
Definition Editor.hpp:81
Panel() noexcept
Constructor.
Definition Panel.cpp:12
Cleaner way of rendering an ImGui popup.
Definition Popup.hpp:21
Panel for editing scenes in engine.
Application.hpp galaxy.