ImGui API
This commit is contained in:
1 parent
b59aea96d9
commit
fcecffa5fa
45 files changed
+6025
-3583
No files matched your search
@@ -1,38 +0,0 @@
|
||||
package imgui;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public final class DrawData {
|
||||
public final static int vBufferSize = (4 + 1) * 4;
|
||||
public final static int iBufferSize = 2;
|
||||
public final static int cmdBufferSize = (1 + 4 + 1) * 4;
|
||||
public int cmdListsCount; // Number of ImDrawList* to render
|
||||
public int totalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
|
||||
public int totalVtxCount;
|
||||
public int totalCmdCount;
|
||||
public float displayPosX;
|
||||
public float displayPosY;
|
||||
public float displaySizeX;
|
||||
public float displaySizeY;
|
||||
public float framebufferScaleX;
|
||||
public float framebufferScaleY;
|
||||
public ByteBuffer vByteBuffer;
|
||||
public ByteBuffer iByteBuffer;
|
||||
public ByteBuffer cmdByteBuffer;
|
||||
|
||||
public DrawData(ByteBuffer vByteBuffer, ByteBuffer iByteBuffer, ByteBuffer cmdByteBuffer) {
|
||||
this.vByteBuffer = vByteBuffer;
|
||||
this.iByteBuffer = iByteBuffer;
|
||||
this.cmdByteBuffer = cmdByteBuffer;
|
||||
}
|
||||
|
||||
public DrawData(int maxVertice, int maxIndices, int maxCmd) {
|
||||
this.vByteBuffer = ByteBuffer.allocateDirect(maxVertice * vBufferSize);
|
||||
this.iByteBuffer = ByteBuffer.allocateDirect(maxIndices * iBufferSize);
|
||||
this.cmdByteBuffer = ByteBuffer.allocateDirect(maxCmd * cmdBufferSize);
|
||||
vByteBuffer.order(ByteOrder.nativeOrder());
|
||||
iByteBuffer.order(ByteOrder.nativeOrder());
|
||||
cmdByteBuffer.order(ByteOrder.nativeOrder());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package imgui;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImBool {
|
||||
boolean[] data = new boolean[]{false};
|
||||
|
||||
public ImBool() {
|
||||
}
|
||||
|
||||
public ImBool(boolean value) {
|
||||
data[0] = value;
|
||||
}
|
||||
|
||||
public boolean get() {
|
||||
return data[0];
|
||||
}
|
||||
|
||||
public void set(boolean value) {
|
||||
data[0] = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(data[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ImBool imBool = (ImBool) o;
|
||||
return data[0] == imBool.data[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(data[0]);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiDouble {
|
||||
public static ImGuiDouble TMP = new ImGuiDouble();
|
||||
public final class ImDouble {
|
||||
public static ImDouble TMP = new ImDouble();
|
||||
|
||||
double[] data = new double[]{0.0d};
|
||||
|
||||
public ImGuiDouble() {
|
||||
public ImDouble() {
|
||||
}
|
||||
|
||||
public ImGuiDouble(double value) {
|
||||
public ImDouble(double value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
package imgui;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
/**
|
||||
* All draw data to render a Dear ImGui frame.
|
||||
* BINDING NOTICE: DO NOT TRY TO MODIFY FIELDS OF THIS CLASS MANUALLY! You should only access their values after {@link ImGui#Render()} call.
|
||||
*/
|
||||
public final class ImDrawData {
|
||||
public static int V_BUFFER_SIZE = (4 + 1) * 4;
|
||||
public static int I_BUFFER_SIZE = 2;
|
||||
public static int CMD_BUFFER_SIZE = (1 + 4 + 1) * 4;
|
||||
|
||||
public ByteBuffer vByteBuffer;
|
||||
public ByteBuffer iByteBuffer;
|
||||
public ByteBuffer cmdByteBuffer;
|
||||
|
||||
public int totalIdxCount; // For convenience, sum of all ImDrawList's IdxBuffer.Size
|
||||
public int totalVtxCount; // For convenience, sum of all ImDrawList's VtxBuffer.Size
|
||||
public int cmdListsCount; // Number of ImDrawList* to render
|
||||
|
||||
// Upper-left position of the viewport to render (== upper-left of the orthogonal projection matrix to use)
|
||||
//
|
||||
public float displayPosX;
|
||||
public float displayPosY;
|
||||
|
||||
// Size of the viewport to render (== io.DisplaySize for the main viewport)
|
||||
// (DisplayPos+DisplaySize == lower-right of the orthogonal projection matrix to use)
|
||||
//
|
||||
public float displaySizeX;
|
||||
public float displaySizeY;
|
||||
|
||||
// Amount of pixels for each unit of DisplaySize. Based on io.DisplayFramebufferScale. Generally (1,1) on normal display, (2,2) on OSX with Retina display.
|
||||
//
|
||||
public float framebufferScaleX;
|
||||
public float framebufferScaleY;
|
||||
|
||||
ImDrawData(int maxVertices, int maxIndices, int maxCmd) {
|
||||
vByteBuffer = ByteBuffer.allocateDirect(maxVertices * V_BUFFER_SIZE).order(ByteOrder.nativeOrder());
|
||||
iByteBuffer = ByteBuffer.allocateDirect(maxIndices * I_BUFFER_SIZE).order(ByteOrder.nativeOrder());
|
||||
cmdByteBuffer = ByteBuffer.allocateDirect(maxCmd * CMD_BUFFER_SIZE).order(ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include <imgui.h>
|
||||
|
||||
jfieldID totalVtxCountID;
|
||||
jfieldID totalIdxCountID;
|
||||
jfieldID CmdListsCountID;
|
||||
jfieldID displayPosXID;
|
||||
jfieldID displayPosYID;
|
||||
jfieldID displaySizeXID;
|
||||
jfieldID displaySizeYID;
|
||||
jfieldID framebufferScaleXID;
|
||||
jfieldID framebufferScaleYID;
|
||||
*/
|
||||
|
||||
static native void nInit(); /*
|
||||
jclass jDrawDataClass = env->FindClass("imgui/ImDrawData");
|
||||
|
||||
totalVtxCountID = env->GetFieldID(jDrawDataClass, "totalVtxCount", "I");
|
||||
totalIdxCountID = env->GetFieldID(jDrawDataClass, "totalIdxCount", "I");
|
||||
CmdListsCountID = env->GetFieldID(jDrawDataClass, "cmdListsCount", "I");
|
||||
displayPosXID = env->GetFieldID(jDrawDataClass, "displayPosX", "F");
|
||||
displayPosYID = env->GetFieldID(jDrawDataClass, "displayPosY", "F");
|
||||
displaySizeXID = env->GetFieldID(jDrawDataClass, "displaySizeX", "F");
|
||||
displaySizeYID = env->GetFieldID(jDrawDataClass, "displaySizeY", "F");
|
||||
framebufferScaleXID = env->GetFieldID(jDrawDataClass, "framebufferScaleX", "F");
|
||||
framebufferScaleYID = env->GetFieldID(jDrawDataClass, "framebufferScaleY", "F");
|
||||
*/
|
||||
|
||||
native void nFillDrawData(Buffer indexBuffer, Buffer vertexBuffer, Buffer cmdBuffer); /*
|
||||
ImDrawData* drawData = ImGui::GetDrawData();
|
||||
|
||||
if (drawData == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
int cmdListsCount = drawData->CmdListsCount;
|
||||
|
||||
// Set values
|
||||
env->SetIntField(object, totalVtxCountID, drawData->TotalVtxCount);
|
||||
env->SetIntField(object, totalIdxCountID, drawData->TotalIdxCount);
|
||||
env->SetIntField(object, CmdListsCountID, cmdListsCount);
|
||||
|
||||
env->SetFloatField(object, displayPosXID, drawData->DisplayPos.x);
|
||||
env->SetFloatField(object, displayPosYID, drawData->DisplayPos.y);
|
||||
|
||||
env->SetFloatField(object, displaySizeXID, drawData->DisplaySize.x);
|
||||
env->SetFloatField(object, displaySizeYID, drawData->DisplaySize.y);
|
||||
|
||||
env->SetFloatField(object, framebufferScaleXID, drawData->FramebufferScale.x);
|
||||
env->SetFloatField(object, framebufferScaleYID, drawData->FramebufferScale.y);
|
||||
|
||||
ImDrawList** drawLists = drawData->CmdLists;
|
||||
|
||||
int verticesOffset = 0;
|
||||
int indicesOffset = 0;
|
||||
int cmdOffset = 0;
|
||||
|
||||
for(int i = 0; i < cmdListsCount; i++) {
|
||||
ImDrawList& drawList = *drawLists[i];
|
||||
ImVector<ImDrawCmd>& imDrawCmdList = drawList.CmdBuffer;
|
||||
ImVector<ImDrawIdx>& idxBuffer = drawList.IdxBuffer;
|
||||
ImVector<ImDrawVert>& vtxBuffer = drawList.VtxBuffer;
|
||||
|
||||
float* vertexArrayDest = (float*)vertexBuffer;
|
||||
short* indexArrayDest = (short*)indexBuffer;
|
||||
|
||||
int colorSize = 1;
|
||||
int verticesItemSize = (4 + colorSize);
|
||||
|
||||
vertexArrayDest[verticesOffset++] = vtxBuffer.Size;
|
||||
|
||||
// copy vertices to Destination buffer
|
||||
for(int j = 0; j < vtxBuffer.Size; j++) {
|
||||
ImDrawVert v = vtxBuffer[j];
|
||||
float posX = v.pos.x;
|
||||
float posY = v.pos.y;
|
||||
float uvX = v.uv.x;
|
||||
float uvY = v.uv.y;
|
||||
|
||||
int byteIndex = (j * verticesItemSize) + verticesOffset;
|
||||
|
||||
float color = 0;
|
||||
memcpy(&color, &v.col, 4); // move unsigned int color to float
|
||||
|
||||
vertexArrayDest[byteIndex + 0] = posX;
|
||||
vertexArrayDest[byteIndex + 1] = posY;
|
||||
vertexArrayDest[byteIndex + 2] = uvX;
|
||||
vertexArrayDest[byteIndex + 3] = uvY;
|
||||
vertexArrayDest[byteIndex + 4] = color;
|
||||
}
|
||||
verticesOffset += vtxBuffer.Size * verticesItemSize;
|
||||
|
||||
// copy index to destination buffer
|
||||
indexArrayDest[indicesOffset++] = idxBuffer.Size;
|
||||
|
||||
for(int j = 0; j < idxBuffer.Size; j++) {
|
||||
indexArrayDest[j + indicesOffset] = idxBuffer[j];
|
||||
}
|
||||
|
||||
indicesOffset += idxBuffer.Size;
|
||||
|
||||
float* cmdArrayDest = (float*)cmdBuffer;
|
||||
|
||||
cmdArrayDest[cmdOffset++] = imDrawCmdList.Size;
|
||||
int bytesOffset = 0;
|
||||
int imDrawCmdSize = 1 + 4 + 1;
|
||||
|
||||
for (int cmd_i = 0; cmd_i < imDrawCmdList.Size; cmd_i++) {
|
||||
const ImDrawCmd* pcmd = &imDrawCmdList[cmd_i];
|
||||
|
||||
float textureID = (float)(intptr_t)pcmd->TextureId;
|
||||
float tempArray [6] = {
|
||||
pcmd->ElemCount,
|
||||
pcmd->ClipRect.x, pcmd->ClipRect.y,
|
||||
pcmd->ClipRect.z, pcmd->ClipRect.w,
|
||||
textureID
|
||||
};
|
||||
|
||||
memcpy((cmdArrayDest + (cmd_i * imDrawCmdSize) + cmdOffset), tempArray, imDrawCmdSize * 4);
|
||||
bytesOffset = bytesOffset + imDrawCmdSize;
|
||||
}
|
||||
|
||||
cmdOffset += imDrawCmdList.Size * imDrawCmdSize;
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -1,128 +1,332 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.enums.ImDrawCornerFlags;
|
||||
/**
|
||||
* Draw command list
|
||||
* This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame,
|
||||
* all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.
|
||||
* Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to
|
||||
* access the current window draw list and draw custom primitives.
|
||||
* You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
||||
* All positions are generally in pixel coordinates (top-left at (0,0), bottom-right at io.DisplaySize),
|
||||
* but you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well)
|
||||
* Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui:: functions), if you use this API a lot consider coarse culling your drawn objects.
|
||||
*/
|
||||
public final class ImDrawList {
|
||||
public static final int TYPE_DEFAULT = 0;
|
||||
public static final int TYPE_BACKGROUND = 1;
|
||||
public static final int TYPE_FOREGROUND = 2;
|
||||
|
||||
public class ImDrawList {
|
||||
private final int drawListType;
|
||||
|
||||
public final static int TYPE_DEFAULT = 0;
|
||||
public final static int TYPE_BACKGROUND = 1;
|
||||
public final static int TYPE_FOREGROUND = 2;
|
||||
|
||||
private int type = TYPE_DEFAULT;
|
||||
|
||||
public ImDrawList(int type) {
|
||||
this.type = type;
|
||||
ImDrawList(int drawListType) {
|
||||
this.drawListType = drawListType;
|
||||
}
|
||||
|
||||
public void AddLine(float a_x, float a_y, float b_x, float b_y, int col) {
|
||||
Native.AddLine(type, a_x, a_y, b_x, b_y, col);
|
||||
}
|
||||
/*JNI
|
||||
#include <imgui.h>
|
||||
#include "jni_common.h"
|
||||
|
||||
public void AddLine(float a_x, float a_y, float b_x, float b_y, int col, float thinkness) {
|
||||
Native.AddLine(type, a_x, a_y, b_x, b_y, col, thinkness);
|
||||
}
|
||||
const static int DRAWLIST_TYPE_DEFAULT = 0;
|
||||
const static int DRAWLIST_TYPE_BACKGROUND = 1;
|
||||
const static int DRAWLIST_TYPE_FOREGROUND = 2;
|
||||
|
||||
public void AddRect(float a_x, float a_y, float b_x, float b_y, int col) {
|
||||
Native.AddRect(type, a_x, a_y, b_x, b_y, col);
|
||||
}
|
||||
ImDrawList* getDrawList(int drawListType) {
|
||||
switch (drawListType) {
|
||||
case DRAWLIST_TYPE_DEFAULT:
|
||||
return ImGui::GetWindowDrawList();
|
||||
case DRAWLIST_TYPE_BACKGROUND:
|
||||
return ImGui::GetBackgroundDrawList();
|
||||
case DRAWLIST_TYPE_FOREGROUND:
|
||||
return ImGui::GetForegroundDrawList();
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRect(float a_x, float a_y, float b_x, float b_y, int col, float rounding) {
|
||||
Native.AddRect(type, a_x, a_y, b_x, b_y, col, rounding);
|
||||
}
|
||||
jfieldID drawListTypeID;
|
||||
*/
|
||||
|
||||
public void AddRect(float a_x, float a_y, float b_x, float b_y, int col, float rounding, ImDrawCornerFlags rounding_corners_flags) {
|
||||
Native.AddRect(type, a_x, a_y, b_x, b_y, col, rounding, rounding_corners_flags.getValue());
|
||||
}
|
||||
static native void nInit(); /*
|
||||
jclass jImDrawListClass = env->FindClass("imgui/ImDrawList");
|
||||
drawListTypeID = env->GetFieldID(jImDrawListClass, "drawListType", "I");
|
||||
*/
|
||||
|
||||
public void AddRect(float a_x, float a_y, float b_x, float b_y, int col, float rounding, ImDrawCornerFlags rounding_corners_flags, float thickness) {
|
||||
Native.AddRect(type, a_x, a_y, b_x, b_y, col, rounding, rounding_corners_flags.getValue(), thickness);
|
||||
}
|
||||
// Flags, you may poke into these to adjust anti-aliasing settings per-primitive.
|
||||
public native int getImDrawListFlags(); /*
|
||||
return getDrawList(env->GetIntField(object, drawListTypeID))->Flags;
|
||||
*/
|
||||
|
||||
public void AddRectFilled(float a_x, float a_y, float b_x, float b_y, int col) {
|
||||
Native.AddRectFilled(type, a_x, a_y, b_x, b_y, col);
|
||||
}
|
||||
public native void setImDrawListFlags(int imDrawListFlags); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->Flags = imDrawListFlags;
|
||||
*/
|
||||
|
||||
public void AddRectFilled(float a_x, float a_y, float b_x, float b_y, int col, float rounding) {
|
||||
Native.AddRectFilled(type, a_x, a_y, b_x, b_y, col, rounding);
|
||||
}
|
||||
// Primitives
|
||||
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
||||
|
||||
public void AddRectFilled(float a_x, float a_y, float b_x, float b_y, int col, float rounding, ImDrawCornerFlags rounding_corners_flags) {
|
||||
Native.AddRectFilled(type, a_x, a_y, b_x, b_y, col, rounding, rounding_corners_flags.getValue());
|
||||
}
|
||||
public native void AddLine(float p1_x, float p1_y, float p2_x, float p2_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), col);
|
||||
*/
|
||||
|
||||
public void AddRectFilledMultiColor(float a_x, float a_y, float b_x, float b_y, int col_upr_left, float col_upr_right, int col_bot_right, int col_bot_left) {
|
||||
Native.AddRectFilledMultiColor(type, a_x, a_y, b_x, b_y, col_upr_left, col_upr_right, col_bot_right, col_bot_left);
|
||||
}
|
||||
public native void AddLine(float p1_x, float p1_y, float p2_x, float p2_y, long col, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddLine(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), col, thickness);
|
||||
*/
|
||||
|
||||
public void AddQuad(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, float d_x, float d_y, int col) {
|
||||
Native.AddQuad(type, a_x, a_y, b_x, b_y, c_x, c_y, d_x, d_y, col);
|
||||
}
|
||||
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col);
|
||||
*/
|
||||
|
||||
public void AddQuad(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, float d_x, float d_y, int col, float thickness) {
|
||||
Native.AddQuad(type, a_x, a_y, b_x, b_y, c_x, c_y, d_x, d_y, col, thickness);
|
||||
}
|
||||
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding);
|
||||
*/
|
||||
|
||||
public void AddQuadFilled(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, float d_x, float d_y, int col) {
|
||||
Native.AddQuadFilled(type, a_x, a_y, b_x, b_y, c_x, c_y, d_x, d_y, col);
|
||||
}
|
||||
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags);
|
||||
*/
|
||||
|
||||
public void AddTriangle(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, int col) {
|
||||
Native.AddTriangle(type, a_x, a_y, b_x, b_y, c_x, c_y, col);
|
||||
}
|
||||
public native void AddRect(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRect(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags, thickness);
|
||||
*/
|
||||
|
||||
public void AddTriangle(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, int col, float thickness) {
|
||||
Native.AddTriangle(type, a_x, a_y, b_x, b_y, c_x, c_y, col, thickness);
|
||||
}
|
||||
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col);
|
||||
*/
|
||||
|
||||
public void AddTriangleFilled(float a_x, float a_y, float b_x, float b_y, float c_x, float c_y, int col) {
|
||||
Native.AddTriangleFilled(type, a_x, a_y, b_x, b_y, c_x, c_y, col);
|
||||
}
|
||||
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding);
|
||||
*/
|
||||
|
||||
public void AddCircle(float centre_x, float centre_y, float radius, float col, int num_segments, float thickness) {
|
||||
Native.AddCircle(type, centre_x, centre_y, radius, col, num_segments, thickness);
|
||||
}
|
||||
public native void AddRectFilled(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col, float rounding, int rounding_corners_flags); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilled(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col, rounding, rounding_corners_flags);
|
||||
*/
|
||||
|
||||
public void AddCircleFilled(float centre_x, float centre_y, float radius, float col) {
|
||||
Native.AddCircleFilled(type, centre_x, centre_y, radius, col);
|
||||
}
|
||||
public native void AddRectFilledMultiColor(float p_min_x, float p_min_y, float p_max_x, float p_max_y, long col_upr_left, long col_upr_right, long col_bot_right, long col_bot_left); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddRectFilledMultiColor(ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), col_upr_left, col_upr_right, col_bot_right, col_bot_left);
|
||||
*/
|
||||
|
||||
public void AddCircleFilled(float centre_x, float centre_y, float radius, float col, int num_segments) {
|
||||
Native.AddCircleFilled(type, centre_x, centre_y, radius, col, num_segments);
|
||||
}
|
||||
public native void AddQuad(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col);
|
||||
*/
|
||||
|
||||
public void AddText(float pos_x, float pos_y, int col, String text_begin) {
|
||||
Native.AddText(type, pos_x, pos_y, col, text_begin);
|
||||
}
|
||||
public native void AddQuad(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuad(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col, thickness);
|
||||
*/
|
||||
|
||||
public void AddText(float pos_x, float pos_y, int col, String text_begin, String text_end) {
|
||||
Native.AddText(type, pos_x, pos_y, col, text_begin, text_end);
|
||||
}
|
||||
public native void AddQuadFilled(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddQuadFilled(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), col);
|
||||
*/
|
||||
|
||||
// TODO AddText
|
||||
public native void AddTriangle(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col);
|
||||
*/
|
||||
|
||||
public void AddImage(int textureID, float a_x, float a_y, float b_x, float b_y) {
|
||||
Native.AddImage(type, textureID, a_x, a_y, b_x, b_y);
|
||||
}
|
||||
public native void AddTriangle(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangle(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col, thickness);
|
||||
*/
|
||||
|
||||
public void AddImage(int textureID, float a_x, float a_y, float b_x, float b_y, float uv_a_x, float uv_a_y, float uv_b_x, float uv_b_y) {
|
||||
Native.AddImage(type, textureID, a_x, a_y, b_x, b_y, uv_a_x, uv_a_y, uv_b_x, uv_b_y);
|
||||
}
|
||||
public native void AddTriangleFilled(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddTriangleFilled(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), col);
|
||||
*/
|
||||
|
||||
//TODO AddImageQuad, AddImageRounded, AddPolyline, AddConvexPolyFilled
|
||||
public native void AddCircle(float centre_x, float centre_y, float radius, float col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col);
|
||||
*/
|
||||
|
||||
public void AddBezierCurve(float pos0_x, float pos0_y, float cp0_x, float cp0_y, float cp1_x, float cp1_y, float pos1_x, float pos1_y, float col, float thickness) {
|
||||
Native.AddBezierCurve(type, pos0_x, pos0_y, cp0_x, cp0_y, cp1_x, cp1_y, pos1_x, pos1_y, col, thickness);
|
||||
}
|
||||
public native void AddCircle(float centre_x, float centre_y, float radius, float col, int num_segments); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col, num_segments);
|
||||
*/
|
||||
|
||||
public void ChannelsSplit(int count) {
|
||||
Native.ChannelsSplit(type, count);
|
||||
}
|
||||
public native void AddCircle(float centre_x, float centre_y, float radius, float col, int num_segments, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircle(ImVec2(centre_x, centre_y), radius, col, num_segments, thickness);
|
||||
*/
|
||||
|
||||
public void ChannelsMerge() {
|
||||
Native.ChannelsMerge(type);
|
||||
}
|
||||
public native void AddCircleFilled(float centre_x, float centre_y, float radius, float col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centre_x, centre_y), radius, col);
|
||||
*/
|
||||
|
||||
public void ChannelsSetCurrent(int n) {
|
||||
Native.ChannelsSetCurrent(type, n);
|
||||
}
|
||||
public native void AddCircleFilled(float centre_x, float centre_y, float radius, float col, int num_segments); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddCircleFilled(ImVec2(centre_x, centre_y), radius, col, num_segments);
|
||||
*/
|
||||
|
||||
public native void AddText(float pos_x, float pos_y, int col, String text_begin); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(pos_x, pos_y), col, text_begin);
|
||||
*/
|
||||
|
||||
public native void AddText(float pos_x, float pos_y, int col, String text_begin, String text_end); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddText(ImVec2(pos_x, pos_y), col, text_begin, text_end);
|
||||
*/
|
||||
|
||||
// TODO add text with font support
|
||||
|
||||
public native void AddPolyline(ImVec2[] points, int num_points, long col, boolean closed, float thickness); /*
|
||||
int points_num = env->GetArrayLength(points);
|
||||
ImVec2 _points[points_num];
|
||||
for (int i = 0; i < points_num; i++) {
|
||||
jobject jImVec2 = env->GetObjectArrayElement(points, i);
|
||||
ImVec2 dst;
|
||||
Jni::ImVec2Cpy(env, jImVec2, &dst);
|
||||
_points[i] = dst;
|
||||
}
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddPolyline(_points, num_points, col, closed, thickness);
|
||||
*/
|
||||
|
||||
// Note: Anti-aliased filling requires points to be in clockwise order.
|
||||
public native void AddConvexPolyFilled(ImVec2[] points, int num_points, long col); /*
|
||||
int points_num = env->GetArrayLength(points);
|
||||
ImVec2 _points[points_num];
|
||||
for (int i = 0; i < points_num; i++) {
|
||||
jobject jImVec2 = env->GetObjectArrayElement(points, i);
|
||||
ImVec2 dst;
|
||||
Jni::ImVec2Cpy(env, jImVec2, &dst);
|
||||
_points[i] = dst;
|
||||
}
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddConvexPolyFilled(_points, num_points, col);
|
||||
*/
|
||||
|
||||
public native void AddBezierCurve(float pos0_x, float pos0_y, float cp0_x, float cp0_y, float cp1_x, float cp1_y, float pos1_x, float pos1_y, long col, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0_x, pos0_y), ImVec2(cp0_x, cp0_y), ImVec2(cp1_x, cp1_y), ImVec2(pos1_x, pos1_y), col, thickness);
|
||||
*/
|
||||
|
||||
public native void AddBezierCurve(float pos0_x, float pos0_y, float cp0_x, float cp0_y, float cp1_x, float cp1_y, float pos1_x, float pos1_y, long col, float thickness, int num_segments); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->AddBezierCurve(ImVec2(pos0_x, pos0_y), ImVec2(cp0_x, cp0_y), ImVec2(cp1_x, cp1_y), ImVec2(pos1_x, pos1_y), col, thickness, num_segments);
|
||||
*/
|
||||
|
||||
// Image primitives
|
||||
// - Read FAQ to understand what ImTextureID is.
|
||||
// - "p_min" and "p_max" represent the upper-left and lower-right corners of the rectangle.
|
||||
// - "uv_min" and "uv_max" represent the normalized texture coordinates to use for those corners. Using (0,0)->(1,1) texture coordinates will generally display the entire texture.
|
||||
|
||||
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y));
|
||||
*/
|
||||
|
||||
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y));
|
||||
*/
|
||||
|
||||
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y));
|
||||
*/
|
||||
|
||||
public native void AddImage(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImage((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col);
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y));
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y));
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y));
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y));
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y, float uv4_x, float uv4_y); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y), ImVec2(uv4_x, uv4_y));
|
||||
*/
|
||||
|
||||
public native void AddImageQuad(int textureID, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, float p4_x, float p4_y, float uv1_x, float uv1_y, float uv2_x, float uv2_y, float uv3_x, float uv3_y, float uv4_x, float uv4_y, long col); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageQuad((ImTextureID)textureID, ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), ImVec2(p4_x, p4_y), ImVec2(uv1_x, uv1_y), ImVec2(uv2_x, uv2_y), ImVec2(uv3_x, uv3_y), ImVec2(uv4_x, uv4_y), col);
|
||||
*/
|
||||
|
||||
public native void AddImageRounded(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col, float rounding); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col, rounding);
|
||||
*/
|
||||
|
||||
public native void AddImageRounded(int textureID, float p_min_x, float p_min_y, float p_max_x, float p_max_y, float uv_min_x, float uv_min_y, float uv_max_x, float uv_max_y, long col, float rounding, int imDrawCornerFlags); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->AddImageRounded((ImTextureID)textureID, ImVec2(p_min_x, p_min_y), ImVec2(p_max_x, p_max_y), ImVec2(uv_min_x, uv_min_y), ImVec2(uv_max_x, uv_max_y), col, rounding, imDrawCornerFlags);
|
||||
*/
|
||||
|
||||
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
|
||||
|
||||
public native void PathClear(); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathClear();
|
||||
*/
|
||||
|
||||
public native void PathLineTo(float pos_x, float pos_y); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineTo(ImVec2(pos_x, pos_y));
|
||||
*/
|
||||
|
||||
public native void PathLineToMergeDuplicate(float pos_x, float pos_y); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathLineToMergeDuplicate(ImVec2(pos_x, pos_y));
|
||||
*/
|
||||
|
||||
// Note: Anti-aliased filling requires points to be in clockwise order.
|
||||
public native void PathFillConvex(long col); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathFillConvex(col);
|
||||
*/
|
||||
|
||||
public native void PathStroke(long col, boolean closed); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathStroke(col, closed);
|
||||
*/
|
||||
|
||||
public native void PathStroke(long col, boolean closed, float thickness); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathStroke(col, closed, thickness);
|
||||
*/
|
||||
|
||||
public native void PathArcTo(float center_x, float center_y, float radius, float a_min, float a_max); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(center_x, center_y), radius, a_min, a_max);
|
||||
*/
|
||||
|
||||
public native void PathArcTo(float center_x, float center_y, float radius, float a_min, float a_max, int num_segments); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcTo(ImVec2(center_x, center_y), radius, a_min, a_max, num_segments);
|
||||
*/
|
||||
|
||||
// Use precomputed angles for a 12 steps circle
|
||||
public native void PathArcToFast(float center_x, float center_y, float radius, int a_min_of_12, int a_max_of_12); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathArcToFast(ImVec2(center_x, center_y), radius, a_min_of_12, a_max_of_12);
|
||||
*/
|
||||
|
||||
public native void PathBezierCurveTo(float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y, int num_segments); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathBezierCurveTo(ImVec2(p1_x, p1_y), ImVec2(p2_x, p2_y), ImVec2(p3_x, p3_y), num_segments);
|
||||
*/
|
||||
|
||||
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y));
|
||||
*/
|
||||
|
||||
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y, float rounding); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y), rounding);
|
||||
*/
|
||||
|
||||
public native void PathRect(float rect_min_x, float rect_min_y, float rect_max_x, float rect_max_y, float rounding, int imDrawCornerFlags); /*
|
||||
getDrawList(env->GetIntField(object, drawListTypeID))->PathRect(ImVec2(rect_min_x, rect_min_y), ImVec2(rect_max_x, rect_max_y), rounding, imDrawCornerFlags);
|
||||
*/
|
||||
|
||||
// Advanced: Channels
|
||||
// - Use to split render into layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
|
||||
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
|
||||
|
||||
public native void ChannelsSplit(int count); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->ChannelsSplit(count);
|
||||
*/
|
||||
|
||||
public native void ChannelsMerge(); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->ChannelsMerge();
|
||||
*/
|
||||
|
||||
public native void ChannelsSetCurrent(int n); /*
|
||||
ImDrawList* drawList = getDrawList(env->GetIntField(object, drawListTypeID));
|
||||
drawList->ChannelsSetCurrent(n);
|
||||
*/
|
||||
}
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiFloat {
|
||||
public static ImGuiFloat TMP = new ImGuiFloat();
|
||||
public final class ImFloat {
|
||||
public static ImFloat TMP = new ImFloat();
|
||||
|
||||
float[] data = new float[]{0.0f};
|
||||
|
||||
public ImGuiFloat() {
|
||||
public ImFloat() {
|
||||
}
|
||||
|
||||
public ImGuiFloat(float value) {
|
||||
public ImFloat(float value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,27 +0,0 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiBoolean {
|
||||
public static ImGuiBoolean TMP = new ImGuiBoolean();
|
||||
|
||||
boolean[] data = new boolean[]{false};
|
||||
|
||||
public ImGuiBoolean() {
|
||||
}
|
||||
|
||||
public ImGuiBoolean(boolean value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
public boolean getValue() {
|
||||
return this.data[0];
|
||||
}
|
||||
|
||||
public void setValue(boolean value) {
|
||||
this.data[0] = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(getValue());
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,608 @@
|
||||
package imgui;
|
||||
|
||||
import imgui.enums.ImGuiConfigFlags;
|
||||
/**
|
||||
* Communicate most settings and inputs/outputs to Dear ImGui using this structure.
|
||||
* Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage.
|
||||
*/
|
||||
public final class ImGuiIO {
|
||||
ImGuiIO() {
|
||||
}
|
||||
|
||||
public class ImGuiIO {
|
||||
/*JNI
|
||||
#include <imgui.h>
|
||||
#include "jni_common.h"
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Configuration (fill once)
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// ConfigFlags
|
||||
// See ImGuiConfigFlags enum. Set by user/application. Gamepad/keyboard navigation options, etc.
|
||||
//
|
||||
public native int getConfigFlags(); /*
|
||||
return ImGui::GetIO().ConfigFlags;
|
||||
*/
|
||||
|
||||
public native void setConfigFlags(int configFlags); /*
|
||||
ImGui::GetIO().ConfigFlags = configFlags;
|
||||
*/
|
||||
|
||||
// BackendFlags
|
||||
// See ImGuiBackendFlags enum. Set by back-end to communicate features supported by the back-end.
|
||||
//
|
||||
public native int getBackendFlags(); /*
|
||||
return ImGui::GetIO().BackendFlags;
|
||||
*/
|
||||
|
||||
public native void setBackendFlags(int backendFlags); /*
|
||||
ImGui::GetIO().BackendFlags = backendFlags;
|
||||
*/
|
||||
|
||||
|
||||
// IniSavingRate
|
||||
// Minimum time between saving positions/sizes to .ini file, in seconds.
|
||||
//
|
||||
public native float getIniSavingRate(); /*
|
||||
return ImGui::GetIO().IniSavingRate;
|
||||
*/
|
||||
|
||||
public native void setIniSavingRate(float iniSavingRate); /*
|
||||
ImGui::GetIO().IniSavingRate = iniSavingRate;
|
||||
*/
|
||||
|
||||
// IniFilename
|
||||
// Path to .ini file. Set NULL to disable automatic .ini loading/saving, if e.g. you want to manually load/save from memory.
|
||||
//
|
||||
public native String getIniFilename(); /*
|
||||
return env->NewStringUTF(ImGui::GetIO().IniFilename);
|
||||
*/
|
||||
|
||||
public native void setIniFilename(String iniFilename); /*MANUAL
|
||||
ImGui::GetIO().IniFilename = obj_iniFilename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_iniFilename, JNI_FALSE);
|
||||
*/
|
||||
|
||||
// LogFilename
|
||||
// Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
|
||||
//
|
||||
public native String getLogFilename(); /*
|
||||
return env->NewStringUTF(ImGui::GetIO().LogFilename);
|
||||
*/
|
||||
|
||||
public native void setLogFilename(String logFilename); /*MANUAL
|
||||
ImGui::GetIO().LogFilename = obj_logFilename == NULL ? NULL : (char*)env->GetStringUTFChars(obj_logFilename, JNI_FALSE);
|
||||
*/
|
||||
|
||||
// MouseDoubleClickTime
|
||||
// Time for a double-click, in seconds.
|
||||
//
|
||||
public native float getMouseDoubleClickTime(); /*
|
||||
return ImGui::GetIO().MouseDoubleClickTime;
|
||||
*/
|
||||
|
||||
public native void setMouseDoubleClickTime(float mouseDoubleClickTime); /*
|
||||
ImGui::GetIO().MouseDoubleClickTime = mouseDoubleClickTime;
|
||||
*/
|
||||
|
||||
// MouseDoubleClickTime
|
||||
// Distance threshold to stay in to validate a double-click, in pixels.
|
||||
//
|
||||
public native float getMouseDoubleClickMaxDist(); /*
|
||||
return ImGui::GetIO().MouseDoubleClickTime;
|
||||
*/
|
||||
|
||||
public native void setMouseDoubleClickMaxDist(float mouseDoubleClickMaxDist); /*
|
||||
ImGui::GetIO().MouseDoubleClickMaxDist = mouseDoubleClickMaxDist;
|
||||
*/
|
||||
|
||||
// MouseDoubleClickTime
|
||||
// Distance threshold before considering we are dragging.
|
||||
public native float getMouseDragThreshold(); /*
|
||||
return ImGui::GetIO().MouseDoubleClickTime;
|
||||
*/
|
||||
|
||||
public native void setMouseDragThreshold(float mouseDragThreshold); /*
|
||||
ImGui::GetIO().MouseDragThreshold = mouseDragThreshold;
|
||||
*/
|
||||
|
||||
// KeyMap
|
||||
// Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state.
|
||||
//
|
||||
public native void getKeyMap(int[] buff); /*
|
||||
for(int i = 0; i < ImGuiKey_COUNT; i++)
|
||||
buff[i] = ImGui::GetIO().KeyMap[i];
|
||||
*/
|
||||
|
||||
public native int getKeyMap(int idx); /*
|
||||
return ImGui::GetIO().KeyMap[idx];
|
||||
*/
|
||||
|
||||
public native void setKeyMap(int idx, int code); /*
|
||||
ImGui::GetIO().KeyMap[idx] = code;
|
||||
*/
|
||||
|
||||
public native void setKeyMap(int[] keyMap); /*
|
||||
for (int i = 0; i < ImGuiKey_COUNT; i++)
|
||||
ImGui::GetIO().KeyMap[i] = keyMap[i];
|
||||
*/
|
||||
|
||||
// KeyRepeatDelay
|
||||
// When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
|
||||
//
|
||||
public native float getKeyRepeatDelay(); /*
|
||||
return ImGui::GetIO().KeyRepeatDelay;
|
||||
*/
|
||||
|
||||
public native void setKeyRepeatDelay(float keyRepeatDelay); /*
|
||||
ImGui::GetIO().KeyRepeatDelay = keyRepeatDelay;
|
||||
*/
|
||||
|
||||
// KeyRepeatRate
|
||||
// When holding a key/button, rate at which it repeats, in seconds.
|
||||
//
|
||||
public native float getKeyRepeatRate(); /*
|
||||
return ImGui::GetIO().KeyRepeatRate;
|
||||
*/
|
||||
|
||||
public native void setKeyRepeatRate(float keyRepeatRate); /*
|
||||
ImGui::GetIO().KeyRepeatRate = keyRepeatRate;
|
||||
*/
|
||||
|
||||
// TODO fonts configuration
|
||||
|
||||
// BINDING NOTICE: this is a stub to pass important for ImGui info
|
||||
public native void SetFontsTexID(int id); /*
|
||||
ImGui::GetIO().Fonts->TexID = (ImTextureID)id;
|
||||
*/
|
||||
|
||||
// Miscellaneous options
|
||||
|
||||
// MouseDrawCursor
|
||||
// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
|
||||
// Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by back-end implementations.
|
||||
//
|
||||
public native boolean getMouseDrawCursor(); /*
|
||||
return ImGui::GetIO().MouseDrawCursor;
|
||||
*/
|
||||
|
||||
public native void setMouseDrawCursor(boolean mouseDrawCursor); /*
|
||||
ImGui::GetIO().MouseDrawCursor = mouseDrawCursor;
|
||||
*/
|
||||
|
||||
// ConfigMacOSXBehaviors
|
||||
// OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl,
|
||||
// Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text,
|
||||
// Multi-selection in lists uses Cmd/Super instead of Ctrl (was called io.OptMacOSXBehaviors prior to 1.63)
|
||||
//
|
||||
public native boolean getConfigMacOSXBehaviors(); /*
|
||||
return ImGui::GetIO().ConfigMacOSXBehaviors;
|
||||
*/
|
||||
|
||||
public native void setConfigMacOSXBehaviors(boolean configMacOSXBehaviors); /*
|
||||
ImGui::GetIO().ConfigMacOSXBehaviors = configMacOSXBehaviors;
|
||||
*/
|
||||
|
||||
// ConfigInputTextCursorBlink
|
||||
// Set to false to disable blinking cursor, for users who consider it distracting. (was called: io.OptCursorBlink prior to 1.63)
|
||||
//
|
||||
public native boolean getConfigInputTextCursorBlink(); /*
|
||||
return ImGui::GetIO().ConfigInputTextCursorBlink;
|
||||
*/
|
||||
|
||||
public native void setConfigInputTextCursorBlink(boolean configInputTextCursorBlink); /*
|
||||
ImGui::GetIO().ConfigInputTextCursorBlink = configInputTextCursorBlink;
|
||||
*/
|
||||
|
||||
// ConfigWindowsResizeFromEdges
|
||||
// Enable resizing of windows from their edges and from the lower-left corner.
|
||||
// This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.
|
||||
// (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
|
||||
//
|
||||
public native boolean getConfigWindowsResizeFromEdges(); /*
|
||||
return ImGui::GetIO().ConfigWindowsResizeFromEdges;
|
||||
*/
|
||||
|
||||
public native void setConfigWindowsResizeFromEdges(boolean configWindowsResizeFromEdges); /*
|
||||
ImGui::GetIO().ConfigWindowsResizeFromEdges = configWindowsResizeFromEdges;
|
||||
*/
|
||||
|
||||
// ConfigWindowsMoveFromTitleBarOnly
|
||||
// [BETA] Set to true to only allow moving windows when clicked+dragged from the title bar. Windows without a title bar are not affected.
|
||||
//
|
||||
public native boolean getConfigWindowsMoveFromTitleBarOnly(); /*
|
||||
return ImGui::GetIO().ConfigWindowsMoveFromTitleBarOnly;
|
||||
*/
|
||||
|
||||
public native void setConfigWindowsMoveFromTitleBarOnly(boolean configWindowsMoveFromTitleBarOnly); /*
|
||||
ImGui::GetIO().ConfigWindowsMoveFromTitleBarOnly = configWindowsMoveFromTitleBarOnly;
|
||||
*/
|
||||
|
||||
// ConfigWindowsMemoryCompactTimer
|
||||
// [BETA] Compact window memory usage when unused. Set to -1.0f to disable.
|
||||
//
|
||||
public native float getConfigWindowsMemoryCompactTimer(); /*
|
||||
return ImGui::GetIO().ConfigWindowsMemoryCompactTimer;
|
||||
*/
|
||||
|
||||
public native void setConfigWindowsMemoryCompactTimer(float configWindowsMemoryCompactTimer); /*
|
||||
ImGui::GetIO().ConfigWindowsMemoryCompactTimer = configWindowsMemoryCompactTimer;
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Platform Functions
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// BackendPlatformName
|
||||
// Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff.
|
||||
//
|
||||
public native String getBackendPlatformName(); /*
|
||||
return env -> NewStringUTF(ImGui::GetIO().BackendPlatformName);
|
||||
*/
|
||||
|
||||
public native void setBackendPlatformName(String backendPlatformName); /*MANUAL
|
||||
ImGui::GetIO().BackendPlatformName = obj_backendPlatformName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_backendPlatformName, JNI_FALSE);
|
||||
*/
|
||||
|
||||
// BackendRendererName
|
||||
//
|
||||
public native String getBackendRendererName(); /*
|
||||
return env -> NewStringUTF(ImGui::GetIO().BackendRendererName);
|
||||
*/
|
||||
|
||||
public native void setBackendRendererName(String backendRendererName); /*MANUAL
|
||||
ImGui::GetIO().BackendRendererName = obj_backendRendererName == NULL ? NULL : (char*)env->GetStringUTFChars(obj_backendRendererName, JNI_FALSE);
|
||||
*/
|
||||
|
||||
// TODO clipboard callback
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Input - Fill before calling NewFrame()
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// DisplaySize
|
||||
// Main display size, in pixels.
|
||||
// BINDING NOTICE: This should be a "Config" part, but since those values may be different for every frame I don't see how it is possible to set them only once.
|
||||
//
|
||||
public native void getDisplaySize(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetIO().DisplaySize, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setDisplaySize(float x, float y); /*
|
||||
ImGui::GetIO().DisplaySize.x = x;
|
||||
ImGui::GetIO().DisplaySize.y = y;
|
||||
*/
|
||||
|
||||
// DisplayFramebufferScale
|
||||
// For retina display or other situations where window coordinates are different from framebuffer coordinates. This generally ends up in ImDrawData::FramebufferScale.
|
||||
// BINDING NOTICE: This should be a "Config" part, but since those values may be different for every frame I don't see how it is possible to set them only once.
|
||||
//
|
||||
public native void getDisplayFramebufferScale(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetIO().DisplayFramebufferScale, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setDisplayFramebufferScale(float x, float y); /*
|
||||
ImGui::GetIO().DisplayFramebufferScale.x = x;
|
||||
ImGui::GetIO().DisplayFramebufferScale.y = y;
|
||||
*/
|
||||
|
||||
// DeltaTime
|
||||
// Time elapsed since last frame, in seconds.
|
||||
// BINDING NOTICE: Same as for DisplaySize. This should be modified every frame.
|
||||
//
|
||||
public native float getDeltaTime(); /*
|
||||
return ImGui::GetIO().DeltaTime;
|
||||
*/
|
||||
|
||||
public native void setDeltaTime(float deltaTime); /*
|
||||
ImGui::GetIO().DeltaTime = deltaTime;
|
||||
*/
|
||||
|
||||
// MousePos
|
||||
// Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
|
||||
//
|
||||
public native void getMousePos(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetIO().MousePos, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setMousePos(float x, float y); /*
|
||||
ImGui::GetIO().MousePos.x = x;
|
||||
ImGui::GetIO().MousePos.y = y;
|
||||
*/
|
||||
|
||||
// MouseDown
|
||||
// Mouse buttons: 0=left, 1=right, 2=middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button).
|
||||
// Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
|
||||
//
|
||||
public native void getMouseDown(boolean[] buff); /*
|
||||
for (int i = 0; i < 5; i++)
|
||||
buff[i] = ImGui::GetIO().MouseDown[i];
|
||||
*/
|
||||
|
||||
public native boolean getMouseDown(int idx); /*
|
||||
return ImGui::GetIO().MouseDown[idx];
|
||||
*/
|
||||
|
||||
public native void setMouseDown(int idx, boolean down); /*
|
||||
ImGui::GetIO().MouseDown[idx] = down;
|
||||
*/
|
||||
|
||||
public native void setMouseDown(boolean[] mouseDown); /*
|
||||
for (int i = 0; i < 5; i++)
|
||||
ImGui::GetIO().MouseDown[i] = mouseDown[i];
|
||||
*/
|
||||
|
||||
// MouseWheel
|
||||
// Mouse wheel Vertical: 1 unit scrolls about 5 lines text.
|
||||
//
|
||||
public native float getMouseWheel(); /*
|
||||
return ImGui::GetIO().MouseWheel;
|
||||
*/
|
||||
|
||||
public native void setMouseWheel(float mouseDeltaY); /*
|
||||
ImGui::GetIO().MouseWheel = mouseDeltaY;
|
||||
*/
|
||||
|
||||
// MouseWheelH
|
||||
// Mouse wheel Horizontal. Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends.
|
||||
//
|
||||
public native float getMouseWheelH(); /*
|
||||
return ImGui::GetIO().MouseWheelH;
|
||||
*/
|
||||
|
||||
public native void setMouseWheelH(float mouseDeltaX); /*
|
||||
ImGui::GetIO().MouseWheelH = mouseDeltaX;
|
||||
*/
|
||||
|
||||
// KeyCtrl
|
||||
// Keyboard modifier pressed: Control
|
||||
//
|
||||
public native boolean getKeyCtrl(); /*
|
||||
return ImGui::GetIO().KeyCtrl;
|
||||
*/
|
||||
|
||||
public native void setKeyCtrl(boolean value); /*
|
||||
ImGui::GetIO().KeyCtrl = value;
|
||||
*/
|
||||
|
||||
// KeyShift
|
||||
// Keyboard modifier pressed: Shift
|
||||
//
|
||||
public native boolean getKeyShift(); /*
|
||||
return ImGui::GetIO().KeyShift;
|
||||
*/
|
||||
|
||||
public native void setKeyShift(boolean value); /*
|
||||
ImGui::GetIO().KeyShift = value;
|
||||
*/
|
||||
|
||||
// KeyAlt
|
||||
// Keyboard modifier pressed: Alt
|
||||
//
|
||||
public native boolean getKeyAlt(); /*
|
||||
return ImGui::GetIO().KeyAlt;
|
||||
*/
|
||||
|
||||
public native void setKeyAlt(boolean value); /*
|
||||
ImGui::GetIO().KeyAlt = value;
|
||||
*/
|
||||
|
||||
// KeySuper
|
||||
// Keyboard modifier pressed: Cmd/Super/Windows
|
||||
//
|
||||
public native boolean getKeySuper(); /*
|
||||
return ImGui::GetIO().KeySuper;
|
||||
*/
|
||||
|
||||
public native void setKeySuper(boolean value); /*
|
||||
ImGui::GetIO().KeySuper = value;
|
||||
*/
|
||||
|
||||
// KeysDown
|
||||
// Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
|
||||
//
|
||||
public native void getKeysDown(boolean[] buff); /*
|
||||
for (int i = 0; i < 512; i++)
|
||||
buff[i] = ImGui::GetIO().KeysDown[i];
|
||||
*/
|
||||
|
||||
public native boolean getKeysDown(int idx); /*
|
||||
return ImGui::GetIO().KeysDown[idx];
|
||||
*/
|
||||
|
||||
public native void setKeysDown(int idx, boolean pressed); /*
|
||||
ImGui::GetIO().KeysDown[idx] = pressed;
|
||||
*/
|
||||
|
||||
public native void setKeysDown(boolean[] keysDown); /*
|
||||
for (int i = 0; i < 512; i++)
|
||||
ImGui::GetIO().KeysDown[i] = keysDown[i];
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Output - Retrieve after calling NewFrame()
|
||||
//------------------------------------------------------------------
|
||||
|
||||
public boolean WantCaptureMouse; // When io.WantCaptureMouse is true, imgui will use the mouse inputs, do not dispatch them to your main game/application (in both cases, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
|
||||
public boolean WantCaptureKeyboard; // When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
|
||||
public boolean WantTextInput; // Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
|
||||
public boolean WantSetMousePos; // MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
|
||||
public boolean WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. IMPORTANT: You need to clear io.WantSaveIniSettings yourself.
|
||||
public boolean NavActive; // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
|
||||
public boolean NavVisible; // Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
|
||||
public float Framerate; // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
|
||||
public int MetricsRenderVertices; // Vertices output during last call to Render()
|
||||
public int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
|
||||
public int MetricsRenderWindows; // Number of visible windows
|
||||
public int MetricsActiveWindows; // Number of active windows
|
||||
public int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
|
||||
public float MouseDeltaX; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
|
||||
public float MouseDeltaY;
|
||||
// WantCaptureMouse
|
||||
// When io.WantCaptureMouse is true, imgui will use the mouse inputs, do not dispatch them to your main game/application (in both cases, always pass on mouse inputs to imgui).
|
||||
// (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
|
||||
//
|
||||
public native boolean getWantCaptureMouse(); /*
|
||||
return ImGui::GetIO().WantCaptureMouse;
|
||||
*/
|
||||
|
||||
public void SetConfigFlags(ImGuiConfigFlags flags) {
|
||||
Native.SetConfigFlags(flags.getValue());
|
||||
}
|
||||
public native void setWantCaptureMouse(boolean wantCaptureMouse); /*
|
||||
ImGui::GetIO().WantCaptureMouse = wantCaptureMouse;
|
||||
*/
|
||||
|
||||
// TODO: Available after docking comes from BETA
|
||||
// public void SetDockingFlags(boolean ConfigDockingNoSplit, boolean ConfigDockingWithShift, boolean ConfigDockingAlwaysTabBar, boolean ConfigDockingTransparentPayload) {
|
||||
// Native.SetDockingFlags(ConfigDockingNoSplit, ConfigDockingWithShift, ConfigDockingAlwaysTabBar, ConfigDockingTransparentPayload);
|
||||
// }
|
||||
// WantCaptureKeyboard
|
||||
// When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui).
|
||||
// (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
|
||||
//
|
||||
public native boolean getWantCaptureKeyboard(); /*
|
||||
return ImGui::GetIO().WantCaptureKeyboard;
|
||||
*/
|
||||
|
||||
public native void setWantCaptureKeyboard(boolean wantCaptureKeyboard); /*
|
||||
ImGui::GetIO().WantCaptureKeyboard = wantCaptureKeyboard;
|
||||
*/
|
||||
|
||||
// WantTextInput
|
||||
// Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard.
|
||||
// This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
|
||||
//
|
||||
public native boolean getWantTextInput(); /*
|
||||
return ImGui::GetIO().WantTextInput;
|
||||
*/
|
||||
|
||||
public native void setWantTextInput(boolean wantTextInput); /*
|
||||
ImGui::GetIO().WantTextInput = wantTextInput;
|
||||
*/
|
||||
|
||||
// WantSetMousePos
|
||||
// MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
|
||||
//
|
||||
public native boolean getWantSetMousePos(); /*
|
||||
return ImGui::GetIO().WantSetMousePos;
|
||||
*/
|
||||
|
||||
public native void setWantSetMousePos(boolean wantSetMousePos); /*
|
||||
ImGui::GetIO().WantSetMousePos = wantSetMousePos;
|
||||
*/
|
||||
|
||||
// WantSaveIniSettings
|
||||
// When manual .ini load/save is active (io.IniFilename == NULL),
|
||||
// this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself.
|
||||
// IMPORTANT: You need to clear io.WantSaveIniSettings yourself.
|
||||
//
|
||||
public native boolean getWantSaveIniSettings(); /*
|
||||
return ImGui::GetIO().WantSaveIniSettings;
|
||||
*/
|
||||
|
||||
public native void setWantSaveIniSettings(boolean wantSaveIniSettings); /*
|
||||
ImGui::GetIO().WantSaveIniSettings = wantSaveIniSettings;
|
||||
*/
|
||||
|
||||
// NavActive
|
||||
// Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
|
||||
//
|
||||
public native boolean getNavActive(); /*
|
||||
return ImGui::GetIO().NavActive;
|
||||
*/
|
||||
|
||||
public native void setNavActive(boolean navActive); /*
|
||||
ImGui::GetIO().NavActive = navActive;
|
||||
*/
|
||||
|
||||
// NavVisible
|
||||
// Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
|
||||
//
|
||||
public native boolean getNavVisible(); /*
|
||||
return ImGui::GetIO().NavVisible;
|
||||
*/
|
||||
|
||||
public native void setNavVisible(boolean navVisible); /*
|
||||
ImGui::GetIO().NavVisible = navVisible;
|
||||
*/
|
||||
|
||||
// Framerate
|
||||
// Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
|
||||
//
|
||||
public native float getFramerate(); /*
|
||||
return ImGui::GetIO().Framerate;
|
||||
*/
|
||||
|
||||
public native void setFramerate(float framerate); /*
|
||||
ImGui::GetIO().Framerate = framerate;
|
||||
*/
|
||||
|
||||
// MetricsRenderVertices
|
||||
// Vertices output during last call to Render()
|
||||
//
|
||||
public native int getMetricsRenderVertices(); /*
|
||||
return ImGui::GetIO().MetricsRenderVertices;
|
||||
*/
|
||||
|
||||
public native void setMetricsRenderVertices(int metricsRenderVertices); /*
|
||||
ImGui::GetIO().MetricsRenderVertices = metricsRenderVertices;
|
||||
*/
|
||||
|
||||
// MetricsRenderIndices
|
||||
// Indices output during last call to Render() = number of triangles * 3
|
||||
//
|
||||
public native int getMetricsRenderIndices(); /*
|
||||
return ImGui::GetIO().MetricsRenderIndices;
|
||||
*/
|
||||
|
||||
public native void setMetricsRenderIndices(int metricsRenderIndices); /*
|
||||
ImGui::GetIO().MetricsRenderIndices = metricsRenderIndices;
|
||||
*/
|
||||
|
||||
// MetricsRenderWindows
|
||||
// Number of visible windows
|
||||
//
|
||||
public native int getMetricsRenderWindows(); /*
|
||||
return ImGui::GetIO().MetricsRenderWindows;
|
||||
*/
|
||||
|
||||
public native void setMetricsRenderWindows(int metricsRenderWindows); /*
|
||||
ImGui::GetIO().MetricsRenderWindows = metricsRenderWindows;
|
||||
*/
|
||||
|
||||
// MetricsActiveWindows
|
||||
// Number of active windows
|
||||
//
|
||||
public native int getMetricsActiveWindows(); /*
|
||||
return ImGui::GetIO().MetricsActiveWindows;
|
||||
*/
|
||||
|
||||
public native void setMetricsActiveWindows(int metricsActiveWindows); /*
|
||||
ImGui::GetIO().MetricsActiveWindows = metricsActiveWindows;
|
||||
*/
|
||||
|
||||
// MetricsActiveAllocations
|
||||
// Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
|
||||
//
|
||||
public native int getMetricsActiveAllocations(); /*
|
||||
return ImGui::GetIO().MetricsActiveAllocations;
|
||||
*/
|
||||
|
||||
public native void setMetricsActiveAllocations(int metricsActiveAllocations); /*
|
||||
ImGui::GetIO().MetricsActiveAllocations = metricsActiveAllocations;
|
||||
*/
|
||||
|
||||
// MouseDelta
|
||||
// Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
|
||||
//
|
||||
public native void getMouseDelta(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetIO().MouseDelta, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setMouseDelta(float x, float y); /*
|
||||
ImGui::GetIO().MouseDelta.x = x;
|
||||
ImGui::GetIO().MouseDelta.y = y;
|
||||
*/
|
||||
|
||||
// Functions
|
||||
|
||||
/**
|
||||
* Queue new character input.
|
||||
*/
|
||||
public native void AddInputCharacter(int c); /*
|
||||
if (c > 0 && c < 0x10000)
|
||||
ImGui::GetIO().AddInputCharacter((unsigned short)c);
|
||||
*/;
|
||||
|
||||
/**
|
||||
* Queue new characters input from an UTF-8 string.
|
||||
*/
|
||||
public native void AddInputCharactersUTF8(String str); /*
|
||||
ImGui::GetIO().AddInputCharactersUTF8(str);
|
||||
*/
|
||||
|
||||
/**
|
||||
* Clear the text input buffer manually.
|
||||
*/
|
||||
public native void ClearInputCharacters(); /*
|
||||
ImGui::GetIO().ClearInputCharacters();
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiInputTextData {
|
||||
public final class ImGuiInputTextData {
|
||||
public int size;
|
||||
public int maxChar = -1;
|
||||
public String allowedChar = "";
|
||||
|
||||
@@ -1,7 +1,440 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiStyle {
|
||||
/**
|
||||
* You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
|
||||
* During the frame, use ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values,
|
||||
* and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
|
||||
*
|
||||
* BINDING NOTICE: This is not a fully featured representation of ImGuiStyle struct from C++.
|
||||
* Mostly it's a stub which communicates with default ImGuiStyle used by ImGuiIO.
|
||||
* Still can be used to make your interface look different, since all of the fields from the original header file are represented here.
|
||||
*/
|
||||
public final class ImGuiStyle {
|
||||
ImGuiStyle() {
|
||||
}
|
||||
|
||||
public float ItemInnerSpacingX;
|
||||
public float ItemInnerSpacingY;
|
||||
/*JNI
|
||||
#include <imgui.h>
|
||||
#include "jni_common.h"
|
||||
*/
|
||||
|
||||
// Alpha
|
||||
// Global alpha applies to everything in Dear ImGui.
|
||||
//
|
||||
public native float getAlpha(); /*
|
||||
return ImGui::GetStyle().Alpha;
|
||||
*/
|
||||
|
||||
public native void setAlpha(float alpha); /*
|
||||
ImGui::GetStyle().Alpha = alpha;
|
||||
*/
|
||||
|
||||
// WindowPadding
|
||||
// Padding within a window.
|
||||
//
|
||||
public native void getWindowPadding(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowPadding, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setWindowPadding(float x, float y); /*
|
||||
ImGui::GetStyle().WindowPadding.x = x;
|
||||
ImGui::GetStyle().WindowPadding.y = y;
|
||||
*/
|
||||
|
||||
// WindowRounding
|
||||
// Radius of window corners rounding. Set to 0.0f to have rectangular windows.
|
||||
//
|
||||
public native float getWindowRounding(); /*
|
||||
return ImGui::GetStyle().WindowRounding;
|
||||
*/
|
||||
|
||||
public native void setWindowRounding(float windowRounding); /*
|
||||
ImGui::GetStyle().WindowRounding = windowRounding;
|
||||
*/
|
||||
|
||||
// WindowBorderSize
|
||||
// Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
//
|
||||
public native float getWindowBorderSize(); /*
|
||||
return ImGui::GetStyle().WindowBorderSize;
|
||||
*/
|
||||
|
||||
public native void setWindowBorderSize(float windowBorderSize); /*
|
||||
ImGui::GetStyle().WindowBorderSize = windowBorderSize;
|
||||
*/
|
||||
|
||||
// WindowMinSize
|
||||
// Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().
|
||||
//
|
||||
public native void getWindowMinSize(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowMinSize, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setWindowMinSize(float x, float y); /*
|
||||
ImGui::GetStyle().WindowMinSize.x = x;
|
||||
ImGui::GetStyle().WindowMinSize.y = y;
|
||||
*/
|
||||
|
||||
// WindowTitleAlign
|
||||
// Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
|
||||
//
|
||||
public native void getWindowTitleAlign(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().WindowTitleAlign, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setWindowTitleAlign(float x, float y); /*
|
||||
ImGui::GetStyle().WindowTitleAlign.x = x;
|
||||
ImGui::GetStyle().WindowTitleAlign.y = y;
|
||||
*/
|
||||
|
||||
// WindowMenuButtonPosition
|
||||
// Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
|
||||
//
|
||||
public native int getWindowMenuButtonPosition(); /*
|
||||
return (int)ImGui::GetStyle().WindowMenuButtonPosition;
|
||||
*/
|
||||
|
||||
public native void setWindowMenuButtonPosition(int windowMenuButtonPosition); /*
|
||||
ImGui::GetStyle().WindowMenuButtonPosition = windowMenuButtonPosition;
|
||||
*/
|
||||
|
||||
// ChildRounding
|
||||
// Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
|
||||
//
|
||||
public native float getChildRounding(); /*
|
||||
return ImGui::GetStyle().ChildRounding;
|
||||
*/
|
||||
|
||||
public native void setChildRounding(float childRounding); /*
|
||||
ImGui::GetStyle().ChildRounding = childRounding;
|
||||
*/
|
||||
|
||||
// ChildBorderSize
|
||||
// Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
//
|
||||
public native float getChildBorderSize(); /*
|
||||
return ImGui::GetStyle().ChildBorderSize;
|
||||
*/
|
||||
|
||||
public native void setChildBorderSize(float childBorderSize); /*
|
||||
ImGui::GetStyle().ChildBorderSize = childBorderSize;
|
||||
*/
|
||||
|
||||
// PopupRounding
|
||||
// Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding)
|
||||
//
|
||||
public native float getPopupRounding(); /*
|
||||
return ImGui::GetStyle().PopupRounding;
|
||||
*/
|
||||
|
||||
public native void setPopupRounding(float popupRounding); /*
|
||||
ImGui::GetStyle().PopupRounding = popupRounding;
|
||||
*/
|
||||
|
||||
// PopupBorderSize
|
||||
// Thickness of border around popup/tooltip windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
//
|
||||
public native float getPopupBorderSize(); /*
|
||||
return ImGui::GetStyle().PopupBorderSize;
|
||||
*/
|
||||
|
||||
public native void setPopupBorderSize(float popupBorderSize); /*
|
||||
ImGui::GetStyle().PopupBorderSize = popupBorderSize;
|
||||
*/
|
||||
|
||||
// FramePadding
|
||||
// Padding within a framed rectangle (used by most widgets).
|
||||
//
|
||||
public native void getFramePadding(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().FramePadding, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setFramePadding(float x, float y); /*
|
||||
ImGui::GetStyle().FramePadding.x = x;
|
||||
ImGui::GetStyle().FramePadding.y = y;
|
||||
*/
|
||||
|
||||
// FrameRounding
|
||||
// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
||||
//
|
||||
public native float getFrameRounding(); /*
|
||||
return ImGui::GetStyle().FrameRounding;
|
||||
*/
|
||||
|
||||
public native void setFrameRounding(float frameRounding); /*
|
||||
ImGui::GetStyle().FrameRounding = frameRounding;
|
||||
*/
|
||||
|
||||
// FrameBorderSize
|
||||
// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
//
|
||||
public native float getFrameBorderSize(); /*
|
||||
return ImGui::GetStyle().FrameBorderSize;
|
||||
*/
|
||||
|
||||
public native void setFrameBorderSize(float frameBorderSize); /*
|
||||
ImGui::GetStyle().FrameBorderSize = frameBorderSize;
|
||||
*/
|
||||
|
||||
// ItemSpacing
|
||||
// Horizontal and vertical spacing between widgets/lines.
|
||||
//
|
||||
public native void getItemSpacing(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().ItemSpacing, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setItemSpacing(float x, float y); /*
|
||||
ImGui::GetStyle().ItemSpacing.x = x;
|
||||
ImGui::GetStyle().ItemSpacing.y = y;
|
||||
*/
|
||||
// ItemInnerSpacing
|
||||
// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
|
||||
//
|
||||
public native void getItemInnerSpacing(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().ItemInnerSpacing, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setItemInnerSpacing(float x, float y); /*
|
||||
ImGui::GetStyle().ItemInnerSpacing.x = x;
|
||||
ImGui::GetStyle().ItemInnerSpacing.y = y;
|
||||
*/
|
||||
// TouchExtraPadding
|
||||
// Expand reactive bounding box for touch-based system where touch position is not accurate enough.
|
||||
// Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
|
||||
//
|
||||
public native void getTouchExtraPadding(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().TouchExtraPadding, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setTouchExtraPadding(float x, float y); /*
|
||||
ImGui::GetStyle().TouchExtraPadding.x = x;
|
||||
ImGui::GetStyle().TouchExtraPadding.y = y;
|
||||
*/
|
||||
|
||||
// IndentSpacing
|
||||
// Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
|
||||
//
|
||||
public native float getIndentSpacing(); /*
|
||||
return ImGui::GetStyle().IndentSpacing;
|
||||
*/
|
||||
|
||||
public native void setIndentSpacing(float indentSpacing); /*
|
||||
ImGui::GetStyle().IndentSpacing = indentSpacing;
|
||||
*/
|
||||
|
||||
// ColumnsMinSpacing
|
||||
// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
|
||||
//
|
||||
public native float getColumnsMinSpacing(); /*
|
||||
return ImGui::GetStyle().ColumnsMinSpacing;
|
||||
*/
|
||||
|
||||
public native void setColumnsMinSpacing(float columnsMinSpacing); /*
|
||||
ImGui::GetStyle().ColumnsMinSpacing = columnsMinSpacing;
|
||||
*/
|
||||
|
||||
// ScrollbarSize
|
||||
// Width of the vertical scrollbar, Height of the horizontal scrollbar.
|
||||
//
|
||||
public native float getScrollbarSize(); /*
|
||||
return ImGui::GetStyle().ScrollbarSize;
|
||||
*/
|
||||
|
||||
public native void setScrollbarSize(float scrollbarSize); /*
|
||||
ImGui::GetStyle().ScrollbarSize = scrollbarSize;
|
||||
*/
|
||||
|
||||
// ScrollbarRounding
|
||||
// Radius of grab corners for scrollbar.
|
||||
//
|
||||
public native float getScrollbarRounding(); /*
|
||||
return ImGui::GetStyle().ScrollbarRounding;
|
||||
*/
|
||||
|
||||
public native void setScrollbarRounding(float scrollbarRounding); /*
|
||||
ImGui::GetStyle().ScrollbarRounding = scrollbarRounding;
|
||||
*/
|
||||
|
||||
// GrabMinSize
|
||||
// Minimum width/height of a grab box for slider/scrollbar.
|
||||
//
|
||||
public native float getGrabMinSize(); /*
|
||||
return ImGui::GetStyle().GrabMinSize;
|
||||
*/
|
||||
|
||||
public native void setGrabMinSize(float grabMinSize); /*
|
||||
ImGui::GetStyle().GrabMinSize = grabMinSize;
|
||||
*/
|
||||
|
||||
// GrabRounding
|
||||
// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
|
||||
//
|
||||
public native float getGrabRounding(); /*
|
||||
return ImGui::GetStyle().GrabRounding;
|
||||
*/
|
||||
|
||||
public native void setGrabRounding(float grabRounding); /*
|
||||
ImGui::GetStyle().GrabRounding = grabRounding;
|
||||
*/
|
||||
|
||||
// TabRounding
|
||||
// Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
|
||||
//
|
||||
public native float getTabRounding(); /*
|
||||
return ImGui::GetStyle().TabRounding;
|
||||
*/
|
||||
|
||||
public native void setTabRounding(float tabRounding); /*
|
||||
ImGui::GetStyle().TabRounding = tabRounding;
|
||||
*/
|
||||
|
||||
// TabBorderSize
|
||||
// Thickness of border around tabs.
|
||||
//
|
||||
public native float getTabBorderSize(); /*
|
||||
return ImGui::GetStyle().TabBorderSize;
|
||||
*/
|
||||
|
||||
public native void setTabBorderSize(float tabBorderSize); /*
|
||||
ImGui::GetStyle().TabBorderSize = tabBorderSize;
|
||||
*/
|
||||
|
||||
// ColorButtonPosition
|
||||
// Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
||||
//
|
||||
public native int getColorButtonPosition(); /*
|
||||
return ImGui::GetStyle().ColorButtonPosition;
|
||||
*/
|
||||
public native void setColorButtonPosition(int colorButtonPosition); /*
|
||||
ImGui::GetStyle().ColorButtonPosition = colorButtonPosition;
|
||||
*/
|
||||
|
||||
// ButtonTextAlign
|
||||
// Alignment of button text when button is larger than text. Defaults to (0.5f, 0.5f) (centered).
|
||||
//
|
||||
public native void getButtonTextAlign(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().ButtonTextAlign, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setButtonTextAlign(float x, float y); /*
|
||||
ImGui::GetStyle().ButtonTextAlign.x = x;
|
||||
ImGui::GetStyle().ButtonTextAlign.y = y;
|
||||
*/
|
||||
|
||||
// SelectableTextAlign
|
||||
// Alignment of selectable text when selectable is larger than text. Defaults to (0.0f, 0.0f) (top-left aligned).
|
||||
//
|
||||
public native void getSelectableTextAlign(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().SelectableTextAlign, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setSelectableTextAlign(float x, float y); /*
|
||||
ImGui::GetStyle().SelectableTextAlign.x = x;
|
||||
ImGui::GetStyle().SelectableTextAlign.y = y;
|
||||
*/
|
||||
|
||||
// DisplayWindowPadding
|
||||
// Window position are clamped to be visible within the display area by at least this amount. Only applies to regular windows.
|
||||
//
|
||||
public native void getDisplayWindowPadding(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().DisplayWindowPadding, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setDisplayWindowPadding(float x, float y); /*
|
||||
ImGui::GetStyle().DisplayWindowPadding.x = x;
|
||||
ImGui::GetStyle().DisplayWindowPadding.y = y;
|
||||
*/
|
||||
|
||||
// DisplaySafeAreaPadding
|
||||
// If you cannot see the edges of your screen (e.g. on a TV) increase the safe area padding.
|
||||
// Apply to popups/tooltips as well regular windows. NB: Prefer configuring your TV sets correctly!
|
||||
//
|
||||
public native void getDisplaySafeAreaPadding(ImVec2 dstImVec2); /*
|
||||
Jni::ImVec2Cpy(env, &ImGui::GetStyle().DisplaySafeAreaPadding, dstImVec2);
|
||||
*/
|
||||
|
||||
public native void setDisplaySafeAreaPadding(float x, float y); /*
|
||||
ImGui::GetStyle().DisplaySafeAreaPadding.x = x;
|
||||
ImGui::GetStyle().DisplaySafeAreaPadding.y = y;
|
||||
*/
|
||||
|
||||
// MouseCursorScale
|
||||
// Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
|
||||
//
|
||||
public native float getMouseCursorScale(); /*
|
||||
return ImGui::GetStyle().MouseCursorScale;
|
||||
*/
|
||||
|
||||
public native void setMouseCursorScale(float mouseCursorScale); /*
|
||||
ImGui::GetStyle().MouseCursorScale = mouseCursorScale;
|
||||
*/
|
||||
|
||||
// AntiAliasedLines
|
||||
// Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
|
||||
//
|
||||
public native boolean getAntiAliasedLines(); /*
|
||||
return ImGui::GetStyle().AntiAliasedLines;
|
||||
*/
|
||||
|
||||
public native void setAntiAliasedLines(boolean antiAliasedLines); /*
|
||||
ImGui::GetStyle().AntiAliasedLines = antiAliasedLines;
|
||||
*/
|
||||
|
||||
// AntiAliasedFill
|
||||
// Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
|
||||
//
|
||||
public native boolean getAntiAliasedFill(); /*
|
||||
return ImGui::GetStyle().AntiAliasedFill;
|
||||
*/
|
||||
|
||||
public native void setAntiAliasedFill(boolean antiAliasedFill); /*
|
||||
ImGui::GetStyle().AntiAliasedFill = antiAliasedFill;
|
||||
*/
|
||||
|
||||
// CurveTessellationTol
|
||||
// Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments.
|
||||
// Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
|
||||
//
|
||||
public native float getCurveTessellationTol(); /*
|
||||
return ImGui::GetStyle().CurveTessellationTol;
|
||||
*/
|
||||
|
||||
public native void setCurveTessellationTol(float curveTessellationTol); /*
|
||||
ImGui::GetStyle().CurveTessellationTol = curveTessellationTol;
|
||||
*/
|
||||
|
||||
// Colors
|
||||
// BINDING NOTICE: buff 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);
|
||||
jfloat* jBuffColor = env->GetFloatArrayElements(jColors, 0);
|
||||
|
||||
jBuffColor[0] = ImGui::GetStyle().Colors[i].x;
|
||||
jBuffColor[1] = ImGui::GetStyle().Colors[i].y;
|
||||
jBuffColor[2] = ImGui::GetStyle().Colors[i].z;
|
||||
jBuffColor[3] = ImGui::GetStyle().Colors[i].w;
|
||||
|
||||
env->ReleaseFloatArrayElements(jColors, jBuffColor, 0);
|
||||
env->DeleteLocalRef(jColors);
|
||||
}
|
||||
*/
|
||||
|
||||
// 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);
|
||||
jfloat* jColor = env->GetFloatArrayElements(jColors, 0);
|
||||
|
||||
ImGui::GetStyle().Colors[i].x = jColor[0];
|
||||
ImGui::GetStyle().Colors[i].y = jColor[1];
|
||||
ImGui::GetStyle().Colors[i].z = jColor[2];
|
||||
ImGui::GetStyle().Colors[i].w = jColor[3];
|
||||
|
||||
env->ReleaseFloatArrayElements(jColors, jColor, 0);
|
||||
env->DeleteLocalRef(jColors);
|
||||
}
|
||||
*/
|
||||
}
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiInt {
|
||||
public static ImGuiInt TMP = new ImGuiInt();
|
||||
public final class ImInt {
|
||||
public static ImInt TMP = new ImInt();
|
||||
|
||||
int[] data = new int[]{0};
|
||||
|
||||
public ImGuiInt() {
|
||||
public ImInt() {
|
||||
}
|
||||
|
||||
public ImGuiInt(int value) {
|
||||
public ImInt(int value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package imgui;
|
||||
|
||||
public class ImLong {
|
||||
long[] data = new long[]{0};
|
||||
|
||||
public ImLong() {
|
||||
}
|
||||
|
||||
public ImLong(long value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
return this.data[0];
|
||||
}
|
||||
|
||||
public void setValue(long value) {
|
||||
this.data[0] = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(getValue());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package imgui;
|
||||
|
||||
public class ImShort {
|
||||
short[] data = new short[]{0};
|
||||
|
||||
public ImShort() {
|
||||
}
|
||||
|
||||
public ImShort(short value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
public short getValue() {
|
||||
return this.data[0];
|
||||
}
|
||||
|
||||
public void setValue(short value) {
|
||||
this.data[0] = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(getValue());
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,25 +1,25 @@
|
||||
package imgui;
|
||||
|
||||
public class ImGuiString {
|
||||
public static ImGuiString TMP = new ImGuiString();
|
||||
final ImGuiInputTextData inputData = new ImGuiInputTextData();
|
||||
public final class ImString {
|
||||
public static ImString TMP = new ImString();
|
||||
ImGuiInputTextData inputData = new ImGuiInputTextData();
|
||||
byte[] data;
|
||||
private String text;
|
||||
|
||||
public ImGuiString() {
|
||||
public ImString() {
|
||||
this(100);
|
||||
}
|
||||
|
||||
public ImGuiString(int size) {
|
||||
public ImString(int size) {
|
||||
data = new byte[size];
|
||||
}
|
||||
|
||||
public ImGuiString(String text) {
|
||||
public ImString(String text) {
|
||||
this(text.length());
|
||||
setValue(text);
|
||||
}
|
||||
|
||||
public ImGuiString(String text, int size) {
|
||||
public ImString(String text, int size) {
|
||||
this(size);
|
||||
setValue(text);
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package imgui;
|
||||
|
||||
public class ImVec2 {
|
||||
public static ImVec2 TMP = new ImVec2();
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImVec2 {
|
||||
public float x;
|
||||
public float y;
|
||||
|
||||
@@ -12,4 +13,25 @@ public class ImVec2 {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImVec2{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ImVec2 imVec2 = (ImVec2) o;
|
||||
return Float.compare(imVec2.x, x) == 0 && Float.compare(imVec2.y, y) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,43 @@
|
||||
package imgui;
|
||||
|
||||
public class ImVec4 extends ImVec2 {
|
||||
public static ImVec4 TMP = new ImVec4();
|
||||
import java.util.Objects;
|
||||
|
||||
public final class ImVec4 {
|
||||
public float x;
|
||||
public float y;
|
||||
public float z;
|
||||
public float w;
|
||||
|
||||
public ImVec4() {
|
||||
}
|
||||
|
||||
public ImVec4(float x, float y, float z, float w) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.w = w;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ImVec4{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
", z=" + z +
|
||||
", w=" + w +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ImVec4 imVec4 = (ImVec4) o;
|
||||
return Float.compare(imVec4.x, x) == 0 && Float.compare(imVec4.y, y) == 0 && Float.compare(imVec4.z, z) == 0 && Float.compare(imVec4.w, w) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(x, y, z, w);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,18 +1,48 @@
|
||||
package imgui;
|
||||
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class TexDataRGBA32 {
|
||||
public final class TexDataRGBA32 {
|
||||
public int width;
|
||||
public int height;
|
||||
|
||||
public ByteBuffer pixelBuffer;
|
||||
|
||||
public TexDataRGBA32() {
|
||||
private TexDataRGBA32() {
|
||||
int pixelMax = 131072;
|
||||
ByteBuffer buffer = ByteBuffer.allocateDirect(pixelMax);
|
||||
buffer.order(ByteOrder.nativeOrder());
|
||||
pixelBuffer = buffer;
|
||||
pixelBuffer = ByteBuffer.allocateDirect(pixelMax).order(ByteOrder.nativeOrder());
|
||||
}
|
||||
|
||||
public static TexDataRGBA32 create() {
|
||||
TexDataRGBA32 data = new TexDataRGBA32();
|
||||
data.nFillData(data.pixelBuffer);
|
||||
return data;
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#include <imgui.h>
|
||||
*/
|
||||
|
||||
private native void nFillData(Buffer pixelBuffer); /*
|
||||
jclass jTexDataClass = env->GetObjectClass(object);
|
||||
|
||||
if(jTexDataClass == NULL)
|
||||
return;
|
||||
|
||||
jfieldID widthID = env->GetFieldID(jTexDataClass, "width", "I");
|
||||
jfieldID heightID = env->GetFieldID(jTexDataClass, "height", "I");
|
||||
|
||||
unsigned char* pixels;
|
||||
int width, height;
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
|
||||
|
||||
env->SetIntField(object, widthID, width);
|
||||
env->SetIntField(object, heightID, height);
|
||||
|
||||
memcpy(pixelBuffer, pixels, width * height * 4);
|
||||
*/
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package imgui.enums;
|
||||
|
||||
public class ImDrawCornerFlags {
|
||||
public final class ImDrawCornerFlags {
|
||||
public static ImDrawCornerFlags TopLeft = new ImDrawCornerFlags(1 << 0);
|
||||
public static ImDrawCornerFlags TopRight = new ImDrawCornerFlags(1 << 1);
|
||||
public static ImDrawCornerFlags BotLeft = new ImDrawCornerFlags(1 << 2);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Back-end capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom back-end.
|
||||
*/
|
||||
public class ImGuiBackendFlags {
|
||||
public final class ImGuiBackendFlags {
|
||||
public static ImGuiBackendFlags None = new ImGuiBackendFlags(0);
|
||||
public static ImGuiBackendFlags HasGamepad = new ImGuiBackendFlags(1 << 0);
|
||||
public static ImGuiBackendFlags HasMouseCursors = new ImGuiBackendFlags(1 << 1);
|
||||
|
||||
@@ -4,7 +4,7 @@ package imgui.enums;
|
||||
* Enumeration for GetMouseCursor()
|
||||
* User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
|
||||
*/
|
||||
public class ImGuiColorEditFlags {
|
||||
public final class ImGuiColorEditFlags {
|
||||
public static ImGuiColorEditFlags None = new ImGuiColorEditFlags(0);
|
||||
public static ImGuiColorEditFlags NoAlpha = new ImGuiColorEditFlags(1 << 1);
|
||||
public static ImGuiColorEditFlags NoPicker = new ImGuiColorEditFlags(1 << 2);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::BeginCombo()
|
||||
*/
|
||||
public class ImGuiComboFlags {
|
||||
public final class ImGuiComboFlags {
|
||||
public static ImGuiComboFlags None = new ImGuiComboFlags(0);
|
||||
public static ImGuiComboFlags PopupAlignLeft = new ImGuiComboFlags(1 << 0);
|
||||
public static ImGuiComboFlags HeightSmall = new ImGuiComboFlags(1 << 1);
|
||||
|
||||
@@ -5,7 +5,7 @@ package imgui.enums;
|
||||
* Represent a condition.
|
||||
* Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
|
||||
*/
|
||||
public class ImGuiCond {
|
||||
public final class ImGuiCond {
|
||||
public static ImGuiCond Always = new ImGuiCond(1 << 0);
|
||||
public static ImGuiCond Once = new ImGuiCond(1 << 1);
|
||||
public static ImGuiCond FirstUseEver = new ImGuiCond(1 << 2);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Configuration flags stored in io.ConfigFlags. Set by user/application.
|
||||
*/
|
||||
public class ImGuiConfigFlags {
|
||||
public final class ImGuiConfigFlags {
|
||||
public static ImGuiConfigFlags None = new ImGuiConfigFlags(0);
|
||||
public static ImGuiConfigFlags NavEnableKeyboard = new ImGuiConfigFlags(1 << 0);
|
||||
public static ImGuiConfigFlags NavEnableGamepad = new ImGuiConfigFlags(1 << 1);
|
||||
|
||||
@@ -8,7 +8,7 @@ public enum ImGuiDir {
|
||||
Down(3),
|
||||
COUNT(4);
|
||||
|
||||
private final int code;
|
||||
private int code;
|
||||
|
||||
ImGuiDir(int code) {
|
||||
this.code = code;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package imgui.enums;
|
||||
|
||||
public class ImGuiDockNodeFlags {
|
||||
public final class ImGuiDockNodeFlags {
|
||||
public static ImGuiDockNodeFlags KeepAliveOnly = new ImGuiDockNodeFlags(1 << 0);
|
||||
public static ImGuiDockNodeFlags NoDockingInCentralNode = new ImGuiDockNodeFlags(1 << 2);
|
||||
public static ImGuiDockNodeFlags PassthruCentralNode = new ImGuiDockNodeFlags(1 << 3);
|
||||
|
||||
@@ -5,7 +5,7 @@ package imgui.enums;
|
||||
* Note: if you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that. Please read the FAQ!
|
||||
* Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls.
|
||||
*/
|
||||
public class ImGuiDragDropFlags {
|
||||
public final class ImGuiDragDropFlags {
|
||||
public static ImGuiDragDropFlags None = new ImGuiDragDropFlags(0);
|
||||
// BeginDragDropSource() flags
|
||||
public static ImGuiDragDropFlags SourceNoPreviewTooltip = new ImGuiDragDropFlags(1 << 0);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::IsWindowFocused()
|
||||
*/
|
||||
public class ImGuiFocusedFlags {
|
||||
public final class ImGuiFocusedFlags {
|
||||
public static ImGuiFocusedFlags None = new ImGuiFocusedFlags(0);
|
||||
public static ImGuiFocusedFlags ChildWindows = new ImGuiFocusedFlags(1 << 0);
|
||||
public static ImGuiFocusedFlags RootWindow = new ImGuiFocusedFlags(1 << 1);
|
||||
|
||||
@@ -5,7 +5,7 @@ package imgui.enums;
|
||||
* Note: if you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that. Please read the FAQ!
|
||||
* Note: windows with the ImGuiWindowFlags_NoInputs flag are ignored by IsWindowHovered() calls.
|
||||
*/
|
||||
public class ImGuiHoveredFlags {
|
||||
public final class ImGuiHoveredFlags {
|
||||
public static ImGuiHoveredFlags None = new ImGuiHoveredFlags(0);
|
||||
public static ImGuiHoveredFlags ChildWindows = new ImGuiHoveredFlags(1 << 0);
|
||||
public static ImGuiHoveredFlags RootWindow = new ImGuiHoveredFlags(1 << 1);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::InputText()
|
||||
*/
|
||||
public class ImGuiInputTextFlags {
|
||||
public final class ImGuiInputTextFlags {
|
||||
public static ImGuiInputTextFlags None = new ImGuiInputTextFlags(0);
|
||||
/**
|
||||
* Allow 0123456789.+-*
|
||||
|
||||
@@ -28,5 +28,5 @@ public enum ImGuiKey {
|
||||
Z,
|
||||
COUNT;
|
||||
|
||||
public final int code = ordinal();
|
||||
public int code = ordinal();
|
||||
}
|
||||
@@ -22,10 +22,6 @@ public enum ImGuiMouseCursor {
|
||||
value = code;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static ImGuiMouseCursor valueOf(int value) {
|
||||
for (ImGuiMouseCursor cursor : values()) {
|
||||
if (cursor.value == value) {
|
||||
@@ -34,4 +30,8 @@ public enum ImGuiMouseCursor {
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid cursor value: " + value);
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,10 @@ public enum ImGuiNavInput {
|
||||
FocusPrev(12),
|
||||
FocusNext(13),
|
||||
TweakSlow(14),
|
||||
TweakFast(15);
|
||||
TweakFast(15),
|
||||
COUNT(16);
|
||||
|
||||
private final int code;
|
||||
private int code;
|
||||
|
||||
ImGuiNavInput(int code) {
|
||||
this.code = code;
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::Selectable()
|
||||
*/
|
||||
public class ImGuiSelectableFlags {
|
||||
public final class ImGuiSelectableFlags {
|
||||
public static ImGuiSelectableFlags None = new ImGuiSelectableFlags(0);
|
||||
public static ImGuiSelectableFlags DontClosePopups = new ImGuiSelectableFlags(1 << 0);
|
||||
public static ImGuiSelectableFlags SpanAllColumns = new ImGuiSelectableFlags(1 << 1);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::BeginTabBar()
|
||||
*/
|
||||
public class ImGuiTabBarFlags {
|
||||
public final class ImGuiTabBarFlags {
|
||||
public static ImGuiTabBarFlags None = new ImGuiTabBarFlags(0);
|
||||
public static ImGuiTabBarFlags Reorderable = new ImGuiTabBarFlags(1 << 0);
|
||||
public static ImGuiTabBarFlags AutoSelectNewTabs = new ImGuiTabBarFlags(1 << 1);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::BeginTabItem()
|
||||
*/
|
||||
public class ImGuiTabItemFlags {
|
||||
public final class ImGuiTabItemFlags {
|
||||
public static ImGuiTabItemFlags None = new ImGuiTabItemFlags(0);
|
||||
public static ImGuiTabItemFlags UnsavedDocument = new ImGuiTabItemFlags(1 << 0);
|
||||
public static ImGuiTabItemFlags SetSelected = new ImGuiTabItemFlags(1 << 1);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
|
||||
*/
|
||||
public class ImGuiTreeNodeFlags {
|
||||
public final class ImGuiTreeNodeFlags {
|
||||
public static ImGuiTreeNodeFlags None = new ImGuiTreeNodeFlags(0);
|
||||
public static ImGuiTreeNodeFlags Selected = new ImGuiTreeNodeFlags(1 << 0);
|
||||
public static ImGuiTreeNodeFlags Framed = new ImGuiTreeNodeFlags(1 << 1);
|
||||
|
||||
@@ -3,7 +3,7 @@ package imgui.enums;
|
||||
/**
|
||||
* Flags for ImGui::Begin()
|
||||
*/
|
||||
public class ImGuiWindowFlags {
|
||||
public final class ImGuiWindowFlags {
|
||||
public static ImGuiWindowFlags None = new ImGuiWindowFlags(0);
|
||||
public static ImGuiWindowFlags NoTitleBar = new ImGuiWindowFlags(1 << 0);
|
||||
public static ImGuiWindowFlags NoResize = new ImGuiWindowFlags(1 << 1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package imgui.enums;
|
||||
|
||||
public class ImLayout {
|
||||
public final class ImLayout {
|
||||
public static float MATCH_PARENT = -0.1f;
|
||||
public static float WRAP_PARENT = 0.0f;
|
||||
}
|
||||
Reference in new issue
Block a user