From 019c7cefb197a81a184a02def257776be05334d2 Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Sun, 8 Nov 2015 00:48:09 -0800 Subject: [PATCH] A couple more wrappers for ImGuiNative methods --- src/ImGui.NET/ImGui.cs | 13 +++++++++++++ src/ImGui.NET/ImGuiNative.cs | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) 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)