JNI based binding for Dear ImGui
MIT License
Bot releases are visible (Hide)
Published by github-actions[bot] about 3 years ago
Added ImPlot extension (#56) [@calvertdw @perrymacmurray];
imgui-app.jar
now contains all needed dependecies to run Dear ImGui Application.Consider reading the official changelog to see other library changes.
ImGuiImplGl3
to the latest Dear ImGui implementation; [d1e264a66365ccd1c3c7bc94fb687aebcabae230]ImGuiImplGlfw
to the latest Dear ImGui implementation; [e8678ef62ca458402694cb9d5d501b7a46257906]Refactored Drag & Drop API
The original Dear ImGui uses raw byte arrays as a payload data. This is fine for C++, yet unacceptable for Java.
Binding has a method setDragDropPayloadObject()
, which is able to take a Java object as a payload.
Now it's the only available method and it was renamed to setDragDropPayload()
.
API itself was extended, so now you can pass any payload, without passing String
data type.
Binding will take payload class as an identifier. For example, now you can write:
static CustomClass PAYLOAD = new CustomClass();
ImGui.setDragDropPayload(PAYLOAD);
...and later...
CustomClass payload = ImGui.acceptDragDropPayload(CustomClass.class);
Binding will do a proper typecasting automatically.
#isValidPtr()
/#isNotValidPtr()
to verify object uses the valid pointer;ImVec2/4
and type classes are now has #set(value)
method, where value is another object of that class.imFloat.set(new ImFloat())
or imVec2.set(new ImVec2())
;ImString#clear
method to drop string content;ImVec2
/ImVec4
directly, without "dst" argument. Under the hood, such methods will create a new object and fill it with data;ImGuiStyle#getColors()
to return float[ImGuiCol.COUNT][4]
array with GUI colors;ImGui#getDragDropPayloadObject()
threw exception if there were no payload.imgui-java
changes:
ImGuiFreeType
class has been deleted. Dear ImGui simplified the process of enabling freetype font renderer. Now, if you are using precompiled libraries, it is enabled by default;ImDrawList
methods: PrimReserve
, PrimUnreserve
, PrimRect
, PrimRectUV
, PrimQuadUV
, PrimWriteVtx
, PrimVtx
;ImFont
methods: FindGlyph
, FindGlyphNoFallback
, GetCharAdvance
, IsLoaded
, GetDebugName
, CalcTextSizeA
, CalcWordWrapPositionA
, RenderChar
, RenderText
;Consider reading the official changelog to see other API changes.
imgui-app
module. More info below.imgui-app
module and was moved into its own module. Has example of extensions usage as well;ImGui#inputTextWithHint()
;ImColor#hslToColor
;ImGui#calcItemSize
(internal API);ImGui#splitterBehavior
(internal API);New module provides an abstraction layer to create ImGui applications. It hides all low-level routine. Every life-cycle method could be overriden with custom logic, so you can extend class in the way you need. Or just keep it as it is, if need nothing specific. Simple application may look like this:
import imgui.ImGui;
import imgui.app.Application;
public class Main extends Application {
@Override
protected void configure(Configuration config) {
config.setTitle("Dear ImGui is Awesome!");
}
@Override
public void process() {
ImGui.text("Hello, World!");
}
public static void main(String[] args) {
launch(new Main());
}
}
clone()
method to ImRect
classReadme now has a How to Build Native Libraries section. It shows how to build natives libraries for all OS, so everyone can play with it.