Package com.ardor3d.renderer.state
Class VertexProgramState
java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.VertexProgramState
- All Implemented Interfaces:
Savable
Implementation of the GL_ARB_vertex_program extension.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType
-
Field Summary
Modifier and TypeFieldDescriptionprotected static float[][]
Environmental parameters applied to all vertex programsprotected float[][]
Parameters local to this vertex programprotected ByteBuffer
protected int
protected boolean
If any local parameters for this VP state are setFields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic float[][]
float[][]
int
void
_setProgramID
(int id) getType()
boolean
void
Loads the vertex program into a byte array.void
void
read
(InputCapsule capsule) static void
setEnvParameter
(float[] param, int paramID) setEnvParameter
sets an environmental vertex program parameter that is accessible by all vertex programs in memory.void
setParameter
(float[] param, int paramID) setParameter
sets a parameter for this vertex program.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.renderer.state.RenderState
createState, extract, getClassTag, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
-
Field Details
-
_envparameters
protected static float[][] _envparametersEnvironmental parameters applied to all vertex programs -
_usingParameters
protected boolean _usingParametersIf any local parameters for this VP state are set -
_parameters
protected float[][] _parametersParameters local to this vertex program -
_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 numbersparamID
- 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 numbersparamID
- identity number of the parameter, ranging from 0 to 95
-
getType
- Specified by:
getType
in classRenderState
- Returns:
- An statetype enum value for the subclass.
- See Also:
-
load
-
load
Loads the vertex program into a byte array.- Parameters:
programContents
- the content of the vertex program to load- See Also:
-
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
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classRenderState
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classRenderState
- Throws:
IOException
-
createStateRecord
- Specified by:
createStateRecord
in classRenderState
-