pull/212/head
Rokonio 3 years ago committed by GitHub
parent 975c6b3502
commit 6f4b540330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -522,13 +522,15 @@ impl State {
}
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
self.projection.resize(new_size.width, new_size.height);
self.size = new_size;
self.sc_desc.width = new_size.width;
self.sc_desc.height = new_size.height;
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
self.depth_texture =
texture::Texture::create_depth_texture(&self.device, &self.sc_desc, "depth_texture");
if new_size.width > 0 && new_size.height > 0 {
self.projection.resize(new_size.width, new_size.height);
self.size = new_size;
self.sc_desc.width = new_size.width;
self.sc_desc.height = new_size.height;
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
self.depth_texture =
texture::Texture::create_depth_texture(&self.device, &self.sc_desc, "depth_texture");
}
}
fn input(&mut self, event: &DeviceEvent) -> bool {

Loading…
Cancel
Save