Made unicode plane work and reversted loading screen

This commit is contained in:
Willem Cazander 2022-03-18 14:42:19 +01:00
parent 5dfd954db1
commit 5679699282
5 changed files with 25 additions and 6 deletions

View file

@ -45,7 +45,7 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR
ImGui.tableNextColumn();
ImGui.text(plane.name());
ImGui.tableNextColumn();
if (plane.isPlane0()) {
if (1==0 && plane.isPlane0()) {
StringBuilder buf = new StringBuilder();
int offset = 33;
for (int i=plane.getStart()+offset;i<plane.getStart()+33+offset;i++) {
@ -59,8 +59,16 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR
// LIMITED;
// Dear ImGui Assertion Failed: draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above"
// Assertion Located At: /tmp/imgui/jni/imgui.cpp:4526
DrawCharacter drawChar2 = unicode4DService.getCharacterForUnicode('?');
if (drawChar2 != null) {
new ImCharacter(drawChar2).render();
ImGui.sameLine(); // print before beginChild to fix height of table row
}
int offset = 33;
for (int i=plane.getStart()+offset;i<plane.getStart()+7+offset;i++) {
ImGui.beginChild("row"+plane.name());
for (int i=plane.getStart()+offset;i<plane.getStart()+17+offset;i++) {
DrawCharacter drawChar = unicode4DService.getCharacterForUnicode(i);
if (drawChar != null) {
new ImCharacter(drawChar).render();
@ -69,6 +77,7 @@ public class DemoUnicodePlaneDeskApp extends AbstractDeskApp implements DeskAppR
}
ImGui.sameLine();
}
ImGui.endChild();
}
}
ImGui.endTable();

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

View file

@ -105,7 +105,10 @@ public class GDXAppVrGem4Activator implements BundleActivator {
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
imguiSetup.init(fonts, v -> logger.info(imguiSetup, v));
imguiSetup.init(fonts, v -> {
logger.info(imguiSetup, v);
bootScreen.bootLine(v);
});
imLoaded.set(true);
}
});

View file

@ -22,7 +22,7 @@ public class GDXAppVrGem4BootScreen extends ScreenAdapter implements GDXAppVrGem
public void create() {
batch = new SpriteBatch();
backgroundImage = new Texture(Gdx.files.internal("background/temple-os.png"));
backgroundImage = new Texture(Gdx.files.internal("background/gdxapp-loading.png"));
}
@Override
@ -31,11 +31,16 @@ public class GDXAppVrGem4BootScreen extends ScreenAdapter implements GDXAppVrGem
int textY = Gdx.graphics.getHeight();
int textYStep = 20;
batch.begin();
batch.draw(backgroundImage, 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
synchronized (messages) {
for (String message:messages) {
int start = 0;
if (messages.size() > 33) {
start = messages.size() - 33;
}
List<String> part = messages.subList(start, messages.size());
for (String message:part) {
font.draw(batch, message, textX, textY-=textYStep);
}
batch.draw(backgroundImage, 200, textY, Gdx.graphics.getWidth() - 200, Gdx.graphics.getHeight() - textY);
}
batch.end();
}

View file

@ -11,6 +11,7 @@ import imgui.ImFontGlyphRangesBuilder;
import imgui.ImGui;
import imgui.ImGuiIO;
import imgui.ImGuiStyle;
import imgui.flag.ImGuiBackendFlags;
import imgui.gl3.ImGuiImplGl3;
import imgui.glfw.ImGuiImplGlfw;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@ -36,6 +37,7 @@ public class ImGuiSetup {
imGuiImp.init(windowHandle, true);
imGuiGlImp.init("#version 140");
ImGui.getIO().setIniFilename(null);
ImGui.getIO().setBackendFlags(ImGuiBackendFlags.RendererHasVtxOffset);
ImGui.init();
initStyle();
}