Skip to content

Commit be66704

Browse files
committed
Notice about the docking and enable it for an example
1 parent 5458a03 commit be66704

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ JNI based binding for [Dear ImGui](https://github.com/ocornut/imgui) with no dep
66
Please read **Binding Notice** to get more info about java-specific things of the API.<br>
77
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 Dear ImGui.
88

9-
Binding provides all the data you need to render Dear ImGui. If, for some reason, you want to use your own backend renderer, see how things are done in [ImGuiImplGl3](https://github.com/SpaiR/imgui-java/blob/v1.76-0.9/imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java).
9+
Binding provides all the data you need to render Dear ImGui. If, for some reason, you want to use your own backend renderer, see how [ImGuiImplGl3](https://github.com/SpaiR/imgui-java/blob/v1.76-0.9/imgui-lwjgl3/src/main/java/imgui/gl3/ImGuiImplGl3.java) is works.
1010

11-
Next versioning semantic is used: `imguiVersion-bindingVersion`.<br>
11+
**[Docking API](https://user-images.githubusercontent.com/8225057/46304087-00035580-c5ae-11e8-8904-f27a9434574a.gif)** is available! Read "Using Docking" to get more info.
12+
13+
Versioning semantic of the binding: `imguiVersion-bindingVersion`.<br>
1214
For example `1.74-0.1` means that imgui-java uses `1.74` version of Dear ImGui and binding itself has the version `0.1`.
1315

14-
*Some of the very specific features are still in a wip state.*
16+
*Some very specific features are still in a wip state.*
1517

1618
## How to Try
1719
_Make sure you have installed Java 8 or higher._
@@ -68,25 +70,32 @@ Alternatively you can download imgui-java binaries manually from the [release pa
6870

6971
**You are ready to use imgui-java binding!**
7072

73+
## Using Docking
74+
Binding based on the Dear ImGui [docking](https://github.com/ocornut/imgui/tree/docking) branch, commit: [b8e2b2bd6b0d21fcb1b17c0133c0b134ac26f6ac](https://github.com/ocornut/imgui/commit/b8e2b2bd6b0d21fcb1b17c0133c0b134ac26f6ac).
75+
That branch contains two important features: [multi-viewports](https://github.com/ocornut/imgui/issues/1542) and [docking](https://github.com/ocornut/imgui/issues/2109).
76+
77+
Even if the viewport feature is still in a very experimental state, yet the docking API seems pretty stable. Thus, imgui-java exposes it and hides everything about viewports.<br>
78+
See an official documentation about how to work with [docking](https://github.com/ocornut/imgui/issues/2109).
79+
7180
## Using FreeType
72-
Dear ImGui by default uses an stb_strutype library to render a fonts atlas. It's possible to use FreeType instead to get better fonts quality. See an example in [ImGuiGlfwExample](https://github.com/spair/imgui-java/blob/v1.76-0.9/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java). [Read more](https://github.com/ocornut/imgui/blob/v1.76/misc/freetype/README.md)
81+
Dear ImGui by default uses a stb_strutype library to render a fonts atlas. It's possible to use FreeType instead to get better fonts quality. See an example in [ImGuiGlfwExample](https://github.com/spair/imgui-java/blob/v1.76-0.9/imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java). [Read more](https://github.com/ocornut/imgui/blob/v1.76/misc/freetype/README.md)
7382

7483
## Binding Notice
7584
* All Dear ImGui methods are available in `camelCase`, not in `PascalCase`.
7685
* To **pass** `ImVec2`/`ImVec4` - provide two/four float numbers.
7786
To **get** `ImVec2`/`ImVec4` - provide a destination object.
7887
* To get an input/output to/from Dear ImGui - use primitive wrappers: `ImBool`, `ImInt` etc.
7988
* Due to the Java and JNI restrictions we can't provide a fully fledged callbacks to the `ImGui::InputText` methods.
80-
To replace some of the features use an ImGuiInputTextData class.
89+
To replace some features use an ImGuiInputTextData class.
8190
* Read [javadoc](https://javadoc.io/doc/io.imgui.java/binding) and sources comments to get more info.
8291

8392
## How to Build
8493
To build native libraries you should install `mingw-w64` and `ant`. Modify [GenerateLibs](https://github.com/SpaiR/imgui-java/blob/master/buildSrc/src/main/groovy/imgui/generate/GenerateLibs.groovy)
85-
to build specific binaries you need. After everything is configured, run `gradlew :imgui-binding:generateLibs`.
94+
to build specific binaries you need. After you've configured everything, run `gradlew :imgui-binding:generateLibs`.
8695
That will build native libraries and place them in `imgui-binding/build/libsNative` folder.
8796

8897
## Credits
89-
Binding is partly based on the work of [xpenatan](https://github.com/xpenatan) and his version [jDear-imgui](https://github.com/xpenatan/jDear-imgui).
98+
Binding partly based on the work of [xpenatan](https://github.com/xpenatan) and his version [jDear-imgui](https://github.com/xpenatan/jDear-imgui).
9099

91100
## License
92101
See the LICENSE file for license rights and limitations (Apache-2.0).

imgui-lwjgl3/src/test/java/ImGuiGlfwExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private void initImGui() {
139139
final ImGuiIO io = ImGui.getIO();
140140

141141
io.setIniFilename(null); // We don't want to save .ini file
142-
io.setConfigFlags(ImGuiConfigFlags.NavEnableKeyboard); // Navigation with keyboard
142+
io.setConfigFlags(ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.DockingEnable); // Navigation with keyboard and enabled docking
143143
io.setBackendFlags(ImGuiBackendFlags.HasMouseCursors); // Mouse cursors to display while resizing windows etc.
144144
io.setBackendPlatformName("imgui_java_impl_glfw");
145145

0 commit comments

Comments
 (0)