Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Class PbufferSurface

java.lang.Object
  extended by org.j3d.aviatrix3d.output.graphics.BaseSurface
      extended by org.j3d.aviatrix3d.output.graphics.PbufferSurface
All Implemented Interfaces:
GraphicsOutputDevice, OutputDevice

public class PbufferSurface
extends BaseSurface

Implementation of a drawable surface that only renders to an offscreen pbuffer.

Resizing information Pbuffers cannot be resized, so all queries to add and remove resize listeners are silently ignored. However, we do something a little different. When the listener add request is received, we immediately call the listener with the size of this surface. This allows applications that depend on getting some resize information (eg using our utility ViewportResizeManager class) to still behave consistently.

Beyond this initial call, no resize events will ever be generated. Listeners are never kept by the implementation.

Version:
$Revision: 3.7 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
alphaCutoff, canCreatePBuffers, canvas, canvasContext, canvasDescriptor, canvasRenderer, errorReporter, FAILED_CONTEXT_MSG, initComplete, numRenderables, renderableList, rendererMap, sharedSurface, singleThreaded, surfaceMonitor, terminate, useTwoPassTransparent
 
Fields inherited from interface org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice
ALTERNATE_FRAME_STEREO, NO_STEREO, QUAD_BUFFER_STEREO, TWO_CANVAS_STEREO
 
Constructor Summary
PbufferSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedSurface, int width, int height)
          Construct a surface shares it's GL context with the given surface.
PbufferSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedSurface, int width, int height)
          Construct a surface shares it's GL context with the given surface.
PbufferSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, int width, int height)
          Construct a surface that requires the given set of capabilities.
PbufferSurface(javax.media.opengl.GLCapabilities caps, int width, int height)
          Construct a surface that requires the given set of capabilities.
 
Method Summary
 void addGraphicsResizeListener(GraphicsResizeListener l)
          Add a resize listener instance to this surface.
 java.lang.Object getSurfaceObject()
          Get the underlying object that this surface is rendered to.
 void removeGraphicsResizeListener(GraphicsResizeListener l)
          Remove a resize listener from this surface.
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface
addSurfaceInfoListener, checkForExtension, completeCanvasInitialisation, createRenderingProcessor, dispose, disposeSingleThreadResources, draw, enableSingleThreaded, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getGLContext, getPixelLocationInSurface, getSharedGLContext, getStereoEyeSeparation, getStereoRenderingPolicy, getSurfaceToVWorld, init, initCanvas, isDisposed, isQuadStereoAvailable, isShared, isStereoAvailable, isTwoPassTransparentEnabled, removeSurfaceInfoListener, setAlphaTestCutoff, setClearColor, setColorClearNeeded, setDrawableObjects, setErrorReporter, setStereoEyeSeparation, setStereoRenderingPolicy, swap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PbufferSurface

public PbufferSurface(javax.media.opengl.GLCapabilities caps,
                      int width,
                      int height)
               throws PbufferUnavailableException
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.
width - The width of the surface in pixels
height - The height of the surface in pixels
Throws:
PbufferUnavailableException - When JOGL tells us that pbuffers are not available on this platform or capabilities

PbufferSurface

public PbufferSurface(javax.media.opengl.GLCapabilities caps,
                      javax.media.opengl.GLCapabilitiesChooser chooser,
                      int width,
                      int height)
               throws PbufferUnavailableException
Construct a surface that requires the given set of capabilities. This surface acts as a standalone canvas.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;
width - The width of the surface in pixels
height - The height of the surface in pixels
Throws:
PbufferUnavailableException - When JOGL tells us that pbuffers are not available on this platform or capabilities

PbufferSurface

public PbufferSurface(javax.media.opengl.GLCapabilities caps,
                      BaseSurface sharedSurface,
                      int width,
                      int height)
               throws PbufferUnavailableException
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedSurface parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
sharedSurface - The surface that you'd like this surface to share the GL context with, if possible. May be null.
width - The width of the surface in pixels
height - The height of the surface in pixels
Throws:
PbufferUnavailableException - When JOGL tells us that pbuffers are not available on this platform or capabilities

PbufferSurface

public PbufferSurface(javax.media.opengl.GLCapabilities caps,
                      javax.media.opengl.GLCapabilitiesChooser chooser,
                      BaseSurface sharedSurface,
                      int width,
                      int height)
               throws PbufferUnavailableException
Construct a surface shares it's GL context with the given surface. This is useful for constructing multiple view displays of the same scene graph, but from different viewing directions, such as in a CAD application.

If the sharedSurface parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.

Parameters:
caps - A set of required capabilities for this canvas.
chooser - Custom algorithm for selecting one of the available GLCapabilities for the component;
sharedSurface - The surface that you'd like this surface to share the GL context with, if possible. May be null.
width - The width of the surface in pixels
height - The height of the surface in pixels
Throws:
PbufferUnavailableException - When JOGL tells us that pbuffers are not available on this platform or capabilities
Method Detail

getSurfaceObject

public java.lang.Object getSurfaceObject()
Get the underlying object that this surface is rendered to. If it is a screen display device, the surface can be one of AWT Component or Swing JComponent. An off-screen buffer would be a form of AWT Image etc.

Returns:
The drawable surface representation

addGraphicsResizeListener

public void addGraphicsResizeListener(GraphicsResizeListener l)
Add a resize listener instance to this surface. Duplicate listener instance add requests are ignored, as are null values.

Parameters:
l - The new listener instance to add

removeGraphicsResizeListener

public void removeGraphicsResizeListener(GraphicsResizeListener l)
Remove a resize listener from this surface. If the listener is not currently registered the request is ignored.

Parameters:
l - The listener instance to remove

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org