mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-04 06:00:47 +00:00
Fixing #200
This commit is contained in:
parent
0a403411bf
commit
7f5dbe7245
@ -268,12 +268,14 @@ impl State {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
|
pub fn resize(&mut self, new_size: winit::dpi::PhysicalSize<u32>) {
|
||||||
|
if new_size.width > 0 && new_size.height > 0 {
|
||||||
self.size = new_size;
|
self.size = new_size;
|
||||||
self.sc_desc.width = new_size.width;
|
self.sc_desc.width = new_size.width;
|
||||||
self.sc_desc.height = new_size.height;
|
self.sc_desc.height = new_size.height;
|
||||||
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
|
self.swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn input(&mut self, event: &WindowEvent) -> bool {
|
fn input(&mut self, event: &WindowEvent) -> bool {
|
||||||
match event {
|
match event {
|
||||||
|
Loading…
Reference in New Issue
Block a user