On 02/22/2012 05:23 PM, ac [via jogamp] wrote:
>
>
> Hello,
>
> If I need to change the number of samples of the gl surface after it has
> been created and possibly in the middle of rendering a frame, what would be
> the recommended way to do it, either with AWT or NEWT?
>
> I think of the following sequence of operations: stop animator, destroy
> canvas, recreate canvas with new sample config, restart animator...
Yes, you got it - sure.
Note: GLWindow and GLCanvas are GLAutoDrawable's.
You can keep the GLEventListener instance alive of course.
If properly implemented (destroy/init),
it should keep it's application state alive.
Hence remove the GLEventListener from the GLAutoDrawable
and add it to the new created one would be enough.
Instead of animator.stop(), you can also 'just' remove the GLAutoDrawable
from the running animator .. and later attach the new one.
If that is not working, you found a bug.
However, we already have a few unit tests validating this
'extended' lifecycle - ie. hopping an GLEventListener from
GLAutoDrawable to GLAutoDrawable :)
~Sven
>
> Thanks!