com.threerings.opengl.renderer.state
Class ArrayState

java.lang.Object
  extended by com.threerings.opengl.renderer.state.RenderState
      extended by com.threerings.opengl.renderer.state.ArrayState

public class ArrayState
extends RenderState

Contains the client array state.


Field Summary
protected  ClientArray _colorArray
          The color array.
protected  BufferObject _elementArrayBuffer
          The element array buffer.
protected  int _firstVertexAttribIndex
          The attribute index of the first vertex attribute array.
protected  ClientArray _normalArray
          The normal array.
protected  ClientArray[] _texCoordArrays
          The texture coordinate arrays.
protected  ClientArray _vertexArray
          The vertex array.
protected  ClientArray[] _vertexAttribArrays
          The generic vertex attribute arrays.
static ArrayState DISABLED
          A state that disables all of the client arrays.
 
Fields inherited from class com.threerings.opengl.renderer.state.RenderState
_defaults, _dirty, ALPHA_STATE, ARRAY_STATE, COLOR_MASK_STATE, COLOR_STATE, CULL_STATE, DEPTH_STATE, FOG_STATE, LIGHT_STATE, LINE_STATE, MATERIAL_STATE, POINT_STATE, POLYGON_STATE, SHADER_STATE, STATE_COUNT, STENCIL_STATE, TEXTURE_STATE, TRANSFORM_STATE
 
Constructor Summary
ArrayState(int firstVertexAttribIndex, ClientArray[] vertexAttribArrays, ClientArray[] texCoordArrays, ClientArray colorArray, ClientArray normalArray, ClientArray vertexArray, BufferObject elementArrayBuffer)
          Creates a new array state.
 
Method Summary
 void apply(Renderer renderer)
          Applies this state.
 ClientArray getColorArray()
          Returns a reference to the color array.
 BufferObject getElementArrayBuffer()
          Returns a reference to the element array buffer object.
 int getFirstVertexAttribIndex()
          Returns the attribute index of the first vertex attribute array.
 ClientArray getNormalArray()
          Returns a reference to the normal array.
 ClientArray[] getTexCoordArrays()
          Returns a reference to the array of texture coordinate arrays.
 int getType()
          Returns the type of this state.
 ClientArray getVertexArray()
          Returns a reference to the vertex array.
 ClientArray[] getVertexAttribArrays()
          Returns a reference to the array of vertex attribute arrays.
 
Methods inherited from class com.threerings.opengl.renderer.state.RenderState
copy, createDefaultSet, createEmptySet, getDefaults, isDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLED

public static final ArrayState DISABLED
A state that disables all of the client arrays.


_firstVertexAttribIndex

protected int _firstVertexAttribIndex
The attribute index of the first vertex attribute array.


_vertexAttribArrays

protected ClientArray[] _vertexAttribArrays
The generic vertex attribute arrays.


_texCoordArrays

protected ClientArray[] _texCoordArrays
The texture coordinate arrays.


_colorArray

protected ClientArray _colorArray
The color array.


_normalArray

protected ClientArray _normalArray
The normal array.


_vertexArray

protected ClientArray _vertexArray
The vertex array.


_elementArrayBuffer

protected BufferObject _elementArrayBuffer
The element array buffer.

Constructor Detail

ArrayState

public ArrayState(int firstVertexAttribIndex,
                  ClientArray[] vertexAttribArrays,
                  ClientArray[] texCoordArrays,
                  ClientArray colorArray,
                  ClientArray normalArray,
                  ClientArray vertexArray,
                  BufferObject elementArrayBuffer)
Creates a new array state.

Method Detail

getFirstVertexAttribIndex

public int getFirstVertexAttribIndex()
Returns the attribute index of the first vertex attribute array.


getVertexAttribArrays

public ClientArray[] getVertexAttribArrays()
Returns a reference to the array of vertex attribute arrays.


getTexCoordArrays

public ClientArray[] getTexCoordArrays()
Returns a reference to the array of texture coordinate arrays.


getColorArray

public ClientArray getColorArray()
Returns a reference to the color array.


getNormalArray

public ClientArray getNormalArray()
Returns a reference to the normal array.


getVertexArray

public ClientArray getVertexArray()
Returns a reference to the vertex array.


getElementArrayBuffer

public BufferObject getElementArrayBuffer()
Returns a reference to the element array buffer object.


getType

public int getType()
Description copied from class: RenderState
Returns the type of this state.

Specified by:
getType in class RenderState

apply

public void apply(Renderer renderer)
Description copied from class: RenderState
Applies this state.

Specified by:
apply in class RenderState