From 0d10358942409cf8fad6fcb730dbedfbd7149df7 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Mon, 26 Mar 2018 16:10:47 +0900 Subject: [PATCH] imgui: Add get_window_width, get_window_height helper functions --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 7bee4ba..bbc23d2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -392,6 +392,18 @@ impl<'ui> Ui<'ui> { } (out.x, out.y) } + /// Get current window's width in pixels + pub fn get_window_width(&self) -> f32 { + unsafe { + sys::igGetWindowWidth() + } + } + /// Get current window's height in pixels + pub fn get_window_height(&self) -> f32 { + unsafe { + sys::igGetWindowHeight() + } + } } // Layout