#[cfg(feature = "vertex-impls")]
mod impls;
#[cfg(feature = "vertex-impls")]
pub use impls::*;
use crate::features::*;
pub use bytemuck::{Pod, Zeroable};
#[cfg(feature = "mesh")]
use wgpu::*;
pub type Index = u32;
pub trait Vertex: Pod + Zeroable {
fn new(pos: [f32; 3], col: [f32; 4], normals: [f32; 3], uvs: [f32; 2]) -> Self;
fn features() -> MeshFeatures;
#[cfg(feature = "mesh")]
fn attribs() -> &'static [VertexAttribute];
#[cfg(feature = "mesh")]
fn layout() -> VertexBufferLayout<'static> {
VertexBufferLayout {
array_stride: std::mem::size_of::<Self>() as BufferAddress,
step_mode: VertexStepMode::Vertex,
attributes: Self::attribs()
}
}
}