|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Batches drawables into sorted geometry, primitive, and custom execution passes for GPURenderer. More...
#include <flint/graphics/render-queue.h>
Collaboration diagram for Flint::RenderQueue:Public Member Functions | |
| RenderQueue (FrameData &frame, const FloatRect &cameraView) | |
| Construct a render queue bound to a specific frame stage and camera view. | |
| FLINT_API void | deferUpload (UploadCallbackFn fn) |
| Defer a resource upload operation to execute prior to render pass submission. | |
| FLINT_API void | quad (GPUTexture *texture, const FloatRect &dst, const FloatRect &srcUV, Color tint, float rotation=0.f, Vec2f origin={0.f, 0.f}) |
| Emit a textured world-space quad into the ordered geometry stream. | |
| FLINT_API void | solidQuad (const FloatRect &dst, Color tint, float rotation=0.f, Vec2f origin={0.f, 0.f}) |
| Emit an untextured, solid-colored world-space quad. | |
| FLINT_API void | circle (GPUTexture *texture, Vec2f center, float radius, Color tint, float rotation=0.f, float innerRadius=0.f) |
| Emit a circular or ring-shape primitive. | |
| FLINT_API void | lines (std::span< const PrimitiveVertex > verts, PrimitiveType type) |
| Emit world-space colored point or line primitives. | |
| FLINT_API void | custom (CustomDrawFn fn) |
| Enqueue a custom rendering callback directly into the execution stream. | |
| FloatRect | getCameraView () const |
| Get the active camera view rectangle bound to this queue. | |
Batches drawables into sorted geometry, primitive, and custom execution passes for GPURenderer.
Definition at line 29 of file render-queue.h.
|
inlineexplicit |
Construct a render queue bound to a specific frame stage and camera view.
| frame | Destination frame data storage. Must remain valid for the duration of this queue's construction phase. |
| cameraView | Active camera view rectangle used for coordinate transforms. |
Definition at line 38 of file render-queue.h.
| FLINT_API void Flint::RenderQueue::circle | ( | GPUTexture * | texture, |
| Vec2f | center, | ||
| float | radius, | ||
| Color | tint, | ||
| float | rotation = 0.f, | ||
| float | innerRadius = 0.f ) |
Emit a circular or ring-shape primitive.
Generates a bounding quad configured for procedural or textured circle rendering.
| texture | Optional texture mapped across circle bounds. May be nullptr. |
| center | World-space center point of the circle. |
| radius | Outer radius in world-space units. |
| tint | RGBA color tint applied to the circle. |
| rotation | Clockwise rotation in radians. |
| innerRadius | innerRadius Inner cutout radius in world-space units. A value of 0.f produces a filled circle; values greater than 0.f produce a hollow ring. |
| FLINT_API void Flint::RenderQueue::custom | ( | CustomDrawFn | fn | ) |
Enqueue a custom rendering callback directly into the execution stream.
Custom GPU commands execute in the exact submission sequence relative to surrounding draw commands. Invoking this breaks active batch runs.
| fn | Callback receiving active command buffer handles at render time. |
| FLINT_API void Flint::RenderQueue::deferUpload | ( | UploadCallbackFn | fn | ) |
Defer a resource upload operation to execute prior to render pass submission.
Callbacks are batched and invoked during the frame's pre-render transfer phase before any draw commands in this queue are issued.
| fn | Callback executing GPU buffer or texture upload operations. |
|
inline |
Get the active camera view rectangle bound to this queue.
Definition at line 132 of file render-queue.h.
| FLINT_API void Flint::RenderQueue::lines | ( | std::span< const PrimitiveVertex > | verts, |
| PrimitiveType | type ) |
Emit world-space colored point or line primitives.
Vertex positions are transformed to normalized device coordinates using the camera view associated with this queue.
| verts | Vertices copied into the current frame's line stream. |
| type | Topology used to interpret the supplied vertices. |
| FLINT_API void Flint::RenderQueue::quad | ( | GPUTexture * | texture, |
| const FloatRect & | dst, | ||
| const FloatRect & | srcUV, | ||
| Color | tint, | ||
| float | rotation = 0.f, | ||
| Vec2f | origin = {0.f, 0.f} ) |
Emit a textured world-space quad into the ordered geometry stream.
Consecutive quads using the same texture and sampler may share one indexed draw run. Geometry is never reordered solely to improve batching.
| texture | Non-owning GPUTexture pointer. Must be valid and contain a usable GPU texture through frame execution. |
| dst | Destination rectangle in world-space units. |
| srcUV | Normalized texture rectangle; values are expected in [0, 1]. |
| tint | RGBA color multiplied with the sampled texture. |
| rotation | Clockwise rotation in radians. |
| origin | Rotation pivot measured from dst position in world-space units. |
| FLINT_API void Flint::RenderQueue::solidQuad | ( | const FloatRect & | dst, |
| Color | tint, | ||
| float | rotation = 0.f, | ||
| Vec2f | origin = {0.f, 0.f} ) |
Emit an untextured, solid-colored world-space quad.
| dst | Destination rectangle in world-space units. |
| tint | Solid RGBA color assigned to vertices. |
| rotation | Clockwise rotation in radians |
| origin | Rotation pivot measured from dst position in world-space units. |