v1.75-0.5
This commit is contained in:
1 parent
db1e7c73ff
commit
b9e20ed3c4
6 files changed
+49
-31
No files matched your search
@@ -5,16 +5,14 @@
|
|||||||
[](https://bintray.com/spair/io.imgui.java/lwjgl3/_latestVersion)
|
[](https://bintray.com/spair/io.imgui.java/lwjgl3/_latestVersion)
|
||||||
[](https://javadoc.io/doc/io.imgui.java/binding)
|
[](https://javadoc.io/doc/io.imgui.java/binding)
|
||||||
|
|
||||||
A handcrafted/generated Java binding for [Dear ImGui](https://github.com/ocornut/imgui) with no dependencies
|
A handcrafted Java binding for [Dear ImGui](https://github.com/ocornut/imgui) with no dependencies and ready to use pre-compiled binaries.
|
||||||
and ready to use pre-compiled binaries.
|
|
||||||
|
|
||||||
It's a straightforward binding, which uses JNI to do a direct calls to Dear ImGui API.<br>
|
It's a straightforward binding, which uses JNI to do a direct calls to Dear ImGui API.<br>
|
||||||
Since we live in Java world - some things require to do them respectively to that fact. Please read **Binding notice**.
|
Please read **Binding notice** to get more info about specific of the binding API.<br>
|
||||||
Despite this fact, see official [documentation](https://github.com/ocornut/imgui#usage) and [wiki](https://github.com/ocornut/imgui/wiki)
|
See official [documentation](https://github.com/ocornut/imgui#usage) and [wiki](https://github.com/ocornut/imgui/wiki) to get more info about how to do things in ImGui.
|
||||||
to get more info about how to do things in ImGui.
|
|
||||||
|
|
||||||
Binding doesn't force you to use backend renderer which is introduced here. Feel free to use your own render engine if you need so.
|
Binding doesn't force you to use backend renderer which is introduced here. Feel free to use your own render engine if you need so.
|
||||||
See how things are done in [ImGuiImplGl3](https://github.com/SpaiR/imgui-java/blob/v1.74-0.4.1/imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java).
|
See how things are done in [ImGuiImplGl3](https://github.com/SpaiR/imgui-java/blob/v1.75-0.5/imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java).
|
||||||
|
|
||||||
Binding has the next version naming: `imguiVersion-bindingVersion`.<br>
|
Binding has the next version naming: `imguiVersion-bindingVersion`.<br>
|
||||||
For example `1.74-0.1` means that binding uses `1.74` version of **ImGui** and binding itself has version `0.1`.
|
For example `1.74-0.1` means that binding uses `1.74` version of **ImGui** and binding itself has version `0.1`.
|
||||||
@@ -27,21 +25,55 @@ _Make sure you have installed Java 8 or higher._
|
|||||||
You can try this binding by yourself in a three simple steps:
|
You can try this binding by yourself in a three simple steps:
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone --branch v1.74-0.4.1 https://github.com/SpaiR/imgui-java.git
|
git clone --branch v1.75-0.5 https://github.com/SpaiR/imgui-java.git
|
||||||
cd imgui-java
|
cd imgui-java
|
||||||
gradlew :imgui-lwjgl3:startExample
|
gradlew :imgui-lwjgl3:startExample
|
||||||
```
|
```
|
||||||
|
|
||||||
That's it! This will start an example app [ImGuiGlfwExample](https://github.com/SpaiR/imgui-java/blob/v1.74-0.4.1/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java)
|
That's it! This will start an example app [ImGuiGlfwExample](https://github.com/SpaiR/imgui-java/blob/v1.75-0.5/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java)
|
||||||
which relies on GLFW and LWJGL3. Feel free to modify [ImGuiGlfwExample#showUi](https://github.com/SpaiR/imgui-java/blob/v1.74-0.4.1/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java#L288)
|
which relies on GLFW and LWJGL3. Feel free to modify [ImGuiGlfwExample#showUi](https://github.com/SpaiR/imgui-java/blob/v1.75-0.5/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java#L335)
|
||||||
method to try different ImGui widgets in action.
|
method to try different ImGui widgets in action.
|
||||||
|
|
||||||
<details>
|
**GIF with example:** https://imgur.com/a/E2rfuCR
|
||||||
<summary>GIF with example</summary>
|
|
||||||
<img src="https://i.imgur.com/ZGHx4xf.gif"/>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>Usage ready build.gradle<b></summary>
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (OperatingSystem.current()) {
|
||||||
|
case OperatingSystem.LINUX:
|
||||||
|
project.ext.nativesType = "natives-linux"
|
||||||
|
break
|
||||||
|
case OperatingSystem.WINDOWS:
|
||||||
|
project.ext.nativesType = "natives-windows"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
lwjglVersion = '3.2.3'
|
||||||
|
imguiVersion = '1.75-0.5'
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "io.imgui.java:binding:$imguiVersion"
|
||||||
|
implementation "io.imgui.java:lwjgl3:$imguiVersion"
|
||||||
|
runtimeOnly "io.imgui.java:$nativesType:$imguiVersion"
|
||||||
|
|
||||||
|
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
|
||||||
|
|
||||||
|
['', '-opengl', '-glfw'].each {
|
||||||
|
implementation "org.lwjgl:lwjgl$it:$lwjglVersion"
|
||||||
|
runtimeOnly "org.lwjgl:lwjgl$it::$nativesType"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</details>
|
||||||
|
|
||||||
### Step 1
|
### Step 1
|
||||||
Add jcenter repository:
|
Add jcenter repository:
|
||||||
```
|
```
|
||||||
@@ -53,13 +85,13 @@ repositories {
|
|||||||
### Step 2
|
### Step 2
|
||||||
Add binding dependency:
|
Add binding dependency:
|
||||||
```
|
```
|
||||||
implementation 'io.imgui.java:binding:1.74-0.4.1'
|
implementation 'io.imgui.java:binding:1.75-0.5'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3
|
### Step 3
|
||||||
If you want to use LWJGL3 renderer:
|
If you want to use LWJGL3 renderer:
|
||||||
```
|
```
|
||||||
implementation 'io.imgui.java:lwjgl3:1.74-0.4.1'
|
implementation 'io.imgui.java:lwjgl3:1.75-0.5'
|
||||||
```
|
```
|
||||||
**Disclaimer!**<br>
|
**Disclaimer!**<br>
|
||||||
LWJGL3 renderer is based on the `3.2.3` version of the [LWJGL](https://www.lwjgl.org/).
|
LWJGL3 renderer is based on the `3.2.3` version of the [LWJGL](https://www.lwjgl.org/).
|
||||||
@@ -69,7 +101,7 @@ You can find how to do that [here](https://www.lwjgl.org/customize).
|
|||||||
### Step 4
|
### Step 4
|
||||||
Add binary lib dependency:
|
Add binary lib dependency:
|
||||||
```
|
```
|
||||||
runtimeOnly "io.imgui.java:$imguiNatives:1.74-0.4.1"
|
runtimeOnly "io.imgui.java:$imguiNatives:1.75-0.5"
|
||||||
```
|
```
|
||||||
Where `imguiNatives` could be:
|
Where `imguiNatives` could be:
|
||||||
- `natives-linux`
|
- `natives-linux`
|
||||||
@@ -83,20 +115,6 @@ Or alternatively you can download binaries manually:<br>
|
|||||||
Go to the `/bin` folder and pick a native library for your OS. Then you'll need to provide `imgui.library.path` or `java.library.path`
|
Go to the `/bin` folder and pick a native library for your OS. Then you'll need to provide `imgui.library.path` or `java.library.path`
|
||||||
VM option with path to a folder where you placed downloaded file.
|
VM option with path to a folder where you placed downloaded file.
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Result build.gradle could look like this</summary>
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'io.imgui.java:binding:1.74-0.4.1'
|
|
||||||
implementation 'io.imgui.java:lwjgl3:1.74-0.4.1'
|
|
||||||
runtimeOnly "io.imgui.java:natives-windows:1.74-0.4.1"
|
|
||||||
}
|
|
||||||
</details>
|
|
||||||
|
|
||||||
**You are ready to use imgui-java binding!**
|
**You are ready to use imgui-java binding!**
|
||||||
|
|
||||||
#### Binding notice:
|
#### Binding notice:
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
|||||||
version=1.74-0.4.1
|
version=1.75-0.5
|
||||||
Reference in new issue
Block a user