Closed doceazedo closed 1 year ago
Hello DoceAzedo,
in Uno I decoupled the OpenGL related stuff from GlfwWindow, in order to have GlWindow for OpenGL and VkWindow, later on, for Vulkan
If you need Opengl, use GlWindow now, which extends GlfwWindow in turns, all the methods you mentioned are there
Is the project public? I might look into that
I'll send you an invitation for the updating
Thanks for your reply!
I see, but GlWindow
still doesn't seem to have the from
method tho... so I tried using GlWindow
in a similar way I was doing in the original post, but the error is the same:
ImguiKt.MINECRAFT_BEHAVIORS = true;
GlfwWindow glfwWindow = new GlfwWindow(MinecraftClient.getInstance().getWindow().getHandle());
GlWindow window = new GlWindow(glfwWindow, Caps.Profile.COMPATIBILITY, true);
// This doesn't seem to make any difference, as it's already being called when GlWindow is built:
window.makeCurrent(true);
// Crashing here: `java.lang.NoClassDefFoundError: uno/glfw/HWND`
new Context();
implGlfw = new ImplGlfw(window, false, null);
implGl3 = new ImplGL3();
I uploaded the full source code here. I was using breadbyte/fabric-example-imgui and the wiki as references. The relevant class can be found here.
Welp, after a little more digging I think uno/glfw/HWND
does not, in fact, exist:
I followed the stack trace to imgui-core's file IO.kt
and noticed it is trying to import uno.glfw.HWND
, which does not exist, instead of uno.kotlin.HWND
. Does this work anywhere else?
I'm not sure where the source code for this resides so it's hard to debug it any further.
Got it! 🥳
Seems like I was using 1.79+05
as the README told me to, instead of the latest version, 1.89.7
.
I had to add the Jitpack repo so sealed-enum
would stop complaining:
repositories {
maven {
url "https://raw.githubusercontent.com/kotlin-graphics/mary/master"
}
maven {
url "https://jitpack.io"
}
}
I will now get the mouse click to work (only mouse hover is working atm for some reason) and clean up the code. When I get everything right I will update the docs.
Thanks for you help :)
I'm trying to use this library in a Minecraft mod, but the wiki seems to be very outdated (#113).
The game is crashing when I create a new context (line 4 below):
Full code
```java package com.doceazedo.screen; import com.doceazedo.ExampleMod; import imgui.ImGui; import imgui.ImguiKt; import imgui.classes.Context; import imgui.classes.IO; import imgui.impl.gl.ImplGL3; import imgui.impl.glfw.ImplGlfw; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; import net.minecraft.text.Text; import org.slf4j.Logger; import uno.glfw.GlfwWindow; import java.util.*; @Environment(EnvType.CLIENT) public class ImguiScreen extends Screen { private static ImGui imgui = ImGui.INSTANCE; private static ImplGL3 implGl3; private static ImplGlfw implGlfw; private static IO ImGuiIO; private static HashSetWith the following error:
The discussion points here are:
GlfwWindow.from(handle)
doesn't seem to exist anymore. I updated it tonew GlfwWindow(handle)
. Is that correct?window.makeContextCurrent()
also doesn't seem to exist anymore. What should be used instead?java.lang.NoClassDefFoundError: uno/glfw/HWND
error?If we can get this fixed, I'm more than willing to update the docs/wiki/readme.
Thanks!