public class GLDrawableUtil extends Object
Constructor and Description |
---|
GLDrawableUtil() |
Modifier and Type | Method and Description |
---|---|
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)
|
static void |
moveGLEventListener(GLAutoDrawable src,
GLAutoDrawable dest,
GLEventListener listener,
boolean preserveInitState)
|
static boolean |
swapBuffersBeforeRead(GLCapabilitiesImmutable chosenCaps)
Determines whether the chosen
GLCapabilitiesImmutable
requires a swap-buffers
before reading pixels. |
static void |
swapGLContext(GLAutoDrawable src,
GLAutoDrawable dest)
|
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(..) . |
public static final boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl)
public static final boolean isAnimatorStarted(GLAnimatorControl animatorCtrl)
public static final boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl)
public static final boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl)
public static final void moveGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, GLEventListener listener, boolean preserveInitState)
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
.
src
- dest
- listener
- preserveInitState
- public static final void moveAllGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, boolean preserveInitState)
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
.
src
- dest
- listener
- preserveInitState
- public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b)
GLContext
and all GLEventListener
between GLAutoDrawable
a
and b
,
while preserving it's initialized state, resets the GL-Viewport and issuing reshape(..)
.
The GLAutoDrawable
to GLAnimatorControl
association
is also swapped.
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.
a
- b
- GLException
- if the AbstractGraphicsDevice
are incompatible w/ each other.public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest)
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.
src
- dest
- public static final boolean swapBuffersBeforeRead(GLCapabilitiesImmutable chosenCaps)
GLCapabilitiesImmutable
requires a swap-buffers
before reading pixels.
Usually one uses the default-read-buffer
in which case swap-buffers
shall happen after calling reading pixels, the default.
However, multisampling offscreen GLFBODrawable
s
utilize swap-buffers
to downsample
the multisamples into the readable sampling sink.
In this case, we require swap-buffers
before reading pixels.
Copyright 2010 JogAmp Community.