Skip to content

Commit ec40a94

Browse files
committed
move igBeginPopupModal implementations from ImGuiNative to ImGui
1 parent e5b1e7c commit ec40a94

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

src/ImGui.NET/ImGui.cs

+11-7
Original file line numberDiff line numberDiff line change
@@ -884,22 +884,26 @@ public static bool SmallButton(string label)
884884

885885
public static bool BeginPopupModal(string name)
886886
{
887-
return ImGuiNative.igBeginPopupModal(name, WindowFlags.Default);
887+
return BeginPopupModal(name, WindowFlags.Default);
888888
}
889889

890-
public static bool BeginPopupModal(string name, WindowFlags extraFlags)
890+
public static bool BeginPopupModal(string name, ref bool opened)
891891
{
892-
return ImGuiNative.igBeginPopupModal(name, extraFlags);
892+
return BeginPopupModal(name, ref opened, WindowFlags.Default);
893893
}
894894

895-
public static bool BeginPopupModal(string name, ref bool opened)
895+
public static unsafe bool BeginPopupModal(string name, WindowFlags extra_flags)
896896
{
897-
return ImGuiNative.igBeginPopupModal(name, ref opened, WindowFlags.Default);
897+
return ImGuiNative.igBeginPopupModal(name, null, extra_flags);
898898
}
899899

900-
public static bool BeginPopupModal(string name, ref bool opened, WindowFlags extraFlags)
900+
public static unsafe bool BeginPopupModal(string name, ref bool p_opened, WindowFlags extra_flags)
901901
{
902-
return ImGuiNative.igBeginPopupModal(name, ref opened, extraFlags);
902+
byte value = p_opened ? (byte)1 : (byte)0;
903+
bool result = ImGuiNative.igBeginPopupModal(name, &value, extra_flags);
904+
905+
p_opened = value == 1 ? true : false;
906+
return result;
903907
}
904908

905909
public static bool Selectable(string label, bool isSelected, SelectableFlags flags)

src/ImGui.NET/ImGuiNative.cs

-14
Original file line numberDiff line numberDiff line change
@@ -584,20 +584,6 @@ public static unsafe class ImGuiNative
584584
[return: MarshalAs(UnmanagedType.I1)]
585585
public static extern bool igBeginPopupModal(string name, byte* p_opened, WindowFlags extra_flags);
586586

587-
public static bool igBeginPopupModal(string name, WindowFlags extra_flags)
588-
{
589-
return igBeginPopupModal(name, null, extra_flags);
590-
}
591-
592-
public static bool igBeginPopupModal(string name, ref bool p_opened, WindowFlags extra_flags)
593-
{
594-
byte value = p_opened ? (byte)1 : (byte)0;
595-
bool result = igBeginPopupModal(name, &value, extra_flags);
596-
597-
p_opened = value == 1 ? true : false;
598-
return result;
599-
}
600-
601587
[DllImport(cimguiLib)]
602588
[return: MarshalAs(UnmanagedType.I1)]
603589
public static extern bool igBeginPopupContextItem(string str_id, int mouse_button);

0 commit comments

Comments
 (0)