[API] Add ImGuiStyle#getColors to return float[][]
Same is applied to NodeEditorStyle
This commit is contained in:
1 parent
36415d60f3
commit
51cfb7ef3d
4 files changed
+31
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
package imgui;
|
package imgui;
|
||||||
|
|
||||||
import imgui.binding.ImGuiStructDestroyable;
|
import imgui.binding.ImGuiStructDestroyable;
|
||||||
|
import imgui.flag.ImGuiCol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
|
* You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
|
||||||
@@ -896,6 +897,12 @@ public final class ImGuiStyle extends ImGuiStructDestroyable {
|
|||||||
IMGUI_STYLE->CircleSegmentMaxError = circleSegmentMaxError;
|
IMGUI_STYLE->CircleSegmentMaxError = circleSegmentMaxError;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public float[][] getColors() {
|
||||||
|
final float[][] colors = new float[ImGuiCol.COUNT][4];
|
||||||
|
getColors(colors);
|
||||||
|
return colors;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4]
|
* BINDING NOTICE: colors is a 2d array with sizes: [ImGuiCol_COUNT][4]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,4 +20,5 @@ public final class ImNodesColorStyle {
|
|||||||
public static final int BoxSelectorOutline = 13;
|
public static final int BoxSelectorOutline = 13;
|
||||||
public static final int GridBackground = 14;
|
public static final int GridBackground = 14;
|
||||||
public static final int GridLine = 15;
|
public static final int GridLine = 15;
|
||||||
|
public static final int COUNT = 16;
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package imgui.extension.nodeditor;
|
|||||||
import imgui.ImVec2;
|
import imgui.ImVec2;
|
||||||
import imgui.ImVec4;
|
import imgui.ImVec4;
|
||||||
import imgui.binding.ImGuiStruct;
|
import imgui.binding.ImGuiStruct;
|
||||||
|
import imgui.extension.nodeditor.flag.NodeEditorStyleColor;
|
||||||
|
|
||||||
public final class NodeEditorStyle extends ImGuiStruct {
|
public final class NodeEditorStyle extends ImGuiStruct {
|
||||||
public NodeEditorStyle(final long ptr) {
|
public NodeEditorStyle(final long ptr) {
|
||||||
@@ -292,6 +293,27 @@ public final class NodeEditorStyle extends ImGuiStruct {
|
|||||||
IM_NODE_EDITOR_STYLE->GroupBorderWidth = groupBorderWidth;
|
IM_NODE_EDITOR_STYLE->GroupBorderWidth = groupBorderWidth;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public float[][] getColors() {
|
||||||
|
final float[][] colors = new float[NodeEditorStyleColor.COUNT][4];
|
||||||
|
getColors(colors);
|
||||||
|
return colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public native void getColors(float[][] buff); /*
|
||||||
|
for (int i = 0; i < ed::StyleColor_Count; i++) {
|
||||||
|
jfloatArray jColors = (jfloatArray)env->GetObjectArrayElement(buff, i);
|
||||||
|
jfloat* jBuffColor = env->GetFloatArrayElements(jColors, 0);
|
||||||
|
|
||||||
|
jBuffColor[0] = IM_NODE_EDITOR_STYLE->Colors[i].x;
|
||||||
|
jBuffColor[1] = IM_NODE_EDITOR_STYLE->Colors[i].y;
|
||||||
|
jBuffColor[2] = IM_NODE_EDITOR_STYLE->Colors[i].z;
|
||||||
|
jBuffColor[3] = IM_NODE_EDITOR_STYLE->Colors[i].w;
|
||||||
|
|
||||||
|
env->ReleaseFloatArrayElements(jColors, jBuffColor, 0);
|
||||||
|
env->DeleteLocalRef(jColors);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BINDING NOTICE: colors is a 2d array with sizes: [StyleColor_Count][4]
|
* BINDING NOTICE: colors is a 2d array with sizes: [StyleColor_Count][4]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ public final class NodeEditorStyleColor {
|
|||||||
public static final int FlowMarker = 15;
|
public static final int FlowMarker = 15;
|
||||||
public static final int GroupBg = 16;
|
public static final int GroupBg = 16;
|
||||||
public static final int GroupBorder = 17;
|
public static final int GroupBorder = 17;
|
||||||
|
public static final int COUNT = 18;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user