Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
mnd::Editor Class Reference

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.
 

Detailed Description

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.

Definition at line 42 of file Editor.h.

Member Typedef Documentation

◆ PanelFn

using mnd::Editor::PanelFn = std::function<void()>

Custom-panel callback — render any ImGui widgets you like inside.

Definition at line 46 of file Editor.h.

Member Function Documentation

◆ BeginFrame()

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().

◆ Draw()

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().

◆ EndFrame()

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().

◆ Init()

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().

◆ IsVisible()

bool mnd::Editor::IsVisible ( ) const
inline

Editor overlay currently shown?

Definition at line 57 of file Editor.h.

Referenced by mnd::EditorSwallowsInput(), and mnd::PlayerControllerComponent::Update().

◆ NotifyDrawCount()

void mnd::Editor::NotifyDrawCount ( int  n)
inline

Stats panel hook: report per-frame draw call count.

Definition at line 68 of file Editor.h.

Referenced by mnd::RenderQueue::Draw().

◆ RegisterPanel()

void mnd::Editor::RegisterPanel ( std::string  name,
PanelFn  fn 
)
inline

Register a custom ImGui panel rendered alongside the built-ins.

Definition at line 71 of file Editor.h.

◆ Shutdown()

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().

◆ ToggleVisible()

void mnd::Editor::ToggleVisible ( )
inline

Flip overlay visibility.

Definition at line 59 of file Editor.h.

Referenced by BeginFrame().

◆ WantsCaptureKeyboard()

bool mnd::Editor::WantsCaptureKeyboard ( ) const

Same as WantsCaptureMouse() but for the keyboard.

Definition at line 256 of file Editor.cpp.

◆ WantsCaptureMouse()

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.


The documentation for this class was generated from the following files: