Draft new iced_graphics crate 🎉
This commit is contained in:
parent
d4743183d4
commit
05af8d00d4
100 changed files with 861 additions and 1755 deletions
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue