Gave native pointer the correct postfix

This commit is contained in:
Willem Cazander 2022-11-04 15:42:07 +01:00
parent beb774a773
commit 17f244ec31

View file

@ -26,16 +26,16 @@ public class ImGuiSetup {
public final static ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3(); public final static ImGuiImplGl3 imGuiGlImp = new ImGuiImplGl3();
public void init(List<File> fonts, Consumer<String> logger) { public void init(List<File> fonts, Consumer<String> logger) {
long windowHandle = -1; long windowHandle = -1;
try { try {
Object window = Gdx.graphics.getClass().getMethod("getWindow").invoke(Gdx.graphics); Object window = Gdx.graphics.getClass().getMethod("getWindow").invoke(Gdx.graphics);
windowHandle = (Long)window.getClass().getMethod("getWindowHandle").invoke(window); windowHandle = (Long)window.getClass().getMethod("getWindowHandle").invoke(window);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
ImGui.createContext(); ImGui.createContext();
initFonts(ImGui.getIO(), fonts, logger); initFonts(ImGui.getIO(), fonts, logger);
imGuiImp.init(windowHandle, true); imGuiImp.init(windowHandle, true);
imGuiGlImp.init("#version 140"); imGuiGlImp.init("#version 140");
ImGui.getIO().setIniFilename(null); ImGui.getIO().setIniFilename(null);
ImGui.getIO().setBackendFlags(ImGuiBackendFlags.RendererHasVtxOffset); ImGui.getIO().setBackendFlags(ImGuiBackendFlags.RendererHasVtxOffset);