Skip to content

Commit

Permalink
Update to winit 0.27.2, glutin 0.29.0, glium 0.32 (emilk#1914)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Aug 14, 2022
1 parent 38a67f8 commit 923b67e
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 161 deletions.
444 changes: 298 additions & 146 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions eframe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ wgpu = { version = "0.13", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dark-light = { version = "0.2.1", optional = true }
egui-winit = { version = "0.18.0", path = "../egui-winit", default-features = false, features = ["clipboard", "links"] }
glutin = { version = "0.28.0" }
winit = "0.26.1"
glutin = { version = "0.29.0" }
winit = "0.27.2"

# optional native:
puffin = { version = "0.13", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ mod glow_integration {
native_options: &epi::NativeOptions,
app_creator: epi::AppCreator,
) {
let event_loop = EventLoop::with_user_event();
let event_loop = glutin::event_loop::EventLoopBuilder::with_user_event().build();
let glow_eframe = GlowWinitApp::new(&event_loop, app_name, native_options, app_creator);

if native_options.run_and_return {
Expand Down Expand Up @@ -682,7 +682,7 @@ mod wgpu_integration {
native_options: &epi::NativeOptions,
app_creator: epi::AppCreator,
) {
let event_loop = EventLoop::with_user_event();
let event_loop = winit::event_loop::EventLoopBuilder::with_user_event().build();
let wgpu_eframe = WgpuWinitApp::new(&event_loop, app_name, native_options, app_creator);

if native_options.run_and_return {
Expand Down
2 changes: 1 addition & 1 deletion egui-wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ wgpu = "0.13"
document-features = { version = "0.2", optional = true }

pollster = { version = "0.2", optional = true }
winit = { version = "0.26", optional = true }
winit = { version = "0.27.2", optional = true }
2 changes: 1 addition & 1 deletion egui-winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ egui = { version = "0.18.0", path = "../egui", default-features = false, feature
] }
instant = { version = "0.1", features = ["wasm-bindgen"] } # We use instant so we can (maybe) compile for web
tracing = { version = "0.1", default-features = false, features = ["std"] }
winit = "0.26.1"
winit = "0.27.2"

#! ### Optional dependencies
arboard = { version = "2.1", optional = true, default-features = false }
Expand Down
4 changes: 1 addition & 3 deletions egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl State {
}

fn on_mouse_wheel(&mut self, delta: winit::event::MouseScrollDelta) {
let mut delta = match delta {
let delta = match delta {
winit::event::MouseScrollDelta::LineDelta(x, y) => {
let points_per_scroll_line = 50.0; // Scroll speed decided by consensus: https://github.com/emilk/egui/issues/461
egui::vec2(x, y) * points_per_scroll_line
Expand All @@ -410,8 +410,6 @@ impl State {
}
};

delta.x *= -1.0; // Winit has inverted hscroll. Remove this line when we update winit after https://github.com/rust-windowing/winit/pull/2105 is merged and released

if self.egui_input.modifiers.ctrl || self.egui_input.modifiers.command {
// Treat as zoom instead:
let factor = (delta.y / 200.0).exp();
Expand Down
2 changes: 1 addition & 1 deletion egui-winit/src/window_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pub struct WindowSettings {
/// Position of window in physical pixels. This is either
/// the inner or outer position depending on the platform.
/// See [`winit::window::WindowAttributes`] for details.
/// See [`winit::window::WindowBuilder::with_position`] for details.
position: Option<egui::Pos2>,

fullscreen: bool,
Expand Down
2 changes: 1 addition & 1 deletion egui_glium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ egui-winit = { version = "0.18.0", path = "../egui-winit", default-features = fa

ahash = "0.7"
bytemuck = "1.7"
glium = "0.31"
glium = "0.32"

#! ### Optional dependencies
## Enable this when generating docs.
Expand Down
2 changes: 1 addition & 1 deletion egui_glium/examples/native_texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use glium::glutin;

fn main() {
let event_loop = glutin::event_loop::EventLoop::with_user_event();
let event_loop = glutin::event_loop::EventLoopBuilder::with_user_event().build();
let display = create_display(&event_loop);

let mut egui_glium = egui_glium::EguiGlium::new(&display, &event_loop);
Expand Down
2 changes: 1 addition & 1 deletion egui_glium/examples/pure_glium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use glium::glutin;

fn main() {
let event_loop = glutin::event_loop::EventLoop::with_user_event();
let event_loop = glutin::event_loop::EventLoopBuilder::with_user_event().build();
let display = create_display(&event_loop);

let mut egui_glium = egui_glium::EguiGlium::new(&display, &event_loop);
Expand Down
2 changes: 1 addition & 1 deletion egui_glow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ wasm-bindgen = { version = "0.2" }


[dev-dependencies]
glutin = "0.28.0" # examples/pure_glow
glutin = "0.29.0" # examples/pure_glow


[[example]]
Expand Down
2 changes: 1 addition & 1 deletion egui_glow/examples/pure_glow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
fn main() {
let mut clear_color = [0.1, 0.1, 0.1];

let event_loop = glutin::event_loop::EventLoop::with_user_event();
let event_loop = glutin::event_loop::EventLoopBuilder::with_user_event().build();
let (gl_window, gl) = create_display(&event_loop);
let gl = std::sync::Arc::new(gl);

Expand Down

0 comments on commit 923b67e

Please sign in to comment.