com.neovisionaries.android.opengl
Class StencilBuffer

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

public final class StencilBuffer
extends Object

Stencil buffer.

Author:
Takahiko Kawasaki

Method Summary
static void clear()
          Clear the stencil buffer (call glClear(GL_STENCIL_BUFFER_BIT)).
static void setClearStencil(int stencil)
          Set a stencil value used to clear the stencil buffer (call glClearStencil(stencil)).
static void setWritable(int stencilMask)
          Set a bit mask to enable and disable writing of individual bits in the stencil planes.
static void setWritable(int stencilMask, Face face)
          Set a bit mask to enable and disable writing of individual bits in the stencil planes for the specified face.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setClearStencil

public static void setClearStencil(int stencil)
Set a stencil value used to clear the stencil buffer (call glClearStencil(stencil)).

Parameters:
stencil - A stencil value used to clear the stencil buffer.
See Also:
glClearStencil

clear

public static void clear()
Clear the stencil buffer (call glClear(GL_STENCIL_BUFFER_BIT)).

See Also:
glClear

setWritable

public static void setWritable(int stencilMask)
Set a bit mask to enable and disable writing of individual bits in the stencil planes.

glStencilMask(stencilMask) is called.

Parameters:
stencilMask - A bit mask.
See Also:
glStencilMask

setWritable

public static void setWritable(int stencilMask,
                               Face face)
Set a bit mask to enable and disable writing of individual bits in the stencil planes for the specified face.

If the OpenGL ES version is equal to or greater than 2.0, this method executes glStencilMaskSeparate(face.getFace(), stencilMask). Otherwise, this method executes glStencilMask(stencilMask) unless the specified face is Face.BACK.

Parameters:
stencilMask - A bit mask.
face - A face to set the bit mask. If null is given, Face.FRONT_AND_BACK is used. If Face.BACK is given but the major version number of the underlying OpenGL ES implementation is less than 2, this method does nothing.
See Also:
glStencilMask, glStencilMaskSeparate