diff options
Diffstat (limited to 'src/shader_data.rs')
| -rw-r--r-- | src/shader_data.rs | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/shader_data.rs b/src/shader_data.rs index bd7ff82..8197bfc 100644 --- a/src/shader_data.rs +++ b/src/shader_data.rs @@ -5,31 +5,6 @@ use std::mem::size_of; use vulkanalia::vk::{ self, HasBuilder }; -pub static VERTICES: [Vertex<f32>; 8] = [ - Vertex::new(Vec3::new(-0.5, -0.5, 0.0), Vec3::new(1.0, 0.0, 0.0), - Vec2::new(1.0, 0.0)), - Vertex::new(Vec3::new( 0.5, -0.5, 0.0), Vec3::new(0.0, 1.0, 0.0), - Vec2::new(0.0, 0.0)), - Vertex::new(Vec3::new( 0.5, 0.5, 0.0), Vec3::new(0.0, 0.0, 1.0), - Vec2::new(0.0, 1.0)), - Vertex::new(Vec3::new(-0.5, 0.5, 0.0), Vec3::new(1.0, 1.0, 1.0), - Vec2::new(1.0, 1.0)), - Vertex::new(Vec3::new(-0.5, -0.5, 0.5), Vec3::new(1.0, 0.0, 0.0), - Vec2::new(1.0, 0.0)), - Vertex::new(Vec3::new( 0.5, -0.5, 0.5), Vec3::new(0.0, 1.0, 0.0), - Vec2::new(0.0, 0.0)), - Vertex::new(Vec3::new( 0.5, 0.5, 0.5), Vec3::new(0.0, 0.0, 1.0), - Vec2::new(0.0, 1.0)), - Vertex::new(Vec3::new(-0.5, 0.5, 0.5), Vec3::new(1.0, 1.0, 1.0), - Vec2::new(1.0, 1.0)), -]; - -pub const INDICES: &[u16] = &[ - 0, 1, 2, 2, 3, 0, - 4, 5, 6, 6, 7, 4, -]; - - #[repr(C)] #[derive(Clone, Debug)] pub struct Vertex<T: Copy> { @@ -48,8 +23,8 @@ pub struct UniformBlock<T: Copy> { } impl<T: Copy> Vertex<T> { - const fn new(position: Vec3<T>, color: Vec3<T>, - texture_coordinates: Vec2<T>) + pub const fn new(position: Vec3<T>, color: Vec3<T>, + texture_coordinates: Vec2<T>) -> Self { Self { position, color, texture_coordinates } |