com.jme.scene.state
Class FragmentProgramState

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

public abstract class FragmentProgramState
extends RenderState

FragmentProgramState

Version:
$Id: FragmentProgramState.java,v 1.1 2004/08/20 23:21:19 ericthered Exp $
Author:
MASTER
See Also:
Serialized Form

Field Summary
protected static float[][] envparameters
           
protected  float[][] parameters
           
protected  boolean usingParameters
           
 
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
FragmentProgramState()
          setEnvParameter sets an environmental fragment program parameter that is accessable by all fragment programs in memory.
 
Method Summary
 int getType()
          Defined by the subclass, this returns an int identifying the renderstate.
abstract  boolean isSupported()
          isSupported determines if the ARB_fragment_program extension is supported by current graphics configuration.
abstract  void load(java.net.URL file)
          load loads the fragment program from the specified file.
 void setParameter(float[] param, int paramID)
          setParameter sets a parameter for this fragment 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

usingParameters

protected boolean usingParameters

parameters

protected float[][] parameters
Constructor Detail

FragmentProgramState

public FragmentProgramState()
setEnvParameter sets an environmental fragment program parameter that is accessable by all fragment programs in memory.

Method Detail

setParameter

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

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

isSupported

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

Returns:
if ARB fragment programs are supported

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:
com.jme.scene.state.RenderState.RS_FRAGMENT_PROGRAM
See Also:
RenderState.getType()

load

public abstract void load(java.net.URL file)
load loads the fragment 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 fragment program