diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-07 20:52:09 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-07 20:52:09 +0200 |
commit | 715bbaf459b88575e11d90ec16bad3841bafd259 (patch) | |
tree | a253d4c40237c7f3c5decff833cf85ea0eafbe42 /engine/src/lib.rs | |
parent | 146635292369cc8a9660139d97cd9662025bd591 (diff) |
feat(engine): add ability to render triangles
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() |