Update CodeGenerator to handle the latest output from cimgui.

internals
Eric Mellino 6 years ago
parent 57de7ca047
commit 2e31c95fa0
  1. 44
      src/CodeGenerator/Program.cs
  2. 14512
      src/CodeGenerator/definitions.json
  3. 2584
      src/CodeGenerator/structs_and_enums.json
  4. 18
      src/ImGui.NET/Generated/ImDrawList.gen.cs
  5. 8
      src/ImGui.NET/Generated/ImFont.gen.cs
  6. 8
      src/ImGui.NET/Generated/ImFontAtlas.gen.cs
  7. 396
      src/ImGui.NET/Generated/ImGui.gen.cs
  8. 104
      src/ImGui.NET/Generated/ImGuiNative.gen.cs
  9. 24
      src/ImGui.NET/Generated/ImGuiStorage.gen.cs
  10. 10
      src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs
  11. 4
      src/ImGui.NET/Generated/ImGuiTextFilter.gen.cs
  12. 2
      src/ImGui.NET/Generated/TextRange.gen.cs

@ -44,11 +44,6 @@ namespace CodeGenerator
{ "float&", "float*" },
{ "ImVec2[2]", "Vector2*" },
{ "char* []", "byte**" },
// TODO: These shouldn't exist
{ "ImVector_ImWchar", "ImVector" },
{ "ImVector_TextRange", "ImVector" },
{ "ImVector_TextRange&", "ImVector*" },
};
private static readonly Dictionary<string, string> s_wellKnownFieldReplacements = new Dictionary<string, string>()
@ -170,7 +165,8 @@ namespace CodeGenerator
{
string ov_cimguiname = val["ov_cimguiname"]?.ToString();
string cimguiname = val["cimguiname"].ToString();
string friendlyName = val["funcname"].ToString();
string friendlyName = val["funcname"]?.ToString();
if (friendlyName == null) { return null; }
string exportedName = ov_cimguiname;
if (exportedName == null)
@ -191,10 +187,6 @@ namespace CodeGenerator
}
List<TypeReference> parameters = new List<TypeReference>();
if (selfTypeName != null)
{
parameters.Add(new TypeReference("self", selfTypeName + "*", enums));
}
foreach (JToken p in val["argsT"])
{
@ -624,8 +616,11 @@ namespace CodeGenerator
else
{
preCallLines.Add($"byte* {nativeArgName};");
preCallLines.Add($"if ({textToEncode} != null)");
preCallLines.Add("{");
if (!hasDefault)
{
preCallLines.Add($"if ({textToEncode} != null)");
preCallLines.Add("{");
}
preCallLines.Add($" int {correctedIdentifier}_byteCount = Encoding.UTF8.GetByteCount({textToEncode});");
preCallLines.Add($" byte* {nativeArgName}_stackBytes = stackalloc byte[{correctedIdentifier}_byteCount + 1];");
preCallLines.Add($" {nativeArgName} = {nativeArgName}_stackBytes;");
@ -634,8 +629,11 @@ namespace CodeGenerator
preCallLines.Add($" int {nativeArgName}_offset = Encoding.UTF8.GetBytes({correctedIdentifier}_ptr, {textToEncode}.Length, {nativeArgName}, {correctedIdentifier}_byteCount);");
preCallLines.Add($" {nativeArgName}[{nativeArgName}_offset] = 0;");
preCallLines.Add(" }");
preCallLines.Add("}");
preCallLines.Add($"else {{ {nativeArgName} = null; }}");
if (!hasDefault)
{
preCallLines.Add("}");
preCallLines.Add($"else {{ {nativeArgName} = null; }}");
}
}
}
else if (tr.Type == "char* []")
@ -727,7 +725,7 @@ namespace CodeGenerator
nonPtrType = GetTypeString(tr.Type.Substring(0, tr.Type.Length - 1), false);
}
string nativeArgName = "native_" + tr.Name;
bool isOutParam = tr.Name.Contains("out_");
bool isOutParam = tr.Name.Contains("out_") || tr.Name == "out";
string direction = isOutParam ? "out" : "ref";
marshalledParameters[i] = new MarshalledParameter($"{direction} {nonPtrType}", true, nativeArgName, false);
marshalledParameters[i].PinTarget = CorrectIdentifier(tr.Name);
@ -853,7 +851,7 @@ namespace CodeGenerator
private static bool GetWrappedType(string nativeType, out string wrappedType)
{
if (nativeType.StartsWith("Im") && nativeType.EndsWith("*"))
if (nativeType.StartsWith("Im") && nativeType.EndsWith("*") && !nativeType.StartsWith("ImVector"))
{
int pointerLevel = nativeType.Length - nativeType.IndexOf('*');
if (pointerLevel > 1)
@ -1031,6 +1029,20 @@ namespace CodeGenerator
{
Name = name;
Type = type.Replace("const", string.Empty).Trim();
if (Type.StartsWith("ImVector_"))
{
if (Type.EndsWith("*"))
{
Type = "ImVector*";
}
else
{
Type = "ImVector";
}
}
TemplateType = templateType;
int startBracket = name.IndexOf('[');
if (startBracket != -1)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -54,6 +54,15 @@ namespace ImGuiNET
{
ImGuiNative.ImDrawList_ChannelsSplit(NativePtr, channels_count);
}
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col)
{
float thickness = 1.0f;
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness);
}
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col, float thickness)
{
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness);
}
public void AddPolyline(ref Vector2 points, int num_points, uint col, bool closed, float thickness)
{
byte native_closed = closed ? (byte)1 : (byte)0;
@ -137,15 +146,6 @@ namespace ImGuiNET
{
ImGuiNative.ImDrawList_PrimRect(NativePtr, a, b, col);
}
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col)
{
float thickness = 1.0f;
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness);
}
public void AddQuad(Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col, float thickness)
{
ImGuiNative.ImDrawList_AddQuad(NativePtr, a, b, c, d, col, thickness);
}
public void ClearFreeMemory()
{
ImGuiNative.ImDrawList_ClearFreeMemory(NativePtr);

@ -48,6 +48,10 @@ namespace ImGuiNET
public ref float Descent => ref Unsafe.AsRef<float>(&NativePtr->Descent);
public ref bool DirtyLookupTables => ref Unsafe.AsRef<bool>(&NativePtr->DirtyLookupTables);
public ref int MetricsTotalSurface => ref Unsafe.AsRef<int>(&NativePtr->MetricsTotalSurface);
public void GrowIndex(int new_size)
{
ImGuiNative.ImFont_GrowIndex(NativePtr, new_size);
}
public void AddRemapChar(ushort dst, ushort src)
{
byte overwrite_dst = 1;
@ -62,10 +66,6 @@ namespace ImGuiNET
{
ImGuiNative.ImFont_AddGlyph(NativePtr, c, x0, y0, x1, y1, u0, v0, u1, v1, advance_x);
}
public void GrowIndex(int new_size)
{
ImGuiNative.ImFont_GrowIndex(NativePtr, new_size);
}
public ImFontGlyphPtr FindGlyphNoFallback(ushort c)
{
ImFontGlyph* ret = ImGuiNative.ImFont_FindGlyphNoFallback(NativePtr, c);

@ -46,6 +46,10 @@ namespace ImGuiNET
public ImVector<CustomRect> CustomRects => new ImVector<CustomRect>(NativePtr->CustomRects);
public ImPtrVector<ImFontConfigPtr> ConfigData => new ImPtrVector<ImFontConfigPtr>(NativePtr->ConfigData, Unsafe.SizeOf<ImFontConfig>());
public RangeAccessor<int> CustomRectIds => new RangeAccessor<int>(NativePtr->CustomRectIds, 1);
public void ClearFonts()
{
ImGuiNative.ImFontAtlas_ClearFonts(NativePtr);
}
public ImFontPtr AddFontFromMemoryCompressedBase85TTF(string compressed_font_data_base85, float size_pixels)
{
byte* native_compressed_font_data_base85;
@ -178,10 +182,6 @@ namespace ImGuiNET
{
ImGuiNative.ImFontAtlas_ClearTexData(NativePtr);
}
public void ClearFonts()
{
ImGuiNative.ImFontAtlas_ClearFonts(NativePtr);
}
public void Clear()
{
ImGuiNative.ImFontAtlas_Clear(NativePtr);

File diff suppressed because it is too large Load Diff

@ -41,20 +41,34 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetScrollY(float scroll_y);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igDummy(Vector2 size);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetColorEditOptions(ImGuiColorEditFlags flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern ImGuiStorage* igGetStateStorage();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void** ImGuiStorage_GetVoidPtrRef(ImGuiStorage* self, uint key, void* default_val);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetScrollFromPosY(float pos_y, float center_y_ratio);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputInt2(byte* label, int* v, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFont_GrowIndex(ImFont* self, int new_size);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern Vector4* igGetStyleColorVec4(ImGuiCol idx);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsMouseHoveringRect(Vector2 r_min, Vector2 r_max, byte clip);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImVec4_ImVec4(Vector4* self);
public static extern void ImVec4_ImVec4();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImVec4_ImVec4Float(float _x, float _y, float _z, float _w);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImVec4_ImVec4Float(Vector4* self, float _x, float _y, float _z, float _w);
public static extern void ImDrawList_AddQuad(ImDrawList* self, Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col, float thickness);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_SetHSV(ImColor* self, float h, float s, float v, float a);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* igGetClipboardText();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igDragFloat3(byte* label, Vector3* v, float v_speed, float v_min, float v_max, byte* format, float power);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_AddPolyline(ImDrawList* self, Vector2* points, int num_points, uint col, byte closed, float thickness);
@ -67,10 +81,16 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igValueFloat(byte* prefix, float v, byte* float_format);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_ClearFonts(ImFontAtlas* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextFilter_Build(ImGuiTextFilter* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetStateStorage(ImGuiStorage* storage);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetItemRectMax_nonUDT2")]
public static extern Vector2 igGetItemRectMax();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igShowStyleSelector(byte* label);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsItemDeactivated();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igPushStyleVarFloat(ImGuiStyleVar idx, float val);
@ -93,6 +113,8 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetCursorScreenPos(Vector2 screen_pos);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImGuiTextBuffer_empty(ImGuiTextBuffer* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputInt4(byte* label, int* v, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFont_AddRemapChar(ImFont* self, ushort dst, ushort src, byte overwrite_dst);
@ -103,8 +125,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsRectVisibleVec2(Vector2 rect_min, Vector2 rect_max);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFont_GrowIndex(ImFont* self, int new_size);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImFontAtlas_Build(ImFontAtlas* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igLabelText(byte* label, byte* fmt);
@ -183,7 +203,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputFloat(byte* label, float* v, float step, float step_fast, byte* format, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFont_ImFont(ImFont* self);
public static extern void ImFont_ImFont();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiStorage_SetFloat(ImGuiStorage* self, uint key, float val);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -223,11 +243,11 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImFontAtlas_IsBuilt(ImFontAtlas* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImVec2_ImVec2(Vector2* self);
public static extern void ImVec2_ImVec2();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImVec2_ImVec2Float(Vector2* self, float _x, float _y);
public static extern void ImVec2_ImVec2Float(float _x, float _y);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiPayload_ImGuiPayload(ImGuiPayload* self);
public static extern void ImGuiPayload_ImGuiPayload();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_Clear(ImDrawList* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -243,7 +263,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_AddBezierCurve(ImDrawList* self, Vector2 pos0, Vector2 cp0, Vector2 cp1, Vector2 pos1, uint col, float thickness, int num_segments);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void GlyphRangesBuilder_GlyphRangesBuilder(GlyphRangesBuilder* self);
public static extern void GlyphRangesBuilder_GlyphRangesBuilder();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetWindowSize_nonUDT2")]
public static extern Vector2 igGetWindowSize();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -269,7 +289,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetWindowPos_nonUDT2")]
public static extern Vector2 igGetWindowPos();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiInputTextCallbackData_ImGuiInputTextCallbackData(ImGuiInputTextCallbackData* self);
public static extern void ImGuiInputTextCallbackData_ImGuiInputTextCallbackData();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetNextWindowContentSize(Vector2 size);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -305,8 +325,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_ClearTexData(ImFontAtlas* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_ClearFonts(ImFontAtlas* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern int igGetColumnsCount();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igPopButtonRepeat();
@ -365,7 +383,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igListBoxHeaderInt(byte* label, int items_count, int height_in_items);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontConfig_ImFontConfig(ImFontConfig* self);
public static extern void ImFontConfig_ImFontConfig();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsMouseReleased(int button);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -399,8 +417,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_PrimRect(ImDrawList* self, Vector2 a, Vector2 b, uint col);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_AddQuad(ImDrawList* self, Vector2 a, Vector2 b, Vector2 c, Vector2 d, uint col, float thickness);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_ClearFreeMemory(ImDrawList* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetNextTreeNodeOpen(byte is_open, ImGuiCond cond);
@ -569,9 +585,9 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igPushIDInt(int int_id);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_ImDrawList(ImDrawList* self, IntPtr shared_data);
public static extern void ImDrawList_ImDrawList(IntPtr shared_data);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawCmd_ImDrawCmd(ImDrawCmd* self);
public static extern void ImDrawCmd_ImDrawCmd();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiListClipper_End(ImGuiListClipper* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -591,7 +607,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igEndTooltip();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiListClipper_ImGuiListClipper(ImGuiListClipper* self, int items_count, float items_height);
public static extern void ImGuiListClipper_ImGuiListClipper(int items_count, float items_height);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igDragInt(byte* label, int* v, float v_speed, int v_min, int v_max, byte* format);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -609,7 +625,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igBeginMainMenuBar();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void CustomRect_CustomRect(CustomRect* self);
public static extern void CustomRect_CustomRect();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImGuiInputTextCallbackData_HasSelection(ImGuiInputTextCallbackData* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -621,8 +637,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiStorage_SetAllInt(ImGuiStorage* self, int val);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void** ImGuiStorage_GetVoidPtrRef(ImGuiStorage* self, uint key, void* default_val);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igStyleColorsLight(ImGuiStyle* dst);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igSliderFloat3(byte* label, Vector3* v, float v_min, float v_max, byte* format, float power);
@ -663,11 +677,11 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiStorage_Clear(ImGuiStorage* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void Pair_PairInt(Pair* self, uint _key, int _val_i);
public static extern void Pair_PairInt(uint _key, int _val_i);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void Pair_PairFloat(Pair* self, uint _key, float _val_f);
public static extern void Pair_PairFloat(uint _key, float _val_f);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void Pair_PairPtr(Pair* self, uint _key, void* _val_p);
public static extern void Pair_PairPtr(uint _key, void* _val_p);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextBuffer_appendf(ImGuiTextBuffer* self, byte* fmt);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -675,8 +689,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextBuffer_reserve(ImGuiTextBuffer* self, int capacity);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImGuiTextBuffer_empty(ImGuiTextBuffer* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igSliderScalar(byte* label, ImGuiDataType data_type, void* v, void* v_min, void* v_max, byte* format, float power);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igBeginCombo(byte* label, byte* preview_value, ImGuiComboFlags flags);
@ -695,7 +707,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputInt3(byte* label, int* v, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiIO_ImGuiIO(ImGuiIO* self);
public static extern void ImGuiIO_ImGuiIO();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igStyleColorsDark(ImGuiStyle* dst);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -715,9 +727,9 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igOpenPopup(byte* str_id);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void TextRange_TextRange(TextRange* self);
public static extern void TextRange_TextRange();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void TextRange_TextRangeStr(TextRange* self, byte* _b, byte* _e);
public static extern void TextRange_TextRangeStr(byte* _b, byte* _e);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ImDrawList_GetClipRectMax_nonUDT2")]
public static extern Vector2 ImDrawList_GetClipRectMax(ImDrawList* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igCalcTextSize_nonUDT2")]
@ -729,9 +741,9 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsItemActive();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextFilter_ImGuiTextFilter(ImGuiTextFilter* self, byte* default_filter);
public static extern void ImGuiTextFilter_ImGuiTextFilter(byte* default_filter);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiOnceUponAFrame_ImGuiOnceUponAFrame(ImGuiOnceUponAFrame* self);
public static extern void ImGuiOnceUponAFrame_ImGuiOnceUponAFrame();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igBeginDragDropTarget();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -743,7 +755,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_AddImageRounded(ImDrawList* self, IntPtr user_texture_id, Vector2 a, Vector2 b, Vector2 uv_a, Vector2 uv_b, uint col, float rounding, int rounding_corners);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiStyle_ImGuiStyle(ImGuiStyle* self);
public static extern void ImGuiStyle_ImGuiStyle();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igColorPicker3(byte* label, Vector3* col, ImGuiColorEditFlags flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetContentRegionMax_nonUDT2")]
@ -755,8 +767,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFont_ClearOutputData(ImFont* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* igGetClipboardText();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawList_PrimQuadUV(ImDrawList* self, Vector2 a, Vector2 b, Vector2 c, Vector2 d, Vector2 uv_a, Vector2 uv_b, Vector2 uv_c, Vector2 uv_d, uint col);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igEndDragDropTarget();
@ -793,15 +803,15 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igColorConvertHSVtoRGB(float h, float s, float v, float* out_r, float* out_g, float* out_b);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_ImColor(ImColor* self);
public static extern void ImColor_ImColor();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_ImColorInt(ImColor* self, int r, int g, int b, int a);
public static extern void ImColor_ImColorInt(int r, int g, int b, int a);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_ImColorU32(ImColor* self, uint rgba);
public static extern void ImColor_ImColorU32(uint rgba);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_ImColorFloat(ImColor* self, float r, float g, float b, float a);
public static extern void ImColor_ImColorFloat(float r, float g, float b, float a);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImColor_ImColorVec4(ImColor* self, Vector4 col);
public static extern void ImColor_ImColorVec4(Vector4 col);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igVSliderFloat(byte* label, Vector2 size, float* v, float v_min, float v_max, byte* format, float power);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igColorConvertU32ToFloat4_nonUDT2")]
@ -811,14 +821,10 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextFilter_Clear(ImGuiTextFilter* self);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern ImGuiStorage* igGetStateStorage();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern float igGetColumnWidth(int column_index);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igEndMenuBar();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetStateStorage(ImGuiStorage* storage);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* igGetStyleColorName(ImGuiCol idx);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igIsMouseDragging(int button, float lock_threshold);
@ -941,11 +947,9 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igSetNextWindowSizeConstraints(Vector2 size_min, Vector2 size_max, ImGuiSizeCallback custom_callback, void* custom_callback_data);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igDummy(Vector2 size);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igVSliderInt(byte* label, Vector2 size, int* v, int v_min, int v_max, byte* format);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImGuiTextBuffer_ImGuiTextBuffer(ImGuiTextBuffer* self);
public static extern void ImGuiTextBuffer_ImGuiTextBuffer();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igBulletText(byte* fmt);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -961,7 +965,7 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igBeginPopupContextWindow(byte* str_id, int mouse_button, byte also_over_items);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImFontAtlas_ImFontAtlas(ImFontAtlas* self);
public static extern void ImFontAtlas_ImFontAtlas();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igDragScalar(byte* label, ImGuiDataType data_type, void* v, float v_speed, void* v_min, void* v_max, byte* format, float power);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -973,13 +977,11 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igPushFont(ImFont* font);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputInt2(byte* label, int* v, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igTreePop();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igEnd();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void ImDrawData_ImDrawData(ImDrawData* self);
public static extern void ImDrawData_ImDrawData();
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern void igDestroyContext(IntPtr ctx);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
@ -989,8 +991,6 @@ namespace ImGuiNET
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte ImGuiTextFilter_PassFilter(ImGuiTextFilter* self, byte* text, byte* text_end);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igShowStyleSelector(byte* label);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igInputScalarN(byte* label, ImGuiDataType data_type, void* v, int components, void* step, void* step_fast, byte* format, ImGuiInputTextFlags extra_flags);
[DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)]
public static extern byte igTreeNodeStr(byte* label);

@ -18,6 +18,18 @@ namespace ImGuiNET
public static implicit operator ImGuiStorage* (ImGuiStoragePtr wrappedPtr) => wrappedPtr.NativePtr;
public static implicit operator ImGuiStoragePtr(IntPtr nativePtr) => new ImGuiStoragePtr(nativePtr);
public ImVector<Pair> Data => new ImVector<Pair>(NativePtr->Data);
public void** GetVoidPtrRef(uint key)
{
void* default_val = null;
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, default_val);
return ret;
}
public void** GetVoidPtrRef(uint key, IntPtr default_val)
{
void* native_default_val = (void*)default_val.ToPointer();
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, native_default_val);
return ret;
}
public void SetFloat(uint key, float val)
{
ImGuiNative.ImGuiStorage_SetFloat(NativePtr, key, val);
@ -42,18 +54,6 @@ namespace ImGuiNET
{
ImGuiNative.ImGuiStorage_SetAllInt(NativePtr, val);
}
public void** GetVoidPtrRef(uint key)
{
void* default_val = null;
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, default_val);
return ret;
}
public void** GetVoidPtrRef(uint key, IntPtr default_val)
{
void* native_default_val = (void*)default_val.ToPointer();
void** ret = ImGuiNative.ImGuiStorage_GetVoidPtrRef(NativePtr, key, native_default_val);
return ret;
}
public byte* GetBoolRef(uint key)
{
byte default_val = 0;

@ -18,6 +18,11 @@ namespace ImGuiNET
public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr;
public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr);
public ImVector<byte> Buf => new ImVector<byte>(NativePtr->Buf);
public bool empty()
{
byte ret = ImGuiNative.ImGuiTextBuffer_empty(NativePtr);
return ret != 0;
}
public void clear()
{
ImGuiNative.ImGuiTextBuffer_clear(NativePtr);
@ -48,11 +53,6 @@ namespace ImGuiNET
{
ImGuiNative.ImGuiTextBuffer_reserve(NativePtr, capacity);
}
public bool empty()
{
byte ret = ImGuiNative.ImGuiTextBuffer_empty(NativePtr);
return ret != 0;
}
public int size()
{
int ret = ImGuiNative.ImGuiTextBuffer_size(NativePtr);

@ -29,8 +29,6 @@ namespace ImGuiNET
public bool Draw()
{
byte* native_label;
if ("Filter(inc,-exc)" != null)
{
int label_byteCount = Encoding.UTF8.GetByteCount("Filter(inc,-exc)");
byte* native_label_stackBytes = stackalloc byte[label_byteCount + 1];
native_label = native_label_stackBytes;
@ -39,8 +37,6 @@ namespace ImGuiNET
int native_label_offset = Encoding.UTF8.GetBytes(label_ptr, "Filter(inc,-exc)".Length, native_label, label_byteCount);
native_label[native_label_offset] = 0;
}
}
else { native_label = null; }
float width = 0.0f;
byte ret = ImGuiNative.ImGuiTextFilter_Draw(NativePtr, native_label, width);
return ret != 0;

@ -20,7 +20,7 @@ namespace ImGuiNET
public static implicit operator TextRangePtr(IntPtr nativePtr) => new TextRangePtr(nativePtr);
public IntPtr b { get => (IntPtr)NativePtr->b; set => NativePtr->b = (byte*)value; }
public IntPtr e { get => (IntPtr)NativePtr->e; set => NativePtr->e = (byte*)value; }
public void split(byte separator, ref ImVector @out)
public void split(byte separator, out ImVector @out)
{
fixed (ImVector* native_out = &@out)
{

Loading…
Cancel
Save