diff --git a/src/gfx/context.rs b/src/gfx/context.rs index f10d8cc..3e8b6c6 100644 --- a/src/gfx/context.rs +++ b/src/gfx/context.rs @@ -68,4 +68,13 @@ impl Context { queue, } } + + pub fn resize(&mut self, new_size: PhysicalSize) { + if new_size.width > 0 && new_size.height > 0 { + self.size = new_size; + self.surface_config.width = new_size.width; + self.surface_config.height = new_size.height; + self.surface.configure(&self.device, &self.surface_config); + } + } }