summaryrefslogtreecommitdiffstats
path: root/graphics/src/triangle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src/triangle.rs')
-rw-r--r--graphics/src/triangle.rs11
1 files changed, 2 insertions, 9 deletions
diff --git a/graphics/src/triangle.rs b/graphics/src/triangle.rs
index ce879ffc..05028f51 100644
--- a/graphics/src/triangle.rs
+++ b/graphics/src/triangle.rs
@@ -1,8 +1,7 @@
//! Draw geometry using meshes of triangles.
+use bytemuck::{Pod, Zeroable};
/// A set of [`Vertex2D`] and indices representing a list of triangles.
-///
-/// [`Vertex2D`]: struct.Vertex2D.html
#[derive(Clone, Debug)]
pub struct Mesh2D {
/// The vertices of the mesh
@@ -16,7 +15,7 @@ pub struct Mesh2D {
}
/// A two-dimensional vertex with some color in __linear__ RGBA.
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone, Debug, Zeroable, Pod)]
#[repr(C)]
pub struct Vertex2D {
/// The vertex position
@@ -24,9 +23,3 @@ pub struct Vertex2D {
/// The vertex color in __linear__ RGBA.
pub color: [f32; 4],
}
-
-#[allow(unsafe_code)]
-unsafe impl bytemuck::Zeroable for Vertex2D {}
-
-#[allow(unsafe_code)]
-unsafe impl bytemuck::Pod for Vertex2D {}