Skip to content

Commit

Permalink
Add methods to provide and get separate ImGuiStyle.Colors values
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed Feb 11, 2020
1 parent aed7287 commit 8571a01
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions imgui-binding/src/main/java/imgui/ImGuiStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
*/
}

0 comments on commit 8571a01

Please sign in to comment.