diff options
Diffstat (limited to 'wgpu/src/primitive.rs')
-rw-r--r-- | wgpu/src/primitive.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/wgpu/src/primitive.rs b/wgpu/src/primitive.rs index 2e31cd53..a8f1119c 100644 --- a/wgpu/src/primitive.rs +++ b/wgpu/src/primitive.rs @@ -1,3 +1,17 @@ +use crate::core::Rectangle; +use crate::graphics::{Damage, Mesh}; + pub type Primitive = crate::graphics::Primitive<Custom>; -pub type Custom = (); +#[derive(Debug, Clone, PartialEq)] +pub enum Custom { + Mesh(Mesh), +} + +impl Damage for Custom { + fn bounds(&self) -> Rectangle { + match self { + Self::Mesh(mesh) => mesh.bounds(), + } + } +} |