use crate::render::DrawCall; use crate::world::World; pub fn render_system(world: &World) -> Vec { let all_entities = world.entities.all_entities(); all_entities .iter() .filter_map(|&entity| { let transform = world.transforms.get(entity)?; let mesh_component = world.meshes.get(entity)?; Some(DrawCall { vertex_buffer: mesh_component.mesh.vertex_buffer.clone(), index_buffer: mesh_component.mesh.index_buffer.clone(), num_indices: mesh_component.mesh.num_indices, model: transform.to_matrix(), pipeline: mesh_component.pipeline, }) }) .collect() }