j3d.org Aviatrix3D

org.j3d.aviatrix3d
Class GL14Shader

java.lang.Object
  extended byorg.j3d.aviatrix3d.SceneGraphObject
      extended byorg.j3d.aviatrix3d.NodeComponent
          extended byorg.j3d.aviatrix3d.Shader
              extended byorg.j3d.aviatrix3d.GL14Shader

public class GL14Shader
extends Shader

Shader container object for the shaders usable with OpenGL 1.4 with the separate vertex and fragment shader code.

Version:
$Revision: 1.1 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
liveCount
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, updateHandler, WRITE_TIMING_MSG
 
Constructor Summary
GL14Shader()
          Constructs a Shader with default values.
 
Method Summary
 FragmentShader getFragmentShader()
          Get the current fragShader in use.
 VertexShader getVertexShader()
          Get the current vertexShader in use.
 void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Issue ogl commands needed for this component.
 void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
          Restore all openGL state.
 void setFragmentShader(FragmentShader shader)
          Set the fragment shader to use.
protected  void setLive(boolean state)
          Notification that this object is live now.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the scenegraph update handler for this node.
 void setVertexShader(VertexShader shader)
          Set the vertexShader to use.
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, hasChanged, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GL14Shader

public GL14Shader()
Constructs a Shader with default values.

Method Detail

setVertexShader

public void setVertexShader(VertexShader shader)
                     throws InvalidWriteTimingException
Set the vertexShader to use. null will clear the vertexShader

Parameters:
shader - The new shader instance to use or null
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

getVertexShader

public VertexShader getVertexShader()
Get the current vertexShader in use.

Returns:
The current shader instance or null

setFragmentShader

public void setFragmentShader(FragmentShader shader)
                       throws InvalidWriteTimingException
Set the fragment shader to use. null will clear the shader.

Parameters:
shader - The new shader instance to use or null
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener callback method

getFragmentShader

public FragmentShader getFragmentShader()
Get the current fragShader in use.

Returns:
The current shader instance or null

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Overrides:
setUpdateHandler in class SceneGraphObject
Parameters:
handler - The instance to use as a handler

renderState

public void renderState(net.java.games.jogl.GL gl,
                        net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component.

Overrides:
renderState in class NodeComponent
Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

restoreState

public void restoreState(net.java.games.jogl.GL gl,
                         net.java.games.jogl.GLU glu)
Restore all openGL state.

Overrides:
restoreState in class NodeComponent
Parameters:
gl - The gl context to draw with
glu - The utility context to draw with

setLive

protected void setLive(boolean state)
Notification that this object is live now. Overridden to make sure that the live state of the nodes represents the same state as the parent scene graph.

Overrides:
setLive in class SceneGraphObject
Parameters:
state - true if this should be marked as live now

j3d.org Aviatrix3D

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