summaryrefslogtreecommitdiff
path: root/src/vertex.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2020-03-04 01:26:52 -0600
committerTom Barrett <tom@tombarrett.xyz>2020-03-04 01:26:52 -0600
commitaf5e8f365478f62bc5108217317e70a6ee1accf4 (patch)
treeecb72e11f3dded73eca3e46c50442008e4290c3f /src/vertex.rs
parente79499cd864dc64017316ef4512991df68837576 (diff)
workable viewport structure
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,
+}