org.xith3d.render
Class OpenGLStatesCache

java.lang.Object
  extended by org.xith3d.render.OpenGLStatesCache
Direct Known Subclasses:
OpenGLStatesCacheImpl, OpenGLStatesCacheImpl

public abstract class OpenGLStatesCache
extends java.lang.Object

The OpenGLStatesCache is a simple, flat class, that keeps a local copy of all the OpenGL states, that are used by the engine. By keeping local copies unnecessary state chenges can be avoided.


Field Summary
 boolean alphaTestEnabled
           
 boolean assemblyFragmentShadersEnabled
           
 boolean assemblyVertexShadersEnabled
           
 boolean blendingEnabled
           
 boolean[] clipPlaneEnabled
           
 org.openmali.vecmath2.Colorf color
           
 boolean colorMaterialEnabled
           
 boolean colorsArrayEnabled
           
 int colorWriteMask
           
 boolean coordsArrayEnabled
           
 boolean cullFaceEnabled
           
 int currentBoundArrayVBO
           
 int currentBoundElementVBO
           
 Texture[] currentBoundTexture
           
 int currentClientTextureUnit
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction0_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction0_RGB
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction1_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction1_RGB
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction2_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction2_RGB
           
 org.jagatoo.opengl.enums.TextureCombineMode[] currentCombineMode_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineMode[] currentCombineMode_RGB
           
 int[] currentCombineRGBScale
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource0_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource0_RGB
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource1_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource1_RGB
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource2_Alpha
           
 org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource2_RGB
           
 org.jagatoo.opengl.enums.CompareFunction[] currentCompareFunc
           
 org.jagatoo.opengl.enums.TextureCompareMode[] currentCompareMode
           
 int currentGLSLShaderProgram
           
 int currentServerTextureUnit
           
 TextureAttributes[] currentTexAttribs
           
 TexCoordGeneration[] currentTexCoordGen
           
 org.openmali.vecmath2.Colorf[] currentTextureBlendColor
           
 Transform3D[] currentTextureMatrix
           
 org.jagatoo.opengl.enums.TextureMode[] currentTextureMode
           
 boolean depthTestEnabled
           
 boolean depthWriteMask
           
 boolean enabled
           
 boolean fogEnabled
           
 long[] lastFrameId
           
 boolean[] lightEnabled
           
 boolean lightingEnabled
           
 boolean lineSmoothEnabled
           
 boolean lineStippleEnabled
           
 int maxUsedVertexAttrib
           
 boolean normalizeEnabled
           
 boolean normalsArrayEnabled
           
 boolean pointSmoothEnabled
           
 boolean polygonOffsetFillEnabled
           
 boolean polygonOffsetLineEnabled
           
 boolean polygonOffsetPointEnabled
           
 boolean polygonSmoothEnabled
           
 boolean scissorTestEnabled
           
 boolean stencilTestEnabled
           
 int texCoordArraysEnableMask
           
 int[] texGenEnableMask
           
 boolean[] texture1DEnabled
           
 boolean[] texture2DEnabled
           
 boolean[] texture3DEnabled
           
 boolean[] textureCMEnabled
           
 long vertexAttribsEnableMask
           
 
Constructor Summary
OpenGLStatesCache()
           
 
Method Summary
 void dump()
           
 void update(boolean _coordsArrayEnabled, boolean _normalsArrayEnabled, boolean _colorsArrayEnabled, int _texCoordArraysEnableMask, int[] _texGenEnableMask, boolean[] _texture1DEnabled, boolean[] _texture2DEnabled, boolean[] _texture3DEnabled, boolean[] _textureCMEnabled, long _vertexAttribsEnableMask, int _currentServerTextureUnit, int _currentClientTextureUnit, int _maxUsedVertexAttrib, int _colorWriteMask, boolean _depthWriteMask, boolean _assemblyVertexShadersEnabled, boolean _assemblyFragmentShadersEnabled, int _currentGLSLShaderProgram, boolean _depthTestEnabled, boolean _alphaTestEnabled, boolean _stencilTestEnabled, boolean _scissorTestEnabled, boolean[] _clipPlaneEnabled, boolean _blendingEnabled, boolean _pointSmoothEnabled, boolean _lineStippleEnabled, boolean _lineSmoothEnabled, boolean _polygonSmoothEnabled, boolean _polygonOffsetPointEnabled, boolean _polygonOffsetLineEnabled, boolean _polygonOffsetFillEnabled, boolean _cullFaceEnabled, boolean _normalizeEnabled, boolean _colorMaterialEnabled, boolean _lightingEnabled, boolean[] _lightEnabled, boolean _fogEnabled, float[] _color)
           
