-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to add imgui to lwjgl? #44
Comments
Contribution is welcomed |
i can run 2 windows side by side |
wut? wut name/version/config of os/jre/lwjgl r u using? |
Theoretically, exposing |
Btw,
what is applciation? |
import org.ice1000.jimgui.JImGui;
import org.ice1000.jimgui.util.JniLoader;
import org.lwjgl.glfw.GLFW;
public class Main {
public Main(){
GLFW.glfwInit();
long window = GLFW.glfwCreateWindow(400,400,"window1",0,0);
GLFW.glfwMakeContextCurrent(window);
GLFW.glfwSwapInterval(1);
GLFW.glfwShowWindow(window);
JniLoader.load();
try (JImGui imGui = new JImGui()) {
// load fonts, global initializations, etc.
imGui.initBeforeMainLoop();
while (!imGui.windowShouldClose()) {
// some drawing-irrelated initializations
// mostly do nothing here
imGui.initNewFrame();
// draw your widgets here, like this
imGui.text("Hello, World!");
imGui.render();
}
}
while (GLFW.glfwWindowShouldClose(window) == false){
GLFW.glfwPollEvents();
}
GLFW.glfwTerminate();
}
public static void main(String[] args){
new Main();
}
} |
@ejamshidiasl you really should learn how to post codeblocks on github: https://help.github.com/en/articles/creating-and-highlighting-code-blocks |
thanks (for code blocks) what is applciation? ---> application |
Try |
OS: win 10 |
i found something |
wut |
|
wha is nativeObjectPtr? |
i find something cool |
may i ask you to change constructor? |
I was just wrapping the native API of glfw, I have no idea how they work |
You can use reflection to access the |
Hello |
I have no idea, you can dig imgui itself if you'd like to |
Could you post the code for / make a new repository to show how you achieved this? |
It occured to me that JImGui is trying to use DirectX on Windows which makes it incompatible with LWJGL. However I'm not 100% sure of this guess: is it true? |
I don't know. There used to be a glfw+ogl3 native library, but I can't recall how to use it. |
Any update for this issue? im using libgdx for a project and libgdx itself spawns a window, while imgui spawns another. |
Using gui=JImGui.fromExistingPointer(windowHandle) makes the program crash and a dump is returned. UPDATE: it seems on linux JImGui.fromExistingPointer(handle) doesnt crash at startup , i have only 1 window shown, but i receive an error inside the gui.render() function that makes the program crash. The error is the following
Any idea @ice1000 ? |
Why was this issue closed? I'm still not able to get this working in LibGDX. |
Me neither |
Hello
i used it in java applciation and it is really good
thanks
is it possible to add it to lwjgl glfw window?
The text was updated successfully, but these errors were encountered: