mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 22:48:34 +00:00
Adapt to latest cimgui function names
This commit is contained in:
parent
290429bd12
commit
41ac160bd8
@ -62,7 +62,7 @@ impl<'ui, 'p> PlotLines<'ui, 'p> {
|
||||
|
||||
pub fn build(self) {
|
||||
unsafe {
|
||||
sys::igPlotLines(
|
||||
sys::igPlotLinesFloatPtr(
|
||||
self.label.as_ptr(),
|
||||
self.values.as_ptr() as *const c_float,
|
||||
self.values.len() as i32,
|
||||
|
||||
@ -58,7 +58,7 @@ impl<'ui> Ui<'ui> {
|
||||
/// color.pop(&ui);
|
||||
/// ```
|
||||
pub fn push_style_color(&self, style_color: StyleColor, color: [f32; 4]) -> ColorStackToken {
|
||||
unsafe { sys::igPushStyleColor(style_color as i32, color.into()) };
|
||||
unsafe { sys::igPushStyleColorVec4(style_color as i32, color.into()) };
|
||||
ColorStackToken {
|
||||
count: 1,
|
||||
ctx: self.ctx,
|
||||
@ -90,7 +90,7 @@ impl<'ui> Ui<'ui> {
|
||||
{
|
||||
let mut count = 0;
|
||||
for &(style_color, color) in style_colors {
|
||||
unsafe { sys::igPushStyleColor(style_color as i32, color.into()) };
|
||||
unsafe { sys::igPushStyleColorVec4(style_color as i32, color.into()) };
|
||||
count += 1;
|
||||
}
|
||||
ColorStackToken {
|
||||
@ -387,7 +387,7 @@ impl<'ui> Ui<'ui> {
|
||||
Id::Str(s) => {
|
||||
let start = s.as_ptr() as *const c_char;
|
||||
let end = start.add(s.len());
|
||||
sys::igPushIDRange(start, end)
|
||||
sys::igPushIDStrStr(start, end)
|
||||
}
|
||||
Id::Ptr(p) => sys::igPushIDPtr(p as *const c_void),
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ impl<'ui> Ui<'ui> {
|
||||
impl<'ui> Ui<'ui> {
|
||||
/// Returns `true` if the rectangle (of given size, starting from cursor position) is visible
|
||||
pub fn is_cursor_rect_visible(&self, size: [f32; 2]) -> bool {
|
||||
unsafe { sys::igIsRectVisible(size.into()) }
|
||||
unsafe { sys::igIsRectVisibleNil(size.into()) }
|
||||
}
|
||||
/// Returns `true` if the rectangle (in screen coordinates) is visible
|
||||
pub fn is_rect_visible(&self, rect_min: [f32; 2], rect_max: [f32; 2]) -> bool {
|
||||
|
||||
@ -108,7 +108,7 @@ impl<'a> Selectable<'a> {
|
||||
/// Returns true if the selectable was clicked.
|
||||
pub fn build(self, _: &Ui) -> bool {
|
||||
unsafe {
|
||||
sys::igSelectable(
|
||||
sys::igSelectableBool(
|
||||
self.label.as_ptr(),
|
||||
self.selected,
|
||||
self.flags.bits() as i32,
|
||||
|
||||
@ -388,7 +388,9 @@ impl<'a> CollapsingHeader<'a> {
|
||||
/// Returns true if the collapsing header is open and content should be rendered.
|
||||
#[must_use]
|
||||
pub fn build(self, _: &Ui) -> bool {
|
||||
unsafe { sys::igCollapsingHeader(self.label.as_ptr(), self.flags.bits() as i32) }
|
||||
unsafe {
|
||||
sys::igCollapsingHeaderTreeNodeFlags(self.label.as_ptr(), self.flags.bits() as i32)
|
||||
}
|
||||
}
|
||||
/// Builds the collapsing header, and adds an additional close button that changes the value of
|
||||
/// the given mutable reference when clicked.
|
||||
|
||||
@ -261,7 +261,7 @@ impl<'a> ChildWindow<'a> {
|
||||
Id::Str(s) => {
|
||||
let start = s.as_ptr() as *const c_char;
|
||||
let end = start.add(s.len());
|
||||
sys::igGetIDRange(start, end)
|
||||
sys::igGetIDStrStr(start, end)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -222,7 +222,7 @@ impl<'ui> WindowDrawList<'ui> {
|
||||
unsafe {
|
||||
let start = text.as_ptr() as *const c_char;
|
||||
let end = (start as usize + text.len()) as *const c_char;
|
||||
sys::ImDrawList_AddText(self.draw_list, pos.into(), col.into().into(), start, end)
|
||||
sys::ImDrawList_AddTextVec2(self.draw_list, pos.into(), col.into().into(), start, end)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user