Ignore static fields in structures.

internals
Eric Mellino 6 years ago
parent bab93b731c
commit 5fe333a691
  1. 4
      src/CodeGenerator/Program.cs
  2. 2
      src/ImGui.NET/Generated/ImGuiTextBuffer.gen.cs

@ -146,12 +146,14 @@ namespace CodeGenerator
string name = jp.Name; string name = jp.Name;
TypeReference[] fields = jp.Values().Select(v => TypeReference[] fields = jp.Values().Select(v =>
{ {
if (v["type"].ToString().Contains("static")) { return null; }
return new TypeReference( return new TypeReference(
v["name"].ToString(), v["name"].ToString(),
v["type"].ToString(), v["type"].ToString(),
v["template_type"]?.ToString(), v["template_type"]?.ToString(),
enums); enums);
}).ToArray(); }).Where(tr => tr != null).ToArray();
return new TypeDefinition(name, fields); return new TypeDefinition(name, fields);
}).ToArray(); }).ToArray();

@ -8,7 +8,6 @@ namespace ImGuiNET
public unsafe partial struct ImGuiTextBuffer public unsafe partial struct ImGuiTextBuffer
{ {
public ImVector Buf; public ImVector Buf;
public static char EmptyString_0;
} }
public unsafe partial struct ImGuiTextBufferPtr public unsafe partial struct ImGuiTextBufferPtr
{ {
@ -19,7 +18,6 @@ namespace ImGuiNET
public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr; public static implicit operator ImGuiTextBuffer* (ImGuiTextBufferPtr wrappedPtr) => wrappedPtr.NativePtr;
public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr); public static implicit operator ImGuiTextBufferPtr(IntPtr nativePtr) => new ImGuiTextBufferPtr(nativePtr);
public ImVector<byte> Buf => new ImVector<byte>(NativePtr->Buf); public ImVector<byte> Buf => new ImVector<byte>(NativePtr->Buf);
public RangeAccessor<static char> EmptyString => new RangeAccessor<static char>(&NativePtr->EmptyString_0, 1);
public void appendf(string fmt) public void appendf(string fmt)
{ {
byte* native_fmt; byte* native_fmt;

Loading…
Cancel
Save