|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A marker interface that represents a class capable of managing the complete rendering pipeline.
A manager is used to handle a system-specific rendering technique. The goal is to manage the contained pipeline(s) in a way that is most efficient to the hardware provided. Thus, it is expected there will be many different types of managers to suit the many hardware configurations available.
Example implementations of the pipeline manager would be one that handles all the pipelines with simultaneous threads, each pinned to a particular CPU/Graphics pipe that the machine has. Another implementation may hold all the pipelines for sequential evaluation piping the output from one into the input for another (eg for handling dynamic cubic environment maps).
Basic common methods are provided for all implementations to use. It is expected that implementations will add additional technique-specific extension methods to the basic features.
Controlling Rendering Updates
Almost all applications will wish to control the rate at which rendering occurs. Typically this is just so that the rest of the application and user's system remains interactive (the default setup is to use 100% CPU to run as fast as possible). Alternatively the application may have a very small rate of change, or wish to run in an offscreen-rendering mode (eg server-based for web-delivery to an end user).
The basic frame rate is controlled by the setMinimumFrameInterval(int)
method. This provides the minimum time, in milliseconds, between sequential
frame renderings. If the rendering of a single frame takes longer than this
time, then the next frame will begin as soon as possible. (Note, we do not
currently provide any mechanism for guaranteeing a specific frame rate,
only a maximum framerate). For example, setting a value of 20 will result
in a maximum of 50 frames per second.
To return the system to an unregulated frame rate, after having set the
value previously, call setMinimumFrameInterval()
method with a
value of 0.
If you wish to render on demand, then set the render manager to disabled
it is disabled by default on construction). Then, whenever you need to
repaint the surface, call the renderOnce()
method.
Method Summary | |
void |
addAudioPipeline(AudioPipeline pipe)
Add a pipeline to be rendered to the manager. |
void |
addPipeline(RenderPipeline pipe)
Add a pipeline to be rendered to the manager. |
void |
disableInternalShutdown()
Disable the internal shutdown hook system. |
void |
getLayers(Layer[] layers)
Fetch the current layers that are set. |
int |
getMinimumFrameInterval()
Fetch the currently set duty cycle value. |
Scene |
getScene()
Fetch the currently set scene. |
boolean |
isEnabled()
Get the current render state of the manager. |
int |
numLayers()
Get the number of layers that are currently set. |
void |
removeAudioPipeline(AudioPipeline pipe)
Remove an already registered pipeline from the manager. |
void |
removePipeline(RenderPipeline pipe)
Remove an already registered pipeline from the manager. |
void |
renderOnce()
Force a single render of all pipelines now. |
void |
requestFullSceneRender()
Request that the manager perform a full scene render pass and update, ignoring any usual optimisations that it may take. |
void |
setApplicationObserver(ApplicationUpdateObserver obs)
Register an observer that can be used to know when the application is safe to update the scene graph. |
void |
setEnabled(boolean state)
Tell render to start or stop rendering. |
void |
setLayers(Layer[] layers,
int numLayers)
Set the set of layers for this manager. |
void |
setMinimumFrameInterval(int cycleTime)
Set the minimum duty cycle of the render manager. |
void |
setScene(Scene scene)
Set the scene for this manager. |
void |
shutdown()
Notification to shutdown the internals of the renderer because the application is about to exit. |
Method Detail |
public void setEnabled(boolean state)
state
- True if to enable renderingpublic boolean isEnabled()
public void renderOnce() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The system is currently rendering and
should be disabled first.public void requestFullSceneRender()
This method will work both in automated rendering and with the
renderOnce()
method.
public void setScene(Scene scene)
null
will remove the currently set scene. If this is set while a current
collection of layers is set, then the layers will be cleared.
scene
- The new scenepublic Scene getScene()
public void setLayers(Layer[] layers, int numLayers)
null
will remove the currently set of layers. If this is
set while a current scene is set, then the scene will be cleared. Layers
are presented in depth order - layers[0] is rendered before layers[1]
etc.
layers
- The collection of layers, in order, to rendernumLayers
- The number of valid layers to usepublic int numLayers()
public void getLayers(Layer[] layers)
numLayers()
in length. If not, this method does nothing (the
provided array will be unchanged).
layers
- An array to copy the values intopublic void setMinimumFrameInterval(int cycleTime)
Setting a value of zero will return the render to an un-regulated state where the code will attempt to render as fast as possible (ie guaranteed 100% CPU usage).
cycleTime
- The minimum time in milliseconds between frames or zeropublic int getMinimumFrameInterval()
public void addPipeline(RenderPipeline pipe) throws java.lang.IllegalStateException
pipe
- The new pipe instance to be added
java.lang.IllegalStateException
- The system is currently rendering and
should be disabled first.public void removePipeline(RenderPipeline pipe) throws java.lang.IllegalStateException
pipe
- The pipe instance to be removed
java.lang.IllegalStateException
- The system is currently rendering and
should be disabled first.public void addAudioPipeline(AudioPipeline pipe) throws java.lang.IllegalStateException
pipe
- The new pipe instance to be added
java.lang.IllegalStateException
- The system is currently rendering and
should be disabled first.public void removeAudioPipeline(AudioPipeline pipe) throws java.lang.IllegalStateException
pipe
- The pipe instance to be removed
java.lang.IllegalStateException
- The system is currently rendering and
should be disabled first.public void setApplicationObserver(ApplicationUpdateObserver obs)
obs
- The observer instance to usepublic void disableInternalShutdown()
shutdown()
method is called to
turn off the OpenGL rendering system. If it does not, there is a good
possibility of a crash of the system.
If the internal shutdown is disabled, then the shutdown callback of the
ApplicationUpdateObserver
will not be called.
public void shutdown()
|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |