[API] Dear ImGui v1.83
This commit is contained in:
1 parent
e5a30ab6be
commit
b4df8d8611
6 files changed
+36
-33
No files matched your search
@@ -8,8 +8,12 @@ repositories {
|
|||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass = 'Main'
|
mainClass = 'Main'
|
||||||
if (libPath) {
|
try {
|
||||||
applicationDefaultJvmArgs = ["-Dimgui.library.path=$libPath"]
|
if (libPath) {
|
||||||
|
applicationDefaultJvmArgs = ["-Dimgui.library.path=$libPath"]
|
||||||
|
}
|
||||||
|
} catch (ignored) {
|
||||||
|
// ignore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public final class ImDrawData extends ImGuiStruct {
|
|||||||
* Ignore if never using images or multiple fonts atlas.
|
* Ignore if never using images or multiple fonts atlas.
|
||||||
*/
|
*/
|
||||||
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
public native int getCmdListCmdBufferTextureId(int cmdListIdx, int cmdBufferIdx); /*
|
||||||
return (intptr_t)IM_DRAW_DATA->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].TextureId;
|
return (intptr_t)IM_DRAW_DATA->CmdLists[cmdListIdx]->CmdBuffer[cmdBufferIdx].GetTexID();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4718,24 +4718,24 @@ public class ImGui {
|
|||||||
// - Use DockSpace() to create an explicit dock node _within_ an existing window. See Docking demo for details.
|
// - Use DockSpace() to create an explicit dock node _within_ an existing window. See Docking demo for details.
|
||||||
// - DockSpace() needs to be submitted _before_ any window they can host. If you use a dockspace, submit it early in your app.
|
// - DockSpace() needs to be submitted _before_ any window they can host. If you use a dockspace, submit it early in your app.
|
||||||
|
|
||||||
public static void dockSpace(int imGuiID) {
|
public static int dockSpace(int imGuiID) {
|
||||||
nDockSpace(imGuiID, 0, 0, 0, 0);
|
return nDockSpace(imGuiID, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY) {
|
public static int dockSpace(int imGuiID, float sizeX, float sizeY) {
|
||||||
nDockSpace(imGuiID, sizeX, sizeY, 0, 0);
|
return nDockSpace(imGuiID, sizeX, sizeY, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags) {
|
public static int dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags) {
|
||||||
nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, 0);
|
return nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, ImGuiWindowClass imGuiWindowClass) {
|
public static int dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, ImGuiWindowClass imGuiWindowClass) {
|
||||||
nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, imGuiWindowClass.ptr);
|
return nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, imGuiWindowClass.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native void nDockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, long windowClassPtr); /*
|
private static native int nDockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, long windowClassPtr); /*
|
||||||
ImGui::DockSpace(imGuiID, ImVec2(sizeX, sizeY), imGuiDockNodeFlags, windowClassPtr != 0 ? (ImGuiWindowClass*)windowClassPtr : NULL);
|
return ImGui::DockSpace(imGuiID, ImVec2(sizeX, sizeY), imGuiDockNodeFlags, windowClassPtr != 0 ? (ImGuiWindowClass*)windowClassPtr : NULL);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static int dockSpaceOverViewport() {
|
public static int dockSpaceOverViewport() {
|
||||||
|
|||||||
@@ -593,20 +593,6 @@ public final class ImGuiIO extends ImGuiStruct {
|
|||||||
IO->ConfigDockingNoSplit = value;
|
IO->ConfigDockingNoSplit = value;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
|
|
||||||
*/
|
|
||||||
public native boolean getConfigDockingWithShift(); /*
|
|
||||||
return IO->ConfigDockingWithShift;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
|
|
||||||
*/
|
|
||||||
public native void setConfigDockingWithShift(boolean value); /*
|
|
||||||
IO->ConfigDockingWithShift = value;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead]
|
* [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead]
|
||||||
* Make every single floating window display within a docking node.
|
* Make every single floating window display within a docking node.
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class ImGuiImplGlfw {
|
|||||||
|
|
||||||
// Mouse cursors provided by GLFW
|
// Mouse cursors provided by GLFW
|
||||||
private final long[] mouseCursors = new long[ImGuiMouseCursor.COUNT];
|
private final long[] mouseCursors = new long[ImGuiMouseCursor.COUNT];
|
||||||
|
private final long[] keyOwnerWindows = new long[512];
|
||||||
|
|
||||||
// Empty array to fill ImGuiIO.NavInputs with zeroes
|
// Empty array to fill ImGuiIO.NavInputs with zeroes
|
||||||
private final float[] emptyNavInputs = new float[ImGuiNavInput.COUNT];
|
private final float[] emptyNavInputs = new float[ImGuiNavInput.COUNT];
|
||||||
@@ -139,10 +140,14 @@ public class ImGuiImplGlfw {
|
|||||||
|
|
||||||
final ImGuiIO io = ImGui.getIO();
|
final ImGuiIO io = ImGui.getIO();
|
||||||
|
|
||||||
if (action == GLFW_PRESS) {
|
if (key >= 0 && key < keyOwnerWindows.length) {
|
||||||
io.setKeysDown(key, true);
|
if (action == GLFW_PRESS) {
|
||||||
} else if (action == GLFW_RELEASE) {
|
io.setKeysDown(key, true);
|
||||||
io.setKeysDown(key, false);
|
keyOwnerWindows[key] = windowId;
|
||||||
|
} else if (action == GLFW_RELEASE) {
|
||||||
|
io.setKeysDown(key, false);
|
||||||
|
keyOwnerWindows[key] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
io.setKeyCtrl(io.getKeysDown(GLFW_KEY_LEFT_CONTROL) || io.getKeysDown(GLFW_KEY_RIGHT_CONTROL));
|
io.setKeyCtrl(io.getKeysDown(GLFW_KEY_LEFT_CONTROL) || io.getKeysDown(GLFW_KEY_RIGHT_CONTROL));
|
||||||
@@ -603,12 +608,20 @@ public class ImGuiImplGlfw {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class DestroyWindowFunction extends ImPlatformFuncViewport {
|
private final class DestroyWindowFunction extends ImPlatformFuncViewport {
|
||||||
@Override
|
@Override
|
||||||
public void accept(final ImGuiViewport vp) {
|
public void accept(final ImGuiViewport vp) {
|
||||||
final ImGuiViewportDataGlfw data = (ImGuiViewportDataGlfw) vp.getPlatformUserData();
|
final ImGuiViewportDataGlfw data = (ImGuiViewportDataGlfw) vp.getPlatformUserData();
|
||||||
|
|
||||||
if (data != null && data.windowOwned) {
|
if (data != null && data.windowOwned) {
|
||||||
|
// Release any keys that were pressed in the window being destroyed and are still held down,
|
||||||
|
// because we will not receive any release events after window is destroyed.
|
||||||
|
for (int i = 0; i < keyOwnerWindows.length; i++) {
|
||||||
|
if (keyOwnerWindows[i] == data.window) {
|
||||||
|
keyCallback(data.window, i, 0, GLFW_RELEASE, 0); // Later params are only used for main viewport, on which this function is never called.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
glfwDestroyWindow(data.window);
|
glfwDestroyWindow(data.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule include/imgui updated: 256594575d...1b435ae3e0.
Reference in new issue
Block a user