|
Monad Engine da02fba2
> Undercity Codex_
|
ImGui-based in-game editor overlay. More...
#include <Editor.h>
Public Types | |
| using | PanelFn = std::function< void()> |
| Custom-panel callback — render any ImGui widgets you like inside. | |
Public Member Functions | |
| bool | Init (GLFWwindow *window) |
| Initialise ImGui against the given GLFW window. Call once at startup. | |
| void | Shutdown () |
| Tear down ImGui state. Call before destroying the GL context. | |
| void | BeginFrame () |
| Call after glfwPollEvents. | |
| void | Draw () |
| Builds all panels (no GL state changes yet). | |
| void | EndFrame () |
| Renders the ImGui draw data to the current framebuffer. | |
| bool | IsVisible () const |
| Editor overlay currently shown? | |
| void | ToggleVisible () |
| Flip overlay visibility. | |
| bool | WantsCaptureMouse () const |
| bool | WantsCaptureKeyboard () const |
| Same as WantsCaptureMouse() but for the keyboard. | |
| void | NotifyDrawCount (int n) |
| Stats panel hook: report per-frame draw call count. | |
| void | RegisterPanel (std::string name, PanelFn fn) |
| Register a custom ImGui panel rendered alongside the built-ins. | |
ImGui-based in-game editor overlay.
Owned by the Engine singleton and driven from Engine::Run(). Provides scene hierarchy, inspector, asset browser, render settings (including internal-resolution pixelation) and stats panels.
| using mnd::Editor::PanelFn = std::function<void()> |
| void mnd::Editor::BeginFrame | ( | ) |
Call after glfwPollEvents.
Definition at line 72 of file Editor.cpp.
References mnd::Engine::GetInputManager(), mnd::Engine::GetInstance(), and ToggleVisible().
Referenced by mnd::Engine::Run().
| void mnd::Editor::Draw | ( | ) |
Builds all panels (no GL state changes yet).
Definition at line 182 of file Editor.cpp.
Referenced by mnd::Engine::Run().
| void mnd::Editor::EndFrame | ( | ) |
Renders the ImGui draw data to the current framebuffer.
Definition at line 241 of file Editor.cpp.
Referenced by mnd::Engine::Run().
| bool mnd::Editor::Init | ( | GLFWwindow * | window | ) |
Initialise ImGui against the given GLFW window. Call once at startup.
Definition at line 35 of file Editor.cpp.
References kGlslVersionDirective, LOG_ERROR, and LOG_INFO.
Referenced by mnd::Engine::Init().
|
inline |
Editor overlay currently shown?
Definition at line 57 of file Editor.h.
Referenced by mnd::EditorSwallowsInput(), and mnd::PlayerControllerComponent::Update().
|
inline |
Stats panel hook: report per-frame draw call count.
Definition at line 68 of file Editor.h.
Referenced by mnd::RenderQueue::Draw().
|
inline |
| void mnd::Editor::Shutdown | ( | ) |
Tear down ImGui state. Call before destroying the GL context.
Definition at line 60 of file Editor.cpp.
Referenced by mnd::Engine::Destroy().
|
inline |
| bool mnd::Editor::WantsCaptureKeyboard | ( | ) | const |
Same as WantsCaptureMouse() but for the keyboard.
Definition at line 256 of file Editor.cpp.
| bool mnd::Editor::WantsCaptureMouse | ( | ) | const |
Tell game code whether ImGui is consuming the mouse this frame (e.g. when hovering a panel) — skip your own click handling if so.
Definition at line 251 of file Editor.cpp.