Migration to winit 0.23

pull/112/head
Alex Komissarov 4 years ago
parent fb5c9fc8fe
commit d38731e472
No known key found for this signature in database
GPG Key ID: E7A6C70F46457C00

@ -14,10 +14,10 @@ image = "0.23"
log = "0.4"
tobj = "2.0"
wgpu = "0.6"
winit = "0.22"
winit = "0.23"
[build-dependencies]
anyhow = "1.0"
fs_extra = "1.2"
glob = "0.3"
shaderc = "0.6"
shaderc = "0.6"

@ -1,7 +1,7 @@
use cgmath::*;
use std::f32::consts::FRAC_PI_2;
use std::time::Duration;
use winit::dpi::LogicalPosition;
use winit::dpi::PhysicalPosition;
use winit::event::*;
#[rustfmt::skip]
@ -143,7 +143,7 @@ impl CameraController {
self.scroll = match delta {
// I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32,
MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
};
}

@ -15,11 +15,11 @@ log = "0.4"
rayon = "1.4" # NEW!
tobj = "2.0"
wgpu = "0.6"
winit = "0.22"
winit = "0.23"
[build-dependencies]
anyhow = "1.0"
fs_extra = "1.2"
glob = "0.3"
rayon = "1.4" # NEW!
shaderc = "0.6"
shaderc = "0.6"

@ -1,7 +1,7 @@
use cgmath::*;
use std::f32::consts::FRAC_PI_2;
use std::time::Duration;
use winit::dpi::LogicalPosition;
use winit::dpi::PhysicalPosition;
use winit::event::*;
#[rustfmt::skip]
@ -143,7 +143,7 @@ impl CameraController {
self.scroll = -match delta {
// I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32,
MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
};
}

@ -1,7 +1,7 @@
use cgmath::*;
use std::f32::consts::FRAC_PI_2;
use std::time::Duration;
use winit::dpi::LogicalPosition;
use winit::dpi::PhysicalPosition;
use winit::event::*;
#[cfg_attr(rustfmt, rustfmt_skip)]
@ -157,7 +157,7 @@ impl CameraController {
self.scroll = -match delta {
// I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32,
MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
};
}

@ -7,7 +7,7 @@ I've been putting this off for a while. Implementing a camera isn't specifically
```rust
use cgmath::*;
use winit::event::*;
use winit::dpi::LogicalPosition;
use winit::dpi::PhysicalPosition;
use std::time::Duration;
use std::f32::consts::FRAC_PI_2;
@ -184,7 +184,7 @@ impl CameraController {
self.scroll = -match delta {
// I'm assuming a line is about 100 pixels
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
MouseScrollDelta::PixelDelta(LogicalPosition {
MouseScrollDelta::PixelDelta(PhysicalPosition {
y: scroll,
..
}) => *scroll as f32,
@ -409,4 +409,4 @@ With that we should be able to move our camera wherever we want.
![./screenshot.png](./screenshot.png)
<AutoGithubLink/>
<AutoGithubLink/>

Loading…
Cancel
Save