diff --git a/build.gradle b/build.gradle index 5a30ebd5..08edebbb 100644 --- a/build.gradle +++ b/build.gradle @@ -43,11 +43,11 @@ subprojects { ext { groovyVersion = '4.0.21' - imguiVersion = '1.86.11' + imguiVersion = '1.87.1' jomlVersion = '1.10.6' jomlPrimitivesVersion = '1.10.0' logbackVersion = '1.5.6' - lwjglVersion = '3.3.3' + lwjglVersion = '3.3.4' slf4jVersion = '2.0.13' } ext.targetPlatform = targetPlatform diff --git a/libraries/imgui-java-binding-with-tablesortspecs-1.86.11-sources.jar b/libraries/imgui-java-binding-with-tablesortspecs-1.86.11-sources.jar deleted file mode 100644 index 7d0fe971..00000000 Binary files a/libraries/imgui-java-binding-with-tablesortspecs-1.86.11-sources.jar and /dev/null differ diff --git a/libraries/imgui-java-binding-with-tablesortspecs-1.86.11.jar b/libraries/imgui-java-binding-with-tablesortspecs-1.86.11.jar deleted file mode 100644 index 0eb2aaba..00000000 Binary files a/libraries/imgui-java-binding-with-tablesortspecs-1.86.11.jar and /dev/null differ diff --git a/libraries/imgui-java-natives-with-tablesortspecs-macos-arm64-1.86.11.jar b/libraries/imgui-java-natives-with-tablesortspecs-macos-arm64-1.86.11.jar deleted file mode 100644 index 1c184462..00000000 Binary files a/libraries/imgui-java-natives-with-tablesortspecs-macos-arm64-1.86.11.jar and /dev/null differ diff --git a/libraries/imgui-java-natives-with-tablesortspecs-windows-1.86.11.jar b/libraries/imgui-java-natives-with-tablesortspecs-windows-1.86.11.jar deleted file mode 100644 index 0925d751..00000000 Binary files a/libraries/imgui-java-natives-with-tablesortspecs-windows-1.86.11.jar and /dev/null differ diff --git a/redhorizon-engine/build.gradle b/redhorizon-engine/build.gradle index f8b357cf..c1c2364a 100644 --- a/redhorizon-engine/build.gradle +++ b/redhorizon-engine/build.gradle @@ -21,10 +21,8 @@ dependencies { implementation project(':redhorizon-filetypes') implementation platform("org.lwjgl:lwjgl-bom:${lwjglVersion}") implementation "ch.qos.logback:logback-core:${logbackVersion}" - implementation("io.github.spair:imgui-java-lwjgl3:${imguiVersion}") { - exclude group: 'io.github.spair', module: 'imgui-java-binding' - } - implementation files("../libraries/imgui-java-binding-with-tablesortspecs-${imguiVersion}.jar") + implementation "io.github.spair:imgui-java-binding:${imguiVersion}" + implementation "io.github.spair:imgui-java-lwjgl3:${imguiVersion}" implementation "org.joml:joml:${jomlVersion}" implementation "org.joml:joml-primitives:${jomlPrimitivesVersion}" implementation 'org.lwjgl:lwjgl' @@ -32,8 +30,8 @@ dependencies { implementation 'org.lwjgl:lwjgl-openal' implementation 'org.lwjgl:lwjgl-opengl' - runtimeOnly files("../libraries/imgui-java-natives-with-tablesortspecs-macos-arm64-${imguiVersion}.jar") - runtimeOnly files("../libraries/imgui-java-natives-with-tablesortspecs-windows-${imguiVersion}.jar") + runtimeOnly "io.github.spair:imgui-java-natives-macos:${imguiVersion}" + runtimeOnly "io.github.spair:imgui-java-natives-windows:${imguiVersion}" ['natives-macos-arm64', 'natives-windows'].each { natives -> runtimeOnly "org.lwjgl:lwjgl::${natives}" runtimeOnly "org.lwjgl:lwjgl-glfw::${natives}" diff --git a/redhorizon-engine/source/nz/net/ultraq/redhorizon/engine/graphics/imgui/ImGuiLayer.groovy b/redhorizon-engine/source/nz/net/ultraq/redhorizon/engine/graphics/imgui/ImGuiLayer.groovy index 3d802313..fd003a43 100644 --- a/redhorizon-engine/source/nz/net/ultraq/redhorizon/engine/graphics/imgui/ImGuiLayer.groovy +++ b/redhorizon-engine/source/nz/net/ultraq/redhorizon/engine/graphics/imgui/ImGuiLayer.groovy @@ -44,8 +44,6 @@ import static imgui.flag.ImGuiWindowFlags.* import static org.lwjgl.glfw.GLFW.* import groovy.transform.TupleConstructor -import java.nio.file.Files -import java.nio.file.StandardCopyOption /** * Wrapper around all of the `imgui-java` binding classes, hiding all of the @@ -64,20 +62,6 @@ class ImGuiLayer implements AutoCloseable, InputSource { static ImFont robotoFont static ImFont robotoMonoFont - static { - - // Extract and use the locally built natives for macOS running M processors - if (System.isMacOs() && System.isArm64()) { - ImGuiLayer.classLoader.getResourceAsStream('io/imgui/java/native-bin/libimgui-javaarm64.dylib').withStream { inputStream -> - var tmpDir = File.createTempDir('imgui-java-natives-macos-arm64') - tmpDir.deleteOnExit() - var libFile = new File(tmpDir, 'libimgui-javaarm64.dylib') - Files.copy(inputStream, libFile.toPath(), StandardCopyOption.REPLACE_EXISTING) - System.load(libFile.absolutePath) - } - } - } - final MainMenu mainMenu final GameWindow gameWindow @@ -165,8 +149,8 @@ class ImGuiLayer implements AutoCloseable, InputSource { @Override void close() { - imGuiGl3.dispose() - imGuiGlfw.dispose() + imGuiGl3.shutdown() + imGuiGlfw.shutdown() ImGui.destroyContext() } @@ -176,6 +160,7 @@ class ImGuiLayer implements AutoCloseable, InputSource { */ void frame(Closure closure) { + imGuiGl3.newFrame() imGuiGlfw.newFrame() ImGui.newFrame() diff --git a/redhorizon-explorer/build.gradle b/redhorizon-explorer/build.gradle index 884d0a1d..d28cbba9 100644 --- a/redhorizon-explorer/build.gradle +++ b/redhorizon-explorer/build.gradle @@ -23,7 +23,7 @@ dependencies { implementation project(':redhorizon-filetypes') implementation platform("org.lwjgl:lwjgl-bom:${lwjglVersion}") implementation "ch.qos.logback:logback-classic:${logbackVersion}" - implementation files("../libraries/imgui-java-binding-with-tablesortspecs-${imguiVersion}.jar") + implementation "io.github.spair:imgui-java-binding:${imguiVersion}" implementation 'nz.net.ultraq.preferences:preferences:3.1.0' implementation "org.apache.groovy:groovy-json:${groovyVersion}" implementation "org.joml:joml:${jomlVersion}" diff --git a/redhorizon-explorer/source/nz/net/ultraq/redhorizon/explorer/EntryList.groovy b/redhorizon-explorer/source/nz/net/ultraq/redhorizon/explorer/EntryList.groovy index 03e7c48f..2a7bbd35 100644 --- a/redhorizon-explorer/source/nz/net/ultraq/redhorizon/explorer/EntryList.groovy +++ b/redhorizon-explorer/source/nz/net/ultraq/redhorizon/explorer/EntryList.groovy @@ -79,14 +79,14 @@ class EntryList implements EventTarget, ImGuiElement { specialEntry = entries.remove(specialEntryIndex) } - var sortingColumn = tableSortSpecs.specs.columnIndex - switch (sortingColumn) { + var sortingColumnSpecs = tableSortSpecs.specs[0] + switch (sortingColumnSpecs.columnIndex) { case 1 -> entries.sort { it.type } case 2 -> entries.sort { it.size } case 3 && entries[0] instanceof MixEntry -> entries.sort { it.description } default -> entries.sort { it.name } } - if (tableSortSpecs.specs.sortDirection == ImGuiSortDirection.Descending) { + if (sortingColumnSpecs.sortDirection == ImGuiSortDirection.Descending) { entries.reverse(true) }