summaryrefslogtreecommitdiff
path: root/engine/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/lib.rs')
-rw-r--r--engine/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/engine/src/lib.rs b/engine/src/lib.rs
index 618bc75..ea74fd1 100644
--- a/engine/src/lib.rs
+++ b/engine/src/lib.rs
@@ -3,6 +3,8 @@
use glfw::Window;
pub use glfw::WindowSize;
+use crate::vector::Vec2;
+
mod renderer;
pub mod vector;
@@ -27,6 +29,10 @@ impl Engine
.make_context_current()
.map_err(Error::ConfigureWindowFailed)?;
+ window.set_framebuffer_size_callback(move |new_window_size| {
+ crate::renderer::set_viewport(&Vec2::ZERO, &new_window_size);
+ });
+
crate::renderer::initialize(&window).map_err(Error::InitializeRendererFailed)?;
Ok(Self { window })