I’m using the absolute basic pattern to animate in JOGL, i.e. using an Animator and writing some gl commands in the display(GLAutoDrawable) interface method. Nothing beyond the introductory tutorial level.
Everything works aside from some horrible flicker/jitter - looks like lack of screen refresh synchronization (see later).
I started used a GLJPanel, tried a few tweaks assuming the double buffering wasn’t working right, then tried a GLCanvas. Same flicker. Then I stumbled on the gl.setSwapInterval() function (I am an OpenGL beginner, but this seems a relevant JOGL question hence the post here) and all of a sudden I get beautiful, smooth, flawless animation (I am using a bunch of gl.glDrawPixels to render a large scrolling off-screen image buffer).
I get the exact same results on ATI and Nvidia, for what that’s worth (i.e. flicker for every combination except GLCanvas + gl.setSwapInterval(1)).
setSwapInterval apparently synchronizes page flipping until the next screen refresh (sounds like a good idea to me). The flicker I see very much looks like it could be due to lack of such synchronization.
SO, my question is, how do I get this synchronization in a GLJPanel which is the drawing surface that I’d really like to use? setSwapInterval makes no difference when I change a GLCanvas for a GLJPanel (and the API docs suggest this would be the case as it apparently only has effect with heavyweight components).
Does anyone have the magic synchronization call to make my GLJPanel as beautiful as my GLCanvas?
Thanks (and thanks for JOGL!)