com.jogamp.opengl.impl
Class GLDrawableHelper
java.lang.Object
com.jogamp.opengl.impl.GLDrawableHelper
public class GLDrawableHelper
- extends Object
Encapsulates the implementation of most of the GLAutoDrawable's
methods to be able to share it between GLCanvas and GLJPanel.
Field Summary |
protected static boolean |
DEBUG
|
Method Summary |
void |
addGLEventListener(GLEventListener listener)
|
void |
addGLEventListener(int index,
GLEventListener listener)
|
void |
display(GLAutoDrawable drawable)
|
void |
dispose(GLAutoDrawable drawable)
Issues GLEventListener.dispose(javax.media.opengl.GLAutoDrawable)
to all listeners. |
GLAnimatorControl |
getAnimator()
|
boolean |
getAutoSwapBufferMode()
|
void |
init(GLAutoDrawable drawable)
|
void |
invoke(GLAutoDrawable drawable,
boolean wait,
GLRunnable glRunnable)
|
void |
invokeGL(GLDrawable drawable,
GLContext context,
Runnable runnable,
Runnable initAction)
Principal helper method which runs a Runnable with the context
made current. |
boolean |
isExternalAnimatorAnimating()
|
boolean |
isExternalAnimatorRunning()
|
void |
removeGLEventListener(GLEventListener listener)
|
void |
reset()
|
void |
reshape(GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
|
void |
setAnimator(GLAnimatorControl animator)
|
void |
setAutoSwapBufferMode(boolean onOrOff)
|
String |
toString()
|
DEBUG
protected static final boolean DEBUG
GLDrawableHelper
public GLDrawableHelper()
reset
public final void reset()
toString
public final String toString()
- Overrides:
toString
in class Object
addGLEventListener
public final void addGLEventListener(GLEventListener listener)
addGLEventListener
public final void addGLEventListener(int index,
GLEventListener listener)
removeGLEventListener
public final void removeGLEventListener(GLEventListener listener)
dispose
public final void dispose(GLAutoDrawable drawable)
- Issues
GLEventListener.dispose(javax.media.opengl.GLAutoDrawable)
to all listeners.
- Parameters:
drawable
-
init
public final void init(GLAutoDrawable drawable)
display
public final void display(GLAutoDrawable drawable)
reshape
public final void reshape(GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
setAnimator
public final void setAnimator(GLAnimatorControl animator)
throws GLException
- Throws:
GLException
getAnimator
public final GLAnimatorControl getAnimator()
isExternalAnimatorRunning
public final boolean isExternalAnimatorRunning()
isExternalAnimatorAnimating
public final boolean isExternalAnimatorAnimating()
invoke
public final void invoke(GLAutoDrawable drawable,
boolean wait,
GLRunnable glRunnable)
setAutoSwapBufferMode
public final void setAutoSwapBufferMode(boolean onOrOff)
getAutoSwapBufferMode
public final boolean getAutoSwapBufferMode()
invokeGL
public final void invokeGL(GLDrawable drawable,
GLContext context,
Runnable runnable,
Runnable initAction)
- Principal helper method which runs a Runnable with the context
made current. This could have been made part of GLContext, but a
desired goal is to be able to implement GLAutoDrawable's in terms of
the GLContext's public APIs, and putting it into a separate
class helps ensure that we don't inadvertently use private
methods of the GLContext or its implementing classes.
Remark: In case this method is called to dispose the GLDrawable/GLAutoDrawable,
initAction
shall be null
to mark this cause.
- Parameters:
drawable
- context
- runnable
- initAction
-
Copyright 2010 JogAmp Community.