org.xith3d.render
Class StateUnitPeerRegistry

java.lang.Object
  extended by org.xith3d.render.StateUnitPeerRegistry

public abstract class StateUnitPeerRegistry
extends java.lang.Object

A ShaderRegistry maintains all ShaderPeer implementations used by the rendering implementation.


Field Summary
protected  RenderAtomPeer[] atomMap
           
protected  StateUnitPeer[] peerMap
           
 
Constructor Summary
StateUnitPeerRegistry()
           
 
Method Summary
 RenderAtomPeer getRenderAtomPeer(int atomStateType)
           
 StateUnitPeer getStateUnitPeer(int stateUnitType)
           
protected  void registerAtomRenderer(int atomType, RenderAtomPeer atomPeer)
          The RenderAtomPeer implements the API specific commands necessary to render the geometry.
protected  void registerStateUnitPeer(int stateUnitType, StateUnitPeer stateUnitPeer)
          Registers an API specific rendering peer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

peerMap

protected final StateUnitPeer[] peerMap

atomMap

protected final RenderAtomPeer[] atomMap
Constructor Detail

StateUnitPeerRegistry

public StateUnitPeerRegistry()
Method Detail

registerStateUnitPeer

protected void registerStateUnitPeer(int stateUnitType,
                                     StateUnitPeer stateUnitPeer)
Registers an API specific rendering peer. An appearance shader could be implemented differently in LWJGL and JOGL.

Parameters:
stateUnitType -
stateUnitPeer -

registerAtomRenderer

protected void registerAtomRenderer(int atomType,
                                    RenderAtomPeer atomPeer)
The RenderAtomPeer implements the API specific commands necessary to render the geometry. For example a GeometryArray.

Parameters:
atomType -
atomPeer -

getStateUnitPeer

public final StateUnitPeer getStateUnitPeer(int stateUnitType)
Parameters:
stateUnitType -
Returns:
the StateUnitPeer for this StateUnit. The first time we hit a stateType we have not seen yet this will need to lookup the class and assign it to the state type. Subsequent times it is a quick lookup.

getRenderAtomPeer

public final RenderAtomPeer getRenderAtomPeer(int atomStateType)
Parameters:
atomStateType -
Returns:
the RenderAtomPeer for this atom. The first time we hit a stateType we have not seen yet this will need to lookup the class and assign it to the state type. Subsequent times it is a quick lookup.