From 7abd3ad7f3c760c9d9f3ef09676f45306563d2cc Mon Sep 17 00:00:00 2001 From: Pat Date: Sat, 9 Apr 2022 21:36:33 -0500 Subject: [PATCH 1/2] Fixed `data` field in `ImVector` Edited `imgui.nim` so `ImVector.data` is of type `ptr UncheckedArray[T]` instead of `UncheckedArray[T]` --- src/imgui.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imgui.nim b/src/imgui.nim index 980bda4..5132f0f 100644 --- a/src/imgui.nim +++ b/src/imgui.nim @@ -746,7 +746,7 @@ type ImVector*[T] = object # Should I importc a generic? size* {.importc: "Size".}: int32 capacity* {.importc: "Capacity".}: int32 - data* {.importc: "Data".}: UncheckedArray[T] + data* {.importc: "Data".}: ptr UncheckedArray[T] ImGuiStyleModBackup* {.union.} = object backup_int* {.importc: "BackupInt".}: int32 # Breaking naming convetion to denote "low level" backup_float* {.importc: "BackupFloat".}: float32 From 5c0cce932210bd9495ab87a21f179ab6e2f32deb Mon Sep 17 00:00:00 2001 From: Pat Date: Sat, 9 Apr 2022 21:51:32 -0500 Subject: [PATCH 2/2] Fixed `ImDrawData.cmdLists` too --- src/imgui.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imgui.nim b/src/imgui.nim index 5132f0f..5f23ddf 100644 --- a/src/imgui.nim +++ b/src/imgui.nim @@ -800,7 +800,7 @@ type cmdListsCount* {.importc: "CmdListsCount".}: int32 totalIdxCount* {.importc: "TotalIdxCount".}: int32 totalVtxCount* {.importc: "TotalVtxCount".}: int32 - cmdLists* {.importc: "CmdLists".}: UncheckedArray[ptr ImDrawList] + cmdLists* {.importc: "CmdLists".}: ptr UncheckedArray[ptr ImDrawList] displayPos* {.importc: "DisplayPos".}: ImVec2 displaySize* {.importc: "DisplaySize".}: ImVec2 framebufferScale* {.importc: "FramebufferScale".}: ImVec2