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

Per-frame command list that batches and issues all draw calls. More...

#include <vector>
#include "Common.h"
#include "Types.h"
+ Include dependency graph for RenderQueue.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mnd::RenderCommand
 One draw call unit: a Mesh + Material + world-space transform. More...
 
class  mnd::RenderQueue
 Accumulates RenderCommands during Update and draws them in one pass. More...
 

Namespaces

namespace  mnd
 

Detailed Description

Per-frame command list that batches and issues all draw calls.

Why a command queue?

Separating "what to draw" from "when to draw" gives the engine a clean boundary between game logic and rendering. Application::Update() submits RenderCommands by value; the engine drains and draws the queue once per frame after Update() returns.

Frame lifecycle

  1. Game code (via MeshComponent::Update or manual calls) calls Submit().
  2. Engine::Run() calls RenderQueue::Draw() after all updates are done.
  3. Draw() iterates the command list, binds each material + mesh, uploads MVP and light uniforms, and issues the GL draw call.
  4. The command list is cleared automatically at the end of Draw(), ready for the next frame.
See also
RenderCommand, GraphicsAPI::DrawMesh, Engine::Run

Definition in file RenderQueue.h.