Skip to content

Commit

Permalink
[API] Dear ImGui v1.82
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed Mar 27, 2021
1 parent 53ca34c commit 0ed891f
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 84 deletions.
2 changes: 1 addition & 1 deletion example/src/main/java/ExampleImNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class ExampleImNodes {
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_B = new ImInt();
Expand Down
4 changes: 2 additions & 2 deletions example/src/main/java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ protected void initImGui(final Configuration config) {
io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // Enable Multi-Viewport / Platform Windows
io.setConfigViewportsNoTaskBarIcon(true);

ImNodes.initialize();
ImNodes.createContext();
}

@Override
protected void disposeImGui() {
ImNodes.shutdown();
ImNodes.destroyContext();
super.disposeImGui();
}

Expand Down
32 changes: 16 additions & 16 deletions imgui-binding/src/main/java/imgui/ImDrawList.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ public ImVec2 getClipRectMax() {
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); /*
IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, 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, imDrawFlags);
*/

public native void addRect(float pMinX, float pMinY, float pMaxX, float pMaxY, int col, float rounding, int roundingCornersFlags, float thickness); /*
IM_DRAW_LIST->AddRect(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, roundingCornersFlags, 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, imDrawFlags, thickness);
*/

public native void addRectFilled(float pMinX, float pMinY, float pMaxX, float pMaxY, int col); /*
Expand All @@ -171,8 +171,8 @@ public ImVec2 getClipRectMax() {
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); /*
IM_DRAW_LIST->AddRectFilled(ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), col, rounding, 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, imDrawFlags);
*/

public native void addRectFilledMultiColor(float pMinX, float pMinY, float pMaxX, float pMaxY, long colUprLeft, long colUprRight, long colBotRight, long colBotLeft); /*
Expand Down Expand Up @@ -264,7 +264,7 @@ public void addText(final ImFont imFont, final float fontSize, final float posX,
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);
ImVec2 _points[points_num];
for (int i = 0; i < points_num; i++) {
Expand All @@ -273,7 +273,7 @@ public void addText(final ImFont imFont, final float fontSize, final float posX,
Jni::ImVec2Cpy(env, jImVec2, &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.
Expand Down Expand Up @@ -366,8 +366,8 @@ public void addText(final ImFont imFont, final float fontSize, final float posX,
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); /*
IM_DRAW_LIST->AddImageRounded((ImTextureID)(intptr_t)textureID, ImVec2(pMinX, pMinY), ImVec2(pMaxX, pMaxY), ImVec2(uvMinX, uvMinY), ImVec2(uvMaxX, uvMaxY), col, rounding, 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, imDrawFlags);
*/

// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
Expand All @@ -389,12 +389,12 @@ public void addText(final ImFont imFont, final float fontSize, final float posX,
IM_DRAW_LIST->PathFillConvex(col);
*/

public native void pathStroke(int col, boolean closed); /*
IM_DRAW_LIST->PathStroke(col, closed);
public native void pathStroke(int col, int imDrawFlags); /*
IM_DRAW_LIST->PathStroke(col, imDrawFlags);
*/

public native void pathStroke(int col, boolean closed, float thickness); /*
IM_DRAW_LIST->PathStroke(col, closed, thickness);
public native void pathStroke(int col, int imDrawFlags, float thickness); /*
IM_DRAW_LIST->PathStroke(col, imDrawFlags, thickness);
*/

public native void pathArcTo(float centerX, float centerY, float radius, float aMin, float aMax); /*
Expand Down Expand Up @@ -448,8 +448,8 @@ public void addText(final ImFont imFont, final float fontSize, final float posX,
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); /*
IM_DRAW_LIST->PathRect(ImVec2(rectMinX, rectMinY), ImVec2(rectMaxX, rectMaxY), rounding, 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, imDrawFlags);
*/

// Advanced: Channels
Expand Down
8 changes: 4 additions & 4 deletions imgui-binding/src/main/java/imgui/ImGuiStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -885,16 +885,16 @@ public ImVec2 getDisplaySafeAreaPadding() {
* 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.
*/
public native float getCircleSegmentMaxError(); /*
return IMGUI_STYLE->CircleSegmentMaxError;
public native float getCircleTessellationMaxError(); /*
return IMGUI_STYLE->CircleTessellationMaxError;
*/

/**
* 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.
*/
public native void setCircleSegmentMaxError(float circleSegmentMaxError); /*
IMGUI_STYLE->CircleSegmentMaxError = circleSegmentMaxError;
public native void setCircleTessellationMaxError(float circleTessellationMaxError); /*
IMGUI_STYLE->CircleTessellationMaxError = circleTessellationMaxError;
*/

public float[][] getColors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public static void editorContextSet(final ImNodesContext context) {
/**
* Initialize the node editor system.
*/
public static native void initialize(); /*
imnodes::Initialize();
public static native void createContext(); /*
imnodes::CreateContext();
*/

public static native void shutdown(); /*
imnodes::Shutdown();
public static native void destroyContext(); /*
imnodes::DestroyContext();
*/

/**
Expand Down
45 changes: 0 additions & 45 deletions imgui-binding/src/main/java/imgui/flag/ImDrawCornerFlags.java

This file was deleted.

42 changes: 42 additions & 0 deletions imgui-binding/src/main/java/imgui/flag/ImDrawFlags.java
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ private ImGuiInputTextFlags() {
*/
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
*/
Expand Down
10 changes: 0 additions & 10 deletions imgui-binding/src/main/java/imgui/internal/ImGuiDockNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -530,16 +530,6 @@ public void setOnlyNodeWithWindows(final ImGuiDockNode imGuiDockNode) {
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.
*/
Expand Down

0 comments on commit 0ed891f

Please sign in to comment.