From 5fe333a6911c9c0464b1c40ce29b2fba21a17e1b Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Thu, 22 Nov 2018 11:24:01 -0800 Subject: [PATCH] Ignore static fields in structures. --- src/CodeGenerator/Program.cs | 4 +++- src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CodeGenerator/Program.cs b/src/CodeGenerator/Program.cs index 8b89c68..98a9b27 100644 --- a/src/CodeGenerator/Program.cs +++ b/src/CodeGenerator/Program.cs @@ -146,12 +146,14 @@ namespace CodeGenerator string name = jp.Name; TypeReference[] fields = jp.Values().Select(v => { + if (v["type"].ToString().Contains("static")) { return null; } + return new TypeReference( v["name"].ToString(), v["type"].ToString(), v["template_type"]?.ToString(), enums); - }).ToArray(); + }).Where(tr => tr != null).ToArray(); return new TypeDefinition(name, fields); }).ToArray(); diff --git a/src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs b/src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs index 7903105..daec1ec 100644 --- a/src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs +++ b/src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs @@ -8,7 +8,6 @@ namespace ImGuiNET public unsafe partial struct ImGuiTextBuffer { public ImVector Buf; - public static char EmptyString_0; } public unsafe partial struct ImGuiTextBufferPtr { @@ -19,7 +18,6 @@ namespace ImGuiNET public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr; public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr); public ImVector Buf => new ImVector(NativePtr->Buf); - public RangeAccessor EmptyString => new RangeAccessor(&NativePtr->EmptyString_0, 1); public void appendf(string fmt) { byte* native_fmt;