Skip to content

xpenatan/xImGui

Repository files navigation

xImGui

Build Build Sonatype Nexus (Snapshots) Static Badge

xImGui is a java binding for C++ dear-imgui.
It uses webidl file to generate java methods with the help of jParser.
It's meant to be small and 1-1 to C++. ImGui::Begin() is ImGui.Begin() and so on.

Supported extensions:

imgui-node-editor
ImGuiColorTextEdit
ImLayout

Examples

ImGui current state:

Emscripten Windows Linux Mac Android iOS
⚠️
  • ✅: Have a working build.
  • ⚠️: Have a working build, but it's not ready yet.
  • ❌: Build not ready.

Note:

* Only snapshot builds are currently available. 
* It's best to try the examples first to see how it works before adding to your project.
* There are 2 ImGui builds. The first contains ImGui only. The second (Ext) contains ImGui with extensions. 

How to run examples

There are two ways to run examples.

  • Build the source and run: ./gradlew :examples:basic:desktop:basic-run-desktop
  • Change LibExt.exampleUseRepoLibs to true in Dependencies.kt and that will make all examples use snapshot from repository

Setup

gdxVersion = "1.13.5"
xImGuiVersion = "-SNAPSHOT"
// Add repository to Root gradle
repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}

Core module

dependencies {
    implementation("com.github.xpenatan.xImGui:gdx-impl:$project.xImGuiVersion")
    implementation("com.github.xpenatan.xImGui:imgui-core:$project.xImGuiVersion")

    // Or the extension build
    implementation "com.github.xpenatan.xImGui:imgui-ext-core:$project.xImGuiVersion"
}

Desktop module

dependencies {
    implementation("com.github.xpenatan.xImGui:imgui-desktop:$project.xImGuiVersion")

    // Or the extension build
    implementation "com.github.xpenatan.xImGui:imgui-ext-desktop:$project.xImGuiVersion"
}

TeaVM module

dependencies {
    implementation("com.github.xpenatan.xImGui:imgui-teavm:$project.xImGuiVersion")

    // Or the extension build
    implementation "com.github.xpenatan.xImGui:imgui-ext-teavm:$project.xImGuiVersion"
}

Build source

  • Requirements: Java 11, mingw64 and emscripten
  • Windows only for now.
##### ImGui
./gradlew :imgui:imgui-build:download_source
./gradlew :imgui:imgui-build:build_project
##### ImGui with extensions. Need to build ImGui first
./gradlew :extensions:imlayout:imlayout-build:build_project
./gradlew :extensions:ImGuiColorTextEdit:textedit-build:download_source
./gradlew :extensions:ImGuiColorTextEdit:textedit-build:build_project
./gradlew :extensions:imgui-node-editor:nodeeditor-build:download_source
./gradlew :extensions:imgui-node-editor:nodeeditor-build:build_project
./gradlew :imgui:imgui-ext-build:build_project

Releases

No releases published

Sponsor this project

 

Packages

No packages published