Class VertexProgramState

java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.VertexProgramState
All Implemented Interfaces:
Savable

public class VertexProgramState extends RenderState
Implementation of the GL_ARB_vertex_program extension.
  • Field Details

    • _envparameters

      protected static float[][] _envparameters
      Environmental parameters applied to all vertex programs
    • _usingParameters

      protected boolean _usingParameters
      If any local parameters for this VP state are set
    • _parameters

      protected float[][] _parameters
      Parameters local to this vertex program
    • _program

      protected ByteBuffer _program
    • _programID

      protected int _programID
  • Constructor Details

    • VertexProgramState

      public VertexProgramState()
      Creates a new VertexProgramState. load(URL) must be called before the state can be used.
  • Method Details

    • setEnvParameter

      public static void setEnvParameter(float[] param, int paramID)
      setEnvParameter sets an environmental vertex program parameter that is accessible by all vertex programs in memory.
      Parameters:
      param - four-element array of floating point numbers
      paramID - identity number of the parameter, ranging from 0 to 95
    • setParameter

      public void setParameter(float[] param, int paramID)
      setParameter sets a parameter for this vertex program.
      Parameters:
      param - four-element array of floating point numbers
      paramID - identity number of the parameter, ranging from 0 to 95
    • getType

      public RenderState.StateType getType()
      Specified by:
      getType in class RenderState
      Returns:
      An statetype enum value for the subclass.
      See Also:
    • load

      public void load(URL file)
    • load

      public void load(String programContents)
      Loads the vertex program into a byte array.
      Parameters:
      programContents - the content of the vertex program to load
      See Also:
    • getProgramAsBuffer

      public ByteBuffer getProgramAsBuffer()
    • _getProgramID

      public int _getProgramID()
    • _setProgramID

      public void _setProgramID(int id)
    • isUsingParameters

      public boolean isUsingParameters()
    • _getParameters

      public float[][] _getParameters()
    • _getEnvParameters

      public static float[][] _getEnvParameters()
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class RenderState
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class RenderState
      Throws:
      IOException
    • createStateRecord

      public StateRecord createStateRecord(ContextCapabilities caps)
      Specified by:
      createStateRecord in class RenderState