com.threerings.opengl.renderer.state
Class StencilState

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

public class StencilState
extends RenderState

Contains the stencil state.


Field Summary
static StencilState DISABLED
          Disables stencil testing/writing.
 
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
StencilState(int stencilTestFunc, int stencilTestRef, int stencilTestMask, int stencilFailOp, int stencilDepthFailOp, int stencilPassOp, int stencilWriteMask)
          Creates a new stencil state with the supplied parameters.
 
Method Summary
 void apply(Renderer renderer)
          Applies this state.
static StencilState getInstance(int stencilTestFunc, int stencilTestRef, int stencilTestMask, int stencilFailOp, int stencilDepthFailOp, int stencilPassOp, int stencilWriteMask)
          Returns a stencil state instance with the supplied parameters.
 int getStencilDepthFailOp()
          Returns the action to take when the fragment passes the stencil test, but fails the depth test.
 int getStencilFailOp()
          Returns the action to take when the fragment fails the stencil test.
 int getStencilPassOp()
          Returns the action to take when the fragment passes both the stencil test and the depth test.
 int getStencilTestFunc()
          Returns the stencil test function.
 int getStencilTestMask()
          Returns the stencil test mask.
 int getStencilTestRef()
          Returns the stencil test reference value.
 int getStencilWriteMask()
          Returns the stencil write mask.
 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

DISABLED

public static final StencilState DISABLED
Disables stencil testing/writing.

Constructor Detail

StencilState

public StencilState(int stencilTestFunc,
                    int stencilTestRef,
                    int stencilTestMask,
                    int stencilFailOp,
                    int stencilDepthFailOp,
                    int stencilPassOp,
                    int stencilWriteMask)
Creates a new stencil state with the supplied parameters.

Method Detail

getInstance

public static StencilState getInstance(int stencilTestFunc,
                                       int stencilTestRef,
                                       int stencilTestMask,
                                       int stencilFailOp,
                                       int stencilDepthFailOp,
                                       int stencilPassOp,
                                       int stencilWriteMask)
Returns a stencil state instance with the supplied parameters. All requests for instances with the same parameters will return the same object.


getStencilTestFunc

public int getStencilTestFunc()
Returns the stencil test function.


getStencilTestRef

public int getStencilTestRef()
Returns the stencil test reference value.


getStencilTestMask

public int getStencilTestMask()
Returns the stencil test mask.


getStencilFailOp

public int getStencilFailOp()
Returns the action to take when the fragment fails the stencil test.


getStencilDepthFailOp

public int getStencilDepthFailOp()
Returns the action to take when the fragment passes the stencil test, but fails the depth test.


getStencilPassOp

public int getStencilPassOp()
Returns the action to take when the fragment passes both the stencil test and the depth test.


getStencilWriteMask

public int getStencilWriteMask()
Returns the stencil write mask.


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.