From 5bac9321082112ae20650d59cc748103c2456106 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Fri, 1 Dec 2023 00:54:32 +0100 Subject: [PATCH] add `bind_texture` field to `UiVertex` --- kubi-ui/src/draw.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kubi-ui/src/draw.rs b/kubi-ui/src/draw.rs index fe1f950..43fe038 100644 --- a/kubi-ui/src/draw.rs +++ b/kubi-ui/src/draw.rs @@ -38,6 +38,7 @@ pub struct UiDrawCommands { // } // } +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BindTexture { FontTexture, //UserDefined(usize), @@ -48,7 +49,7 @@ pub struct UiVertex { pub position: Vec2, pub color: Vec4, pub uv: Vec2, - //pub texture: Option, + pub bind_texture: Option, } #[derive(Default)] @@ -75,21 +76,25 @@ impl UiDrawPlan { position: *position, color: *color, uv: vec2(0.0, 0.0), + bind_texture: None, }, UiVertex { position: *position + Vec2::new(size.x, 0.0), color: *color, uv: vec2(1.0, 0.0), + bind_texture: None, }, UiVertex { position: *position + *size, color: *color, uv: vec2(1.0, 1.0), + bind_texture: None, }, UiVertex { position: *position + Vec2::new(0.0, size.y), color: *color, uv: vec2(0.0, 1.0), + bind_texture: None, }, ]); },