Merge pull request #37 from bitshifter/small_additions

Small additions
This commit is contained in:
Joonas Javanainen 2017-01-01 13:12:30 +02:00 committed by GitHub
commit e60e5161c5
2 changed files with 12 additions and 0 deletions

View File

@ -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 {

View File

@ -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