Decouple Mesh primitives from main Primitive type

This commit is contained in:
Héctor Ramón Jiménez 2023-06-29 07:48:03 +02:00
parent 2128472c2a
commit fa5650cfd1
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
15 changed files with 248 additions and 205 deletions

View file

@ -1,6 +1,6 @@
//! A collection of triangle primitives.
use crate::core::{Point, Rectangle};
use crate::graphics::primitive;
use crate::graphics::mesh;
/// A mesh of triangles.
#[derive(Debug, Clone, Copy)]
@ -11,7 +11,7 @@ pub enum Mesh<'a> {
origin: Point,
/// The vertex and index buffers of the [`Mesh`].
buffers: &'a primitive::Mesh2D<primitive::ColoredVertex2D>,
buffers: &'a mesh::Indexed<mesh::SolidVertex2D>,
/// The clipping bounds of the [`Mesh`].
clip_bounds: Rectangle<f32>,
@ -22,7 +22,7 @@ pub enum Mesh<'a> {
origin: Point,
/// The vertex and index buffers of the [`Mesh`].
buffers: &'a primitive::Mesh2D<primitive::GradientVertex2D>,
buffers: &'a mesh::Indexed<mesh::GradientVertex2D>,
/// The clipping bounds of the [`Mesh`].
clip_bounds: Rectangle<f32>,