diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index 4704086..925bcdd 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -121,11 +121,24 @@ namespace ImGuiNET ImGuiNative.igBeginMenuBar(); } + public static void CloseCurrentPopup() + { + ImGuiNative.igCloseCurrentPopup(); + } + public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, WindowFlags flags) { return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, 1f, flags); } + public static unsafe bool Checkbox(string label, ref bool value) + { + bool localVal = value; + bool result = ImGuiNative.igCheckbox(label, &localVal); + value = localVal; + return result; + } + public static void EndMenuBar() { ImGuiNative.igEndMenuBar(); diff --git a/src/ImGui.NET/ImGuiNative.cs b/src/ImGui.NET/ImGuiNative.cs index 38b73ef..c4249e1 100644 --- a/src/ImGui.NET/ImGuiNative.cs +++ b/src/ImGui.NET/ImGuiNative.cs @@ -265,7 +265,7 @@ namespace ImGuiNET public static extern void igTextWrapped(string fmt); [DllImport(cimguiLib)] - public static extern void igTextUnformatted(string text, string text_end); + public static extern void igTextUnformatted(byte* text, byte* text_end); [DllImport(cimguiLib)] public static extern void igLabelText(string label, string fmt); @@ -480,7 +480,7 @@ namespace ImGuiNET public static extern void igOpenPopup(string str_id); [DllImport(cimguiLib)] public static extern bool igBeginPopup(string str_id); - [DllImport(cimguiLib, CharSet=CharSet.Ansi)] + [DllImport(cimguiLib, CharSet = CharSet.Ansi)] public static extern bool igBeginPopupModal(string name, byte* p_opened, WindowFlags extra_flags); public static bool igBeginPopupModal(string name, WindowFlags extra_flags)