From e003063b5309eb73d31b3642b5dedb2d36f24012 Mon Sep 17 00:00:00 2001 From: Willem Date: Fri, 18 Mar 2022 16:47:00 +0100 Subject: [PATCH] Added render option to unicode plane desk app. --- .../glyphdemo/apps/DemoUnicodePlaneDeskApp.java | 16 ++++++---------- .../gdxapp4d/app/glyphdemo/Main.properties | 1 + .../gdxapp4d/app/glyphdemo/Main_hiero.properties | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java index 1392eb55..885814fd 100644 --- a/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java +++ b/gdxapp4d-app-glyphdemo/src/main/java/love/distributedrebirth/gdxapp4d/app/glyphdemo/apps/DemoUnicodePlaneDeskApp.java @@ -5,6 +5,7 @@ import java.util.ResourceBundle; import imgui.ImGui; import imgui.flag.ImGuiStyleVar; import imgui.flag.ImGuiTableFlags; +import imgui.type.ImBoolean; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService; import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp; @@ -19,6 +20,7 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR private final VrGem4Unicode4DService unicode4DService; private final ResourceBundle bundle; + private final ImBoolean render4DPlane0 = new ImBoolean(false); public DemoUnicodePlaneDeskApp(ResourceBundle bundle, VrGem4Unicode4DService unicode4DService) { this.unicode4DService = unicode4DService; @@ -36,6 +38,7 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR @Override public void render() { + ImGui.checkbox(getTxt("render4DPlane0"), render4DPlane0); int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable; ImGui.beginTable("base-part", 2, flags); ImGui.tableSetupColumn(getTxt("colPlane")); @@ -46,7 +49,7 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR ImGui.tableNextColumn(); ImGui.text(plane.name()); ImGui.tableNextColumn(); - if (1==0 && plane.isPlane0()) { + if (plane.isPlane0() && render4DPlane0.get() == false) { StringBuilder buf = new StringBuilder(); int offset = 33; for (int i=plane.getStart()+offset;i_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above" - // Assertion Located At: /tmp/imgui/jni/imgui.cpp:4526 - ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, 0f, 0f); - DrawCharacter drawChar2 = unicode4DService.getCharacterForUnicode(' '); if (drawChar2 != null) { ImCharacter.render(drawChar2); - ImGui.sameLine(); // print before beginChild to fix height of table row + ImGui.sameLine(); // print before beginChild to fix row height of table } - int offset = 33; - ImGui.beginChild("row"+plane.name()); + ImGui.beginChild("row"+plane.name()); // workaround for error; Too many vertices in ImDrawList using 16-bit indices. for (int i=plane.getStart()+offset;i