abstract  void update(java.lang.Object glObj, OpenGLCapabilities glCaps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

public boolean enabled

lastFrameId

public final long[] lastFrameId

coordsArrayEnabled

public boolean coordsArrayEnabled

normalsArrayEnabled

public boolean normalsArrayEnabled

colorsArrayEnabled

public boolean colorsArrayEnabled

texCoordArraysEnableMask

public int texCoordArraysEnableMask

texGenEnableMask

public final int[] texGenEnableMask

texture1DEnabled

public final boolean[] texture1DEnabled

texture2DEnabled

public final boolean[] texture2DEnabled

texture3DEnabled

public final boolean[] texture3DEnabled

textureCMEnabled

public final boolean[] textureCMEnabled

currentBoundTexture

public final Texture[] currentBoundTexture

currentTexAttribs

public final TextureAttributes[] currentTexAttribs

currentTexCoordGen

public final TexCoordGeneration[] currentTexCoordGen

currentTextureMode

public final org.jagatoo.opengl.enums.TextureMode[] currentTextureMode

currentTextureBlendColor

public final org.openmali.vecmath2.Colorf[] currentTextureBlendColor

currentCombineMode_RGB

public final org.jagatoo.opengl.enums.TextureCombineMode[] currentCombineMode_RGB

currentCombineMode_Alpha

public final org.jagatoo.opengl.enums.TextureCombineMode[] currentCombineMode_Alpha

currentCombineSource0_RGB

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource0_RGB

currentCombineSource0_Alpha

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource0_Alpha

currentCombineSource1_RGB

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource1_RGB

currentCombineSource1_Alpha

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource1_Alpha

currentCombineSource2_RGB

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource2_RGB

currentCombineSource2_Alpha

public final org.jagatoo.opengl.enums.TextureCombineSource[] currentCombineSource2_Alpha

currentCombineFunction0_RGB

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction0_RGB

currentCombineFunction0_Alpha

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction0_Alpha

currentCombineFunction1_RGB

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction1_RGB

currentCombineFunction1_Alpha

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction1_Alpha

currentCombineFunction2_RGB

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction2_RGB

currentCombineFunction2_Alpha

public final org.jagatoo.opengl.enums.TextureCombineFunction[] currentCombineFunction2_Alpha

currentCompareMode

public final org.jagatoo.opengl.enums.TextureCompareMode[] currentCompareMode

currentCompareFunc

public final org.jagatoo.opengl.enums.CompareFunction[] currentCompareFunc

currentTextureMatrix

public final Transform3D[] currentTextureMatrix

currentCombineRGBScale

public final int[] currentCombineRGBScale

vertexAttribsEnableMask

public long vertexAttribsEnableMask

currentServerTextureUnit

public int currentServerTextureUnit

currentClientTextureUnit

public int currentClientTextureUnit

maxUsedVertexAttrib

public int maxUsedVertexAttrib

colorWriteMask

public int colorWriteMask

depthWriteMask

public boolean depthWriteMask

assemblyVertexShadersEnabled

public boolean assemblyVertexShadersEnabled

assemblyFragmentShadersEnabled

public boolean assemblyFragmentShadersEnabled

currentGLSLShaderProgram

public int currentGLSLShaderProgram

depthTestEnabled

public boolean depthTestEnabled

alphaTestEnabled

public boolean alphaTestEnabled

stencilTestEnabled

public boolean stencilTestEnabled

scissorTestEnabled

public boolean scissorTestEnabled

clipPlaneEnabled

public final boolean[] clipPlaneEnabled

blendingEnabled

public boolean blendingEnabled

pointSmoothEnabled

public boolean pointSmoothEnabled

lineStippleEnabled

public boolean lineStippleEnabled

lineSmoothEnabled

public boolean lineSmoothEnabled

polygonSmoothEnabled

public boolean polygonSmoothEnabled

polygonOffsetPointEnabled

public boolean polygonOffsetPointEnabled

polygonOffsetLineEnabled

public boolean polygonOffsetLineEnabled

polygonOffsetFillEnabled

public boolean polygonOffsetFillEnabled

cullFaceEnabled

public boolean cullFaceEnabled

normalizeEnabled

public boolean normalizeEnabled

colorMaterialEnabled

public boolean colorMaterialEnabled

lightingEnabled

public boolean lightingEnabled

lightEnabled

public final boolean[] lightEnabled

fogEnabled

public boolean fogEnabled

color

public final org.openmali.vecmath2.Colorf color

currentBoundArrayVBO

public int currentBoundArrayVBO

currentBoundElementVBO

public int currentBoundElementVBO
Constructor Detail

OpenGLStatesCache

public OpenGLStatesCache()
Method Detail

update

public final void update(boolean _coordsArrayEnabled,
                         boolean _normalsArrayEnabled,
                         boolean _colorsArrayEnabled,
                         int _texCoordArraysEnableMask,
                         int[] _texGenEnableMask,
                         boolean[] _texture1DEnabled,
                         boolean[] _texture2DEnabled,
                         boolean[] _texture3DEnabled,
                         boolean[] _textureCMEnabled,
                         long _vertexAttribsEnableMask,
                         int _currentServerTextureUnit,
                         int _currentClientTextureUnit,
                         int _maxUsedVertexAttrib,
                         int _colorWriteMask,
                         boolean _depthWriteMask,
                         boolean _assemblyVertexShadersEnabled,
                         boolean _assemblyFragmentShadersEnabled,
                         int _currentGLSLShaderProgram,
                         boolean _depthTestEnabled,
                         boolean _alphaTestEnabled,
                         boolean _stencilTestEnabled,
                         boolean _scissorTestEnabled,
                         boolean[] _clipPlaneEnabled,
                         boolean _blendingEnabled,
                         boolean _pointSmoothEnabled,
                         boolean _lineStippleEnabled,
                         boolean _lineSmoothEnabled,
                         boolean _polygonSmoothEnabled,
                         boolean _polygonOffsetPointEnabled,
                         boolean _polygonOffsetLineEnabled,
                         boolean _polygonOffsetFillEnabled,
                         boolean _cullFaceEnabled,
                         boolean _normalizeEnabled,
                         boolean _colorMaterialEnabled,
                         boolean _lightingEnabled,
                         boolean[] _lightEnabled,
                         boolean _fogEnabled,
                         float[] _color)

update

public abstract void update(java.lang.Object glObj,
                            OpenGLCapabilities glCaps)

dump

public void dump()