Login  Register

Re: GLCanvas in CardLayout

Posted by Gene on Dec 13, 2011; 10:42pm
URL: https://forum.jogamp.org/GLCanvas-in-CardLayout-tp3571796p3583894.html

Greetings,

I may have a fix, but am more puzzled than ever.

I tried removing the animator in the pared down example, and good news: the GLCanvas card started flipping correctly, responding to paint(), no longer dead.

I tried this because Wade had a hunch that the problem may be a missing MakeCurrent somewhere that the NVIDIA card tolerates and the Intel card does not. The animator has a timer thread, so taking it out of the picture seemed a way to reduce chances for such a bug to manifest.

Another clue in Wade's favor: If I start() the animator just once when it's created, use pause() / resume() in place of stop() / start() in the button actions, and finally call stop() just once when the canvas is disposed, all works correctly. The only difference between pause/resume and start/stop is that the latter create/destroy a timer, including its thread.  Pause/resume use the same timer.

Incidentally, the reason for pause/resume in addition to start/stop is not explained in the FPSAnimator API docs.  So maybe I've just discovered the way the timer is supposed to be used?

I'd really appreciate comments from the experts on this.  

I will copy this note on Bugzilla for the record.

Thanks.