From 8dea2edcfaf8858fde82c73c040acda4314abfbf Mon Sep 17 00:00:00 2001 From: Jack Mac Date: Mon, 21 Feb 2022 18:01:27 -0500 Subject: [PATCH] init. copying other work --- imgui-examples/Cargo.toml | 2 +- imgui-glium-renderer/Cargo.toml | 2 +- imgui-glow-renderer/Cargo.toml | 2 +- imgui-winit-support/Cargo.toml | 2 +- imgui-winit-support/src/lib.rs | 20 +++++++++++--------- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/imgui-examples/Cargo.toml b/imgui-examples/Cargo.toml index 87950d2..0f2fba6 100644 --- a/imgui-examples/Cargo.toml +++ b/imgui-examples/Cargo.toml @@ -11,7 +11,7 @@ publish = false [dev-dependencies] clipboard = "0.5" -glium = { version = "0.30", default-features = true } +glium = { version = "0.31", default-features = true } image = "0.23" imgui = { path = "../imgui", features = ["tables-api"] } imgui-glium-renderer = { path = "../imgui-glium-renderer" } diff --git a/imgui-glium-renderer/Cargo.toml b/imgui-glium-renderer/Cargo.toml index 68134f6..574b93a 100644 --- a/imgui-glium-renderer/Cargo.toml +++ b/imgui-glium-renderer/Cargo.toml @@ -10,5 +10,5 @@ license = "MIT/Apache-2.0" categories = ["gui", "rendering"] [dependencies] -glium = { version = "0.30", default-features = false } +glium = { version = "0.31", default-features = false } imgui = { version = "0.8.1-alpha.0", path = "../imgui" } diff --git a/imgui-glow-renderer/Cargo.toml b/imgui-glow-renderer/Cargo.toml index 3fbc013..a0df2bd 100644 --- a/imgui-glow-renderer/Cargo.toml +++ b/imgui-glow-renderer/Cargo.toml @@ -15,7 +15,7 @@ glow = "0.10.0" memoffset = "0.6.4" [dev-dependencies] -glutin = "0.27.0" +glutin = "0.28.0" imgui-winit-support = { version = "0.8.1-alpha.0", path = "../imgui-winit-support" } image = "0.23" diff --git a/imgui-winit-support/Cargo.toml b/imgui-winit-support/Cargo.toml index 668a946..e105b0e 100644 --- a/imgui-winit-support/Cargo.toml +++ b/imgui-winit-support/Cargo.toml @@ -20,7 +20,7 @@ winit-25 = { version = "0.25", package = "winit", default-features = false, opti winit-26 = { version = "0.26", package = "winit", default-features = false, optional = true } [features] -default = ["winit-25/default"] +default = ["winit-26/default"] test = ["winit-23/default", "winit-24/default", "winit-25/default", "winit-26/default"] # This is phrased as a negative (unlike most features) so that it needs to be diff --git a/imgui-winit-support/src/lib.rs b/imgui-winit-support/src/lib.rs index 72f9689..46ffb17 100644 --- a/imgui-winit-support/src/lib.rs +++ b/imgui-winit-support/src/lib.rs @@ -79,9 +79,10 @@ //! //! The following versions are supported, controlled by the listed feature. //! -//! - The `winit-25` feature uses winit versions compatible with `0.25`. This is +//! - The `winit-26` feature uses winit versions compatible with `0.26`. This is //! on by default, so to use any other version you need to disable this crates //! default features. +//! - The `winit-25` feature supports winit versions `0.25`. //! - The `winit-24` feature supports winit versions `0.24`. //! - The `winit-23` feature uses winit versions compatible with `0.23`. //! - The `winit-22` feature uses winit versions compatible with `0.22`. @@ -95,7 +96,7 @@ //! feature, fixing the configuration, or disabling `debug_assertions`. //! //! Conversely, if no `winit-*` features are enabled, we will fail to compile. -//! This is not an issue generally, as by default we turn on `winit-25`. +//! This is not an issue generally, as by default we turn on `winit-26`. //! //! All of this is in attempt to preserve the additive nature of features (while //! still helping users notice project configuration issues), however it's done @@ -245,7 +246,8 @@ fn check_multiple_winits() { if cfg!(any(not(debug_assertions), feature = "no-warn-on-multiple")) { return; } - let winits_enabled = cfg!(feature = "winit-25") as usize + let winits_enabled = cfg!(feature = "winit-26") as usize + + cfg!(feature = "winit-25") as usize + cfg!(feature = "winit-24") as usize + cfg!(feature = "winit-23") as usize + cfg!(feature = "winit-22") as usize @@ -274,8 +276,8 @@ fn check_multiple_winits() { (this likely indicates misconfiguration, see documentation for details)." ); let feats = [ - ("winit-26", cfg!(feature = "winit-26"), ""), - ("winit-25", cfg!(feature = "winit-25"), " (default)"), + ("winit-26", cfg!(feature = "winit-26"), " (default)"), + ("winit-25", cfg!(feature = "winit-25"), ""), ("winit-24", cfg!(feature = "winit-24"), ""), ("winit-23", cfg!(feature = "winit-23"), ""), ("winit-22", cfg!(feature = "winit-22"), ""), @@ -535,7 +537,7 @@ impl WinitPlatform { self.hidpi_mode = hidpi_mode; self.hidpi_factor = hidpi_factor; io.display_framebuffer_scale = [hidpi_factor as f32, hidpi_factor as f32]; - let logical_size = window.inner_size().to_logical(window.scale_factor()); + let logical_size = window.inner_size().to_logical(hidpi_factor); let logical_size = self.scale_size_from_winit(window, logical_size); io.display_size = [logical_size.width as f32, logical_size.height as f32]; } @@ -976,7 +978,7 @@ impl WinitPlatform { self.hidpi_factor = hidpi_factor; io.display_framebuffer_scale = [hidpi_factor as f32, hidpi_factor as f32]; // Window size might change too if we are using DPI rounding - let logical_size = window.inner_size().to_logical(window.scale_factor()); + let logical_size = window.inner_size().to_logical(scale_factor); let logical_size = self.scale_size_from_winit(window, logical_size); io.display_size = [logical_size.width as f32, logical_size.height as f32]; } @@ -1084,7 +1086,7 @@ impl WinitPlatform { self.hidpi_factor = hidpi_factor; io.display_framebuffer_scale = [hidpi_factor as f32, hidpi_factor as f32]; // Window size might change too if we are using DPI rounding - let logical_size = window.inner_size().to_logical(window.scale_factor()); + let logical_size = window.inner_size().to_logical(scale_factor); let logical_size = self.scale_size_from_winit(window, logical_size); io.display_size = [logical_size.width as f32, logical_size.height as f32]; } @@ -1246,4 +1248,4 @@ impl WinitPlatform { } } } -} +} \ No newline at end of file