mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-16 06:12:55 +00:00
Migration to winit 0.23
This commit is contained in:
parent
fb5c9fc8fe
commit
d38731e472
@ -14,7 +14,7 @@ image = "0.23"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
tobj = "2.0"
|
tobj = "2.0"
|
||||||
wgpu = "0.6"
|
wgpu = "0.6"
|
||||||
winit = "0.22"
|
winit = "0.23"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use cgmath::*;
|
use cgmath::*;
|
||||||
use std::f32::consts::FRAC_PI_2;
|
use std::f32::consts::FRAC_PI_2;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use winit::dpi::LogicalPosition;
|
use winit::dpi::PhysicalPosition;
|
||||||
use winit::event::*;
|
use winit::event::*;
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
@ -143,7 +143,7 @@ impl CameraController {
|
|||||||
self.scroll = match delta {
|
self.scroll = match delta {
|
||||||
// I'm assuming a line is about 100 pixels
|
// I'm assuming a line is about 100 pixels
|
||||||
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
||||||
MouseScrollDelta::PixelDelta(LogicalPosition { y: scroll, .. }) => *scroll as f32,
|
MouseScrollDelta::PixelDelta(PhysicalPosition { y: scroll, .. }) => *scroll as f32,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ log = "0.4"
|
|||||||
rayon = "1.4" # NEW!
|
rayon = "1.4" # NEW!
|
||||||
tobj = "2.0"
|
tobj = "2.0"
|
||||||
wgpu = "0.6"
|
wgpu = "0.6"
|
||||||
winit = "0.22"
|
winit = "0.23"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use cgmath::*;
|
use cgmath::*;
|
||||||
use std::f32::consts::FRAC_PI_2;
|
use std::f32::consts::FRAC_PI_2;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use winit::dpi::LogicalPosition;
|
use winit::dpi::PhysicalPosition;
|
||||||
use winit::event::*;
|
use winit::event::*;
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
@ -143,7 +143,7 @@ impl CameraController {
|
|||||||
self.scroll = -match delta {
|
self.scroll = -match delta {
|
||||||
// I'm assuming a line is about 100 pixels
|
// I'm assuming a line is about 100 pixels
|
||||||
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
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 cgmath::*;
|
||||||
use std::f32::consts::FRAC_PI_2;
|
use std::f32::consts::FRAC_PI_2;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use winit::dpi::LogicalPosition;
|
use winit::dpi::PhysicalPosition;
|
||||||
use winit::event::*;
|
use winit::event::*;
|
||||||
|
|
||||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||||
@ -157,7 +157,7 @@ impl CameraController {
|
|||||||
self.scroll = -match delta {
|
self.scroll = -match delta {
|
||||||
// I'm assuming a line is about 100 pixels
|
// I'm assuming a line is about 100 pixels
|
||||||
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
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
|
```rust
|
||||||
use cgmath::*;
|
use cgmath::*;
|
||||||
use winit::event::*;
|
use winit::event::*;
|
||||||
use winit::dpi::LogicalPosition;
|
use winit::dpi::PhysicalPosition;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::f32::consts::FRAC_PI_2;
|
use std::f32::consts::FRAC_PI_2;
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ impl CameraController {
|
|||||||
self.scroll = -match delta {
|
self.scroll = -match delta {
|
||||||
// I'm assuming a line is about 100 pixels
|
// I'm assuming a line is about 100 pixels
|
||||||
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
MouseScrollDelta::LineDelta(_, scroll) => scroll * 100.0,
|
||||||
MouseScrollDelta::PixelDelta(LogicalPosition {
|
MouseScrollDelta::PixelDelta(PhysicalPosition {
|
||||||
y: scroll,
|
y: scroll,
|
||||||
..
|
..
|
||||||
}) => *scroll as f32,
|
}) => *scroll as f32,
|
||||||
|
Loading…
Reference in New Issue
Block a user