Skip to content

Commit

Permalink
[API] Dear ImGui v1.83
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaiR committed May 29, 2021
1 parent e5a30ab commit b4df8d8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 33 deletions.
8 changes: 6 additions & 2 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion imgui-binding/src/main/java/imgui/ImDrawData.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public ImVec4 getCmdListCmdBufferClipRect(final int cmdListIdx, final int cmdBuf
* 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();
*/

/**
Expand Down
20 changes: 10 additions & 10 deletions imgui-binding/src/main/java/imgui/ImGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -4718,24 +4718,24 @@ public static boolean beginTabItem(String label, ImBoolean pOpen, int imGuiTabIt
// - 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() {
Expand Down
14 changes: 0 additions & 14 deletions imgui-binding/src/main/java/imgui/ImGuiIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -593,20 +593,6 @@ public ImVec2 getDisplayFramebufferScale() {
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.
Expand Down
23 changes: 18 additions & 5 deletions imgui-lwjgl3/src/main/java/imgui/glfw/ImGuiImplGlfw.java
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -139,10 +140,14 @@ public void keyCallback(final long windowId, final int key, final int scancode,

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));
Expand Down Expand Up @@ -603,12 +608,20 @@ public void accept(final ImGuiViewport vp) {
}
}

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);
}

Expand Down
2 changes: 1 addition & 1 deletion include/imgui
Submodule imgui updated 57 files
+2 −1 .github/workflows/build.yml
+3 −0 .gitignore
+2 −1 backends/imgui_impl_allegro5.cpp
+4 −4 backends/imgui_impl_android.cpp
+4 −2 backends/imgui_impl_dx10.cpp
+4 −2 backends/imgui_impl_dx11.cpp
+4 −1 backends/imgui_impl_dx12.cpp
+33 −10 backends/imgui_impl_dx9.cpp
+21 −4 backends/imgui_impl_glfw.cpp
+2 −1 backends/imgui_impl_marmalade.cpp
+3 −2 backends/imgui_impl_metal.mm
+2 −1 backends/imgui_impl_opengl2.cpp
+11 −6 backends/imgui_impl_opengl3.cpp
+36 −7 backends/imgui_impl_osx.mm
+9 −2 backends/imgui_impl_sdl.cpp
+17 −5 backends/imgui_impl_vulkan.cpp
+107 −176 backends/imgui_impl_wgpu.cpp
+9 −4 backends/imgui_impl_win32.cpp
+2 −0 docs/BACKENDS.md
+248 −2 docs/CHANGELOG.txt
+5 −1 docs/EXAMPLES.md
+13 −13 docs/FAQ.md
+32 −9 docs/FONTS.md
+10 −8 docs/README.md
+1 −1 docs/TODO.txt
+7 −1 examples/README.txt
+4 −4 examples/example_android_opengl3/android/build.gradle
+4 −4 examples/example_emscripten_wgpu/main.cpp
+3 −2 examples/example_glfw_metal/Makefile
+2 −2 examples/example_glfw_opengl2/Makefile
+13 −4 examples/example_glfw_opengl3/Makefile
+10 −2 examples/example_glfw_opengl3/main.cpp
+18 −6 examples/example_glfw_vulkan/main.cpp
+1 −1 examples/example_sdl_directx11/build_win32.bat
+1 −1 examples/example_sdl_directx11/main.cpp
+2 −2 examples/example_sdl_opengl2/README.md
+1 −1 examples/example_sdl_opengl2/build_win32.bat
+14 −2 examples/example_sdl_opengl3/Makefile
+2 −2 examples/example_sdl_opengl3/README.md
+1 −1 examples/example_sdl_opengl3/build_win32.bat
+11 −2 examples/example_sdl_opengl3/main.cpp
+10 −0 examples/example_sdl_vulkan/build_win32.bat
+18 −6 examples/example_sdl_vulkan/main.cpp
+8 −5 examples/example_win32_directx10/main.cpp
+8 −5 examples/example_win32_directx11/main.cpp
+8 −5 examples/example_win32_directx12/main.cpp
+8 −5 examples/example_win32_directx9/main.cpp
+2 −1 imconfig.h
+480 −317 imgui.cpp
+48 −23 imgui.h
+158 −100 imgui_demo.cpp
+64 −40 imgui_draw.cpp
+172 −80 imgui_internal.h
+148 −73 imgui_tables.cpp
+233 −152 imgui_widgets.cpp
+7 −0 misc/freetype/README.md
+1 −1 misc/freetype/imgui_freetype.cpp

0 comments on commit b4df8d8

Please sign in to comment.