use glium;
use math::{Vec2, Vec3};
#[derive(Copy, Clone)]
pub struct Vertex {
position: [f32; 3],
uv: [f32; 2],
}
impl Vertex {
pub fn new<V: Into<Vec3>>(position: V, uv: Vec2) -> Self {
let position = position.into();
Self {
position: position.into(),
uv: uv.into(),
}
}
}
pub type Index = u32;
implement_vertex!(Vertex, position, uv);
pub struct Mesh {
pub vertices: glium::VertexBuffer<Vertex>,
pub indices: glium::IndexBuffer<Index>,
}