Пример #1
0
        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;
Пример #3
0
 public ListClipper(int itemsCount, float itemsHeight = -1)
 {
     clipper = ImGuiNative.ImGuiListClipper_ImGuiListClipper(itemsCount, itemsHeight);
 }
Пример #4
0
 public abstract void ImGuiListClipper_ImGuiListClipper(ImGuiListClipper *self, int items_count, float items_height);
Пример #5
0
 public abstract byte ImGuiListClipper_Step(ImGuiListClipper *self);
Пример #6
0
 public abstract void ImGuiListClipper_End(ImGuiListClipper *self);
Пример #7
0
 public ListClipper(int itemsCount, float itemsHeight = -1)
 {
     clipper = (ImGuiListClipper *)Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ImGuiListClipper)));
     ImGuiNative.ImGuiListClipper_ImGuiListClipper(clipper, itemsCount, itemsHeight);
 }