[API] Dear ImGui v1.82

This commit is contained in:
SpaiR committed 2021-03-27 20:03:16 +02:00
1 parent 53ca34cf66
commit 0ed891f391
9 files changed
+71 -84

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import java.net.URI;
public class ExampleImNodes { public class ExampleImNodes {
private static final ImNodesContext CONTEXT = new ImNodesContext(); private static final ImNodesContext CONTEXT = new ImNodesContext();
private static final String URL = "https://github.com/Nelarius/imnodes/tree/868dda6"; private static final String URL = "https://github.com/Nelarius/imnodes/tree/857cc86";
private static final ImInt LINK_A = new ImInt(); private static final ImInt LINK_A = new ImInt();
private static final ImInt LINK_B = new ImInt(); private static final ImInt LINK_B = new ImInt();
+2 -2
View File
@@ -28,12 +28,12 @@ public class Main extends Application {
io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // Enable Multi-Viewport / Platform Windows io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // Enable Multi-Viewport / Platform Windows
io.setConfigViewportsNoTaskBarIcon(true); io.setConfigViewportsNoTaskBarIcon(true);
ImNodes.initialize(); ImNodes.createContext();
} }
@Override @Override
protected void disposeImGui() { protected void disposeImGui() {
ImNodes.shutdown(); ImNodes.destroyContext();
super.disposeImGui(); super.disposeImGui();
} }
@@ -155,12 +155,12 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding); IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding);
*/ */
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int roundingCornersFlags); /* public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int imDrawFlags); /*
IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags); IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, imDrawFlags);
*/ */
public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int roundingCornersFlags, float thickness); /* public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int imDrawFlags, float thickness); /*
IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags, thickness); IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, imDrawFlags, thickness);
*/ */
public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, int col); /* public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, int col); /*
@@ -171,8 +171,8 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding); IM_DRAW_LIST->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding);
*/ */
public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int roundingCornersFlags); /* public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int imDrawFlags); /*
IM_DRAW_LIST->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags); IM_DRAW_LIST->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, imDrawFlags);
*/ */
public native void addRectFilledMultiColor(float pMinX, float pMinY, float pMaxX, float pMaxY, long colUprLeft, long colUprRight, long colBotRight, long colBotLeft); /* public native void addRectFilledMultiColor(float pMinX, float pMinY, float pMaxX, float pMaxY, long colUprLeft, long colUprRight, long colBotRight, long colBotLeft); /*
@@ -264,7 +264,7 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->AddText((ImFont*)imFontPtr, fontSize, ImVec2(posX, posY), col, text, NULL, wrapWidth, &cpuFineClipRect); IM_DRAW_LIST->AddText((ImFont*)imFontPtr, fontSize, ImVec2(posX, posY), col, text, NULL, wrapWidth, &cpuFineClipRect);
*/ */
public native void addPolyline(ImVec2[] points, int numPoints, int col, boolean closed, float thickness); /* public native void addPolyline(ImVec2[] points, int numPoints, int col, int imDrawFlags, float thickness); /*
int points_num = env->GetArrayLength(points); int points_num = env->GetArrayLength(points);
ImVec2 _points[points_num]; ImVec2 _points[points_num];
for (int i = 0; i < points_num; i++) { for (int i = 0; i < points_num; i++) {
@@ -273,7 +273,7 @@ public final class ImDrawList extends ImGuiStruct {
Jni::ImVec2Cpy(env, jImVec2, &dst); Jni::ImVec2Cpy(env, jImVec2, &dst);
_points[i] = dst; _points[i] = dst;
} }
IM_DRAW_LIST->AddPolyline(_points, numPoints, col, closed, thickness); IM_DRAW_LIST->AddPolyline(_points, numPoints, col, imDrawFlags, thickness);
*/ */
// Note: Anti-aliased filling requires points to be in clockwise order. // Note: Anti-aliased filling requires points to be in clockwise order.
@@ -366,8 +366,8 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->AddImageRounded((ImTextureID)(intptr_t)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding); IM_DRAW_LIST->AddImageRounded((ImTextureID)(intptr_t)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding);
*/ */
public native void addImageRounded(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY, int col, float rounding, int imDrawCornerFlags); /* public native void addImageRounded(int textureID, float pMinX, float pMinY, float pMaxX, float pMaxY, float uvMinX, float uvMinY, float uvMaxX, float uvMaxY, int col, float rounding, int imDrawFlags); /*
IM_DRAW_LIST->AddImageRounded((ImTextureID)(intptr_t)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding, imDrawCornerFlags); IM_DRAW_LIST->AddImageRounded((ImTextureID)(intptr_t)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding, imDrawFlags);
*/ */
// Stateful path API, add points then finish with PathFillConvex() or PathStroke() // Stateful path API, add points then finish with PathFillConvex() or PathStroke()
@@ -389,12 +389,12 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->PathFillConvex(col); IM_DRAW_LIST->PathFillConvex(col);
*/ */
public native void pathStroke(int col, boolean closed); /* public native void pathStroke(int col, int imDrawFlags); /*
IM_DRAW_LIST->PathStroke(col, closed); IM_DRAW_LIST->PathStroke(col, imDrawFlags);
*/ */
public native void pathStroke(int col, boolean closed, float thickness); /* public native void pathStroke(int col, int imDrawFlags, float thickness); /*
IM_DRAW_LIST->PathStroke(col, closed, thickness); IM_DRAW_LIST->PathStroke(col, imDrawFlags, thickness);
*/ */
public native void pathArcTo(float centerX, float centerY, float radius, float aMin, float aMax); /* public native void pathArcTo(float centerX, float centerY, float radius, float aMin, float aMax); /*
@@ -448,8 +448,8 @@ public final class ImDrawList extends ImGuiStruct {
IM_DRAW_LIST->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding); IM_DRAW_LIST->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding);
*/ */
public native void pathRect(float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, float rounding, int imDrawCornerFlags); /* public native void pathRect(float rectMinX, float rectMinY, float rectMaxX, float rectMaxY, float rounding, int imDrawFlags); /*
IM_DRAW_LIST->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding, imDrawCornerFlags); IM_DRAW_LIST->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding, imDrawFlags);
*/ */
// Advanced: Channels // Advanced: Channels
@@ -885,16 +885,16 @@ public final class ImGuiStyle extends ImGuiStructDestroyable {
* Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. * Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified.
* Decrease for higher quality but more geometry. * Decrease for higher quality but more geometry.
*/ */
public native float getCircleSegmentMaxError(); /* public native float getCircleTessellationMaxError(); /*
return IMGUI_STYLE->CircleSegmentMaxError; return IMGUI_STYLE->CircleTessellationMaxError;
*/ */
/** /**
* Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. * Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified.
* Decrease for higher quality but more geometry. * Decrease for higher quality but more geometry.
*/ */
public native void setCircleSegmentMaxError(float circleSegmentMaxError); /* public native void setCircleTessellationMaxError(float circleTessellationMaxError); /*
IMGUI_STYLE->CircleSegmentMaxError = circleSegmentMaxError; IMGUI_STYLE->CircleTessellationMaxError = circleTessellationMaxError;
*/ */
public float[][] getColors() { public float[][] getColors() {
@@ -49,12 +49,12 @@ public final class ImNodes {
/** /**
* Initialize the node editor system. * Initialize the node editor system.
*/ */
public static native void initialize(); /* public static native void createContext(); /*
imnodes::Initialize(); imnodes::CreateContext();
*/ */
public static native void shutdown(); /* public static native void destroyContext(); /*
imnodes::Shutdown(); imnodes::DestroyContext();
*/ */
/** /**
@@ -1,45 +0,0 @@
package imgui.flag;
public final class ImDrawCornerFlags {
private ImDrawCornerFlags() {
}
public static final int None = 0;
/**
* 0x1
*/
public static final int TopLeft = 1;
/**
* 0x2
*/
public static final int TopRight = 1 << 1;
/**
* 0x4
*/
public static final int BotLeft = 1 << 2;
/**
* 0x8
*/
public static final int BotRight = 1 << 3;
/**
* 0x3
*/
public static final int Top = TopLeft | TopRight;
/**
* 0xC
*/
public static final int Bot = BotLeft | BotRight;
/**
* 0x5
*/
public static final int Left = TopLeft | BotLeft;
/**
* 0xA
*/
public static final int Right = TopRight | BotRight;
/**
* In your function calls you may use ~0 (= all bits sets) instead of All, as a convenience
*/
public static final int All = 0xF;
}
@@ -0,0 +1,42 @@
package imgui.flag;
public final class ImDrawFlags {
private ImDrawFlags() {
}
public static final int None = 0;
/**
* PathStroke(), AddPolyline(): specify that shape should be closed (Important: this is always == 1 for legacy reason)
*/
public static final int Closed = 1;
/**
* AddRect(), AddRectFilled(), PathRect(): enable rounding top-left corner only (when rounding {@code >} 0.0f, we default to all corners). Was 0x01.
*/
public static final int RoundCornersTopLeft = 1 << 4;
/**
* AddRect(), AddRectFilled(), PathRect(): enable rounding top-right corner only (when rounding {@code >} 0.0f, we default to all corners). Was 0x02.
*/
public static final int RoundCornersTopRight = 1 << 5;
/**
* AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-left corner only (when rounding {@code >} 0.0f, we default to all corners). Was 0x04.
*/
public static final int RoundCornersBottomLeft = 1 << 6;
/**
* AddRect(), AddRectFilled(), PathRect(): enable rounding bottom-right corner only (when rounding {@code >} 0.0f, we default to all corners). Wax 0x08.
*/
public static final int RoundCornersBottomRight = 1 << 7;
/**
* AddRect(), AddRectFilled(), PathRect(): disable rounding on all corners (when rounding {@code >} 0.0f). This is NOT zero, NOT an implicit flag!
*/
public static final int RoundCornersNone = 1 << 8;
public static final int RoundCornersTop = RoundCornersTopLeft | RoundCornersTopRight;
public static final int RoundCornersBottom = RoundCornersBottomLeft | RoundCornersBottomRight;
public static final int RoundCornersLeft = RoundCornersBottomLeft | RoundCornersTopLeft;
public static final int RoundCornersRight = RoundCornersBottomRight | RoundCornersTopRight;
public static final int RoundCornersAll = RoundCornersTopLeft | RoundCornersTopRight | RoundCornersBottomLeft | RoundCornersBottomRight;
/**
* Default to ALL corners if none of the _RoundCornersXX flags are specified.
*/
public static final int RoundCornersDefault = RoundCornersAll;
public static final int RoundCornersMask = RoundCornersAll | RoundCornersNone;
}
@@ -61,9 +61,9 @@ public final class ImGuiInputTextFlags {
*/ */
public static final int NoHorizontalScroll = 1 << 12; public static final int NoHorizontalScroll = 1 << 12;
/** /**
* Insert mode * Overwrite mode
*/ */
public static final int AlwaysInsertMode = 1 << 13; public static final int AlwaysOverwrite = 1 << 13;
/** /**
* Read-only mode * Read-only mode
*/ */
@@ -530,16 +530,6 @@ public final class ImGuiDockNode extends ImGuiStruct {
IMGUI_DOCK_NODE->HasWindowMenuButton = hasWindowMenuButton; IMGUI_DOCK_NODE->HasWindowMenuButton = hasWindowMenuButton;
*/ */
public native boolean getEnableCloseButton(); /*
return IMGUI_DOCK_NODE->EnableCloseButton;
*/
public native void setEnableCloseButton(boolean enableCloseButton); /*
IMGUI_DOCK_NODE->EnableCloseButton = enableCloseButton;
*/
/** /**
* Set when closing all tabs at once. * Set when closing all tabs at once.
*/ */