Re: com.jogamp.opengl.util.Animator
Posted by
Sven Gothel on
Mar 26, 2011; 6:34pm
URL: https://forum.jogamp.org/com-jogamp-opengl-util-Animator-tp2735609p2736262.html
On Saturday, March 26, 2011 16:31:53 Itun [via jogamp] wrote:
>
> It is not clear an animator class function.
> >From JavaDoc: "An Animator can be attached to one or more GLAutoDrawables to
> drive their display() methods in a loop."
> It is clear, It make function calls of GLEventListener object.
> >From JavaDoc:"The Animator class creates a background thread in which the
> calls to display() are performed".
> I make a simple test with javax.swing.SwingUtilities.isEventDispatchThread()
> and receive "true" in all cases.
> When I wrote:
> final GLWindow win1 = GLWindow.create(glCapabilities);
> newtCanvasAWT = new NewtCanvasAWT(win1);
> Thread glEventListenerImpl = new Thread(new Runnable() {
>
> public void run() {
> win1.addGLEventListener(
> new GLEventListenerImpl());
> }
> });
> glEventListenerImpl.start();
don't get your test .. looks like a burner / load test ?
> I interesting in one question: Can I suppose that GLEventListener object
> functions calls will be safe (thread-safe). I mean that can case occur when
> animator makes a display() call earlier, than previous call would be
> finished or any other different cases.
our GLAutoDrawables (animator is linked back to it) check if such is attached and running,
where display() is skipped for these (GLCanvas, GLWindow).
however, display is blocking .. so should be fine.
~Sven