From 4e897f7534f4bfa1370959d6d0e94b2becd1a9b7 Mon Sep 17 00:00:00 2001 From: Eric Mellino Date: Fri, 5 Aug 2016 19:19:05 -0700 Subject: [PATCH] Actually implement ImGui.Combo --- src/ImGui.NET/ImGui.cs | 7 ++++++- src/ImGui.NET/ImGuiNative.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ImGui.NET/ImGui.cs b/src/ImGui.NET/ImGui.cs index 41742a3..339be62 100644 --- a/src/ImGui.NET/ImGui.cs +++ b/src/ImGui.NET/ImGui.cs @@ -162,7 +162,12 @@ namespace ImGuiNET public unsafe static bool Combo(string label, ref int current_item, string[] items) { - throw new NotImplementedException(); + return ImGuiNative.igCombo(label, ref current_item, items, items.Length, 5); + } + + public unsafe static bool Combo(string label, ref int current_item, string[] items, int heightInItems) + { + return ImGuiNative.igCombo(label, ref current_item, items, items.Length, heightInItems); } public static bool ColorButton(Vector4 color, bool smallHeight, bool outlineBorder) diff --git a/src/ImGui.NET/ImGuiNative.cs b/src/ImGui.NET/ImGuiNative.cs index f6a6380..6c12f8d 100644 --- a/src/ImGui.NET/ImGuiNative.cs +++ b/src/ImGui.NET/ImGuiNative.cs @@ -313,7 +313,7 @@ namespace ImGuiNET public static extern bool igRadioButton(string label, int* v, int v_button); [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] - public static extern bool igCombo(string label, ref int current_item, char** items, int items_count, int height_in_items); + public static extern bool igCombo(string label, ref int current_item, string[] items, int items_count, int height_in_items); [DllImport(cimguiLib)] [return: MarshalAs(UnmanagedType.I1)] public static extern bool igCombo2(string label, ref int current_item, string items_separated_by_zeros, int height_in_items);