JOGL heavyweight GLCanvas not rendering

Hi,

I’m trying to get an OpenGL application working with DockingFrames. If I use the lightweight GLJPanel component, then it works as expected; the graphics are rendered correctly, but framerate is poor since it internally does something like copy the gl framebuffer to a BufferedImage every frame. Using the normal heavyweight GLCanvas, I just see the background colour of the panel.

I realise that heavyweight components can be problematic, and I would expect for example that certain overlays from DockingFrames would be lost where they intersected with the GLCanvas… but not seeing any of my GL rendering is obviously rather more critical.

The version of JOGL I’m using is 1.1.1, as downloaded from https://jogl.dev.java.net/

It should be possible, as described here, to use the OpenGL-based Java2D pipeline to avoid the problem of GLJPanel being slow… however, since the OpenGL-based Java2D pipeline is horribly broken this is a non-starter.

Is there something that could be done to configure DockingFrames such that a GLCanvas will be rendered? I can produce a simple test case if that helps.

FWIW, a library called ‘VLDocking’, referenced on http://jogamp.org/jogl/www/ “fully supports heavyweight components such as JOGL’s GLCanvas in a docking environment.” Unfortunately, the link to their webpage is broken and IIRC it was a commercial library. I’m going to try some other libraries now, although DockingFrames was my preferred choice.

Regards,
Peter

update: MyDoggy seems to work fine (there may be some nuances, but at least I see my graphics). If there’s an easy solution, I think I’d still prefer to use DockingFrames, but I guess I’m moderately likely to stick with MyDoggy now. Need to think a bit deeper about what the relative merits are.

We had similar problems some time ago old thread.

DF sometimes uses transparent JPanels to catch and handle MouseEvents before they reach any other component (a glass-pane). With Java 1.6.14 they started to “optimize” the whole painting algorithm with the effect that glasspanes+AWT did no longer work (there was even a bugreport basically saying “no one needs that anyway, so we don’t need to care”). There was a workaround calling some obscure and not documented methods to get real transparent JPanels, but that may have changed again (the class bibliothek.util.JavaVersionWorkaround does all of that).

I’ll put it on the todo-list. But frankly, I don’t know when that will be and if it will ever work again.

Many thanks for the reply, Beni, and keep up the good work.

It looks like I’ll strike DockingFrames from my list of candidates and probably stick with MyDoggy (with API details abstracted enough that I can switch fairly easily if needs be).

Cheers,
Peter

I may also have a poke into JavaVersionWorkaround to see if it can help easily. Also, I might try with LWJGL and see if similar problems are encountered, although I don’t plan to port my whole application to that even if it does.

There was a solution in another thread that may help: click me