com.jme.scene.state.jogl
Class JOGLShaderObjectsState

java.lang.Object
  extended by com.jme.scene.state.RenderState
      extended by com.jme.scene.state.GLSLShaderObjectsState
          extended by com.jme.scene.state.jogl.JOGLShaderObjectsState
All Implemented Interfaces:
Savable

public class JOGLShaderObjectsState
extends GLSLShaderObjectsState

Implementation of the GL_ARB_shader_objects extension.

Author:
Thomas Hourdel, Joshua Slack (attributes and StateRecord), Rikard Herlitz (MrCoder)

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState
RenderState.StateType
 
Field Summary
 
Fields inherited from class com.jme.scene.state.GLSLShaderObjectsState
fragShader, geom, glslSupported, glslSupportedDetected, needSendShader, shaderAttributes, shaderDataLogic, shaderUniforms, vertShader
 
Fields inherited from class com.jme.scene.state.RenderState
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, 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
JOGLShaderObjectsState(JOGLContextCapabilities caps)
           
 
Method Summary
 void apply()
          Applies those shader objects to the current scene.
 void checkAttributeSizeLimits()
          Check if we are keeping the size limits in terms of attribute locations on the card.
 void checkUniformSizeLimits()
          Check if we are keeping the size limits in terms of uniform locations on the card.
 void cleanup()
          Frees the memory and invalidates the shader handle
 StateRecord createStateRecord()
           
protected  void sendToGL(java.nio.ByteBuffer vertexByteBuffer, java.nio.ByteBuffer fragmentByteBuffer)
          Loads the shader object.
 
Methods inherited from class com.jme.scene.state.GLSLShaderObjectsState
clearAttributes, clearUniforms, getAttributeByName, getClassTag, getFragmentShader, getShaderAttributes, getShaderUniforms, getStateType, getType, getUniformByName, getVertexShader, isSupported, load, load, load, load, overrideSupport, read, resetSupport, setAttributePointer, setAttributePointer, setAttributePointer, setAttributePointer, setGeometry, setShaderDataLogic, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, setUniform, write
 
Methods inherited from class com.jme.scene.state.RenderState
extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JOGLShaderObjectsState

public JOGLShaderObjectsState(JOGLContextCapabilities caps)
Method Detail

sendToGL

protected void sendToGL(java.nio.ByteBuffer vertexByteBuffer,
                        java.nio.ByteBuffer fragmentByteBuffer)
Loads the shader object. Use null for an empty vertex or empty fragment shader.

Specified by:
sendToGL in class GLSLShaderObjectsState
Parameters:
vertexByteBuffer - vertex shader
fragmentByteBuffer - fragment shader
See Also:
GLSLShaderObjectsState.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()

createStateRecord

public StateRecord createStateRecord()
Specified by:
createStateRecord in class RenderState

checkAttributeSizeLimits

public void checkAttributeSizeLimits()
Description copied from class: GLSLShaderObjectsState
Check if we are keeping the size limits in terms of attribute locations on the card.

Overrides:
checkAttributeSizeLimits in class GLSLShaderObjectsState

checkUniformSizeLimits

public void checkUniformSizeLimits()
Description copied from class: GLSLShaderObjectsState
Check if we are keeping the size limits in terms of uniform locations on the card.

Overrides:
checkUniformSizeLimits in class GLSLShaderObjectsState

cleanup

public void cleanup()
Description copied from class: GLSLShaderObjectsState
Frees the memory and invalidates the shader handle

Specified by:
cleanup in class GLSLShaderObjectsState
See Also:
GLSLShaderObjectsState.cleanup()