JME lwjgl3 render to JavaFx or Awt/Swing

JME lwjgl3 render to JavaFx or Awt/Swing

DontingK/jme3-fx-awt (github.com)

core class LwjglCanvas.java

Run javafx(Based on openglfx)

I don’t know why the gui part is like this. It looks a little different from the native startup mode of jme lwjgl3.
jme3-fx-awt/imge/img.png at master · DontingK/jme3-fx-awt (github.com)

Run Awt (Based on lwjgl3-awt)

img

But I haven’t perfected the input yet.

4 Likes

Interesting, you implement your own ‘LwjglCanvas’ class, your AWTGLCanvas cleans up the canvas, normally that’s the job of the jme3 rendering engine.

It is possible to implement “lwjgl-awt” in jme3 inheriting from class LwjglWindow (With this we continue using glfw).

[ Small test library ]

Screenshots




1 Like

Thank you very much. This LwjglCanvas is more perfect.It’s what I need.

Please note that this is only a trial version; Errors may occur that I am not yet aware of :yum:

If you can improve it, I’d love to see your progress. :+1:

Did you try to use lwjgl3-awt straight?

This is a missing feature on jME. It has only been implemented for LWJGL 2. I tried to implement it once and a software render version is in the PR. But… if one could implement this in jME, hardware supported and MacOS compatible… That would be super. Have you @SwiftWolf considered contributing?

1 Like

I have tried it, but I didn’t like it very much since you have to implement or override the methods to be able to use them :yum: (class → AWTGLCanvas)

Well at first I was just experimenting with lwjgl3-awt, but now it’s quite ‘stable’… it would be great if with this I can help the community to use lwjgl3 with Java-AWT. :slightly_smiling_face:

1 Like

In your implementation I see these copy pasted to your own code base. I’m just worried that (if the license allows this in the first place) by doing that, they are essentially jME’s headache from that point forward. They would need maintaining and syncing.

It would be better to have these maintained in their own project. That way they also benefit everyone else, not just jME. We would give back to the community should they need fixing i.e.

Well, like I said before, it was just an experiment (at first) and I didn’t think much of it.

Yep, I’m working on it now!

3 Likes