diff options
Diffstat (limited to 'engine/src/lib.rs')
-rw-r--r-- | engine/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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() |