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

Accumulates RenderCommands during Update and draws them in one pass. More...

#include <RenderQueue.h>

Public Member Functions

void Submit (const RenderCommand &command)
 Add a draw command to the queue for this frame.
 
void Draw (GraphicsAPI &graphicsAPI, const CameraData &cameraData, const std::vector< LightData > &lights)
 Draw all submitted commands, then clear the queue.
 

Detailed Description

Accumulates RenderCommands during Update and draws them in one pass.

The queue is stateless across frames — it is filled during Update and drained (and cleared) during Draw, forming a clean producer/consumer pattern.

Definition at line 56 of file RenderQueue.h.

Member Function Documentation

◆ Draw()

void mnd::RenderQueue::Draw ( GraphicsAPI graphicsAPI,
const CameraData cameraData,
const std::vector< LightData > &  lights 
)

Draw all submitted commands, then clear the queue.

For each command:

  1. Bind the material's shader program.
  2. Upload view, projection, and model matrices as uniforms.
  3. Upload camera position and all light data as uniforms.
  4. Bind the material (textures + float params).
  5. Bind the mesh VAO and issue the draw call.
Parameters
graphicsAPIThe GL wrapper that issues the actual gl* calls.
cameraDataView and projection matrices for this frame.
lightsWorld-space light positions and colours.

Definition at line 29 of file RenderQueue.cpp.

References mnd::GraphicsAPI::BindMaterial(), mnd::GraphicsAPI::BindMesh(), mnd::GraphicsAPI::DrawMesh(), mnd::Engine::GetEditor(), mnd::Engine::GetInstance(), mnd::Engine::GetRenderSettings(), LOG_ERROR, mnd::Editor::NotifyDrawCount(), mnd::CameraData::position, mnd::CameraData::projectionMatrix, mnd::GraphicsAPI::UnbindMesh(), and mnd::CameraData::viewMatrix.

Referenced by mnd::Engine::Run().

◆ Submit()

void mnd::RenderQueue::Submit ( const RenderCommand command)

Add a draw command to the queue for this frame.

Parameters
commandThe mesh + material + transform to be drawn.

Definition at line 16 of file RenderQueue.cpp.

References LOG_WARN, mnd::RenderCommand::material, and mnd::RenderCommand::mesh.

Referenced by mnd::MeshComponent::Update(), and mnd::SkinnedMeshComponent::Update().


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