[Example] Migrate example to the new module
This commit is contained in:
1 parent
46f74381aa
commit
cf9e74b1d0
17 files changed
+489
-822
No files matched your search
@@ -2,9 +2,16 @@ import imgui.ImGui;
|
||||
import imgui.ImGuiIO;
|
||||
import imgui.app.Application;
|
||||
import imgui.app.Configuration;
|
||||
import imgui.extension.imnodes.ImNodes;
|
||||
import imgui.flag.ImGuiConfigFlags;
|
||||
import imgui.flag.ImGuiInputTextFlags;
|
||||
import imgui.type.ImString;
|
||||
|
||||
public class Main extends Application {
|
||||
private final ImString str = new ImString(5);
|
||||
private final float[] flt = new float[1];
|
||||
private int count = 0;
|
||||
|
||||
public final class Main extends Application {
|
||||
@Override
|
||||
protected void configure(final Configuration config) {
|
||||
config.setTitle("Example Application");
|
||||
@@ -20,11 +27,29 @@ public final class Main extends Application {
|
||||
io.addConfigFlags(ImGuiConfigFlags.DockingEnable); // Enable Docking
|
||||
io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // Enable Multi-Viewport / Platform Windows
|
||||
io.setConfigViewportsNoTaskBarIcon(true);
|
||||
|
||||
ImNodes.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeImGui() {
|
||||
ImNodes.shutdown();
|
||||
super.disposeImGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process() {
|
||||
ImGui.text("Hello, World");
|
||||
ImGui.text("Hello, World!");
|
||||
if (ImGui.button("Save")) {
|
||||
count++;
|
||||
}
|
||||
ImGui.sameLine();
|
||||
ImGui.text(String.valueOf(count));
|
||||
ImGui.inputText("string", str, ImGuiInputTextFlags.CallbackResize);
|
||||
ImGui.sliderFloat("float", flt, 0, 1);
|
||||
ImGui.separator();
|
||||
ImGui.text("Extra");
|
||||
Extra.show(this);
|
||||
}
|
||||
|
||||
public static void main(final String[] args) {
|
||||
|
||||
Reference in new issue
Block a user