why don't use the ref keyword in the pointer parameter instead?
and function like ImGui.ListBox
[DllImport("Mochi.DearImGui.Native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ListBox@ImGui@@YA_NPEBDPEAHQEBQEBDHH@Z", ExactSpelling = true)]
private static extern byte ListBox_PInvoke(byte* label, int* current_item, sbyte** items, int items_count, int height_in_items);
use UnmanagedType.LPArray and use string[];
[DllImport("Mochi.DearImGui.Native", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ListBox@ImGui@@YA_NPEBDPEAHQEBQEBDHH@Z", ExactSpelling = true)]
private static extern byte ListBox_PInvoke(byte* label, int* current_item, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)]string[] items, int items_count, int height_in_items);
why don't use the ref keyword in the pointer parameter instead?
and function like ImGui.ListBox
use
UnmanagedType.LPArrayand use string[];