kotlin-graphics / imgui

Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
MIT License
594 stars 37 forks source link

Is there a version of imgui for kotlin that works with lwjgl 3.3.1 #183

Closed markjfisher closed 10 months ago

markjfisher commented 1 year ago

Hi, I have the following deps in my build, which works fine with lwjgl 3.2.3

    val imguiVersion = "v1.79"
    implementation("com.github.kotlin-graphics.imgui:core:$imguiVersion")
    implementation("com.github.kotlin-graphics.imgui:gl:$imguiVersion")
    implementation("com.github.kotlin-graphics.imgui:glfw:$imguiVersion")

however, if I update my lwjgl to 3.3.1, then I get the following errors building:

:visualisations:test: Could not resolve org.lwjgl:lwjgl-bom:3.2.3.
Required by:
    project :visualisations > com.github.kotlin-graphics.imgui:core:v1.79
    project :visualisations > com.github.kotlin-graphics.imgui:gl:v1.79
    project :visualisations > com.github.kotlin-graphics.imgui:glfw:v1.79
    // ...

So the 1.79 libs are built against 3.2.3. No biggie. I just need to find the latest imgui libs I assumed.

However, I've tried and failed to change the imgui version string to import to update it from anything offered to me by various "Get it" in jitpack.io. Nothing seems to work.

e.g. I pick master-ffcfb6c8aa-1 which gives me:

implementation 'com.github.kotlin-graphics.imgui:imgui-core:master-ffcfb6c8aa-1'

Trying this just gives me

:visualisations:test: Could not resolve com.github.kotlin-graphics.imgui:imgui-core:master-ffcfb6c8aa-1.

So I tried it in the format that the v1.79 works with (i.e. com.github.kotlin-graphics.imgui:core:master-ffcfb6c8aa-1) but that fails with same error "Could not resolve..."

So there are 2 issues here:

  1. Is there a version I can use with lwjgl 3.3.1 and exactly what are the dependency strings?
  2. why doesn't any of the jitpack.io dependencies work at all?

Many thanks. Really would love to use latest in kotlin if possible.

elect86 commented 1 year ago

Sorry, jitpack has some very nice advantages but also huge disadvantages which at the end forced me to drop it

I still haven't got the time to update properly the readme, but this should do it (and it uses lwjgl 3.3.1)


repositories {
    ...
    maven("https://raw.githubusercontent.com/kotlin-graphics/mary/master")
}

dependencies {
    ...
    implementation("kotlin.graphics:imgui-core:1.79+05")
    implementation("kotlin.graphics:imgui-gl:1.79+05")
    implementation("kotlin.graphics:imgui-glfw:1.79+05")
markjfisher commented 1 year ago

This is awesome, thanks. I saw mary mentioned somewhere, but didn't delve into it as everyone's graphics pages have all got the "jitpack" icon and so never looked more closely.

It's also solved my glm, gln, and uno library dependencies out, and my engine is now working on 3.3.1 lwjgl.

markjfisher commented 1 year ago

I would suggest stripping out the jitpack icon and docs around it, it's very confusing to new users like myself. I feel a lot more confident updating my deps now it's out of my build entirely.

elect86 commented 10 months ago

I'll do, thanks

ps: why the docs as well?

markjfisher commented 10 months ago

I have no idea why I mentioned the docs, it was a long time ago :)

Does the jitpack reference need to be taken out of settings.gradle.kts too? Not sure if you have dependencies on it? I haven't checked to be honest.

image
elect86 commented 10 months ago

That's a nice catch, thanks Mark

elect86 commented 10 months ago

Uh, Jitpack looks like is still need for the sealed-enum feature..

https://github.com/kotlin-graphics/imgui/actions/runs/6063138470/job/16450116072