Skip to content

Commit a51c982

Browse files
authored
Merge pull request #427 from ImGuiNET/f/upgrade-18990
Ugrade to imgui.net 1.89.9
2 parents 0ea06bb + ab30115 commit a51c982

File tree

18 files changed

+2008
-1659
lines changed

18 files changed

+2008
-1659
lines changed

deps/cimgui/linux-x64/cimgui.so

9.13 KB
Binary file not shown.

deps/cimgui/osx/cimgui.dylib

33.2 KB
Binary file not shown.

deps/cimgui/win-arm64/cimgui.dll

3 KB
Binary file not shown.

deps/cimgui/win-x64/cimgui.dll

5 KB
Binary file not shown.

deps/cimgui/win-x86/cimgui.dll

6 KB
Binary file not shown.

src/CodeGenerator/definitions/cimgui/definitions.json

Lines changed: 1548 additions & 1426 deletions
Large diffs are not rendered by default.

src/CodeGenerator/definitions/cimgui/structs_and_enums.json

Lines changed: 424 additions & 208 deletions
Large diffs are not rendered by default.

src/ImGui.NET.SampleProgram.XNA/ImGuiRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private unsafe void UpdateBuffers(ImDrawDataPtr drawData)
346346

347347
for (int n = 0; n < drawData.CmdListsCount; n++)
348348
{
349-
ImDrawListPtr cmdList = drawData.CmdListsRange[n];
349+
ImDrawListPtr cmdList = drawData.CmdLists[n];
350350

351351
fixed (void* vtxDstPtr = &_vertexData[vtxOffset * DrawVertDeclaration.Size])
352352
fixed (void* idxDstPtr = &_indexData[idxOffset * sizeof(ushort)])
@@ -374,7 +374,7 @@ private unsafe void RenderCommandLists(ImDrawDataPtr drawData)
374374

375375
for (int n = 0; n < drawData.CmdListsCount; n++)
376376
{
377-
ImDrawListPtr cmdList = drawData.CmdListsRange[n];
377+
ImDrawListPtr cmdList = drawData.CmdLists[n];
378378

379379
for (int cmdi = 0; cmdi < cmdList.CmdBuffer.Size; cmdi++)
380380
{

src/ImGui.NET.SampleProgram/ImGuiController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
439439

440440
for (int i = 0; i < draw_data.CmdListsCount; i++)
441441
{
442-
ImDrawListPtr cmd_list = draw_data.CmdListsRange[i];
442+
ImDrawListPtr cmd_list = draw_data.CmdLists[i];
443443

444444
cl.UpdateBuffer(
445445
_vertexBuffer,
@@ -481,7 +481,7 @@ private void RenderImDrawData(ImDrawDataPtr draw_data, GraphicsDevice gd, Comman
481481
int idx_offset = 0;
482482
for (int n = 0; n < draw_data.CmdListsCount; n++)
483483
{
484-
ImDrawListPtr cmd_list = draw_data.CmdListsRange[n];
484+
ImDrawListPtr cmd_list = draw_data.CmdLists[n];
485485
for (int cmd_i = 0; cmd_i < cmd_list.CmdBuffer.Size; cmd_i++)
486486
{
487487
ImDrawCmdPtr pcmd = cmd_list.CmdBuffer[cmd_i];

src/ImGui.NET/Generated/ImDrawData.gen.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public unsafe partial struct ImDrawData
1111
public int CmdListsCount;
1212
public int TotalIdxCount;
1313
public int TotalVtxCount;
14-
public ImDrawList** CmdLists;
14+
public ImVector CmdLists;
1515
public Vector2 DisplayPos;
1616
public Vector2 DisplaySize;
1717
public Vector2 FramebufferScale;
@@ -29,11 +29,16 @@ public unsafe partial struct ImDrawDataPtr
2929
public ref int CmdListsCount => ref Unsafe.AsRef<int>(&NativePtr->CmdListsCount);
3030
public ref int TotalIdxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalIdxCount);
3131
public ref int TotalVtxCount => ref Unsafe.AsRef<int>(&NativePtr->TotalVtxCount);
32-
public IntPtr CmdLists { get => (IntPtr)NativePtr->CmdLists; set => NativePtr->CmdLists = (ImDrawList**)value; }
32+
public ImVector<ImDrawListPtr> CmdLists => new ImVector<ImDrawListPtr>(NativePtr->CmdLists);
3333
public ref Vector2 DisplayPos => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplayPos);
3434
public ref Vector2 DisplaySize => ref Unsafe.AsRef<Vector2>(&NativePtr->DisplaySize);
3535
public ref Vector2 FramebufferScale => ref Unsafe.AsRef<Vector2>(&NativePtr->FramebufferScale);
3636
public ImGuiViewportPtr OwnerViewport => new ImGuiViewportPtr(NativePtr->OwnerViewport);
37+
public void AddDrawList(ImDrawListPtr draw_list)
38+
{
39+
ImDrawList* native_draw_list = draw_list.NativePtr;
40+
ImGuiNative.ImDrawData_AddDrawList((ImDrawData*)(NativePtr), native_draw_list);
41+
}
3742
public void Clear()
3843
{
3944
ImGuiNative.ImDrawData_Clear((ImDrawData*)(NativePtr));

0 commit comments

Comments
 (0)