summaryrefslogtreecommitdiffstats
path: root/glow/src/triangle.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 17:15:44 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-19 17:15:44 +0200
commit05af8d00d4c0f7b8e0ece85224fd90a92da86da8 (patch)
tree98e4774a2c0d4a2a0a01aff1d772f89c4cb0aa5e /glow/src/triangle.rs
parentd4743183d40c6044ce6fa39e2a52919a32912cda (diff)
downloadiced-05af8d00d4c0f7b8e0ece85224fd90a92da86da8.tar.gz
iced-05af8d00d4c0f7b8e0ece85224fd90a92da86da8.tar.bz2
iced-05af8d00d4c0f7b8e0ece85224fd90a92da86da8.zip
Draft new `iced_graphics` crate :tada:
Diffstat (limited to 'glow/src/triangle.rs')
-rw-r--r--glow/src/triangle.rs25
1 files changed, 2 insertions, 23 deletions
diff --git a/glow/src/triangle.rs b/glow/src/triangle.rs
index f71022d0..8b21c0a8 100644
--- a/glow/src/triangle.rs
+++ b/glow/src/triangle.rs
@@ -3,6 +3,8 @@ use crate::{settings, Transformation};
use iced_native::{Rectangle, Vector};
use std::mem;
+pub use iced_graphics::triangle::Mesh2D;
+
const UNIFORM_BUFFER_SIZE: usize = 100;
const VERTEX_BUFFER_SIZE: usize = 10_000;
const INDEX_BUFFER_SIZE: usize = 10_000;
@@ -59,26 +61,3 @@ impl From<Transformation> for Uniforms {
}
}
}
-
-/// A two-dimensional vertex with some color in __linear__ RGBA.
-#[repr(C)]
-#[derive(Copy, Clone, Debug)]
-pub struct Vertex2D {
- /// The vertex position
- pub position: [f32; 2],
- /// The vertex color in __linear__ RGBA.
- pub color: [f32; 4],
-}
-
-/// 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
- pub vertices: Vec<Vertex2D>,
- /// The list of vertex indices that defines the triangles of the mesh.
- ///
- /// Therefore, this list should always have a length that is a multiple of 3.
- pub indices: Vec<u32>,
-}