initial text impl

This commit is contained in:
2025-08-23 21:15:39 -04:00
parent abcbc267b5
commit 5ce6fca275
33 changed files with 530 additions and 117 deletions

View File

@@ -1,5 +1,5 @@
use crate::{
Color, UiRegion,
layout::{Color, TextureHandle, UiRegion},
render::{ArrBuf, data::PrimitiveInstance},
};
use bytemuck::Pod;
@@ -8,6 +8,8 @@ use wgpu::*;
pub struct Primitives {
pub(super) instances: Vec<PrimitiveInstance>,
pub(super) data: PrimitiveData,
// ensure drawn textures don't get freed
pub(crate) drawn_textures: Vec<TextureHandle>,
pub updated: bool,
}
@@ -16,6 +18,7 @@ impl Default for Primitives {
Self {
instances: Default::default(),
data: Default::default(),
drawn_textures: Default::default(),
updated: true,
}
}
@@ -98,6 +101,7 @@ impl Primitives {
self.updated = true;
self.instances.clear();
self.data.clear();
self.drawn_textures.clear();
}
}