initial text impl
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user