com.threerings.opengl.renderer.state
Class DepthState

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

public class DepthState
extends RenderState

Contains the depth buffer testing/writing state.


Field Summary
static DepthState DISABLED
          A depth state for neither testing nor writing to the depth buffer.
static DepthState TEST
          A depth state for testing, but not writing to, the depth buffer.
static DepthState TEST_WRITE
          A depth state for testing and writing to the depth buffer.
static DepthState WRITE
          A depth state for writing to, but not testing, the depth buffer.
 
Fields inherited from class com.threerings.opengl.renderer.state.RenderState
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
DepthState(int depthTestFunc, boolean depthMask)
          Creates a new depth state with the supplied parameters.
 
Method Summary
 void apply(Renderer renderer)
          Applies this state.
 boolean getDepthMask()
          Returns the depth mask value.
 int getDepthTestFunc()
          Returns the depth test function.
static DepthState getInstance(int depthTestFunc, boolean depthMask)
          Returns a depth state instance with the supplied parameters.
 int getType()
          Returns the type of this state.
 
Methods inherited from class com.threerings.opengl.renderer.state.RenderState
copy, createDefaultSet, createEmptySet, getDefaults, isDirty, setDirty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST

public static final DepthState TEST
A depth state for testing, but not writing to, the depth buffer.


WRITE

public static final DepthState WRITE
A depth state for writing to, but not testing, the depth buffer.


TEST_WRITE

public static final DepthState TEST_WRITE
A depth state for testing and writing to the depth buffer.


DISABLED

public static final DepthState DISABLED
A depth state for neither testing nor writing to the depth buffer.

Constructor Detail

DepthState

public DepthState(int depthTestFunc,
                  boolean depthMask)
Creates a new depth state with the supplied parameters.

Method Detail

getInstance

public static DepthState getInstance(int depthTestFunc,
                                     boolean depthMask)
Returns a depth state instance with the supplied parameters. All requests for instances with the same parameters will return the same object.


getDepthTestFunc

public int getDepthTestFunc()
Returns the depth test function.


getDepthMask

public boolean getDepthMask()
Returns the depth mask value.


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


Copyright © 2011. All Rights Reserved.