summaryrefslogtreecommitdiff
path: root/src/vertex.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/vertex.rs')
-rw-r--r--src/vertex.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vertex.rs b/src/vertex.rs
new file mode 100644
index 0000000..2030218
--- /dev/null
+++ b/src/vertex.rs
@@ -0,0 +1,17 @@
+use luminance_derive::{Semantics, Vertex};
+
+#[derive(Vertex)]
+#[vertex(sem = "VertexSemantics")]
+pub struct Vertex {
+ pub position: VertexPosition,
+ #[vertex(normalized = "true")]
+ pub color: VertexRGB,
+}
+
+#[derive(Copy, Clone, Debug, Semantics)]
+pub enum VertexSemantics {
+ #[sem(name = "position", repr = "[f32; 2]", wrapper = "VertexPosition")]
+ Position,
+ #[sem(name = "color", repr = "[u8; 3]", wrapper = "VertexRGB")]
+ Color,
+}