Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (789)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (864)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Still no good solution for rich UI (JavaFX/Swing) + LWJGL?  (Read 1151 times)
0 Members and 1 Guest are viewing this topic.
Offline ShannonSmith
« Posted 2019-04-21 20:08:45 »

Every so often over the last 10 years I check to see if there is a solution for integrating a rich UI like JavaFX or Swing with an LWJGL view. It seems like it should be easy but must be a really hard problem as it has remained unsolved for over a decade. There are lots of part solutions but they all wind up with deal breaker performance or cross platform issues.

Is anyone aware of any recent progress being made on this?
Offline orange451

JGO Kernel


Medals: 516
Projects: 8
Exp: 8 years


Your face? Your ass? What's the difference?


« Reply #1 - Posted 2019-04-21 20:17:35 »

There's JFXGL.
However it is not performant. It'll slow to a crawl when you make complex UI's. I tried to create an IDE using it, ran at 10 FPS with only UI code.

As for Java-based solutions, there's:

I can't speak for AUI or Legui, but @SkyAphid is constantly working on Clear, and I am constantly working on LWJGUI!
I'm currently working on a small game engine using LWJGUI

[EDIT]
I think I heard of some developments with actual integrations of JavaFX and LWJGL a few months back. Havent seen anything since.

First Recon. A java made online first person shooter!
Offline ShannonSmith
« Reply #2 - Posted 2019-04-21 20:50:46 »

Thanks for those links I'll check them out. I would tend to avoid pet project GUI libraries due to the likelihood of them lacking important features and being abandoned at some point in future.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SkyAphid
« Reply #3 - Posted 2019-04-21 23:01:59 »

There's JFXGL.
However it is not performant. It'll slow to a crawl when you make complex UI's. I tried to create an IDE using it, ran at 10 FPS with only UI code.

As for Java-based solutions, there's:

I can't speak for AUI or Legui, but @SkyAphid is constantly working on Clear, and I am constantly working on LWJGUI!
I'm currently working on a small game engine using LWJGUI

[EDIT]
I think I heard of some developments with actual integrations of JavaFX and LWJGL a few months back. Havent seen anything since.

Backing this, LWJGUI is an amazing solution if you're looking to get the fast and seamless JavaFX approach to making UIs. Definitely a deserved self-plug. My API is Clear, which is actually directly inspired by LWJGUI and is meant to be a bit harder to use but more flexible for the needs of what you're making. Either solution will likely be more than capable of what you're wanting and both of us are responsive to any bugs you may run into.

Thanks for those links I'll check them out. I would tend to avoid pet project GUI libraries due to the likelihood of them lacking important features and being abandoned at some point in future.

Clear might be for you in that case. I designed my library to essentially be as barebones/highly documented as possible so that if I did stop working on it, others can easily both continue working with/on it. If it's missing something you want, I've made it very easy for you to attach it yourself with a plethora of examples.

it just werks
Offline ShannonSmith
« Reply #4 - Posted 2019-04-22 17:06:52 »

Usually the things missing in personal gui projects include:

* Dialogs and Windows with modal handling
* Focus traversal
* Animation
* Clipboard handling
* Lots of widgets (Spinners, Date Pickers, Sliders, Trees)

I think it is pretty hard to do a fully fledged GUI toolkit without a team of developers which is why it would be really nice if there was a hook in JavaFX for a native surface node you could attach a GL context to.
Offline ShannonSmith
« Reply #5 - Posted 2019-04-22 17:25:38 »

I don't suppose anyone has tried using DriftFX (https://github.com/eclipse-efx/efxclipse-drift) to integrate LWJGL into JavaFX?
Offline SHC
« Reply #6 - Posted 2019-04-22 17:54:23 »

I don't suppose anyone has tried using DriftFX (https://github.com/eclipse-efx/efxclipse-drift) to integrate LWJGL into JavaFX?

I didn't try it, but I went through the link. Found this discouraging comment in the class.

