j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class ShaderProgram

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.ShaderProgram
Direct Known Subclasses:
FragmentShader, VertexShader

public abstract class ShaderProgram
extends NodeComponent

Base class representing a single shader program that can be applied to the rendering pipeline.

Version:
$Revision: 1.2 $
Author:
Justin Couch

Field Summary
protected  boolean programChanged
          Flag to say that the string has changed and should be recompiled
protected  int programId
          The ID of the shader program that has been allocated here
protected  java.lang.String programString
          The program string that is stored as the shader
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
liveCount
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
ShaderProgram()
          Constructs a Shader with default values.
 
Method Summary
 java.lang.String getProgramString()
          Get the currently set program string.
 void setProgramString(java.lang.String str)
          Set the program string that is to be registered by this shader.
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, hasChanged, numParents, removeParent, renderState, restoreState
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

programString

protected java.lang.String programString
The program string that is stored as the shader


programChanged

protected boolean programChanged
Flag to say that the string has changed and should be recompiled


programId

protected int programId
The ID of the shader program that has been allocated here

Constructor Detail

ShaderProgram

public ShaderProgram()
Constructs a Shader with default values.

Method Detail

setProgramString

public void setProgramString(java.lang.String str)
                      throws InvalidWriteTimingException
Set the program string that is to be registered by this shader. Setting a value of null will clear the current shader and prevent it from being rendered next frame.

Parameters:
str - The new program string to be registered or null
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

getProgramString

public java.lang.String getProgramString()
Get the currently set program string. If none is set, return null.

Returns:
The current string or null

j3d.org Aviatrix3D

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