Add example for GLFW

This commit is contained in:
SpaiR committed 2019-12-29 23:59:35 +03:00
1 parent dc59810566
commit 3e7c50296c
13 files changed
+2606 -2561

No files matched your search

+43 -12
View File
@@ -41,6 +41,10 @@ public class ImGui {
Native.CreateContext();
}
public static void destroy() {
Native.DestroyContext();
}
public static ImGuiIO GetIO() {
return imguiIO;
}
@@ -69,10 +73,24 @@ public class ImGui {
Native.ShowMetricsWindow(open);
}
public static void UpdateDisplayAndInputAndFrame(float deltaTime, float w, float h, float backBufferWidth, float backBufferHeight,
int mouseX, int mouseY, boolean mouseDown0, boolean mouseDown1, boolean mouseDown2) {
Native.UpdateDisplayAndInputAndFrame(imguiIO, imguiStyle, deltaTime, w, h, backBufferWidth, backBufferHeight,
mouseX, mouseY, mouseDown0, mouseDown1, mouseDown2, false, false, false);
public static void UpdateDisplaySize(float width, float height, float frameBufferWidth, float frameBufferHeight) {
Native.UpdateDisplaySize(width, height, frameBufferWidth, frameBufferHeight);
}
public static void UpdateMousePos(float mouseX, float mouseY) {
Native.UpdateMousePos(mouseX, mouseY);
}
public static void UpdateMouseState(boolean mouseDown0, boolean mouseDown1, boolean mouseDown2, boolean mouseDown3, boolean mouseDown4, boolean mouseDown5) {
Native.UpdateMouseState(mouseDown0, mouseDown1, mouseDown2, mouseDown3, mouseDown4, mouseDown5);
}
public static void UpdateImGui() {
Native.UpdateImGui(imguiIO, imguiStyle);
}
public static void UpdateDeltaTime(float deltaTime) {
Native.UpdateDeltaTime(deltaTime);
}
public static void initKeyMap(int[] keys) {
@@ -80,15 +98,23 @@ public class ImGui {
}
public static void UpdateKey(int key, boolean pressed, boolean released, boolean ctrlKey, boolean shiftKey, boolean altKey, boolean superKey) {
Native.updateKey(key, pressed, released, ctrlKey, shiftKey, altKey, superKey);
Native.UpdateKey(key, pressed, released, ctrlKey, shiftKey, altKey, superKey);
}
public static void UpdateScroll(float amountX, float amountY) {
Native.updateScroll(amountX, amountY);
Native.UpdateScroll(amountX, amountY);
}
public static void UpdateKeyTyped(int c) {
Native.updateKeyTyped(c);
Native.UpdateKeyTyped(c);
}
public static void NewFrame() {
Native.NewFrame();
}
public static void EndFrame() {
Native.EndFrame();
}
public static void Render() {
@@ -248,6 +274,10 @@ public class ImGui {
Native.SetNextWindowPos(x, y);
}
public static void SetNextWindowPos(float x, float y, ImGuiCond cond) {
Native.SetNextWindowPos(x, y, cond.getValue());
}
public static void SetNextWindowPos(float x, float y, ImGuiCond cond, float pivotX, float pivotY) {
Native.SetNextWindowPos(x, y, cond.getValue(), pivotX, pivotY);
}
@@ -287,10 +317,11 @@ public class ImGui {
}
public static void SetWindowFocus(String name) {
if (name == null)
if (name == null) {
Native.RemoveWindowFocus();
else
} else {
Native.SetWindowFocus(name);
}
}
// Content region
@@ -841,9 +872,9 @@ public class ImGui {
}
//TODO impl
// public static boolean DragScalar(String label, ImGuiDataType_ data_type, ImGuiInt v, ImGuiInt v_current_max, float v_speed, float v_min, float v_max, String format, String format_max) {
// return ImGuiNative.DragScalar(label, data_type.getValue(), v.data, v_current_max.data, v_speed, v_min, v_max, format, format_max);
// }
// public static boolean DragScalar(String label, ImGuiDataType_ data_type, ImGuiInt v, ImGuiInt v_current_max, float v_speed, float v_min, float v_max, String format, String format_max) {
// return ImGuiNative.DragScalar(label, data_type.getValue(), v.data, v_current_max.data, v_speed, v_min, v_max, format, format_max);
// }
// Widgets: Sliders
@@ -15,7 +15,12 @@ public class ImGuiString {
}
public ImGuiString(String text) {
this(100);
this(text.length());
setValue(text);
}
public ImGuiString(String text, int size) {
this(size);
setValue(text);
}
File diff suppressed because it is too large. Load diff
@@ -3,166 +3,166 @@ package imgui;
import imgui.enums.ImDrawCornerFlags;
class NativeCustomWidget {
public static ImGuiCollapseLayoutOptions defaultOptions = new ImGuiCollapseLayoutOptions();
public static ImGuiCollapseLayoutOptions defaultOptions = new ImGuiCollapseLayoutOptions();
// @formatter:off
/*JNI
#include <imgui_layout_widget.h>
/*JNI
#include <imgui_layout_widget.h>
jfieldID paddingLeftID;
jfieldID paddingRightID;
jfieldID paddingTopID;
jfieldID paddingBottomID;
jfieldID arrowColorID;
jfieldID arrowBackgroundHoveredColorID;
jfieldID arrowBackgroundClickedColorID;
jfieldID frameColorID;
jfieldID borderColorID;
jfieldID borderRoundID;
jfieldID roundingCornersID;
*/
jfieldID paddingLeftID;
jfieldID paddingRightID;
jfieldID paddingTopID;
jfieldID paddingBottomID;
jfieldID arrowColorID;
jfieldID arrowBackgroundHoveredColorID;
jfieldID arrowBackgroundClickedColorID;
jfieldID frameColorID;
jfieldID borderColorID;
jfieldID borderRoundID;
jfieldID roundingCornersID;
*/
static native void init() /*-{ }-*/; /*
jclass jLayoutOptionsClass = env->FindClass("imgui/NativeCustomWidget");
paddingLeftID = env->GetFieldID(jLayoutOptionsClass, "paddingLeft", "F");
paddingRightID = env->GetFieldID(jLayoutOptionsClass, "paddingRight", "F");
paddingTopID = env->GetFieldID(jLayoutOptionsClass, "paddingTop", "F");
paddingBottomID = env->GetFieldID(jLayoutOptionsClass, "paddingBottom", "F");
arrowColorID = env->GetFieldID(jLayoutOptionsClass, "arrowColor", "I");
arrowBackgroundHoveredColorID = env->GetFieldID(jLayoutOptionsClass, "arrowBackgroundHoveredColor", "I");
arrowBackgroundClickedColorID = env->GetFieldID(jLayoutOptionsClass, "arrowBackgroundClickedColor", "I");
frameColorID = env->GetFieldID(jLayoutOptionsClass, "frameColor", "I");
borderColorID = env->GetFieldID(jLayoutOptionsClass, "borderColor", "I");
borderRoundID = env->GetFieldID(jLayoutOptionsClass, "borderRound", "I");
roundingCornersID = env->GetFieldID(jLayoutOptionsClass, "roundingCorners", "I");
*/
static native void init() /*-{ }-*/; /*
jclass jLayoutOptionsClass = env->FindClass("imgui/NativeCustomWidget");
paddingLeftID = env->GetFieldID(jLayoutOptionsClass, "paddingLeft", "F");
paddingRightID = env->GetFieldID(jLayoutOptionsClass, "paddingRight", "F");
paddingTopID = env->GetFieldID(jLayoutOptionsClass, "paddingTop", "F");
paddingBottomID = env->GetFieldID(jLayoutOptionsClass, "paddingBottom", "F");
arrowColorID = env->GetFieldID(jLayoutOptionsClass, "arrowColor", "I");
arrowBackgroundHoveredColorID = env->GetFieldID(jLayoutOptionsClass, "arrowBackgroundHoveredColor", "I");
arrowBackgroundClickedColorID = env->GetFieldID(jLayoutOptionsClass, "arrowBackgroundClickedColor", "I");
frameColorID = env->GetFieldID(jLayoutOptionsClass, "frameColor", "I");
borderColorID = env->GetFieldID(jLayoutOptionsClass, "borderColor", "I");
borderRoundID = env->GetFieldID(jLayoutOptionsClass, "borderRound", "I");
roundingCornersID = env->GetFieldID(jLayoutOptionsClass, "roundingCorners", "I");
*/
static {
init();
}
static {
init();
}
static native void ShowLayoutDebug() /*-{ }-*/; /*
ImGuiEx::ShowLayoutDebug();
*/
static native void ShowLayoutDebug() /*-{ }-*/; /*
ImGuiEx::ShowLayoutDebug();
*/
static native void BeginLayout(String id, float sizeX, float sizeY); /*-{ }-*/; /*
ImGuiEx::BeginLayout(id, sizeX, sizeY);
*/
static native void BeginLayout(String id, float sizeX, float sizeY); /*-{ }-*/; /*
ImGuiEx::BeginLayout(id, sizeX, sizeY);
*/
static native void BeginLayout(String id, float sizeX, float sizeY, float paddingLeft, float paddingRight, float paddingTop, float paddingBottom); /*-{ }-*/; /*
ImGuiEx::BeginLayout(id, sizeX, sizeY, paddingLeft, paddingRight, paddingTop, paddingBottom);
*/
static native void BeginLayout(String id, float sizeX, float sizeY, float paddingLeft, float paddingRight, float paddingTop, float paddingBottom); /*-{ }-*/; /*
ImGuiEx::BeginLayout(id, sizeX, sizeY, paddingLeft, paddingRight, paddingTop, paddingBottom);
*/
static native void EndLayout(); /*-{ }-*/; /*
ImGuiEx::EndLayout();
*/
static native void EndLayout(); /*-{ }-*/; /*
ImGuiEx::EndLayout();
*/
static native boolean BeginCollapseLayoutEx2(String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
return ImGuiEx::BeginCollapseLayoutEx(title, sizeX, sizeY, options);
*/
static native boolean BeginCollapseLayoutEx2(String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
return ImGuiEx::BeginCollapseLayoutEx(title, sizeX, sizeY, options);
*/
static native void BeginCollapseLayoutEx(boolean [] isOpen, String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
ImGuiEx::BeginCollapseLayoutEx(&isOpen[0], title, sizeX, sizeY, options);
*/
static native void BeginCollapseLayoutEx(boolean [] isOpen, String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
ImGuiEx::BeginCollapseLayoutEx(&isOpen[0], title, sizeX, sizeY, options);
*/
static native boolean BeginCollapseLayout2(String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
return ImGuiEx::BeginCollapseLayout(title, sizeX, sizeY, options);
*/
static native boolean BeginCollapseLayout2(String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
return ImGuiEx::BeginCollapseLayout(title, sizeX, sizeY, options);
*/
static native void BeginCollapseLayout(boolean [] isOpen, String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
ImGuiEx::BeginCollapseLayout(&isOpen[0], title, sizeX, sizeY, options);
*/
static native void BeginCollapseLayout(boolean [] isOpen, String title, float sizeX, float sizeY, ImGuiCollapseLayoutOptions jOptions); /*-{ }-*/; /*
ImGuiCollapseLayoutOptions options;
options.paddingLeft = env->GetFloatField (jOptions, paddingLeftID);
options.paddingRight = env->GetFloatField (jOptions, paddingRightID);
options.paddingTop = env->GetFloatField (jOptions, paddingTopID);
options.paddingBottom = env->GetFloatField (jOptions, paddingBottomID);
options.arrowColor = env->GetIntField (jOptions, arrowColorID);
options.arrowBackgroundHoveredColor = env->GetIntField (jOptions, arrowBackgroundHoveredColorID);
options.arrowBackgroundClickedColor = env->GetIntField (jOptions, arrowBackgroundClickedColorID);
options.frameColor = env->GetIntField (jOptions, frameColorID);
options.borderColor = env->GetIntField (jOptions, borderColorID);
options.borderRound = env->GetIntField (jOptions, borderRoundID);
options.roundingCorners = env->GetIntField (jOptions, roundingCornersID);
ImGuiEx::BeginCollapseLayout(&isOpen[0], title, sizeX, sizeY, options);
*/
static native void EndCollapseFrameLayout(); /*-{ }-*/; /*
ImGuiEx::EndCollapseFrameLayout();
*/
static native void EndCollapseFrameLayout(); /*-{ }-*/; /*
ImGuiEx::EndCollapseFrameLayout();
*/
static native void EndCollapseLayout(); /*-{ }-*/; /*
ImGuiEx::EndCollapseLayout();
*/
static native void EndCollapseLayout(); /*-{ }-*/; /*
ImGuiEx::EndCollapseLayout();
*/
static native void BeginAlign(String id, float sizeX, float sizeY, float alignX, float alignY) /*-{ }-*/; /*
ImGuiEx::BeginAlign(id, sizeX, sizeY, alignX, alignY);
*/
static native void BeginAlign(String id, float sizeX, float sizeY, float alignX, float alignY) /*-{ }-*/; /*
ImGuiEx::BeginAlign(id, sizeX, sizeY, alignX, alignY);
*/
static native void BeginAlign(String id, float sizeX, float sizeY, float alignX, float alignY, float offsetX, float offsetY) /*-{ }-*/; /*
ImGuiEx::BeginAlign(id, sizeX, sizeY, alignX, alignY, offsetX, offsetY);
*/
static native void BeginAlign(String id, float sizeX, float sizeY, float alignX, float alignY, float offsetX, float offsetY) /*-{ }-*/; /*
ImGuiEx::BeginAlign(id, sizeX, sizeY, alignX, alignY, offsetX, offsetY);
*/
static native void EndAlign() /*-{ }-*/; /*
ImGuiEx::EndAlign();
*/
static native void EndAlign() /*-{ }-*/; /*
ImGuiEx::EndAlign();
*/
static native void AlignLayout(float alignX, float alignY) /*-{ }-*/; /*
ImGuiEx::AlignLayout(alignX, alignY);
*/
static native void AlignLayout(float alignX, float alignY) /*-{ }-*/; /*
ImGuiEx::AlignLayout(alignX, alignY);
*/
static native void AlignLayout(float alignX, float alignY, float offsetX, float offsetY) /*-{ }-*/; /*
ImGuiEx::AlignLayout(alignX, alignY, offsetX, offsetY);
*/
static native void AlignLayout(float alignX, float alignY, float offsetX, float offsetY) /*-{ }-*/; /*
ImGuiEx::AlignLayout(alignX, alignY, offsetX, offsetY);
*/
// @formatter:on
public static class ImGuiCollapseLayoutOptions {
public float paddingLeft = 2;
public float paddingRight = 2;
public float paddingTop = 2;
public float paddingBottom = 2;
public int arrowColor = ImGuiEx.colorToIntBits(0xFF, 0xFF, 0xFF, 0xFF);
public int arrowBackgroundHoveredColor = ImGuiEx.colorToIntBits(0x77, 0x77, 0x77, 0xFF);
public int arrowBackgroundClickedColor = ImGuiEx.colorToIntBits(0x55, 0x55, 0x55, 0xFF);
public int frameColor = ImGuiEx.colorToIntBits(0x24, 0x24, 0x24, 0xFF);
public int borderColor = ImGuiEx.colorToIntBits(0x40, 0x40, 0x49, 0xFF);
public int borderRound = 4;
public int roundingCorners = ImDrawCornerFlags.TopLeft.or(ImDrawCornerFlags.TopRight).getValue();
}
public static class ImGuiCollapseLayoutOptions {
public float paddingLeft = 2;
public float paddingRight = 2;
public float paddingTop = 2;
public float paddingBottom = 2;
public int arrowColor = ImGuiEx.colorToIntBits(0xFF, 0xFF, 0xFF, 0xFF);
public int arrowBackgroundHoveredColor = ImGuiEx.colorToIntBits(0x77, 0x77, 0x77, 0xFF);
public int arrowBackgroundClickedColor = ImGuiEx.colorToIntBits(0x55, 0x55, 0x55, 0xFF);
public int frameColor = ImGuiEx.colorToIntBits(0x24, 0x24, 0x24, 0xFF);
public int borderColor = ImGuiEx.colorToIntBits(0x40, 0x40, 0x49, 0xFF);
public int borderRound = 4;
public int roundingCorners = ImDrawCornerFlags.TopLeft.or(ImDrawCornerFlags.TopRight).getValue();
}
}
@@ -6,23 +6,23 @@ package imgui;
class NativeInternal {
// @formatter:off
/*JNI
#include <imgui.h>
#include <imgui_internal.h>
*/
/*JNI
#include <imgui.h>
#include <imgui_internal.h>
*/
public static native void PushMultiItemsWidths(int components, float w_full) /*-{ }-*/; /*
ImGui::PushMultiItemsWidths(components, w_full);
*/
public static native void PushMultiItemsWidths(int components, float w_full) /*-{ }-*/; /*
ImGui::PushMultiItemsWidths(components, w_full);
*/
public static native boolean ItemAdd(float x1, float y1, float x2, float y2, String id) /*-{ }-*/; /*
ImGuiID imGuiID = ImGui::GetID(id);
return ImGui::ItemAdd(ImRect(x1, y1, x2, y2), imGuiID);
*/
public static native boolean ItemAdd(float x1, float y1, float x2, float y2, String id) /*-{ }-*/; /*
ImGuiID imGuiID = ImGui::GetID(id);
return ImGui::ItemAdd(ImRect(x1, y1, x2, y2), imGuiID);
*/
public static native void ItemSize(float x1, float y1, float x2, float y2, float text_offset_y) /*-{ }-*/; /*
ImGui::ItemSize(ImRect(x1, y1, x2, y2), text_offset_y);
*/
public static native void ItemSize(float x1, float y1, float x2, float y2, float text_offset_y) /*-{ }-*/; /*
ImGui::ItemSize(ImRect(x1, y1, x2, y2), text_offset_y);
*/
// @formatter:on
// @formatter:on
}
@@ -11,7 +11,7 @@ public class ImGuiHoveredFlags {
public static ImGuiHoveredFlags RootWindow = new ImGuiHoveredFlags(1 << 1);
public static ImGuiHoveredFlags AnyWindow = new ImGuiHoveredFlags(1 << 2);
public static ImGuiHoveredFlags AllowWhenBlockedByPopup = new ImGuiHoveredFlags(1 << 3);
// public static ImGuiHoveredFlags AllowWhenBlockedByModal = new ImGuiHoveredFlags(1 << 4);
// public static ImGuiHoveredFlags AllowWhenBlockedByModal = new ImGuiHoveredFlags(1 << 4);
public static ImGuiHoveredFlags AllowWhenBlockedByActiveItem = new ImGuiHoveredFlags(1 << 5);
public static ImGuiHoveredFlags AllowWhenOverlapped = new ImGuiHoveredFlags(1 << 6);
public static ImGuiHoveredFlags AllowWhenDisabled = new ImGuiHoveredFlags(1 << 7);
@@ -4,36 +4,29 @@ package imgui.enums;
* User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
*/
public enum ImGuiKey {
Tab(0),
LeftArrow(1),
RightArrow(2),
UpArrow(3),
DownArrow(4),
PageUp(5),
PageDown(6),
Home(7),
End(8),
Insert(9),
Delete(10),
Backspace(11),
Space(12),
Enter(13),
Escape(14),
A(15),
C(16),
V(17),
X(18),
Y(19),
Z(20),
COUNT(21);
Tab,
LeftArrow,
RightArrow,
UpArrow,
DownArrow,
PageUp,
PageDown,
Home,
End,
Insert,
Delete,
Backspace,
Space,
Enter,
Escape,
KeyPadEnter,
A,
C,
V,
X,
Y,
Z,
COUNT;
private final int code;
ImGuiKey(int code) {
this.code = code;
}
public int getValue() {
return code;
}
public final int code = ordinal();
}
@@ -16,8 +16,8 @@ public class ImGuiTreeNodeFlags {
public static ImGuiTreeNodeFlags Leaf = new ImGuiTreeNodeFlags(1 << 8);
public static ImGuiTreeNodeFlags Bullet = new ImGuiTreeNodeFlags(1 << 9);
public static ImGuiTreeNodeFlags FramePadding = new ImGuiTreeNodeFlags(1 << 10);
// public static ImGuiTreeNodeFlags SpanAllAvailWidth = new ImGuiTreeNodeFlags(1 << 11);
// public static ImGuiTreeNodeFlags NoScrollOnOpen = new ImGuiTreeNodeFlags(1 << 12);
// public static ImGuiTreeNodeFlags SpanAllAvailWidth = new ImGuiTreeNodeFlags(1 << 11);
// public static ImGuiTreeNodeFlags NoScrollOnOpen = new ImGuiTreeNodeFlags(1 << 12);
public static ImGuiTreeNodeFlags NavLeftJumpsBackHere = new ImGuiTreeNodeFlags(1 << 13);
public static ImGuiTreeNodeFlags CollapsingHeader = new ImGuiTreeNodeFlags(Framed.getValue() | NoTreePushOnOpen.getValue() | NoAutoOpenOnLog.getValue());
private static ImGuiTreeNodeFlags Custom = new ImGuiTreeNodeFlags(0);