Add ImGuiListClipper functions to imgui-sys

This commit is contained in:
Joonas Javanainen 2017-06-17 14:53:06 +03:00
parent 4f94557a3e
commit 792f95979c
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
2 changed files with 24 additions and 1 deletions

View File

@ -6,6 +6,7 @@ fn main() {
.file("third-party/cimgui/cimgui/cimgui.cpp")
.file("third-party/cimgui/cimgui/fontAtlas.cpp")
.file("third-party/cimgui/cimgui/drawList.cpp")
.file("third-party/cimgui/cimgui/listClipper.cpp")
.file("third-party/cimgui/imgui/imgui.cpp")
.file("third-party/cimgui/imgui/imgui_demo.cpp")
.file("third-party/cimgui/imgui/imgui_draw.cpp")

View File

@ -559,7 +559,7 @@ pub struct ImColor {
}
#[repr(C)]
#[derive(Copy, Clone, Debug, Default)]
#[derive(Copy, Clone, Debug)]
pub struct ImGuiListClipper {
pub start_pos_y: c_float,
pub items_height: c_float,
@ -569,6 +569,19 @@ pub struct ImGuiListClipper {
pub display_end: c_int,
}
impl Default for ImGuiListClipper {
fn default() -> ImGuiListClipper {
ImGuiListClipper {
start_pos_y: 0.0,
items_height: -1.0,
items_count: -1,
step_no: 0,
display_start: 0,
display_end: 0,
}
}
}
pub type ImDrawCallback = Option<extern "C" fn(parent_list: *const ImDrawList,
cmd: *const ImDrawCmd)>;
@ -1672,6 +1685,15 @@ extern "C" {
pub fn ImDrawList_UpdateTextureID(list: *mut ImDrawList);
}
// ImGuiListClipper
extern "C" {
pub fn ImGuiListClipper_Begin(clipper: *mut ImGuiListClipper, count: c_int, items_height: c_float);
pub fn ImGuiListClipper_End(clipper: *mut ImGuiListClipper);
pub fn ImGuiListClipper_Step(clipper: *mut ImGuiListClipper) -> bool;
pub fn ImGuiListClipper_GetDisplayStart(clipper: *mut ImGuiListClipper) -> c_int;
pub fn ImGuiListClipper_GetDisplayEnd(clipper: *mut ImGuiListClipper) -> c_int;
}
// Although this test is sensitive to ImGui updates, it's useful to reveal potential
// alignment errors
#[test]