Skip to content

Commit d86dc08

Browse files
authored
Merge pull request #25 from dpethes/master
Declaration cleanups
2 parents ef9f937 + ec40a94 commit d86dc08

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

src/ImGui.NET/ImGui.cs

+21-17
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,16 @@ public static bool BeginWindow(string windowTitle, ref bool opened, float backgr
511511
return ImGuiNative.igBegin2(windowTitle, ref opened, new Vector2(), backgroundAlpha, flags);
512512
}
513513

514+
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, WindowFlags flags)
515+
{
516+
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, 1f, flags);
517+
}
518+
519+
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, float backgroundAlpha, WindowFlags flags)
520+
{
521+
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, backgroundAlpha, flags);
522+
}
523+
514524
public static bool BeginMenu(string label)
515525
{
516526
return ImGuiNative.igBeginMenu(label, true);
@@ -531,11 +541,6 @@ public static void CloseCurrentPopup()
531541
ImGuiNative.igCloseCurrentPopup();
532542
}
533543

534-
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, WindowFlags flags)
535-
{
536-
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, 1f, flags);
537-
}
538-
539544
public static void EndMenuBar()
540545
{
541546
ImGuiNative.igEndMenuBar();
@@ -546,11 +551,6 @@ public static void EndMenu()
546551
ImGuiNative.igEndMenu();
547552
}
548553

549-
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, float backgroundAlpha, WindowFlags flags)
550-
{
551-
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, backgroundAlpha, flags);
552-
}
553-
554554
public static void Separator()
555555
{
556556
ImGuiNative.igSeparator();
@@ -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)