Skip to content

Commit 7f3739a

Browse files
committed
Update to 1.67.
1 parent c4842e4 commit 7f3739a

21 files changed

+12505
-11655
lines changed

deps/cimgui/linux-x64/cimgui.so

38.9 KB
Binary file not shown.

deps/cimgui/osx-x64/cimgui.dylib

27.5 KB
Binary file not shown.

deps/cimgui/win-x64/cimgui.dll

25 KB
Binary file not shown.

deps/cimgui/win-x86/cimgui.dll

23.5 KB
Binary file not shown.

src/CodeGenerator/definitions.json

Lines changed: 10478 additions & 10127 deletions
Large diffs are not rendered by default.

src/CodeGenerator/structs_and_enums.json

Lines changed: 1495 additions & 1334 deletions
Large diffs are not rendered by default.

src/ImGui.NET.SampleProgram/Program.cs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class Program
2626
private static bool _showAnotherWindow = false;
2727
private static bool _showMemoryEditor = false;
2828
private static byte[] _memoryEditorData;
29+
private static uint s_tab_bar_flags = (uint)ImGuiTabBarFlags.Reorderable;
30+
static bool[] s_opened = { true, true, true, true }; // Persistent user state
2931

3032
static void SetThing(out float i, float val) { i = val; }
3133

@@ -120,6 +122,75 @@ private static unsafe void SubmitUI()
120122
ImGui.ShowDemoWindow(ref _showDemoWindow);
121123
}
122124

125+
if (ImGui.TreeNode("Tabs"))
126+
{
127+
if (ImGui.TreeNode("Basic"))
128+
{
129+
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags.None;
130+
if (ImGui.BeginTabBar("MyTabBar", tab_bar_flags))
131+
{
132+
if (ImGui.BeginTabItem("Avocado"))
133+
{
134+
ImGui.Text("This is the Avocado tab!\nblah blah blah blah blah");
135+
ImGui.EndTabItem();
136+
}
137+
if (ImGui.BeginTabItem("Broccoli"))
138+
{
139+
ImGui.Text("This is the Broccoli tab!\nblah blah blah blah blah");
140+
ImGui.EndTabItem();
141+
}
142+
if (ImGui.BeginTabItem("Cucumber"))
143+
{
144+
ImGui.Text("This is the Cucumber tab!\nblah blah blah blah blah");
145+
ImGui.EndTabItem();
146+
}
147+
ImGui.EndTabBar();
148+
}
149+
ImGui.Separator();
150+
ImGui.TreePop();
151+
}
152+
153+
if (ImGui.TreeNode("Advanced & Close Button"))
154+
{
155+
// Expose a couple of the available flags. In most cases you may just call BeginTabBar() with no flags (0).
156+
ImGui.CheckboxFlags("ImGuiTabBarFlags_Reorderable", ref s_tab_bar_flags, (uint)ImGuiTabBarFlags.Reorderable);
157+
ImGui.CheckboxFlags("ImGuiTabBarFlags_AutoSelectNewTabs", ref s_tab_bar_flags, (uint)ImGuiTabBarFlags.AutoSelectNewTabs);
158+
ImGui.CheckboxFlags("ImGuiTabBarFlags_NoCloseWithMiddleMouseButton", ref s_tab_bar_flags, (uint)ImGuiTabBarFlags.NoCloseWithMiddleMouseButton);
159+
if ((s_tab_bar_flags & (uint)ImGuiTabBarFlags.FittingPolicyMask) == 0)
160+
s_tab_bar_flags |= (uint)ImGuiTabBarFlags.FittingPolicyDefault;
161+
if (ImGui.CheckboxFlags("ImGuiTabBarFlags_FittingPolicyResizeDown", ref s_tab_bar_flags, (uint)ImGuiTabBarFlags.FittingPolicyResizeDown))
162+
s_tab_bar_flags &= ~((uint)ImGuiTabBarFlags.FittingPolicyMask ^ (uint)ImGuiTabBarFlags.FittingPolicyResizeDown);
163+
if (ImGui.CheckboxFlags("ImGuiTabBarFlags_FittingPolicyScroll", ref s_tab_bar_flags, (uint)ImGuiTabBarFlags.FittingPolicyScroll))
164+
s_tab_bar_flags &= ~((uint)ImGuiTabBarFlags.FittingPolicyMask ^ (uint)ImGuiTabBarFlags.FittingPolicyScroll);
165+
166+
// Tab Bar
167+
string[] names = { "Artichoke", "Beetroot", "Celery", "Daikon" };
168+
169+
for (int n = 0; n < s_opened.Length; n++)
170+
{
171+
if (n > 0) { ImGui.SameLine(); }
172+
ImGui.Checkbox(names[n], ref s_opened[n]);
173+
}
174+
175+
// Passing a bool* to BeginTabItem() is similar to passing one to Begin(): the underlying bool will be set to false when the tab is closed.
176+
if (ImGui.BeginTabBar("MyTabBar", (ImGuiTabBarFlags)s_tab_bar_flags))
177+
{
178+
for (int n = 0; n < s_opened.Length; n++)
179+
if (s_opened[n] && ImGui.BeginTabItem(names[n], ref s_opened[n]))
180+
{
181+
ImGui.Text($"This is the {names[n]} tab!");
182+
if ((n & 1) != 0)
183+
ImGui.Text("I am an odd tab.");
184+
ImGui.EndTabItem();
185+
}
186+
ImGui.EndTabBar();
187+
}
188+
ImGui.Separator();
189+
ImGui.TreePop();
190+
}
191+
ImGui.TreePop();
192+
}
193+
123194
ImGuiIOPtr io = ImGui.GetIO();
124195
SetThing(out io.DeltaTime, 2f);
125196

