Platform-independent class exposing pbuffer functionality to
applications. This class is not exposed in the public API as it
would probably add no value; however it implements the GLDrawable
interface so can be interacted with via its display() method.
createContext
public GLContext createContext(GLContext shareWith)
Creates a new context for drawing to this drawable that will
optionally share display lists and other server-side OpenGL
objects with the specified GLContext.
The GLContext
share
need not be associated with this
GLDrawable and may be null if sharing of display lists and other
objects is not desired. See the note in the overview
documentation on
context sharing.
- createContext in interface GLDrawable
display
public void display()
Causes OpenGL rendering to be performed for this GLAutoDrawable
by calling
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.
- display in interface GLAutoDrawable
getContext
public GLContext getContext()
Returns the context associated with this drawable. The returned
context will be synchronized.
- getContext in interface GLAutoDrawable
getGL
public GL getGL()
Returns the
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.
- getGL in interface GLAutoDrawable
getHeight
public int getHeight()
Returns the current height of this GLDrawable.
- getHeight in interface GLDrawable
getWidth
public int getWidth()
Returns the current width of this GLDrawable.
- getWidth in interface GLDrawable
repaint
public void repaint()
Schedules a repaint of the component at some point in the
future.
- repaint in interface GLAutoDrawable
setAutoSwapBufferMode
public void setAutoSwapBufferMode(boolean onOrOff)
Enables or disables automatic buffer swapping for this drawable.
By default this property is set to true; when true, after all
GLEventListeners have been called for a display() event, the
front and back buffers are swapped, displaying the results of
the render. When disabled, the user is responsible for calling
GLAutoDrawable
manually.
- setAutoSwapBufferMode in interface GLAutoDrawable
setGL
public void setGL(GL gl)
Sets the
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.
- setGL in interface GLAutoDrawable
setRealized
public void setRealized(boolean realized)
Indicates to on-screen GLDrawable implementations whether the
underlying window has been created and can be drawn into. This
method must be called from GLDrawables obtained from the
GLDrawableFactory via the
GLDrawableFactory.getGLDrawable()
method. It must typically be
called with an argument of
true
in the
addNotify
method of components performing OpenGL
rendering and with an argument of
false
in the
removeNotify
method. Calling this method has no
other effects. For example, if
removeNotify
is
called on a Canvas implementation for which a GLDrawable has been
created, it is also necessary to destroy all OpenGL contexts
associated with that GLDrawable. This is not done automatically
by the implementation. It is not necessary to call
setRealized
on a GLCanvas, a GLJPanel, or a
GLPbuffer, as these perform the appropriate calls on their
underlying GLDrawables internally..
- setRealized in interface GLDrawable
setSize
public void setSize(int width,
int height)
Requests a new width and height for this GLDrawable. Not all
drawables are able to respond to this request and may silently
ignore it.
- setSize in interface GLDrawable
swapBuffers
public void swapBuffers()
Swaps the front and back buffers of this drawable. For
GLAutoDrawable
implementations, when automatic buffer swapping
is enabled (as is the default), this method is called
automatically and should not be called by the end user.
- swapBuffers in interface GLDrawable