com.neovisionaries.android.opengl
Class StencilComparator

java.lang.Object
  extended by com.neovisionaries.android.opengl.StencilComparator

public class StencilComparator
extends Object

Comparator used for the stencil test.

Author:
Takahiko Kawasaki
See Also:
StencilComparisonOperator, glStencilFunc, glStencilFuncSeparate

Constructor Summary
StencilComparator()
          This constructor is an alias of StencilComparator(null, 0, 0xffffffff).
StencilComparator(StencilComparator comparator)
          A copy constructor.
StencilComparator(StencilComparisonOperator operator, int referenceValue, int mask)
          A constructor to define the function for the stencil test.
 
Method Summary
 int getMask()
          Get the bit mask.
 StencilComparisonOperator getOperator()
          Get the comparison operator.
 int getReferenceValue()
          Get the reference value.
 StencilComparator setMask(int mask)
          Set a bit mask.
 StencilComparator setOperator(StencilComparisonOperator operator)
          Set a comparison operator.
 StencilComparator setReferenceValue(int referenceValue)
          Set a reference value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StencilComparator

public StencilComparator()
This constructor is an alias of StencilComparator(null, 0, 0xffffffff).


StencilComparator

public StencilComparator(StencilComparisonOperator operator,
                         int referenceValue,
                         int mask)
A constructor to define the function for the stencil test.

Parameters:
operator - A comparison operator. If null is given, StencilComparisonOperator.ALWAYS is used.
referenceValue - A reference value used for the comparison.
mask - A bit mask that is logical-ANDed with the bits of the stencil buffer.

StencilComparator

public StencilComparator(StencilComparator comparator)
A copy constructor.

Parameters:
comparator - A comparator to copy from. If null is given, ALWAYS, 0 and 0xffffffff are used as operator, reference value and mask, respectively.
Method Detail

getOperator

public StencilComparisonOperator getOperator()
Get the comparison operator.

Returns:
The comparison operator.

setOperator

public StencilComparator setOperator(StencilComparisonOperator operator)
Set a comparison operator.

Parameters:
operator - A comparison operator. If null is given, StencilComparisonOperator.ALWAYS is set.
Returns:
This StencilComparator object.

getReferenceValue

public int getReferenceValue()
Get the reference value.

Returns:
The reference value used for the comparison.

setReferenceValue

public StencilComparator setReferenceValue(int referenceValue)
Set a reference value.

Parameters:
referenceValue - A reference value used for the comparison.
Returns:
This StencilComparator object.

getMask

public int getMask()
Get the bit mask.

Returns:
The bit mask that is logical-ANDed with the bits of the stencil buffer.

setMask

public StencilComparator setMask(int mask)
Set a bit mask.

Parameters:
mask - A bit mask that is logical-ANDed with the bits of the stencil buffer.
Returns:
This StencilComparator object