/ comp / gb.opengl / gl / stencilmask
Gl.StencilMask (gb.opengl)
Syntax

    STATIC SUB StencilMask ( Mask AS Integer )

### control the writing of individual bits in the stencil planes

#### Parameters

- Mask specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all ones.

#### Description

Gl.StencilMask controls the writing of individual bits in the stencil planes. The least significant n bits of mask, where n is the number of bits in the stencil buffer, specify a mask. Wherever a one appears in the mask, the corresponding bit in the stencil buffer is made writable. Where a zero appears, the bit is write-protected. Initially, all bits are enabled for writing.

#### Errors

Gl.GL_INVALID_OPERATION is generated if Gl.StencilMask is called between a call to Gl.Begin and the corresponding call to Gl.End.

#### Associated Gets

Gl.GetStencilWritemask
Gl.GetStencilBits

### See also

Gl.ColorMask , Gl.DepthMask, Gl.IndexMask, Gl.StencilFunc, gl.StencilOp