Question about using javaFX in an external OpenGL context

Richard Bair richard.bair at
Thu Jul 25 10:34:43 PDT 2013

> However we would need to do this kind of thing sooner. In fact we will need
> to render JavaFX context on top of OpenGL terain or video images (for
> example XPLane or Flightgear content). We have 3 options we consider:
> - not bothering with the context but drawing the JavaFX content on top
> using the alwaysOnTop property for frames. But we have a problem because
> this is still not AFAIK available directly from JavaFX (we could still wrap
> JavaFX in a Swing container an use this option in Swing, however)
> - wrap the JavaFX structure in a Swing container, and draw the Swing
> Graphics2D context in the external OpenGL context. We have an OpenGL
> Graphicsd2D "driver" which does this (open sourced, and using JOGL), but it
> will maybe cause us performance issues
> - Go in the depths of the rendering implementation and draw directly in
> OpenGL ourselves, but it's maybe a lot of work (the Swing OpenGL renderer
> was not something we did in a few days work for example).
> We know which approach will be the simplest, but how much work for the last
> (we fear a lot). We will try the two first ones in the coming months.

In this last option, do you mean to use OpenJFX and plug into the Prism rendering at a low level to insert your content? This would be difficult and ultimately unreliable as the way prism renders may change substantially in the future (for example, if we use multithreading).

It seems that rendering to an intermediate image might be the best solution, if it is fast enough.


More information about the openjfx-dev mailing list