Merge pull request #25 from dpethes/master

Declaration cleanups
internals
Eric Mellino 8 years ago committed by GitHub
commit d86dc085ed
  1. 38
      src/ImGui.NET/ImGui.cs
  2. 14
      src/ImGui.NET/ImGuiNative.cs

@ -511,6 +511,16 @@ namespace ImGuiNET
return ImGuiNative.igBegin2(windowTitle, ref opened, new Vector2(), backgroundAlpha, flags); return ImGuiNative.igBegin2(windowTitle, ref opened, new Vector2(), backgroundAlpha, flags);
} }
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, WindowFlags flags)
{
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, 1f, flags);
}
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, float backgroundAlpha, WindowFlags flags)
{
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, backgroundAlpha, flags);
}
public static bool BeginMenu(string label) public static bool BeginMenu(string label)
{ {
return ImGuiNative.igBeginMenu(label, true); return ImGuiNative.igBeginMenu(label, true);
@ -531,11 +541,6 @@ namespace ImGuiNET
ImGuiNative.igCloseCurrentPopup(); 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 void EndMenuBar() public static void EndMenuBar()
{ {
ImGuiNative.igEndMenuBar(); ImGuiNative.igEndMenuBar();
@ -546,11 +551,6 @@ namespace ImGuiNET
ImGuiNative.igEndMenu(); ImGuiNative.igEndMenu();
} }
public static bool BeginWindow(string windowTitle, ref bool opened, Vector2 startingSize, float backgroundAlpha, WindowFlags flags)
{
return ImGuiNative.igBegin2(windowTitle, ref opened, startingSize, backgroundAlpha, flags);
}
public static void Separator() public static void Separator()
{ {
ImGuiNative.igSeparator(); ImGuiNative.igSeparator();
@ -884,22 +884,26 @@ namespace ImGuiNET
public static bool BeginPopupModal(string name) 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) public static bool Selectable(string label, bool isSelected, SelectableFlags flags)

@ -584,20 +584,6 @@ namespace ImGuiNET
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
public static extern bool igBeginPopupModal(string name, byte* p_opened, WindowFlags extra_flags); 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)] [DllImport(cimguiLib)]
[return: MarshalAs(UnmanagedType.I1)] [return: MarshalAs(UnmanagedType.I1)]
public static extern bool igBeginPopupContextItem(string str_id, int mouse_button); public static extern bool igBeginPopupContextItem(string str_id, int mouse_button);

Loading…
Cancel
Save