Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Engine.h File Reference

Central singleton that owns and coordinates all engine subsystems. More...

#include <chrono>
#include <memory>
#include "audio/AudioManager.h"
#include "editor/Editor.h"
#include "graphics/GraphicsAPI.h"
#include "graphics/PostProcess.h"
#include "graphics/RenderSettings.h"
#include "graphics/RenderTarget.h"
#include "graphics/RendererBackend.h"
#include "graphics/Texture.h"
#include "input/InputManager.h"
#include "io/FileSystem.h"
#include "physics/PhysicsManager.h"
#include "render/RenderQueue.h"
#include "render/ParticleSystem.h"
#include "render/SpriteRenderer.h"
#include "scene/Scene.h"
+ Include dependency graph for Engine.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mnd::Engine
 Singleton façade that drives the full engine lifecycle. More...
 

Namespaces

namespace  mnd
 

Detailed Description

Central singleton that owns and coordinates all engine subsystems.

Startup sequence (see main.cpp)

Engine &engine = Engine::GetInstance();
engine.SetApplication(new Game()); // hand over ownership
engine.Init(1280, 720); // GLFW → window → GLEW → app->Init()
engine.Run(); // main loop until close requested
engine.Destroy(); // app->Destroy() → GLFW cleanup
Definition Game.h:6

Main loop (Engine::Run)

Each iteration:

  1. glfwPollEvents() → GLFW callbacks update InputManager.
  2. Compute deltaTime with a steady_clock timestamp.
  3. app->Update(dt) — game logic runs here.
  4. Collect CameraData and LightData from the active Scene.
  5. RenderQueue::Draw() drains all submitted RenderCommands.
  6. glfwSwapBuffers() — present frame.
Note
Engine is a non-copyable, non-movable singleton (Meyer's singleton pattern). Access it anywhere via Engine::GetInstance().
See also
Application, RenderQueue, Scene

Definition in file Engine.h.