Checkpoint

This commit is contained in:
Nathan Sobo 2023-10-03 16:17:25 -06:00
parent 4208ac2958
commit 550d9a9f71
11 changed files with 96 additions and 80 deletions

View file

@ -109,6 +109,7 @@ impl AtlasAllocator {
};
descriptor.set_width(size.x() as u64);
descriptor.set_height(size.y() as u64);
self.device.new_texture(&descriptor)
} else {
self.device.new_texture(&self.texture_descriptor)
@ -146,10 +147,10 @@ impl Atlas {
bounds.size().y() as u64,
);
self.texture.replace_region(
region,
dbg!(region),
0,
bytes.as_ptr() as *const _,
(bounds.size().x() * self.bytes_per_pixel() as i32) as u64,
dbg!((bounds.size().x() * self.bytes_per_pixel() as i32) as u64),
);
}

View file

@ -632,7 +632,8 @@ impl Renderer {
) {
// Snap sprite to pixel grid.
let origin = (glyph.origin * scale_factor).floor() + sprite.offset.to_f32();
// dbg!(origin);
dbg!(origin);
sprites_by_atlas
.entry(sprite.atlas_id)
.or_insert_with(Vec::new)

View file

@ -114,7 +114,7 @@ impl SpriteCache {
let (alloc_id, atlas_bounds) = self
.atlases
.upload(dbg!(glyph_bounds.size()), &mask)
.upload(glyph_bounds.size(), &mask)
.expect("could not upload glyph");
Some(GlyphSprite {
atlas_id: alloc_id.atlas_id,