mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 06:28:36 +00:00
ImGui: Add safe wrapper around igGetWindowSize
This commit is contained in:
parent
72ddc788b1
commit
d6897b1556
@ -384,6 +384,14 @@ impl<'a> Ui<'a> {
|
||||
// Window
|
||||
impl<'ui> Ui<'ui> {
|
||||
pub fn window<'p>(&self, name: &'p ImStr) -> Window<'ui, 'p> { Window::new(self, name) }
|
||||
/// Get current window's size in pixels
|
||||
pub fn get_window_size(&self) -> (f32, f32) {
|
||||
let mut out = ImVec2::new(0.0, 0.0);
|
||||
unsafe {
|
||||
sys::igGetWindowSize(&mut out as *mut ImVec2);
|
||||
}
|
||||
(out.x, out.y)
|
||||
}
|
||||
}
|
||||
|
||||
// Layout
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user