Skip to content

Commit

Permalink
Update winit to 0.25 (#168)
Browse files Browse the repository at this point in the history
- Update winit
- Update egui_winit_platform
- Update imgui_winit_support
- Fix hyperlink and resize in `egui-winit` example
  • Loading branch information
parasyte committed May 29, 2021
1 parent 355448a commit b76ae1f
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -27,7 +27,7 @@ wgpu = "0.8.1"

[dev-dependencies]
pixels-mocks = { path = "internals/pixels-mocks" }
winit = "0.24"
winit = "0.25"

[workspace]
resolver = "2"
Expand Down
4 changes: 2 additions & 2 deletions examples/conway/Cargo.toml
Expand Up @@ -17,5 +17,5 @@ line_drawing = "0.8"
log = "0.4"
pixels = { path = "../.." }
randomize = "3.0"
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"
4 changes: 2 additions & 2 deletions examples/custom-shader/Cargo.toml
Expand Up @@ -13,5 +13,5 @@ default = ["optimize"]
env_logger = "0.8"
log = "0.4"
pixels = { path = "../.." }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"
10 changes: 7 additions & 3 deletions examples/egui-winit/Cargo.toml
Expand Up @@ -12,9 +12,13 @@ default = ["optimize"]
[dependencies]
egui = "0.12"
egui_wgpu_backend = "0.8"
egui_winit_platform = "0.7"
env_logger = "0.8"
log = "0.4"
pixels = { path = "../.." }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"

[dependencies.egui_winit_platform]
git = "https://github.com/hasenbanck/egui_winit_platform.git"
rev = "9fd92782d8de22d7882168d7b5ae7a2eb02448d9"
features = ["webbrowser"]
22 changes: 19 additions & 3 deletions examples/egui-winit/src/gui.rs
Expand Up @@ -46,13 +46,29 @@ impl Gui {

/// Handle input events from the window manager.
pub(crate) fn handle_event(&mut self, event: &winit::event::Event<'_, ()>) {
self.platform.handle_event(event);
use winit::dpi::PhysicalSize;
use winit::event::Event::WindowEvent;
use winit::event::WindowEvent::Resized;

match &event {
WindowEvent {
event:
Resized(PhysicalSize {
width: 0,
height: 0,
}),
..
} => (),
_ => self.platform.handle_event(event),
}
}

/// Resize egui.
pub(crate) fn resize(&mut self, width: u32, height: u32) {
self.screen_descriptor.physical_width = width;
self.screen_descriptor.physical_height = height;
if width > 0 && height > 0 {
self.screen_descriptor.physical_width = width;
self.screen_descriptor.physical_height = height;
}
}

/// Update scaling factor.
Expand Down
6 changes: 3 additions & 3 deletions examples/imgui-winit/Cargo.toml
Expand Up @@ -13,8 +13,8 @@ default = ["optimize"]
env_logger = "0.8"
imgui = "0.7"
imgui-wgpu = "0.15.1"
imgui-winit-support = "0.7"
imgui-winit-support = { version = "0.7.1", default-features = false, features = ["winit-25"] }
log = "0.4"
pixels = { path = "../.." }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"
4 changes: 2 additions & 2 deletions examples/invaders/Cargo.toml
Expand Up @@ -18,5 +18,5 @@ log = "0.4"
pixels = { path = "../.." }
randomize = "3.0"
simple-invaders = { path = "simple-invaders" }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"
4 changes: 2 additions & 2 deletions examples/minimal-winit/Cargo.toml
Expand Up @@ -13,5 +13,5 @@ default = ["optimize"]
env_logger = "0.8"
log = "0.4"
pixels = { path = "../.." }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"
4 changes: 2 additions & 2 deletions examples/raqote-winit/Cargo.toml
Expand Up @@ -15,5 +15,5 @@ euclid = "0.22"
log = "0.4"
pixels = { path = "../.." }
raqote = { git = "https://github.com/jrmuizel/raqote.git", rev = "74f0afa2be54561c1a9928e885ab95e8a4c5322d", default-features = false }
winit = "0.24"
winit_input_helper = "0.9"
winit = "0.25"
winit_input_helper = "0.10"

0 comments on commit b76ae1f

Please sign in to comment.