From 9359df753ef76fdeb40a0de19c67080329710067 Mon Sep 17 00:00:00 2001 From: Micha White Date: Mon, 17 Oct 2022 23:06:51 -0400 Subject: More docs --- src/vertex.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/vertex.rs') diff --git a/src/vertex.rs b/src/vertex.rs index a24a601..570eec4 100644 --- a/src/vertex.rs +++ b/src/vertex.rs @@ -12,23 +12,23 @@ pub const SQUARE: [Vertex; 6] = [ Vertex::new(0.5, -0.5), ]; +/// A vertex that is usable by the alligator shader #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq, Pod, Zeroable)] pub struct Vertex { position: [f32; 2], } -impl Vertex { - const fn new(x: f32, y: f32) -> Self { - Self { position: [x, y] } - } -} - impl Vertex { // whenever this is updated, please also update `sprite.wgsl` pub(crate) const ATTRIBUTES: [wgpu::VertexAttribute; 1] = wgpu::vertex_attr_array![0 => Float32x2]; + /// Create a new vertex + const fn new(x: f32, y: f32) -> Self { + Self { position: [x, y] } + } + pub(crate) const fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { wgpu::VertexBufferLayout { array_stride: size_of::() as wgpu::BufferAddress, -- cgit v1.2.3