com.sun.opengl.impl.x11
Class X11OnscreenGLDrawable

java.lang.Object
  extended by com.sun.opengl.impl.GLDrawableImpl
      extended by com.sun.opengl.impl.x11.X11GLDrawable
          extended by com.sun.opengl.impl.x11.X11OnscreenGLDrawable
All Implemented Interfaces:
GLDrawable

public class X11OnscreenGLDrawable
extends X11GLDrawable


Field Summary
protected  java.awt.Component component
           
static int LOCK_SUCCESS
           
static int LOCK_SURFACE_CHANGED
           
static int LOCK_SURFACE_NOT_READY
           
protected  boolean realized
           
 
Fields inherited from class com.sun.opengl.impl.x11.X11GLDrawable
capabilities, chooser, DEBUG, display, drawable, visualID
 
Constructor Summary
X11OnscreenGLDrawable(java.awt.Component component)
           
 
Method Summary
 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.
 int getHeight()
          Returns the current height of this GLDrawable.
 int getWidth()
          Returns the current width of this GLDrawable.
 int lockSurface()
           
 void setRealized(boolean realized)
          Indicates to on-screen GLDrawable implementations whether the underlying window has been created and can be drawn into.
 void setSize(int width, int height)
          Requests a new width and height for this GLDrawable.
 void swapBuffers()
          Swaps the front and back buffers of this drawable.
 void unlockSurface()
           
 
Methods inherited from class com.sun.opengl.impl.x11.X11GLDrawable
chooseVisual, destroy, getDisplay, getDrawable, lockToolkit, unlockToolkit
 
Methods inherited from class com.sun.opengl.impl.GLDrawableImpl
getChosenGLCapabilities, setChosenGLCapabilities, toHexString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCK_SURFACE_NOT_READY

public static final int LOCK_SURFACE_NOT_READY
See Also:
Constant Field Values

LOCK_SURFACE_CHANGED

public static final int LOCK_SURFACE_CHANGED
See Also:
Constant Field Values

LOCK_SUCCESS

public static final int LOCK_SUCCESS
See Also:
Constant Field Values

component

protected java.awt.Component component

realized

protected boolean realized
Constructor Detail

X11OnscreenGLDrawable

public X11OnscreenGLDrawable(java.awt.Component component)
Method Detail

createContext

public GLContext createContext(GLContext shareWith)
Description copied from interface: GLDrawable
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.


setRealized

public void setRealized(boolean realized)
Description copied from interface: GLDrawable
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..

Specified by:
setRealized in interface GLDrawable
Overrides:
setRealized in class X11GLDrawable

setSize

public void setSize(int width,
                    int height)
Description copied from interface: GLDrawable
Requests a new width and height for this GLDrawable. Not all drawables are able to respond to this request and may silently ignore it.


getWidth

public int getWidth()
Description copied from interface: GLDrawable
Returns the current width of this GLDrawable.


getHeight

public int getHeight()
Description copied from interface: GLDrawable
Returns the current height of this GLDrawable.


swapBuffers

public void swapBuffers()
                 throws GLException
Description copied from interface: GLDrawable
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.

Specified by:
swapBuffers in interface GLDrawable
Overrides:
swapBuffers in class X11GLDrawable
Throws:
GLException

lockSurface

public int lockSurface()
                throws GLException
Throws:
GLException

unlockSurface

public void unlockSurface()


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.