diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-23 22:23:25 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-23 22:23:25 +0200 |
commit | 386aad9dac7c22cabb0f1bbba33d248c40bb0310 (patch) | |
tree | 1f4379ab50ffc85e9ad511b9fe9e9dd8a7f8c321 /engine/src/lib.rs | |
parent | fee2320189d6e758748a939c56d539043cbffde6 (diff) |
feat(engine): add perspective
Diffstat (limited to 'engine/src/lib.rs')
-rw-r--r-- | engine/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engine/src/lib.rs b/engine/src/lib.rs index dbbd407..ee93695 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -9,6 +9,7 @@ use crate::vector::Vec2; mod matrix; mod opengl; +mod projection; mod renderer; mod transform; @@ -93,7 +94,9 @@ impl Engine while !self.window.should_close() { func(self); - crate::renderer::render(self.objects.values()); + let window_size = self.window.size().map_err(Error::GetWindowSizeFailed)?; + + crate::renderer::render(self.objects.values(), &window_size); self.window .swap_buffers() @@ -123,4 +126,7 @@ pub enum Error #[error("Failed to update window")] UpdateWindowFailed(#[source] glfw::Error), + + #[error("Failed to get window size")] + GetWindowSizeFailed(#[source] glfw::Error), } |