Aviatrix3D
2.1.0

org.j3d.aviatrix3d.pipeline
Interface OutputDevice

All Known Subinterfaces:
AudioOutputDevice, ElumensOutputDevice, GraphicsOutputDevice
All Known Implementing Classes:
BaseAWTSurface, BaseDraw2DSurface, BaseSurface, BaseSWTSurface, BaseSWTSurface, DebugAWTSurface, DebugDraw2DSurface, DebugSWTSurface, DebugSWTSurface, ElumensAWTSurface, ElumensSWTSurface, ElumensSWTSurface, OpenALAudioDevice, PbufferSurface, SimpleAWTSurface, SimpleDraw2DSurface, SimpleSWTSurface, SimpleSWTSurface, StereoAWTSurface, StereoSWTSurface, StereoSWTSurface

public interface OutputDevice

Interface representing the output of a render pipeline.

The output may be any of the traditional types: pBuffer, screen or memory or any non-traditional type like haptic devices, network streams etc.

Version:
$Revision: 2.9 $
Author:
Justin Couch

Method Summary
 void dispose()
          Instruct this surface that you have finished with the resources needed and to dispose all rendering resources.
 void disposeSingleThreadResources()
          If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited.
 boolean draw(ProfilingData profilingData)
          Instruct the surface to draw the collected set of nodes now.
 void enableSingleThreaded(boolean state)
          Notification that this surface is being drawn to with a single thread.
 java.lang.Object getSurfaceObject()
          Get the underlying object that this implementation is rendered to.
 boolean isDisposed()
          Check to see the disposal state of the surface.
 void setErrorReporter(org.j3d.util.ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion.
 

Method Detail

setErrorReporter

void setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

draw

boolean draw(ProfilingData profilingData)
Instruct the surface to draw the collected set of nodes now. The registered view environment is used to draw to this surface. If no view is registered, the surface is cleared and then this call is exited. The drawing surface does not swap the buffers at this point.

The return value indicates success or failure in the ability to render this frame. Typically it will indicate failure if the underlying surface has been disposed of, either directly through the calling of the method on this interface, or through an internal check mechanism. If failure is indicated, then check to see if the surface has been disposed of and discontinue rendering if it has.

Parameters:
profilingData - The timing and load data
Returns:
true if the drawing succeeded, or false if not

getSurfaceObject

java.lang.Object getSurfaceObject()
Get the underlying object that this implementation 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. Audio or haptics rendering will return output-specific objects.

Returns:
The drawable surface representation

dispose

void dispose()
Instruct this surface that you have finished with the resources needed and to dispose all rendering resources. The surface will not be used again.


isDisposed

boolean isDisposed()
Check to see the disposal state of the surface. Will return true if the dispose() method has been called or an internal dispose handler has detected the underlying surface is no longer valid to draw to.

Returns:
true if the surface is disposed and no longer usable

enableSingleThreaded

void enableSingleThreaded(boolean state)
Notification that this surface is being drawn to with a single thread. This can be used to optmise internal state handling when needed in a single versus multithreaded environment.

This method should never be called by end user code. It is purely for the purposes of the RenderManager to inform the device about what state it can expect.

Parameters:
state - true if the device can expect single threaded behaviour

disposeSingleThreadResources

void disposeSingleThreadResources()
If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited. Next time the draw method is called, a new rendering context will need to be created for a new incoming thread instance. Also, if any other per-thread resources are around, clean those up now. This is called just before that thread exits.


Aviatrix3D
2.1.0

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