Trait veloren_voxygen::mesh::greedy::AtlasAllocator
source · pub trait AtlasAllocator {
type Config;
// Required methods
fn with_max_size(max_size: Vec2<u16>, config: Self::Config) -> Self;
fn allocate(&mut self, size: Vec2<u16>) -> Option<Rectangle>;
fn size(&self) -> Vec2<u16>;
fn grow(&mut self, new_size: Vec2<u16>);
}
Expand description
Abstraction over different atlas allocators. Useful to swap out the allocator implementation for specific cases (e.g. sprites).
Required Associated Types§
Required Methods§
sourcefn with_max_size(max_size: Vec2<u16>, config: Self::Config) -> Self
fn with_max_size(max_size: Vec2<u16>, config: Self::Config) -> Self
Creates a new instance of this atlas allocator taking into account the provided max size;
Object Safety§
This trait is not object safe.