com.threerings.opengl.renderer.state
Class RenderState

java.lang.Object
  extended by com.threerings.opengl.renderer.state.RenderState
Direct Known Subclasses:
AlphaState, ArrayState, ColorMaskState, ColorState, CullState, DepthState, FogState, LightState, LineState, MaterialState, PointState, PolygonState, ShaderState, StencilState, TextureState, TransformState

public abstract class RenderState
extends Object

The superclass for all render state classes. Each render state class represents a separate aspect of the OpenGL state. Because the renderer relies on referential equality while rendering, the states must not change while rendering is taking place.


Field Summary
static int ALPHA_STATE
          The alpha testing/blending state.
static int ARRAY_STATE
          The geometry array state.
static int COLOR_MASK_STATE
          The color mask state.
static int COLOR_STATE
          The draw color state.
static int CULL_STATE
          The back-face culling state.
static int DEPTH_STATE
          The depth testing/writing state.
static int FOG_STATE
          The fog state.
static int LIGHT_STATE
          The light state.
static int LINE_STATE
          The line state.
static int MATERIAL_STATE
          The material state.
static int POINT_STATE
          The point state.
static int POLYGON_STATE
          The polygon state.
static int SHADER_STATE
          The GLSL shader state.
static int STATE_COUNT
          The total number of state types.
static int STENCIL_STATE
          The stencil state.
static int TEXTURE_STATE
          The texture state.
static int TRANSFORM_STATE
          The transform state.
 
Constructor Summary
RenderState()
           
 
Method Summary
abstract  void apply(Renderer renderer)
          Applies this state.
static void copy(RenderState[] s1, RenderState[] s2)
          Copies any non-null states in s1 into s2.
static RenderState[] createDefaultSet()
          Returns a new render state set containing the default states.
static RenderState[] createEmptySet()
          Creates and returns a new, empty render state set.
static RenderState[] getDefaults()
          Returns a reference to the shared default state array.
abstract  int getType()
          Returns the type of this state.
 boolean isDirty()
          Checks the dirty flag.
 void setDirty(boolean dirty)
          Sets the dirty flag.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHA_STATE

public static final int ALPHA_STATE
The alpha testing/blending state.

See Also:
Constant Field Values

ARRAY_STATE

public static final int ARRAY_STATE
The geometry array state.

See Also:
Constant Field Values

COLOR_STATE

public static final int COLOR_STATE
The draw color state.

See Also:
Constant Field Values

COLOR_MASK_STATE

public static final int COLOR_MASK_STATE
The color mask state.

See Also:
Constant Field Values

CULL_STATE

public static final int CULL_STATE
The back-face culling state.

See Also:
Constant Field Values

DEPTH_STATE

public static final int DEPTH_STATE
The depth testing/writing state.

See Also:
Constant Field Values

FOG_STATE

public static final int FOG_STATE
The fog state.

See Also:
Constant Field Values

LIGHT_STATE

public static final int LIGHT_STATE
The light state.

See Also:
Constant Field Values

LINE_STATE

public static final int LINE_STATE
The line state.

See Also:
Constant Field Values

MATERIAL_STATE

public static final int MATERIAL_STATE
The material state.

See Also:
Constant Field Values

POINT_STATE

public static final int POINT_STATE
The point state.

See Also:
Constant Field Values

POLYGON_STATE

public static final int POLYGON_STATE
The polygon state.

See Also:
Constant Field Values

SHADER_STATE

public static final int SHADER_STATE
The GLSL shader state.

See Also:
Constant Field Values

STENCIL_STATE

public static final int STENCIL_STATE
The stencil state.

See Also:
Constant Field Values

TEXTURE_STATE

public static final int TEXTURE_STATE
The texture state.

See Also:
Constant Field Values

TRANSFORM_STATE

public static final int TRANSFORM_STATE
The transform state.

See Also:
Constant Field Values

STATE_COUNT

public static final int STATE_COUNT
The total number of state types.

See Also:
Constant Field Values
Constructor Detail

RenderState

public RenderState()
Method Detail

createEmptySet

public static RenderState[] createEmptySet()
Creates and returns a new, empty render state set.


createDefaultSet

public static RenderState[] createDefaultSet()
Returns a new render state set containing the default states.


getDefaults

public static RenderState[] getDefaults()
Returns a reference to the shared default state array.


copy

public static void copy(RenderState[] s1,
                        RenderState[] s2)
Copies any non-null states in s1 into s2.


getType

public abstract int getType()
Returns the type of this state.


apply

public abstract void apply(Renderer renderer)
Applies this state.


setDirty

public final void setDirty(boolean dirty)
Sets the dirty flag.


isDirty

public final boolean isDirty()
Checks the dirty flag.



Copyright © 2011. All Rights Reserved.