/** * Moves the designated {@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 moveGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final GLEventListener listener, final boolean preserveInitState) { final boolean initialized = src.getGLEventListenerInitState(listener); if( preserveInitState ) { src.removeGLEventListener(listener); dest.addGLEventListener(listener); if( initialized ) { dest.setGLEventListenerInitState(listener, true); dest.invoke(false, new ReshapeGLEventListener(listener, true)); } } else { src.disposeGLEventListener(listener, true); dest.addGLEventListener(listener); } }
/** * Moves the designated {@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 moveGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final GLEventListener listener, final boolean preserveInitState) { final boolean initialized = src.getGLEventListenerInitState(listener); if( preserveInitState ) { src.removeGLEventListener(listener); dest.addGLEventListener(listener); if( initialized ) { dest.setGLEventListenerInitState(listener, true); dest.invoke(false, new ReshapeGLEventListener(listener, true)); } } else { src.disposeGLEventListener(listener, true); dest.addGLEventListener(listener); } }
a.disposeGLEventListener(a.getGLEventListener(i), false); b.disposeGLEventListener(b.getGLEventListener(i), false);
a.disposeGLEventListener(a.getGLEventListener(i), false); b.disposeGLEventListener(b.getGLEventListener(i), false);