// Library use gfx::{ self, traits::FactoryExt, }; // Local use super::{ mesh::Mesh, Pipeline, gfx_backend, }; /// Represents a mesh that has been sent to the CPU pub struct Model { pub vbuf: gfx::handle::Buffer, pub slice: gfx::Slice, } impl Model

{ pub fn new( factory: &mut gfx_backend::Factory, mesh: &Mesh

, ) -> Self { Self { vbuf: factory.create_vertex_buffer(mesh.vertices()), slice: gfx::Slice { start: 0, end: mesh.vertices().len() as u32, base_vertex: 0, instances: None, buffer: gfx::IndexBuffer::Auto, }, } } }