|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A higher-level abstraction than GLDrawable
which supplies
an event based mechanism (GLEventListener
) for performing
OpenGL rendering. A GLAutoDrawable automatically creates a primary
rendering context which is associated with the GLAutoDrawable for
the lifetime of the object. This context has the synchronized
property enabled so that
calls to makeCurrent
will block if
the context is current on another thread. This allows the internal
GLContext for the GLAutoDrawable to be used both by the event
based rendering mechanism as well by end users directly.
Method Summary | |
void |
addGLEventListener(GLEventListener listener)
Adds a GLEventListener to this drawable. |
void |
display()
Causes OpenGL rendering to be performed for this GLAutoDrawable by calling display for all
registered GLEventListener s. |
boolean |
getAutoSwapBufferMode()
Indicates whether automatic buffer swapping is enabled for this drawable. |
GLContext |
getContext()
Returns the context associated with this drawable. |
GL |
getGL()
Returns the GL pipeline object this GLAutoDrawable uses. |
void |
removeGLEventListener(GLEventListener listener)
Removes a GLEventListener from this drawable. |
void |
repaint()
Schedules a repaint of the component at some point in the future. |
void |
setAutoSwapBufferMode(boolean onOrOff)
Enables or disables automatic buffer swapping for this drawable. |
void |
setGL(GL gl)
Sets the GL pipeline object this GLAutoDrawable uses. |
Methods inherited from interface javax.media.opengl.GLDrawable |
createContext, getHeight, getWidth, setRealized, setSize, swapBuffers |
Method Detail |
public GLContext getContext()
public void addGLEventListener(GLEventListener listener)
GLEventListener
to this drawable. If multiple
listeners are added to a given drawable, they are notified of
events in an arbitrary order.
public void removeGLEventListener(GLEventListener listener)
GLEventListener
from this drawable. Note that
if this is done from within a particular drawable's GLEventListener
handler (reshape, display, etc.) that it is not
guaranteed that all other listeners will be evaluated properly
during this update cycle.
public void display()
display
for all
registered GLEventListener
s. Called automatically by the
window system toolkit upon receiving a repaint() request. this
routine may be called manually for better control over the
rendering process. It is legal to call another GLAutoDrawable's
display method from within the display
callback.
public void repaint()
public void setAutoSwapBufferMode(boolean onOrOff)
GLDrawable.swapBuffers()
manually.
public boolean getAutoSwapBufferMode()
setAutoSwapBufferMode(boolean)
.
public GL getGL()
GL
pipeline object this GLAutoDrawable uses.
If this method is called outside of the GLEventListener
's callback methods (init, display, etc.) it may
return null. Users should not rely on the identity of the
returned GL object; for example, users should not maintain a
hash table with the GL object as the key. Additionally, the GL
object should not be cached in client code, but should be
re-fetched from the GLAutoDrawable at the beginning of each call
to init, display, etc.
public void setGL(GL gl)
GL
pipeline object this GLAutoDrawable uses.
This should only be called from within the GLEventListener's
callback methods, and usually only from within the init()
method, in order to install a composable pipeline. See the JOGL
demos for examples.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |