GLJPanel in JavaFX - blanking out window?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GLJPanel in JavaFX - blanking out window?

Brendan
I have a simple JavaFX 2 + JOGL2 frame using GLJPanel working:

    <SwingNode id="MySwingNode"/>
    ...
    SwingNode swingNode = (SwingNode)root.lookup("#MySwingNode");
    swingNode.setContent(new GLJPanel());

The trouble I'm having now is that when I resize the window, ~30% of the time the GL redraw in GLJPanel ends up blanking out the entire window, overwriting other UI elements. They only redraw on events (hover, alt-tab etc). My google-fu suggests JavaFX does not permit a forced redraw of the other elements as a workaround. (I get the same symptoms when initializing inside SwingUtilities.invokeLater()).

1) Is this blanking out because JavaFX is using OpenGL behind the scenes?

2) Is it a symptom of an immature JavaFX/OpenGL integration overall, which may throw up further issues as I progress?

3) What's a workaround??

I would like to use JavaFX as I love the architecture, but considering a move to Swing for the sake of avoiding these issues.
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel in JavaFX - blanking out window?

Brendan
This post was updated on .
Some further info:

1) GLJPanel is drawing over the top of elements in the scene which appear EARLIER in the FXML document (including the parent). So the workaround may be to have it first.

2) The blanking out happens when the GLJPanel is anchored & the window is resized.

3) It only occurs when either the X or Y dimensions of the window decrease. If I resize and make it both taller and wider, drawing is correct.

4) Setting the fx-backgroundcolor class on controls explicitly seems to solve the problem. (This is a viable workaround!)

5) I am working in Netbeans on windows 7 home
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel in JavaFX - blanking out window?

gouessej
Administrator
This post was updated on .
In reply to this post by Brendan
Hi

Please provide a small full test case if you really want to get some help.

Edit.: OpenJFX/JavaFX uses OpenGL ES only if you ask it to do so under Windows.

Edit.2: Don't be discouraged by the few replies here during August and I can't use OpenJFX/JavaFX on my machine (OpenJDK 1.7) but I'll try to help you as much as I can.
Julien Gouesse | Personal blog | Website