Add window surface resizing function
This commit is contained in:
parent
ae298d8ca2
commit
8c53a2d7b7
|
@ -68,4 +68,13 @@ impl Context {
|
|||
queue,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn resize(&mut self, new_size: PhysicalSize<u32>) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue