From 429dbcb9e0fcbb0b1c800f928cccc3b06800e6a4 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sat, 11 Jul 2026 18:00:08 -0700 Subject: use an index buffer now, and draw two triangles Force-Push: yes Change-Id: I2c58bad402908fa36caf271da3cae78e43ef3110 --- src/linear_algebra.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/linear_algebra.rs') diff --git a/src/linear_algebra.rs b/src/linear_algebra.rs index 950877b..9b3ef73 100644 --- a/src/linear_algebra.rs +++ b/src/linear_algebra.rs @@ -3,12 +3,15 @@ use std::mem::size_of; use vulkanalia::vk::{ self, HasBuilder }; -pub static VERTICES: [Vertex; 3] = [ - Vertex::new(Vec2( 0.0, -0.5), Vec3(1.0, 0.0, 0.0)), - Vertex::new(Vec2( 0.5, 0.5), Vec3(0.0, 1.0, 0.0)), - Vertex::new(Vec2(-0.5, 0.5), Vec3(0.0, 0.0, 1.0)), +pub static VERTICES: [Vertex; 4] = [ + Vertex::new(Vec2(-0.5, -0.5), Vec3(1.0, 0.0, 0.0)), + Vertex::new(Vec2( 0.5, -0.5), Vec3(0.0, 1.0, 0.0)), + Vertex::new(Vec2( 0.5, 0.5), Vec3(0.0, 0.0, 1.0)), + Vertex::new(Vec2(-0.5, 0.5), Vec3(1.0, 1.0, 1.0)), ]; +pub const INDICES: &[u16] = &[0, 1, 2, 2, 3, 0]; + #[derive(Clone, Debug)] pub struct Vec2(T, T); -- cgit 1.4.1