WIP: Start on rendering glyphs

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-03-23 15:15:41 +01:00
parent 43abd96769
commit 764bfba2e2
9 changed files with 211 additions and 65 deletions

View file

@ -0,0 +1,19 @@
use crate::geometry::vector::Vector2I;
use etagere::BucketedAtlasAllocator;
struct SpriteCache {
atlasses: Vec<etagere::BucketedAtlasAllocator>,
}
impl SpriteCache {
fn new(size: Vector2I) -> Self {
let size = etagere::Size::new(size.x(), size.y());
Self {
atlasses: vec![BucketedAtlasAllocator::new(size)],
}
}
fn render_glyph(&mut self) {
self.atlasses.last().unwrap()
}
}