/** * Moves all {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>. * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved * and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued w/ the next {@link GLAutoDrawable#display()} call. * <p> * Note that it is only legal to pass <code>preserveInitState := true</code>, * if the {@link GLContext} of both <code>src</code> and <code>dest</code> are shared, or has itself moved from <code>src</code> to <code>dest</code>. * </p> * <p> * Also note that the caller is encouraged to pause an attached {@link GLAnimatorControl}. * </p> * @param src * @param dest * @param listener * @param preserveInitState */ public static final void moveAllGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final boolean preserveInitState) { for(int count = src.getGLEventListenerCount(); 0<count; count--) { final GLEventListener listener = src.getGLEventListener(0); moveGLEventListener(src, dest, listener, preserveInitState); } }
listenersInit = new boolean[aSz]; for(int i=0; i<aSz; i++) { final GLEventListener l = glad.getGLEventListener(0); listenersInit[i] = glad.getGLEventListenerInitState(l); listeners[i] = glad.removeGLEventListener( l );
final GLEventListener l = src.getGLEventListener(0); glls.listenersInit[i] = src.getGLEventListenerInitState(l); glls.listeners[i] = src.removeGLEventListener( l );
a.disposeGLEventListener(a.getGLEventListener(i), false); b.disposeGLEventListener(b.getGLEventListener(i), false);