
Generated facade for cimgui Dear ImGui API, simple GLFW desktop window host, click-through and interactive overlay hosts, with ready examples and build helpers.
Kotlin/Native bindings and window helpers for Dear ImGui on desktop.
imgui2kt provides:
linuxX64 and Windows mingwX64 targetsAdd the plugin from Maven Central:
// settings.gradle.kts
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories { mavenCentral() }
}// build.gradle.kts
plugins {
kotlin("multiplatform") version "2.3.20"
id("org.kvxd.imgui2kt.runtime") version "0.7.0"
}
kotlin {
linuxX64 {
binaries.executable {
entryPoint = "example.main"
}
}
}Then create src/nativeMain/kotlin/example/Main.kt:
package example
import org.kvxd.imgui2kt.ImGui
import org.kvxd.imgui2kt.desktopWindow
fun main() {
desktopWindow(title = "imgui2kt", width = 900, height = 560) { window ->
window.run {
ImGui.window("Hello") {
ImGui.textUnformatted("Dear ImGui from Kotlin/Native")
}
}
}
}Build it:
./gradlew linkDebugExecutableLinuxX64Run an example from this repository:
./gradlew :examples:simple-window:linkDebugExecutableLinuxX64To build the Windows executable from Linux:
./gradlew :examples:simple-window:linkDebugExecutableMingwX64examples/simple-window: normal desktop windowexamples/simple-overlay: click-through HUD overlayexamples/interactive-overlay: overlay that can switch between HUD and interactive inputLinux builds require:
wayland-scannerWindows target builds use Kotlin/Native mingwX64. Cross-building from Linux also requires:
x86_64-w64-mingw32-gccx86_64-w64-mingw32-g++x86_64-w64-mingw32-windresPublish the library and Gradle plugin to Maven Local:
./gradlew publishAllToMavenLocalPublish the library and Gradle plugin to Maven Central:
./gradlew publishAllToMavenCentralMaven Central publishing requires the Vanniktech Maven Publish credentials and signing properties to be available to Gradle.
The release version is set in gradle.properties as imgui2kt.version.
Kotlin/Native bindings and window helpers for Dear ImGui on desktop.
imgui2kt provides:
linuxX64 and Windows mingwX64 targetsAdd the plugin from Maven Central:
// settings.gradle.kts
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}
dependencyResolutionManagement {
repositories { mavenCentral() }
}// build.gradle.kts
plugins {
kotlin("multiplatform") version "2.3.20"
id("org.kvxd.imgui2kt.runtime") version "0.7.0"
}
kotlin {
linuxX64 {
binaries.executable {
entryPoint = "example.main"
}
}
}Then create src/nativeMain/kotlin/example/Main.kt:
package example
import org.kvxd.imgui2kt.ImGui
import org.kvxd.imgui2kt.desktopWindow
fun main() {
desktopWindow(title = "imgui2kt", width = 900, height = 560) { window ->
window.run {
ImGui.window("Hello") {
ImGui.textUnformatted("Dear ImGui from Kotlin/Native")
}
}
}
}Build it:
./gradlew linkDebugExecutableLinuxX64Run an example from this repository:
./gradlew :examples:simple-window:linkDebugExecutableLinuxX64To build the Windows executable from Linux:
./gradlew :examples:simple-window:linkDebugExecutableMingwX64examples/simple-window: normal desktop windowexamples/simple-overlay: click-through HUD overlayexamples/interactive-overlay: overlay that can switch between HUD and interactive inputLinux builds require:
wayland-scannerWindows target builds use Kotlin/Native mingwX64. Cross-building from Linux also requires:
x86_64-w64-mingw32-gccx86_64-w64-mingw32-g++x86_64-w64-mingw32-windresPublish the library and Gradle plugin to Maven Local:
./gradlew publishAllToMavenLocalPublish the library and Gradle plugin to Maven Central:
./gradlew publishAllToMavenCentralMaven Central publishing requires the Vanniktech Maven Publish credentials and signing properties to be available to Gradle.
The release version is set in gradle.properties as imgui2kt.version.