com.jme.scene.state
Class VertexProgramState

java.lang.Object
  extended bycom.jme.scene.state.RenderState
      extended bycom.jme.scene.state.VertexProgramState
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LWJGLVertexProgramState

public abstract class VertexProgramState
extends RenderState

Implementation of the GL_ARB_vertex_program extension.

Version:
$Id: VertexProgramState.java,v 1.5 2004/08/02 23:10:15 ericthered Exp $
Author:
Eric Woroshow
See Also:
Serialized Form

Field Summary
protected static float[][] envparameters
          Environmental parameters applied to all vertex programs
protected  float[][] parameters
          Parameters local to this vertex program
protected  boolean usingParameters
          If any local parameters for this VP state are set
 
Fields inherited from class com.jme.scene.state.RenderState
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER
 
Constructor Summary
VertexProgramState()
          Creates a new VertexProgramState.
 
Method Summary
 int getType()
          Defined by the subclass, this returns an int identifying the renderstate.
abstract  boolean isSupported()
          isSupported determines if the ARB_vertex_program extension is supported by current graphics configuration.
abstract  void load(java.net.URL file)
          load loads the vertex program from the specified file.
static void setEnvParameter(float[] param, int paramID)
          setEnvParameter sets an environmental vertex program parameter that is accessable by all vertex programs in memory.
 void setParameter(float[] param, int paramID)
          setParameter sets a parameter for this vertex program.
 
Methods inherited from class com.jme.scene.state.RenderState
apply, extract, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

Constructor Detail

VertexProgramState

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

Method Detail

setEnvParameter

public static void setEnvParameter(float[] param,
                                   int paramID)
setEnvParameter sets an environmental vertex program parameter that is accessable 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

isSupported

public abstract boolean isSupported()
isSupported determines if the ARB_vertex_program extension is supported by current graphics configuration.

Returns:
if ARB vertex programs are supported

setParameter

public void setParameter(float[] param,
                         int paramID)
setParameter sets a parameter for this vertex program.

Parameters:
paramID - identity number of the parameter, ranging from 0 to 95
param - four-element array of floating point numbers

getType

public int getType()
Description copied from class: RenderState
Defined by the subclass, this returns an int identifying the renderstate. For example, RS_CULL or RS_TEXTURE.

Specified by:
getType in class RenderState
Returns:
RS_VERTEX_PROGRAM
See Also:
RenderState.getType()

load

public abstract void load(java.net.URL file)
load loads the vertex program from the specified file. The program must be in ASCII format. We delegate the loading to each implementation because we do not know in what format the underlying API wants the data.

Parameters:
file - text file containing the vertex program