public unsafe void Draw() { if (Core.Scene.Entities.Count > MIN_ENTITIES_FOR_CLIPPER) { ImGuiListClipper * clipperPtr = ImGuiNative.ImGuiListClipper_ImGuiListClipper(Core.Scene.Entities.Count, -1); ImGuiListClipperPtr clipper = new ImGuiListClipperPtr(clipperPtr); while (clipper.Step()) { for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) { DrawEntity(Core.Scene.Entities[i]); } } ImGuiNative.ImGuiListClipper_destroy(clipperPtr); } else { for (int i = 0; i < Core.Scene.Entities.Count; i++) { DrawEntity(Core.Scene.Entities[i]); } } NezImGui.MediumVerticalSpace(); if (NezImGui.CenteredButton("Create Entity", 0.6f)) { ImGui.OpenPopup("create-entity"); } DrawCreateEntityPopup(); }
public ImGuiListClipperPtr(ImGuiListClipper *nativePtr) => NativePtr = nativePtr;
public ListClipper(int itemsCount, float itemsHeight = -1) { clipper = ImGuiNative.ImGuiListClipper_ImGuiListClipper(itemsCount, itemsHeight); }
public abstract void ImGuiListClipper_ImGuiListClipper(ImGuiListClipper *self, int items_count, float items_height);
public abstract byte ImGuiListClipper_Step(ImGuiListClipper *self);
public abstract void ImGuiListClipper_End(ImGuiListClipper *self);
public ListClipper(int itemsCount, float itemsHeight = -1) { clipper = (ImGuiListClipper *)Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ImGuiListClipper))); ImGuiNative.ImGuiListClipper_ImGuiListClipper(clipper, itemsCount, itemsHeight); }