org.xith3d.scenegraph
Class ShaderProgramContext<SP extends ShaderProgram<?>>

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.NodeComponent
          extended by org.xith3d.scenegraph.ShaderProgramContext<SP>
All Implemented Interfaces:
java.lang.Comparable<ShaderProgramContext<SP>>, org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, StateTrackable<ShaderProgramContext<SP>>
Direct Known Subclasses:
AssemblyShaderProgramContext, GLSLContext

public abstract class ShaderProgramContext<SP extends ShaderProgram<?>>
extends NodeComponent
implements org.jagatoo.datatypes.Enableable, StateTrackable<ShaderProgramContext<SP>>


Field Summary
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
ShaderProgramContext(SP program)
           
 
Method Summary
abstract  int compareTo(ShaderProgramContext<SP> o)
          
protected  void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate)
           
abstract  boolean equals(java.lang.Object obj)
          
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all this NodeComponent and all child-components.
 SP getProgram()
           
 long getStateId()
           
 StateNode getStateNode()
           
 boolean isEnabled()
           
protected abstract  SP newProgramInstance()
           
 void setEnabled(boolean enabled)
           
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 
Methods inherited from class org.xith3d.scenegraph.NodeComponent
cloneNodeComponent, freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xith3d.render.states.StateTrackable
getCopy
 

Constructor Detail

ShaderProgramContext

public ShaderProgramContext(SP program)
Method Detail

getProgram

public final SP getProgram()

setEnabled

public final void setEnabled(boolean enabled)
Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable

isEnabled

public final boolean isEnabled()
Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable

freeOpenGLResources

public void freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components.

Specified by:
freeOpenGLResources in class NodeComponent

setStateNode

public final void setStateNode(StateNode node)
Description copied from interface: StateTrackable
Used by the render engine to set the state id for the node.

Specified by:
setStateNode in interface StateTrackable<ShaderProgramContext<SP extends ShaderProgram<?>>>

getStateNode

public final StateNode getStateNode()
Specified by:
getStateNode in interface StateTrackable<ShaderProgramContext<SP extends ShaderProgram<?>>>
Returns:
the id of the object. This should return -1 if there is no assigned id.

getStateId

public final long getStateId()

compareTo

public abstract int compareTo(ShaderProgramContext<SP> o)

Specified by:
compareTo in interface java.lang.Comparable<ShaderProgramContext<SP extends ShaderProgram<?>>>

equals

public abstract boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

newProgramInstance

protected abstract SP newProgramInstance()

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)
Overrides:
duplicateNodeComponent in class NodeComponent