Skip to main content

goud_engine/rendering/sprite_batch/
config.rs

1//! Configuration for the sprite batch renderer.
2
3/// Configuration for sprite batch rendering.
4#[derive(Debug, Clone, Copy, PartialEq)]
5pub struct SpriteBatchConfig {
6    /// Initial capacity for vertex buffer (number of sprites).
7    pub initial_capacity: usize,
8
9    /// Maximum number of sprites per batch before automatic flush.
10    pub max_batch_size: usize,
11
12    /// Enable Z-layer sorting (disable for UI layers that don't need depth).
13    pub enable_z_sorting: bool,
14
15    /// Enable automatic batching by texture (disable for debugging).
16    pub enable_batching: bool,
17}
18
19impl Default for SpriteBatchConfig {
20    fn default() -> Self {
21        Self {
22            initial_capacity: 1024, // Start with space for 1024 sprites
23            max_batch_size: 10000,  // Flush after 10K sprites
24            enable_z_sorting: true, // Sort by Z-layer by default
25            enable_batching: true,  // Batch by texture by default
26        }
27    }
28}