diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-07-11 18:00:08 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-07-11 18:00:08 -0700 |
| commit | 429dbcb9e0fcbb0b1c800f928cccc3b06800e6a4 (patch) | |
| tree | c2fa1b4a2723c69bf4118d8e2ed5efeee8f364c3 /src/linear_algebra.rs | |
| parent | 99e542e07cef78ef4af8e1443bd879b2565b3f61 (diff) | |
use an index buffer now, and draw two triangles
Force-Push: yes Change-Id: I2c58bad402908fa36caf271da3cae78e43ef3110
Diffstat (limited to 'src/linear_algebra.rs')
| -rw-r--r-- | src/linear_algebra.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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<f32>; 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<f32>; 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, T); |