From e39ab4249e0861f56b6b8d040b50fa55fe7b88e3 Mon Sep 17 00:00:00 2001 From: dbr Date: Mon, 13 Sep 2021 14:42:44 +1000 Subject: [PATCH] Change structs to match imgui 1.84 Also change oddly-specific test to avoid having to change it every update --- imgui/src/fonts/atlas.rs | 1 + imgui/src/fonts/font.rs | 1 + imgui/src/io.rs | 1 + imgui/src/lib.rs | 2 +- imgui/src/style.rs | 2 ++ 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/imgui/src/fonts/atlas.rs b/imgui/src/fonts/atlas.rs index 537e4d1..6f12e56 100644 --- a/imgui/src/fonts/atlas.rs +++ b/imgui/src/fonts/atlas.rs @@ -48,6 +48,7 @@ pub struct FontAtlas { pub tex_glyph_padding: i32, locked: bool, + text_ready: bool, tex_pixels_use_colors: bool, tex_pixels_alpha8: *mut u8, tex_pixels_rgba32: *mut u32, diff --git a/imgui/src/fonts/font.rs b/imgui/src/fonts/font.rs index fcb3317..b60da86 100644 --- a/imgui/src/fonts/font.rs +++ b/imgui/src/fonts/font.rs @@ -19,6 +19,7 @@ pub struct Font { pub config_data_count: i16, pub fallback_char: sys::ImWchar, pub ellipsis_char: sys::ImWchar, + pub dot_char: sys::ImWchar, pub dirty_lookup_tables: bool, pub scale: f32, pub ascent: f32, diff --git a/imgui/src/io.rs b/imgui/src/io.rs index 648c9fc..cc01ba1 100644 --- a/imgui/src/io.rs +++ b/imgui/src/io.rs @@ -292,6 +292,7 @@ pub struct Io { pub mouse_delta: [f32; 2], key_mods: sys::ImGuiKeyModFlags, + key_mods_prev: sys::ImGuiKeyModFlags, mouse_pos_prev: [f32; 2], mouse_clicked_pos: [[f32; 2]; 5], mouse_clicked_time: [f64; 5], diff --git a/imgui/src/lib.rs b/imgui/src/lib.rs index f53a12f..a890733 100644 --- a/imgui/src/lib.rs +++ b/imgui/src/lib.rs @@ -96,7 +96,7 @@ pub fn dear_imgui_version() -> &'static str { #[test] fn test_version() { // TODO: what's the point of this test? - assert_eq!(dear_imgui_version(), "1.82"); + assert!(dear_imgui_version().starts_with("1.")); } impl Context { diff --git a/imgui/src/style.rs b/imgui/src/style.rs index 11ad1d8..a0f1d18 100644 --- a/imgui/src/style.rs +++ b/imgui/src/style.rs @@ -10,6 +10,8 @@ use crate::Direction; pub struct Style { /// Global alpha applies to everything pub alpha: f32, + /// Additional alpha multiplier applied to disabled elements. Multiplies over current value of [`Style::alpha`]. + pub disabled_alpha: f32, /// Padding within a window pub window_padding: [f32; 2], /// Rounding radius of window corners.