1  
2  
3  
//Note: this implementation is against internal JavafX API
@SuppressWarnings({"restriction", "deprecation"})
public class DriftFXSurface extends Node {

This is also the reason why integration with JavaFX is not pretty possible with good performance in LWJGL.

The closest that comes to JavaFX is LWJGLUI library written by @orange451. Most parts of it are resembling the JavaFX API itself. With some reflection, I think we can make a FxmlLoader to work with this.

Offline elect

JGO Knight


Medals: 67



« Reply #7 - Posted 2019-04-25 09:14:27 »

There is also an imgui port we are mantaining here

* Dialogs and Windows with modal handling = Yes
* Focus traversal = what do you mean? When you click on a window or open a new one, then its focus shall be obtained automatically? This is there though
* Animation = Yes
* Clipboard handling = Yes
* Lots of widgets (Spinners, Date Pickers, Sliders, Trees) = Yes

Also, we have an experimental JavaFX branch
Offline CommanderKeith
« Reply #8 - Posted 2019-04-25 11:06:26 »

There is also an imgui port we are mantaining here

* Focus traversal = what do you mean? When you click on a window or open a new one, then its focus shall be obtained automatically? This is there though
Sounds like a rich UI. Great to see.
I think that what ShannonSmith means by focus traversal is being able to use the tab key and shift tab to select different buttons and text input on the UI, and maybe also space or enter to activate.
Another thing that UI's often lack is proper multi-line wrapping text entry. Of course this is an extremely laborious and difficult thing to code since it's basically a word-processor.
I've always wanted to try using Java-CEF but haven't had time:
https://bitbucket.org/chromiumembedded/
This is supposed to act as a web browser within a java application and might make a nice UI.
But maybe it's silly since there's little point using java at all in that case, may as well just use web pages, webGL and javascript in the browser.

Offline elect

JGO Knight


Medals: 67



« Reply #9 - Posted 2019-04-25 13:48:07 »

Sounds like a rich UI. Great to see.

Thanks, appreciated

I think that what ShannonSmith means by focus traversal is being able to use the tab key and shift tab to select different buttons and text input on the UI, and maybe also space or enter to activate.
Another thing that UI's often lack is proper multi-line wrapping text entry. Of course this is an extremely laborious and difficult thing to code since it's basically a word-processor.

Both the features are there
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #10 - Posted 2019-04-25 15:28:18 »

I've always wanted to try using Java-CEF but haven't had time:
https://bitbucket.org/chromiumembedded/
This is supposed to act as a web browser within a java application and might make a nice UI.
But maybe it's silly since there's little point using java at all in that case, may as well just use web pages, webGL and javascript in the browser.

Or you could always embed a headless JVM in Electron for completely over-the-top bloat!  Grin  Actually, it's not as stupid an idea as it sounds as Electron has useful desktop API's too on top of CEF.  I had a play with this last year using HTML4Java / DukeScript.

https://twitter.com/neilcsmith_net/status/975817341639512066

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline ShannonSmith
« Reply #11 - Posted 2019-04-25 21:15:19 »

I haven't ever properly tried immediate mode GUI's. I think they require such a different mindset and I instinctively have concerns about how they scale (seems like a lot of work every frame). I did briefly try Nuklear because it can be easily bundled with lwjgl but never got very far because of the aforementioned mindset block. Might have to give it another try.

Offline elect

JGO Knight


Medals: 67



« Reply #12 - Posted 2019-04-26 07:18:37 »

I haven't ever properly tried immediate mode GUI's. I think they require such a different mindset and I instinctively have concerns about how they scale (seems like a lot of work every frame). I did briefly try Nuklear because it can be easily bundled with lwjgl but never got very far because of the aforementioned mindset block. Might have to give it another try.

It's a common worrying, however from some past tests I run with RemoteryGL, the demo example "weights" just 0.3ms to say

They shine especially for debugging and simple GUIs in production (take a look at some samples).

If you need it extensively in production (with a huge/complex usage) you shall fallback to the retained solutions.

Also, some interesting quotes



Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (2639 views)
2018-11-16 13:46:03

hadezbladez (954 views)
2018-11-16 13:41:33

hadezbladez (2600 views)
2018-11-16 13:35:35

hadezbladez (513 views)
2018-11-16 13:32:03

EgonOlsen (3748 views)
2018-06-10 19:43:48

EgonOlsen (4144 views)
2018-06-10 19:43:44

EgonOlsen (2499 views)
2018-06-10 19:43:20

DesertCoockie (3307 views)
2018-05-13 18:23:11

nelsongames (3403 views)
2018-04-24 18:15:36

nelsongames (4381 views)
2018-04-24 18:14:32
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!