Class FragmentProgramState

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

public class FragmentProgramState extends RenderState
  • Field Details

    • usingParameters

      protected boolean usingParameters
      If any local parameters for this FP state are set
    • parameters

      protected float[][] parameters
      Parameters local to this fragment program
    • program

      protected ByteBuffer program
    • _programID

      protected int _programID
  • Constructor Details

    • FragmentProgramState

      public FragmentProgramState()
  • Method Details

    • setParameter

      public void setParameter(float[] param, int paramID)
      setParameter sets a parameter for this fragment program.
      Parameters:
      param - four-element array of floating point numbers
      paramID - identity number of the parameter, ranging from 0 to 23
    • 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)
      Loads the fragment program into a byte array.
      Parameters:
      file - the URL of the file containing the fragment program to load
      See Also:
    • load

      public void load(String programContents)
      Loads the fragment program into a byte array.
      Parameters:
      programContents - the content of the fragment 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()
    • 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