From 8571a01abd2e6b1ebe83ccf1d8fdaa557fb9bac8 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Tue, 11 Feb 2020 22:03:07 +0300 Subject: [PATCH] Add methods to provide and get separate ImGuiStyle.Colors values --- .../src/main/java/imgui/ImGuiStyle.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/imgui-binding/src/main/java/imgui/ImGuiStyle.java b/imgui-binding/src/main/java/imgui/ImGuiStyle.java index dfab070..c6bd46f 100644 --- a/imgui-binding/src/main/java/imgui/ImGuiStyle.java +++ b/imgui-binding/src/main/java/imgui/ImGuiStyle.java @@ -422,9 +422,9 @@ public final class ImGuiStyle { ImGui::GetStyle().CircleSegmentMaxError = circleSegmentMaxError; */ - // Colors - // BINDING NOTICE: buff is a 2d array with sizes: [ImGuiCol_COUNT][4] - // + /** + * BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4] + */ public native void getColors(float[][] buff); /* for (int i = 0; i < ImGuiCol_COUNT; i++) { jfloatArray jColors = (jfloatArray)env->GetObjectArrayElement(buff, i); @@ -440,8 +440,9 @@ public final class ImGuiStyle { } */ - // BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4] - // + /** + * BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4] + */ public native void setColors(float[][] colors); /* for (int i = 0; i < ImGuiCol_COUNT; i++) { jfloatArray jColors = (jfloatArray)env->GetObjectArrayElement(colors, i); @@ -460,4 +461,12 @@ public final class ImGuiStyle { public native void scaleAllSizes(float scaleFactor); /* ImGui::GetStyle().ScaleAllSizes(scaleFactor); */ + + public native void getColor(int imGuiCol, ImVec4 dstImVec4); /* + Jni::ImVec4Cpy(env, ImGui::GetStyle().Colors[imGuiCol], dstImVec4); + */ + + public native void setColor(int imGuiCol, float r, float g, float b, float a); /* + ImGui::GetStyle().Colors[imGuiCol] = ImVec4(r, g, b, a); + */ }