com.jogamp.opengl.util.Animator
Posted by Itun on Mar 26, 2011; 3:31pm
URL: https://forum.jogamp.org/com-jogamp-opengl-util-Animator-tp2735609.html
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();
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.