diff --git a/imgui-sys/src/lib.rs b/imgui-sys/src/lib.rs index fe87031..108b4e8 100644 --- a/imgui-sys/src/lib.rs +++ b/imgui-sys/src/lib.rs @@ -321,6 +321,12 @@ impl ImVec2 { y: y as c_float, } } + pub fn zero() -> ImVec2 { + ImVec2 { + x: 0.0 as c_float, + y: 0.0 as c_float, + } + } } impl From<[f32; 2]> for ImVec2 { diff --git a/src/lib.rs b/src/lib.rs index 2863c11..c38281e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -478,6 +478,9 @@ impl<'ui> Ui<'ui> { imgui_sys::igBulletText(fmt_ptr(), text.as_ptr()); } } + pub fn button<'p>(&self, label: ImStr<'p>, size: ImVec2) -> bool { + unsafe { imgui_sys::igButton(label.as_ptr(), size) } + } pub fn small_button<'p>(&self, label: ImStr<'p>) -> bool { unsafe { imgui_sys::igSmallButton(label.as_ptr()) } } @@ -616,6 +619,9 @@ impl<'ui> Ui<'ui> { unsafe { imgui_sys::igEndPopup() }; } } + pub fn close_current_popup(&self) { + unsafe { imgui_sys::igCloseCurrentPopup() }; + } } // Widgets: Combos