use std::collections::HashMap; use std::rc::Rc; use crate::entity::EntityHandle; use crate::loaders::mesh::Mesh; use crate::render::{DrawCall, Pipeline}; pub type DrawHandle = usize; struct DrawEntry { mesh: Rc, entity: EntityHandle, pipeline: Pipeline, } pub struct DrawManager { entries: HashMap, next_handle: DrawHandle, } impl DrawManager { pub fn new() -> Self { Self { entries: HashMap::new(), next_handle: 0, } } pub fn draw_mesh_internal( &mut self, mesh: Rc, entity: EntityHandle, pipeline: Pipeline, ) -> DrawHandle { let handle = self.next_handle; self.next_handle += 1; self.entries.insert( handle, DrawEntry { mesh, entity, pipeline, }, ); handle } pub fn clear_mesh_internal(&mut self, handle: DrawHandle) { self.entries.remove(&handle); } pub fn collect_draw_calls(&self) -> Vec { vec![] } pub fn draw_mesh(_mesh: Rc, _entity: EntityHandle, _pipeline: Pipeline) -> DrawHandle { 0 } pub fn clear_mesh(_handle: DrawHandle) {} }