t3.hrd.renderer
Class HRDRenderer

java.lang.Object
  extended by t3.hrd.renderer.HRDRenderer

public class HRDRenderer
extends java.lang.Object

This class creates a multiprojector display that renders tiles, cursors and links. Create the tiles, cursors and links by calling methods on its stateManager object.

Threading notes: You may only update the statemanager from callback routines - this avoids race conditions and deadlock.

Author:
pjt40

Nested Class Summary
static class HRDRenderer.AWTErrorHandler
           
 
Field Summary
 HRDRendererCallBacks callBacks
           
 int clientId
           
 java.lang.String infoString
           
 boolean mouseAsPointInputDevice
           
 StateManager stateManager
          Call methods on the stateManager object to create and manipulate Tiles, Cursors and Links on the display.
 
Constructor Summary
HRDRenderer(int clientId, java.util.List<ProjectorConfig> projectorConfigs, HRDRendererCallBacks callBacks, java.util.LinkedList<PointInputDevice> pointInputDevices, ShapeInputDevice shapeInputDevice, boolean shareTexturesBetweenContexts, boolean mouseAsPointInputDevice, BlendOptions bo)
          Create a new HRDRenderer.
 
Method Summary
 void doItSingleThreaded()
          Run the HRDRenderer in single threaded mode.
 void requestClose()
          Request that the display be closed and the render loop stopped.
 void requestForceRedrawAll()
          Request that all projectors be redrawn.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stateManager

public final StateManager stateManager
Call methods on the stateManager object to create and manipulate Tiles, Cursors and Links on the display. Threading notes: You may only update the statemanager from callback routines. This ensures a single-threaded model and avoids deadlock.


callBacks

public final HRDRendererCallBacks callBacks

mouseAsPointInputDevice

public final boolean mouseAsPointInputDevice

clientId

public final int clientId

infoString

public java.lang.String infoString
Constructor Detail

HRDRenderer

public HRDRenderer(int clientId,
                   java.util.List<ProjectorConfig> projectorConfigs,
                   HRDRendererCallBacks callBacks,
                   java.util.LinkedList<PointInputDevice> pointInputDevices,
                   ShapeInputDevice shapeInputDevice,
                   boolean shareTexturesBetweenContexts,
                   boolean mouseAsPointInputDevice,
                   BlendOptions bo)
            throws Projector.ProjectorOpeningException
Create a new HRDRenderer. This creates all the OpenGL windows but does not start the render loop. You should call the doRenderLoop method once you have created the HRDRenderer.

Parameters:
clientId - Client ID for this client
projectorConfigs - Configuration of each projector, in blacking order (ie head of list has no blacking applied)
callBacks - Callbacks allow you
pointInputDevices - Pointing devices used with the display
shapeInputDevice - Shape device
shareTexturesBetweenContexts - Iff this is true then opengl textures are shared between the different opengl windows, using the opengl features to share textures between contexts.
mouseAsPointInputDevice - Iff this is true then mouse events are converted to point input device events. It has personId 0 (or 1 if ALT held down) and penType 0 (or 1 if CTRL held down).
aDESKvisibleAreaOrNull - A mask that can be applied to restrict the visible area eg to a rectangle. If null then no mask.
Throws:
Projector.ProjectorOpeningException - If there are problems opening the window
Method Detail

doItSingleThreaded

public void doItSingleThreaded()
Run the HRDRenderer in single threaded mode. Go into a loop: call callback_oncePerFrame; then redraw each projector if it needs to be redrawn (1); then call updateState on each PointInputDevice.

Returns only when the display is closed by pressing F12 or calling requestClose(). It does not close the PointInputDevices.

Note that at point (1) the actual opengl rendering may well take place in a different thread, with this thread blocked until it completes. The thread that does the OpenGL rendering is determined by the java.media.opengl.Threading class and depends on the platform but this can be overridden by specifying -Dopengl.1thread=(option) at the command line. On our system it didn't make any difference to performance. See java.media.opengl.Threading for more information.


requestClose

public void requestClose()
Request that the display be closed and the render loop stopped. This method returns immediately and is thread-safe: it can be called by any thread.


requestForceRedrawAll

public void requestForceRedrawAll()
Request that all projectors be redrawn. This method returns immediately and i thread-safe: it can be called by any thread.