com.jme.scene.state.lwjgl
Class LWJGLShaderObjectsState

java.lang.Object
  extended bycom.jme.scene.state.RenderState
      extended bycom.jme.scene.state.GLSLShaderObjectsState
          extended bycom.jme.scene.state.lwjgl.LWJGLShaderObjectsState
All Implemented Interfaces:
java.io.Serializable

public class LWJGLShaderObjectsState
extends GLSLShaderObjectsState

Implementation of the GL_ARB_shader_objects extension.

Author:
Thomas Hourdel, Joshua Slack (attributes)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.state.GLSLShaderObjectsState
attribs, uniforms
 
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
LWJGLShaderObjectsState()
           
 
Method Summary
 void apply()
          Applies those shader objects to the current scene.
 boolean isSupported()
          Determines if the current OpenGL context supports the GL_ARB_shader_objects extension.
 void load(java.net.URL vert, java.net.URL frag)
          Loads the shader object.
 void relinkProgram()
          relinkProgram instructs openGL to relink the associated program.
 
Methods inherited from class com.jme.scene.state.GLSLShaderObjectsState
clearAttributes, clearUniforms, getType, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributePointer, setAttributePointer, setAttributePointer, setAttributePointer, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform
 
Methods inherited from class com.jme.scene.state.RenderState
extract, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLShaderObjectsState

public LWJGLShaderObjectsState()
Method Detail

isSupported

public boolean isSupported()
Determines if the current OpenGL context supports the GL_ARB_shader_objects extension.

Specified by:
isSupported in class GLSLShaderObjectsState
Returns:
if ARB shader objects are supported
See Also:
com.jme.scene.state.ShaderObjectsState#isSupported()

relinkProgram

public void relinkProgram()
relinkProgram instructs openGL to relink the associated program. This should be used after setting ShaderAttributes.

Specified by:
relinkProgram in class GLSLShaderObjectsState

load

public void load(java.net.URL vert,
                 java.net.URL frag)
Loads the shader object.

Specified by:
load in class GLSLShaderObjectsState
Parameters:
vert - text file containing the vertex shader object
frag - text file containing the fragment shader object
See Also:
com.jme.scene.state.ShaderObjectsState#load(java.net.URL, java.net.URL)

apply

public void apply()
Applies those shader objects to the current scene. Checks if the GL_ARB_shader_objects extension is supported before attempting to enable those objects.

Specified by:
apply in class RenderState
See Also:
RenderState.apply()