Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
sprite_batch.hpp
Go to the documentation of this file.
1
3#pragma once
4
5#include <aegis2d/render/export.hpp>
7
8#include <cstddef>
9#include <cstdint>
10#include <vector>
11
12namespace aegis2d::render {
13
19 std::int32_t layer = 0;
21 std::size_t first = 0;
23 std::size_t count = 0;
24};
25
32[[nodiscard]] AEGIS2D_RENDER_EXPORT std::vector<SpriteBatch>
33batch_sprites(std::vector<Sprite>& sprites);
34
35} // namespace aegis2d::render
OpenGL renderer: sprites, text and camera (client only).
Definition bitmap_font.hpp:16
constexpr TextureId no_texture
Texture identifier meaning "no texture": the sprite is a plain tinted rectangle.
Definition renderer.hpp:35
std::uint32_t TextureId
Identifier of a texture loaded by the resource manager.
Definition renderer.hpp:32
std::vector< SpriteBatch > batch_sprites(std::vector< Sprite > &sprites)
Orders sprites for drawing and groups those that share a layer and a texture.
Backend-independent renderer interface and the sprite it draws.
Run of consecutive sprites drawn with one texture on one layer: one draw call.
Definition sprite_batch.hpp:15
TextureId texture
Texture of every sprite of the run.
Definition sprite_batch.hpp:17
std::size_t first
Index of the first sprite of the run, in the sorted sprites.
Definition sprite_batch.hpp:21
std::int32_t layer
Layer of every sprite of the run.
Definition sprite_batch.hpp:19
std::size_t count
Number of sprites in the run, at least 1.
Definition sprite_batch.hpp:23