[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 {
|
||||
mainClass = 'Main'
|
||||
if (libPath) {
|
||||
applicationDefaultJvmArgs = ["-Dimgui.library.path=$libPath"]
|
||||
try {
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
// - 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) {
|
||||
nDockSpace(imGuiID, 0, 0, 0, 0);
|
||||
public static int dockSpace(int imGuiID) {
|
||||
return nDockSpace(imGuiID, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY) {
|
||||
nDockSpace(imGuiID, sizeX, sizeY, 0, 0);
|
||||
public static int dockSpace(int imGuiID, float sizeX, float sizeY) {
|
||||
return nDockSpace(imGuiID, sizeX, sizeY, 0, 0);
|
||||
}
|
||||
|
||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags) {
|
||||
nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, 0);
|
||||
public static int dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags) {
|
||||
return nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, 0);
|
||||
}
|
||||
|
||||
public static void dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, ImGuiWindowClass imGuiWindowClass) {
|
||||
nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, imGuiWindowClass.ptr);
|
||||
public static int dockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, ImGuiWindowClass imGuiWindowClass) {
|
||||
return nDockSpace(imGuiID, sizeX, sizeY, imGuiDockNodeFlags, imGuiWindowClass.ptr);
|
||||
}
|
||||
|
||||
private static native void nDockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, long windowClassPtr); /*
|
||||
ImGui::DockSpace(imGuiID, ImVec2(sizeX, sizeY), imGuiDockNodeFlags, windowClassPtr != 0 ? (ImGuiWindowClass*)windowClassPtr : NULL);
|
||||
private static native int nDockSpace(int imGuiID, float sizeX, float sizeY, int imGuiDockNodeFlags, long windowClassPtr); /*
|
||||
return ImGui::DockSpace(imGuiID, ImVec2(sizeX, sizeY), imGuiDockNodeFlags, windowClassPtr != 0 ? (ImGuiWindowClass*)windowClassPtr : NULL);
|
||||
*/
|
||||
|
||||
public static int dockSpaceOverViewport() {
|
||||
|
||||
@@ -593,20 +593,6 @@ public final class ImGuiIO extends ImGuiStruct {
|
||||
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]
|
||||
* Make every single floating window display within a docking node.
|
||||
|
||||
@@ -68,6 +68,7 @@ public class ImGuiImplGlfw {
|
||||
|
||||
// Mouse cursors provided by GLFW
|
||||
private final long[] mouseCursors = new long[ImGuiMouseCursor.COUNT];
|
||||
private final long[] keyOwnerWindows = new long[512];
|
||||
|
||||
// Empty array to fill ImGuiIO.NavInputs with zeroes
|
||||
private final float[] emptyNavInputs = new float[ImGuiNavInput.COUNT];
|
||||
@@ -139,10 +140,14 @@ public class ImGuiImplGlfw {
|
||||
|
||||
final ImGuiIO io = ImGui.getIO();
|
||||
|
||||
if (action == GLFW_PRESS) {
|
||||
io.setKeysDown(key, true);
|
||||
} else if (action == GLFW_RELEASE) {
|
||||
io.setKeysDown(key, false);
|
||||
if (key >= 0 && key < keyOwnerWindows.length) {
|
||||
if (action == GLFW_PRESS) {
|
||||
io.setKeysDown(key, true);
|
||||
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));
|
||||
@@ -603,12 +608,20 @@ public class ImGuiImplGlfw {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class DestroyWindowFunction extends ImPlatformFuncViewport {
|
||||
private final class DestroyWindowFunction extends ImPlatformFuncViewport {
|
||||
@Override
|
||||
public void accept(final ImGuiViewport vp) {
|
||||
final ImGuiViewportDataGlfw data = (ImGuiViewportDataGlfw) vp.getPlatformUserData();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
Submodule include/imgui updated: 256594575d...1b435ae3e0.
Reference in new issue
Block a user