Engine → Renderer → sprite_batch.h
sprite_batcher
| Type | Class |
| Namespace | conjure::renderer |
| Include File Path | engine/include/conjure/renderer/sprite_batch.h |
| Source File Path | N/A |
| API ↗ | Rendering, Rendering a frame |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | sprite_batcher(); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~sprite_batcher(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mDropped | u32 | 0 | |
| private | mIndices | std::vector<u32> | {} | |
| private | mKeys | std::vector<u64> | {} | |
| private | mOrder | std::vector<u32> | {} | |
| private | m | bool | false | |
| private | mRuns | std::vector<sprite_run> | {} | |
| private | mScratchKeys | std::vector<u64> | {} | |
| private | m | std::vector<u32> | {} | |
| private | mVertices | std:: | {} |
Functions
Public
build
buildvoid build(
std::span<const sprite> sprites);Rebuilds vertices, indices and runs from the sprites. Keeps capacity between calls. Logs the overflow WARN when this build drops sprites and the one before it dropped none.
clear
clearvoid clear() noexcept;Forgets the output and the dropped count; capacity is kept, and so is whether the overflow WARN is armed (only a build decides that).
dropped_count
dropped_count[[nodiscard]] u32 dropped_count() const noexcept;Sprites dropped by the last build because the cap was reached (both spaces); 0 after clear(). The renderer reports its batcher's count as render_stats::spritesDropped.
indices
indices[[nodiscard]] std::span<const u32> indices() const noexcept;runs
runs[[nodiscard]] std::span<const sprite_run> runs() const noexcept;sort_key
sort_keyThe sort key of a sprite: space, then layer, order and texture, all ascending.
sprite_count
sprite_count[[nodiscard]] u32 sprite_count() const noexcept;Number of sprites the last build emitted.
vertices
vertices[[nodiscard]] std::span<const sprite_vertex> vertices() const noexcept;