com.jogamp.opengl.util
Class GLDrawableUtil

java.lang.Object
  extended by com.jogamp.opengl.util.GLDrawableUtil

public class GLDrawableUtil
extends Object

Providing utility functions dealing w/ GLDrawables, GLAutoDrawable and their GLEventListener.


Constructor Summary
GLDrawableUtil()
           
 
Method Summary
static boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl)
           
static boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl)
           
static boolean isAnimatorStarted(GLAnimatorControl animatorCtrl)
           
static boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl)
           
static void moveAllGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, boolean preserveInitState)
          Moves all GLEventListener from GLAutoDrawable src to dest.
static void moveGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, GLEventListener listener, boolean preserveInitState)
          Moves the designated GLEventListener from GLAutoDrawable src to dest.
static void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest)
          Swaps the GLContext of given GLAutoDrawable and disposes each GLEventListener w/o removing it.
static void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b)
          Swaps the GLContext and all GLEventListener between GLAutoDrawable a and b, while preserving it's initialized state, resets the GL-Viewport and issuing reshape(..).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLDrawableUtil

public GLDrawableUtil()
Method Detail

isAnimatorStartedOnOtherThread

public static final boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl)

isAnimatorStarted

public static final boolean isAnimatorStarted(GLAnimatorControl animatorCtrl)

isAnimatorAnimatingOnOtherThread

public static final boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl)

isAnimatorAnimating

public static final boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl)

moveGLEventListener

public static final void moveGLEventListener(GLAutoDrawable src,
                                             GLAutoDrawable dest,
                                             GLEventListener listener,
                                             boolean preserveInitState)
Moves the designated GLEventListener from GLAutoDrawable src to dest. If preserveInitState is true, it's initialized state is preserved and reshape(..) issued w/ the next GLAutoDrawable.display() call.

Note that it is only legal to pass preserveInitState := true, if the GLContext of both src and dest are shared, or has itself moved from src to dest.

Also note that the caller is encouraged to pause an attached GLAnimatorControl.

Parameters:
src -
dest -
listener -
preserveInitState -

moveAllGLEventListener

public static final void moveAllGLEventListener(GLAutoDrawable src,
                                                GLAutoDrawable dest,
                                                boolean preserveInitState)
Moves all GLEventListener from GLAutoDrawable src to dest. If preserveInitState is true, it's initialized state is preserved and reshape(..) issued w/ the next GLAutoDrawable.display() call.

Note that it is only legal to pass preserveInitState := true, if the GLContext of both src and dest are shared, or has itself moved from src to dest.

Also note that the caller is encouraged to pause an attached GLAnimatorControl.

Parameters:
src -
dest -
listener -
preserveInitState -

swapGLContextAndAllGLEventListener

public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a,
                                                            GLAutoDrawable b)
Swaps the GLContext and all GLEventListener between GLAutoDrawable a and b, while preserving it's initialized state, resets the GL-Viewport and issuing reshape(..).

If an GLAnimatorControl is being attached to GLAutoDrawable a or b and the current thread is different than the animator's thread, it is paused during the operation.

Parameters:
a -
b -
Throws:
GLException - if the AbstractGraphicsDevice are incompatible w/ each other.

swapGLContext

public static final void swapGLContext(GLAutoDrawable src,
                                       GLAutoDrawable dest)
Swaps the GLContext of given GLAutoDrawable and disposes each GLEventListener w/o removing it.

The GL-Viewport is reset and reshape(..) issued implicit.

If an GLAnimatorControl is being attached to GLAutoDrawable src or dest and the current thread is different than the animator's thread, it is paused during the operation.

Parameters:
src -
dest -


Copyright 2010 JogAmp Community.