src/ImGui.NET/Generated/ImDrawListFlags.gen.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace ImGuiNET
33
[System.Flags]
44
public enum ImDrawListFlags
55
{
6+
None = 0,
67
AntiAliasedLines = 1 << 0,
78
AntiAliasedFill = 1 << 1,
89
}

src/ImGui.NET/Generated/GlyphRangesBuilder.gen.cs renamed to src/ImGui.NET/Generated/ImFontGlyphRangesBuilder.gen.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55

66
namespace ImGuiNET
77
{
8-
public unsafe partial struct GlyphRangesBuilder
8+
public unsafe partial struct ImFontGlyphRangesBuilder
99
{
1010
public ImVector UsedChars;
1111
}
12-
public unsafe partial struct GlyphRangesBuilderPtr
12+
public unsafe partial struct ImFontGlyphRangesBuilderPtr
1313
{
14-
public GlyphRangesBuilder* NativePtr { get; }
15-
public GlyphRangesBuilderPtr(GlyphRangesBuilder* nativePtr) => NativePtr = nativePtr;
16-
public GlyphRangesBuilderPtr(IntPtr nativePtr) => NativePtr = (GlyphRangesBuilder*)nativePtr;
17-
public static implicit operator GlyphRangesBuilderPtr(GlyphRangesBuilder* nativePtr) => new GlyphRangesBuilderPtr(nativePtr);
18-
public static implicit operator GlyphRangesBuilder* (GlyphRangesBuilderPtr wrappedPtr) => wrappedPtr.NativePtr;
19-
public static implicit operator GlyphRangesBuilderPtr(IntPtr nativePtr) => new GlyphRangesBuilderPtr(nativePtr);
20-
public ImVector<byte> UsedChars => new ImVector<byte>(NativePtr->UsedChars);
14+
public ImFontGlyphRangesBuilder* NativePtr { get; }
15+
public ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) => NativePtr = nativePtr;
16+
public ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) => NativePtr = (ImFontGlyphRangesBuilder*)nativePtr;
17+
public static implicit operator ImFontGlyphRangesBuilderPtr(ImFontGlyphRangesBuilder* nativePtr) => new ImFontGlyphRangesBuilderPtr(nativePtr);
18+
public static implicit operator ImFontGlyphRangesBuilder* (ImFontGlyphRangesBuilderPtr wrappedPtr) => wrappedPtr.NativePtr;
19+
public static implicit operator ImFontGlyphRangesBuilderPtr(IntPtr nativePtr) => new ImFontGlyphRangesBuilderPtr(nativePtr);
20+
public ImVector<int> UsedChars => new ImVector<int>(NativePtr->UsedChars);
2121
public void AddChar(ushort c)
2222
{
23-
ImGuiNative.GlyphRangesBuilder_AddChar(NativePtr, c);
23+
ImGuiNative.ImFontGlyphRangesBuilder_AddChar(NativePtr, c);
2424
}
2525
public void AddRanges(IntPtr ranges)
2626
{
2727
ushort* native_ranges = (ushort*)ranges.ToPointer();
28-
ImGuiNative.GlyphRangesBuilder_AddRanges(NativePtr, native_ranges);
28+
ImGuiNative.ImFontGlyphRangesBuilder_AddRanges(NativePtr, native_ranges);
2929
}
3030
public void AddText(string text)
3131
{
@@ -48,7 +48,7 @@ public void AddText(string text)
4848
}
4949
else { native_text = null; }
5050
byte* native_text_end = null;
51-
ImGuiNative.GlyphRangesBuilder_AddText(NativePtr, native_text, native_text_end);
51+
ImGuiNative.ImFontGlyphRangesBuilder_AddText(NativePtr, native_text, native_text_end);
5252
if (text_byteCount > Util.StackAllocationSizeLimit)
5353
{
5454
Util.Free(native_text);
@@ -58,17 +58,17 @@ public void BuildRanges(out ImVector out_ranges)
5858
{
5959
fixed (ImVector* native_out_ranges = &out_ranges)
6060
{
61-
ImGuiNative.GlyphRangesBuilder_BuildRanges(NativePtr, native_out_ranges);
61+
ImGuiNative.ImFontGlyphRangesBuilder_BuildRanges(NativePtr, native_out_ranges);
6262
}
6363
}
6464
public bool GetBit(int n)
6565
{
66-
byte ret = ImGuiNative.GlyphRangesBuilder_GetBit(NativePtr, n);
66+
byte ret = ImGuiNative.ImFontGlyphRangesBuilder_GetBit(NativePtr, n);
6767
return ret != 0;
6868
}
6969
public void SetBit(int n)
7070
{
71-
ImGuiNative.GlyphRangesBuilder_SetBit(NativePtr, n);
71+
ImGuiNative.ImFontGlyphRangesBuilder_SetBit(NativePtr, n);
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)