1#include "render/RenderQueue.h"
7#include "graphics/GraphicsAPI.h"
9#include "graphics/ShaderProgram.h"
10#include "render/Material.h"
11#include "render/Mesh.h"
21 "RenderQueue::Submit received incomplete command (material=%p mesh=%p)",
26 m_commands.push_back(command);
34 for (
auto &command : m_commands)
36 if (!command.material)
38 LOG_ERROR(
"RenderQueue::Draw skipping command with null material");
42 auto *program = command.material->GetShaderProgram();
45 LOG_ERROR(
"RenderQueue::Draw material has no shader program");
48 program->SetUniform(
"uModel", command.modelMatrix);
49 program->SetUniform(
"uView", cameraData.
viewMatrix);
51 program->SetUniform(
"uCameraPos", cameraData.
position);
54 auto &light = lights[0];
55 program->SetUniform(
"uLight.color", light.color);
56 program->SetUniform(
"uLight.position", light.position);
In-game ImGui overlay: hierarchy, inspector, console, stats.
Console logging macros for all engine and game code.
#define LOG_WARN(fmt,...)
#define LOG_ERROR(fmt,...)
Per-frame renderer tuning knobs (PSX-style pixelation, fog, ambient).
void NotifyDrawCount(int n)
Stats panel hook: report per-frame draw call count.
Editor & GetEditor()
ImGui-based editor overlay.
static Engine & GetInstance()
Returns the single Engine instance (created on first call).
RenderSettings & GetRenderSettings()
Mutable render settings edited by the Editor's Render panel.
OpenGL 3.3 Core Profile abstraction layer.
void BindMaterial(Material *material)
Upload all material parameters as uniforms to the active shader.
void UnbindMesh(Mesh *mesh)
void DrawMesh(Mesh *mesh)
Issue a draw call for the bound mesh.
void BindMesh(Mesh *mesh)
Bind the mesh's VAO so the next draw call uses its geometry.
void Draw(GraphicsAPI &graphicsAPI, const CameraData &cameraData, const std::vector< LightData > &lights)
Draw all submitted commands, then clear the queue.
void Submit(const RenderCommand &command)
Add a draw command to the queue for this frame.
Per-frame camera matrices and world-space position.
mat4 projectionMatrix
Camera → Clip space transform (perspective or ortho).
mat4 viewMatrix
World → Camera space transform (glm::lookAt result).
vec3 position
Camera world-space position, used for specular calculations.
One draw call unit: a Mesh + Material + world-space transform.
Mesh * mesh
Geometry to draw (non-owning raw pointer).
Material * material
Surface definition (non-owning raw pointer).