123 void line(
const glm::vec2& from,
const glm::vec2& to,
124 const glm::vec4& color,
f32 thickness = 1.0f);
133 void line3D(
const glm::vec3& from,
const glm::vec3& to,
134 const glm::vec4& color,
f32 thickness = 1.0f);
137 void line3DScreen(
const glm::vec3& from,
const glm::vec3& to,
138 const glm::vec4& color,
f32 thickness = 1.0f);
147 const glm::vec2& fromOffset,
148 const glm::vec2& toOffset,
149 const glm::vec4& color,
f32 thickness = 1.0f);
151 void polyline(std::span<const glm::vec2> vertices,
const glm::vec4& color,
152 f32 thickness = 1.0f,
bool closed =
false);
158 void rect(
const glm::vec2& position,
const glm::vec2& size,
159 const glm::vec4& color,
bool filled =
true);
161 void rectOutline(
const glm::vec2& position,
const glm::vec2& size,
162 const glm::vec4& color,
f32 thickness = 1.0f);
168 void circle(
const glm::vec2& center,
f32 radius,
169 const glm::vec4& color,
bool filled =
true,
i32 segments = 32);
172 const glm::vec4& color,
f32 thickness = 1.0f,
i32 segments = 32);
178 void polygon(std::span<const glm::vec2> vertices,
const glm::vec4& color);
189 const glm::vec4& tint,
const f32 xform[6]);
222 void texture(
const glm::vec2& position,
const glm::vec2& size,
223 u32 textureId,
const glm::vec4& tint = glm::vec4(1.0f));
225 void textureRotated(
const glm::vec2& position,
const glm::vec2& size,
226 f32 rotation,
u32 textureId,
227 const glm::vec4& tint = glm::vec4(1.0f));
245 bool depthTest()
const {
return current_desc_.depthTest; }
252 void setDither(
bool on,
bool phase =
false) { dither_ = on; ditherPhase_ = phase; }
267 void emitQuad(
const glm::vec2& center,
const glm::vec2& size,
f32 rotation,
268 const glm::vec4& color,
u32 textureId,
269 const glm::vec2& uvOffset = glm::vec2(0.0f),
270 const glm::vec2& uvScale = glm::vec2(1.0f));
272 void emitTriangle(
const glm::vec2& p0,
const glm::vec2& p1,
const glm::vec2& p2,
273 const glm::vec4& color);
275 void useTexture(
u32 textureId);
279 void uploadInstances();
296 PipelineDesc current_desc_{};
297 bool dither_ =
false;
298 bool ditherPhase_ =
false;
299 std::vector<BatchVertex> ditherScratch_;
301 u32 appendBatch(
const BatchVertex* vertices,
usize count);
303 u32 white_texture_id_ = 0;
304 u32 currentTexture_ = 0;
305 bool pendingGeometry_ =
false;
307 std::vector<BatchVertex> triangleVertices_;
308 std::vector<u32> triangleIndices_;
309 bool deferredGeometry_ =
false;
310 struct DeferredBatch {
317 u32 firstInstance = 0;
318 u32 instanceCount = 0;
320 std::vector<DeferredBatch> deferredBatches_;
321 u32 recordedIndices_ = 0;
322 bool recording_ =
false;
324 struct ResidentMesh {
331 struct InstanceRecord {
335 std::vector<ResidentMesh> meshes_;
336 std::vector<u32> freeMeshes_;
337 std::vector<u32> doomedMeshes_;
339 std::vector<InstanceRecord> instances_;
340 u32 instancesUploaded_ = 0;
342 u32 instanceCapacity_ = 0;
347 bool instancedLinear_ =
false;
348 bool instancedCompiled_ =
false;
349 bool instancedDisplayCompiled_ =
false;
359 glm::vec3 viewForward_{0.0f, 0.0f, -1.0f};
361 glm::mat4 viewProjection_{1.0f};
362 glm::mat4 inverseViewProjection_{1.0f};
363 f32 viewportWidth_ = 1.0f;
364 f32 viewportHeight_ = 1.0f;
366 i32 currentLayer_ = 0;
367 f32 currentDepth_ = 0.0f;
368 u32 primitiveCount_ = 0;
369 u32 drawCallCount_ = 0;
370 bool initialized_ =
false;
371 bool inFrame_ =
false;
Type-safe resource handle system.
Math utilities and GLM configuration for ESEngine.
Immutable GPU pipeline state — the backend-agnostic unit of "how to draw".
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
Central manager for GPU resources.
Handle< esengine::Shader > ShaderHandle
Handle to a shader resource.
std::int32_t i32
Signed 32-bit integer.
std::size_t usize
Size type for indexing and sizes.
PipelineHandle
Opaque handle to a cached pipeline; PipelineHandle{0} is the null/invalid handle.
std::uint32_t u32
Unsigned 32-bit integer.
BlendMode
Predefined blend modes for rendering.
float f32
32-bit floating point
Immutable description of a draw pipeline. Equality keys the pipeline cache, so two draws with the sam...