Re: New tutorial on AWT/SWT/Swing/GLJPanel/GLCanvas
Posted by euclidix on Feb 16, 2011; 10:48pm
URL: https://forum.jogamp.org/New-tutorial-on-AWT-SWT-Swing-GLJPanel-GLCanvas-tp2363921p2513693.html
Hi Wade / all,
I went through Wade's tutorial for GLJPanel and Swing, and it worked like a charm (using B298, 32bit Windows xp).
I've since moved on to creating a JFrame, with JInternalFrames. I've added JPanels to the JInternalFrames, as well as a GLJPanel to a JInternalFrame.
I use an FPSAnimator to update the GLJPanel in one of my JInternalFrames (the triangle just like in Wade's example). This works fine.
From a main thread, I am calling repaint at a regular interval on a JPanel in another JInternalFrame. This causes an image to update in that JPanel. This worked fine, until I added the JInternalFrame that has the GLJPanel. Now it "flickers."
Assuming that I need to be able to make the periodic repaint request, is there another way I should be doing this? My understanding of the repaint request is that it gets executed eventually on the Swing Event thread. The fact that the GLJPanel is being rendered by the FPSAnimator separately shouldn't seem to have an impact.
Any suggestions would be greatly appreciated.