Skip to content

Commit 68b36de

Browse files
committed
[Doc] Add info about ImPlot
1 parent ac7ae3d commit 68b36de

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
[![binding javadoc](https://javadoc.io/badge2/io.github.spair/imgui-java-binding/javadoc_binding.svg?logo=java)](https://javadoc.io/doc/io.github.spair/imgui-java-binding)
66
[![app javadoc](https://javadoc.io/badge2/io.github.spair/imgui-java-app/javadoc_app.svg?logo=java)](https://javadoc.io/doc/io.github.spair/imgui-java-app)
77

8-
## Important News!
9-
_(If you are using raw jars, you can skip this section.)_<br>
10-
Because of [JCenter shutdown](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/) library has moved to Maven Central.
11-
That fact affects nothing, but the groupId parameter in your Gradle and Maven configuration files.
12-
From version `1.80-1.5.0` use `io.github.spair` instead of `io.imgui.java`. See an updated [How To Use](#how-to-use) section for details.
13-
14-
**<ins>Old versions will not be transferred to Maven Central and will become unavailable after JCenter goes down.</ins>**
15-
168
---
179

1810
JNI based binding for [Dear ImGui](https://github.com/ocornut/imgui) with no dependencies.<br>
@@ -54,7 +46,7 @@ cd imgui-java
5446

5547
See [example](https://github.com/SpaiR/imgui-java/blob/v1.83.0/example) module to try other widgets in action.
5648

57-
# How To Use
49+
# How to Use
5850
**[ImGui in LWJGL YouTube video](https://youtu.be/Xq-eVcNtUbw)** by [GamesWithGabe](https://www.youtube.com/channel/UCQP4qSCj1eHMHisDDR4iPzw).<br>
5951
You can use this video as a basic step-by-step tutorial. It shows how to integrate binding with the usage of jar files. Gradle and Maven dependecies could be used for this purpose as well.
6052

@@ -262,6 +254,8 @@ dependencies {
262254
Node Editor using ImGui. (A bit more complex than ImNodes, but has more features.)
263255
- [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo/tree/f7bbbe39971d9d45816417a70e9b53a0f698c56e) | [Example](https://github.com/SpaiR/imgui-java/blob/v1.83.0/example/src/main/java/ExampleImGuizmo.java) <br>
264256
Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui.
257+
- [implot](https://github.com/epezent/implot/tree/555ff688a8134bc0c602123149abe9c17d577475) | [Example](https://github.com/SpaiR/imgui-java/blob/v1.83.0/example/src/main/java/ExampleImPlot.java) <br>
258+
Advanced 2D Plotting for Dear ImGui.
265259

266260
## Freetype
267261
By default, Dear ImGui uses stb-truetype to render fonts. Yet there is an option to use FreeType font renderer. Go to the [imgui_freetype](https://github.com/ocornut/imgui/tree/256594575d95d56dda616c544c509740e74906b4/misc/freetype) to read about the difference.

example/src/main/java/ExampleImPlot.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import imgui.extension.implot.ImPlot;
2-
import imgui.extension.implot.ImPlotContext;
32
import imgui.flag.ImGuiCond;
43
import imgui.internal.ImGui;
54
import imgui.type.ImBoolean;
65

7-
import java.awt.*;
6+
import java.awt.Desktop;
87
import java.net.URI;
98

109
public class ExampleImPlot {
@@ -14,10 +13,8 @@ public class ExampleImPlot {
1413
private static final Integer[] xs = {0, 1, 2, 3, 4, 5};
1514
private static final Integer[] ys = {0, 1, 2, 3, 4, 5};
1615

17-
private final static ImPlotContext IMPLOT_CONTEXT;
18-
1916
static {
20-
IMPLOT_CONTEXT = ImPlot.createContext();
17+
ImPlot.createContext();
2118
}
2219

2320
public static void show(ImBoolean showImPlotWindow) {

example/src/main/java/Main.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import imgui.*;
1+
import imgui.ImFontConfig;
2+
import imgui.ImFontGlyphRangesBuilder;
3+
import imgui.ImGui;
4+
import imgui.ImGuiIO;
25
import imgui.app.Application;
36
import imgui.app.Configuration;
4-
import imgui.extension.imnodes.ImNodes;
5-
import imgui.extension.implot.ImPlot;
6-
import imgui.extension.implot.ImPlotContext;
77
import imgui.flag.ImGuiConfigFlags;
88
import imgui.flag.ImGuiInputTextFlags;
99
import imgui.type.ImString;
@@ -68,12 +68,6 @@ private void initFonts(final ImGuiIO io) {
6868
fontConfig.destroy();
6969
}
7070

71-
@Override
72-
protected void disposeImGui() {
73-
ImNodes.destroyContext();
74-
super.disposeImGui();
75-
}
76-
7771
@Override
7872
public void process() {
7973
ImGui.text("Hello, World! " + FontAwesomeIcons.Smile);

0 commit comments

Comments
 (0)