|
Monad Engine da02fba2
> Undercity Codex_
|
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. | |
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.
| 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:
| graphicsAPI | The GL wrapper that issues the actual gl* calls. |
| cameraData | View and projection matrices for this frame. |
| lights | World-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().
| void mnd::RenderQueue::Submit | ( | const RenderCommand & | command | ) |
Add a draw command to the queue for this frame.
| command | The 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().