From 715bbaf459b88575e11d90ec16bad3841bafd259 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 7 Oct 2023 20:52:09 +0200 Subject: feat(engine): add ability to render triangles --- engine/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engine/src/lib.rs') diff --git a/engine/src/lib.rs b/engine/src/lib.rs index ea74fd1..28cd2da 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -3,10 +3,13 @@ use glfw::Window; pub use glfw::WindowSize; +use crate::object::Object; use crate::vector::Vec2; mod renderer; +mod shader; +pub mod object; pub mod vector; pub struct Engine @@ -42,12 +45,12 @@ impl Engine /// /// # Errors /// Will return `Err` if updating the window fails. - pub fn start(&self, mut func: impl FnMut()) -> Result<(), Error> + pub fn start(&self, objects: &[Object], mut func: impl FnMut()) -> Result<(), Error> { while !self.window.should_close() { func(); - crate::renderer::render(); + crate::renderer::render(objects.iter().map(Object::renderable)); self.window .swap_buffers() -- cgit v1.2.3-18-g5258