summaryrefslogtreecommitdiff
path: root/render/src/vertex.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2024-08-15 20:16:32 -0400
committerMicha White <botahamec@outlook.com>2024-08-15 20:16:32 -0400
commitdb9aa9f1bf49e8bede384b9ceb1e1fb82b522799 (patch)
tree0d60727acf481f59b42ef0f74ed07c16ec562bcf /render/src/vertex.rs
parentf8a80039c74332e2101a177ef3fde31ef2077224 (diff)
Delete stuff
Diffstat (limited to 'render/src/vertex.rs')
-rw-r--r--render/src/vertex.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/render/src/vertex.rs b/render/src/vertex.rs
deleted file mode 100644
index 570eec4..0000000
--- a/render/src/vertex.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-use std::mem::size_of;
-
-use bytemuck::{Pod, Zeroable};
-
-/// The vertices needed to form a square
-pub const SQUARE: [Vertex; 6] = [
- Vertex::new(-0.5, -0.5),
- Vertex::new(0.5, -0.5),
- Vertex::new(-0.5, 0.5),
- Vertex::new(0.5, 0.5),
- Vertex::new(-0.5, 0.5),
- 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 {
- // 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::<Self>() as wgpu::BufferAddress,
- step_mode: wgpu::VertexStepMode::Vertex,
- attributes: &Self::ATTRIBUTES,
- }
- }
-}