Open zbx1425 opened 11 months ago
I don't think this has a problem.
I built this repository and published it to my local maven repository.
Then I run the example code on my test gradle project. It works with arm64 JVM.
I tested it on M2 MacBook Air.
@SpaiR Hi, could you please merge this PR, It will be greatly appreciated, Much obliged, Maor.
Excitedly waiting for this to be merged.
Any update on this? Trying to use imgui on my m1
@SpaiR what's stopping this pr?
@SpaiR I too would like to know what's stopping this PR
I think the branch needs to be merged with new changes, but apart from that i don't see any issues.
I think if the author won't merge someone should maintain the fork and release the mac m-series version, this fork should also have a guide for providing the forked version to a java program. At the moment, I am too busy.
@zbx1425 Could you merge or give rights to @b7011343 or me to the fork, so we wouldn't have to make an another pr
I think if the author won't merge someone should maintain the fork and release the mac m-series version, this fork should also have a guide for providing the forked version to a java program. At the moment, I am too busy.
I see there's workflows in the repo for releasing built bindings and natives to maven. But I'm new to gradle and maven, so I'd appreciate helps on getting it working on forked repository.
@zbx1425 i've forked your fork, merged changes from upstream and setup the workflows to publish to my maven repo: https://maven.realrobotix.me/#/imgui-java/io/github/spair https://github.com/realRobotix/imgui-java would be nice if someone could test the macos artifacts the build produced
would be nice if someone could test the macos artifacts the build produced
Wow, this works! Thanks!!! @realRobotix. I'm on an M1 MacBook Pro running Sonoma.
How do I use this dependency in a gradle project? I know i have to point it at the maven repo but I keep having build errors
How do I use this dependency in a gradle project? I know i have to point it at the maven repo but I keep having build errors
This worked for me.
project.ext.lwjglVersion = "3.3.3" project.ext.lwjglNatives = "natives-macos-arm64"
repositories {
maven {
name "realrobotixImguiJava"
url "https://maven.realrobotix.me/imgui-java"
}
mavenCentral()
}
dependencies {
// Imgui fork at real robotix
implementation "io.github.spair:imgui-java-app:1.86.11-10-g0dbf36c"
implementation "io.github.spair:imgui-java-natives-macos-ft:1.86.11-10-g0dbf36c"
// LWJGL
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-opengl"
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
}
I am getting build errors with the following build.gradle
repositories {
// mavenLocal()
maven {
name "realrobotixImguiJava"
url "https://maven.realrobotix.me/imgui-java"
}
mavenCentral()
}
project.ext.lwjglVersion = "3.3.3"
project.ext.jomlVersion = "1.10.5"
project.ext.imguiVersion = "1.82.2"
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.lwjglNatives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "natives-linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "natives-linux"
break
case OperatingSystem.MAC_OS:
project.ext.lwjglNatives = System.getProperty("os.arch").startsWith("aarch64") ? "natives-macos-arm64" : "natives-macos"
break
case OperatingSystem.WINDOWS:
def osArch = System.getProperty("os.arch")
project.ext.lwjglNatives = osArch.contains("64")
? "natives-windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
: "natives-windows-x86"
break
}
project.ext.lwjglNatives = "natives-macos-arm64"
dependencies {
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
['', '-opengl', '-glfw'].each {
implementation "org.lwjgl:lwjgl$it:$lwjglVersion"
implementation "org.lwjgl:lwjgl$it::natives-windows"
}
implementation "io.github.spair:imgui-java-binding:$imguiVersion"
implementation "io.github.spair:imgui-java-lwjgl3:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-windows:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-windows-x86:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-linux:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-linux-x86:$imguiVersion"
// implementation "io.github.spair:imgui-java-natives-macos:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-macos-ft:1.86.11-10-g0dbf36c"
implementation "io.github.spair:imgui-java-app:1.86.11-10-g0dbf36c"
// implementation "io.github.spair:imgui-java-natives-macos:1.86.11-10-g0dbf36c"
// implementation "io.github.spair:imgui-java-natives-macosarm64"
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-assimp"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-nfd"
implementation "org.lwjgl:lwjgl-openal"
implementation "org.lwjgl:lwjgl-opengl"
implementation "org.lwjgl:lwjgl-stb"
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-nfd::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
implementation "org.joml:joml:${jomlVersion}"
Error
Exception in thread "main" java.lang.IllegalStateException: Failed to compile shader:
ERROR: 0:1: '' : #version required and missing.
ERROR: 0:1: '330' : syntax error: syntax error
at imgui.gl3.ImGuiImplGl3.createAndCompileShader(ImGuiImplGl3.java:463)
at imgui.gl3.ImGuiImplGl3.createShaders(ImGuiImplGl3.java:313)
at imgui.gl3.ImGuiImplGl3.createDeviceObjects(ImGuiImplGl3.java:272)
at imgui.gl3.ImGuiImplGl3.init(ImGuiImplGl3.java:127)
at jcw.jge2d.engine.gui.ImGuiLayer.initImGui(ImGuiLayer.java:233)
at jcw.jge2d.engine.gui.Window.init(Window.java:187)
at jcw.jge2d.engine.gui.Window.run(Window.java:117)
at jcw.jge2d.Main.main(Main.java:9)
Would be nice if this was merged.
Can this be merged?
@SpaiR I have reverted some unnecessary changes so it could be merged, and the example app works fine for me, but there is still something to do:
@SpaiR It would be great to get this (or #223 if that's better) merged and released (since the @realRobotix maven repo is not functional).
@SpaiR It would be great to get this (or #223 if that's better) merged and released (since the @realRobotix maven repo is not functional).
sorry for the inconvenience, i have identified the issue with the maven it should be up again in a few minutes
Description
This PR attempts to finish #112 by merging it with the latest upstream updates and trying tofix the build scripts. Now the CI script can produce correct binary files. I have yet to test if these native binaries built actually works currently though.
Type of change