summaryrefslogtreecommitdiff
path: root/engine/src/lib.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-10-23 22:23:25 +0200
committerHampusM <hampus@hampusmat.com>2023-10-23 22:23:25 +0200
commit386aad9dac7c22cabb0f1bbba33d248c40bb0310 (patch)
tree1f4379ab50ffc85e9ad511b9fe9e9dd8a7f8c321 /engine/src/lib.rs
parentfee2320189d6e758748a939c56d539043cbffde6 (diff)
feat(engine): add perspective
Diffstat (limited to 'engine/src/lib.rs')
-rw-r--r--engine/src/lib.rs8
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),
}