Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
BatchPlugin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
19#pragma once
20
24
25#include <glm/glm.hpp>
26
27namespace esengine {
28
30public:
31 void init(RenderFrameContext& ctx) override { batch_shader_id_ = ctx.batch_shader_id; }
32 void shutdown() override {}
33
34protected:
40 void emitQuad(TransientBufferPool& buffers, DrawList& draw_list, const ClipState& clips,
41 const glm::vec3& position, const glm::vec2& size, const glm::vec2& pivotNorm,
42 f32 angle, const glm::vec2& uvOffset, const glm::vec2& uvScale,
43 const glm::vec4& color, const BatchDrawKey& key);
44
50 void emitNineSlice(TransientBufferPool& buffers, DrawList& draw_list, const ClipState& clips,
51 const glm::vec3& position, const glm::vec2& size, const glm::vec2& pivotNorm,
52 f32 angle, const glm::vec2& texSize, const glm::vec4& border,
53 const glm::vec2& uvOffset, const glm::vec2& uvScale,
54 const glm::vec4& color, const BatchDrawKey& key);
55
70 void emitRadialFill(TransientBufferPool& buffers, DrawList& draw_list, const ClipState& clips,
71 const glm::vec3& center, const glm::vec2& size, f32 angle,
72 f32 startAngle, f32 sweep,
73 const glm::vec2& uvOffset, const glm::vec2& uvScale,
74 const glm::vec4& color, const BatchDrawKey& key);
75
77};
78
79} // namespace esengine
The single submission face: the ONLY place a DrawCommand is assembled.
void shutdown() override
void emitRadialFill(TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &center, const glm::vec2 &size, f32 angle, f32 startAngle, f32 sweep, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
Emits a centered angular wedge (Radial Filled): a triangle fan from the box center out to its perimet...
void init(RenderFrameContext &ctx) override
void emitQuad(TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &position, const glm::vec2 &size, const glm::vec2 &pivotNorm, f32 angle, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
Emits a single rotated/unrotated textured quad.
void emitNineSlice(TransientBufferPool &buffers, DrawList &draw_list, const ClipState &clips, const glm::vec3 &position, const glm::vec2 &size, const glm::vec2 &pivotNorm, f32 angle, const glm::vec2 &texSize, const glm::vec4 &border, const glm::vec2 &uvOffset, const glm::vec2 &uvScale, const glm::vec4 &color, const BatchDrawKey &key)
Emits a 3x3 nine-slice grid of quads sharing one BatchDrawKey.
std::uint32_t u32
Unsigned 32-bit integer.
Definition Types.hpp:45
static EstellaContext & ctx()
float f32
32-bit floating point
Definition Types.hpp:59
Non-geometry attributes of a batch draw — everything needed to build the sort key + DrawCommand.