Merge pull request #1139 from thenlevy/fix_wgpu_integration

Fix wgpu integration example
This commit is contained in:
Héctor Ramón 2022-09-26 16:02:27 +02:00 committed by GitHub
commit 4aea743999
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,12 +157,7 @@ pub fn main() {
WindowEvent::ModifiersChanged(new_modifiers) => {
modifiers = new_modifiers;
}
WindowEvent::Resized(new_size) => {
viewport = Viewport::with_physical_size(
Size::new(new_size.width, new_size.height),
window.scale_factor(),
);
WindowEvent::Resized(_) => {
resized = true;
}
WindowEvent::CloseRequested => {
@ -205,6 +200,11 @@ pub fn main() {
if resized {
let size = window.inner_size();
viewport = Viewport::with_physical_size(
Size::new(size.width, size.height),
window.scale_factor(),
);
surface.configure(
&device,
&wgpu::SurfaceConfiguration {