AWT Frame flicker (and better SWT integration)

Why is it that an AWT Frame that contains a GLCanvas flickers when it is resized? This is especially annoying when the resize is “continuous”, e.g. when the Frame is a part of a splitted UI. The flicker color is the background color of the Frame - it seems that the Frame is always repainted before the GLCanvas, even if ignoreRepaint is set to true for the Frame. Is there a known work-around for this behaviour?

I’m restricted to use the Frame as a container for my GLCanvas, since I’m using SWT for the GUI and SWT only allows to integrate with AWT components via Frame containers. This leads me to the next question: is a better SWT integration planned for JOGL (i.e. direct integration to Composite containers in SWT)? This kind of thing would be extremely useful, in my opinion. An example of such integration would be the SWT OpenGL plugin, which only has rudimentary OpenGL support at this moment:

http://dev.eclipse.org/viewcvs/index.cgi/platform-swt-home/opengl/opengl.html?rev=1.6

Cheers

I can see the flickering you’re talking about on X11. On Windows XP I don’t see continuous resizing. We override Canvas.update() in GLCanvas specifically to prevent the component from being cleared to the background color; I don’t know what could be causing the flickering. If you want to file a bug, feel free, but it would be good if you could first find a C program (like Brian Paul’s original Gears demo) that doesn’t exhibit the same flickering.

There are no plans by the JOGL development team to implement SWT support, though at least one port was done in the past by Rob Grzywinski. JSR-231 will add extensibility mechanisms to the API to more easily allow third parties to provide such support.

Thanks for the swift reply. I partly resolved the problem by modifying my SWT splitter component to update the contained components only when the “splitter-bar” is released to a new location. So, now the Frame blinks only once, after the splitter (Sash in SWT terms) has been released by the user. Also, setting the Frame background color to match the GLCanvas clear color, makes the flicker a little less apparent.

Edit: BTW, I don’t think that the flicker is caused by the Canvas painting its background, but by the underlying Frame (which contains the GLCanvas) painting itself with its background color, before the GLCanvas displays its image.