diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index 8fb93ce..db4c81b 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -884,22 +884,26 @@ namespace ImGuiNET public static bool BeginPopupModal(string name) { - return ImGuiNative.igBeginPopupModal(name, WindowFlags.Default); + return BeginPopupModal(name, WindowFlags.Default); } - public static bool BeginPopupModal(string name, WindowFlags extraFlags) + public static bool BeginPopupModal(string name, ref bool opened) { - return ImGuiNative.igBeginPopupModal(name, extraFlags); + return BeginPopupModal(name, ref opened, WindowFlags.Default); } - public static bool BeginPopupModal(string name, ref bool opened) + public static unsafe bool BeginPopupModal(string name, WindowFlags extra_flags) { - return ImGuiNative.igBeginPopupModal(name, ref opened, WindowFlags.Default); + return ImGuiNative.igBeginPopupModal(name, null, extra_flags); } - public static bool BeginPopupModal(string name, ref bool opened, WindowFlags extraFlags) + public static unsafe bool BeginPopupModal(string name, ref bool p_opened, WindowFlags extra_flags) { - return ImGuiNative.igBeginPopupModal(name, ref opened, extraFlags); + byte value = p_opened ? (byte)1 : (byte)0; + bool result = ImGuiNative.igBeginPopupModal(name, &value, extra_flags); + + p_opened = value == 1 ? true : false; + return result; } public static bool Selectable(string label, bool isSelected, SelectableFlags flags) diff --git a/src/ImGui.NET/ImGuiNative.cs b/src/ImGui.NET/ImGuiNative.cs index bd7fc53..e244543 100644 --- a/src/ImGui.NET/ImGuiNative.cs +++ b/src/ImGui.NET/ImGuiNative.cs @@ -584,20 +584,6 @@ namespace ImGuiNET [return: MarshalAs(UnmanagedType.I1)] public static extern bool igBeginPopupModal(string name, byte* p_opened, WindowFlags extra_flags); - public static bool igBeginPopupModal(string name, WindowFlags extra_flags) - { - return igBeginPopupModal(name, null, extra_flags); - } - - public static bool igBeginPopupModal(string name, ref bool p_opened, WindowFlags extra_flags) - { - byte value = p_opened ? (byte)1 : (byte)0; - bool result = igBeginPopupModal(name, &value, extra_flags); - - p_opened = value == 1 ? true : false; - return result; - } - [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool igBeginPopupContextItem(string str_id, int mouse_button);