mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-15 23:48:31 +00:00
Add ImGuiListClipper functions to imgui-sys
This commit is contained in:
parent
4f94557a3e
commit
792f95979c
@ -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")
|
||||
|
||||
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user