From d62845f4c2cfc8eb05d19ec7a9688d015ec558da Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Wed, 19 Sep 2018 08:36:23 +0900 Subject: [PATCH 1/2] [ImGui] Wrap igGetWindowPos --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9b78d17..08d86bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -604,6 +604,14 @@ impl<'ui> Ui<'ui> { } (out.x, out.y) } + /// Get current window's position in pixels + pub fn get_window_pos(&self) -> (f32, f32) { + let mut out = ImVec2::new(0.0, 0.0); + unsafe { + sys::igGetWindowPos(&mut out); + } + (out.x, out.y) + } } // Layout From a893f3e6658a10d8f945115af47ea525304fe483 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Wed, 19 Sep 2018 09:27:59 +0900 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 9b13d9f..2e66d07 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -5,6 +5,10 @@ ### Added - `ImGui::mouse_down` +- `Ui::get_window_pos` +- `Ui::is_window_focused` +- `Ui::is_root_window_focused` +- `Ui::is_child_window_focused` - `imgui-glutin-support` crate ### Changed