1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glStencilMask">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glStencilMask
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glStencilMask
</refname>
17 <refpurpose>control the front and back writing of individual bits in the stencil planes
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glStencilMask
</function></funcdef>
23 <paramdef>GLuint
<parameter>mask
</parameter></paramdef>
27 <!-- eqn: ignoring delim $$ -->
28 <refsect1 id=
"parameters"><title>Parameters
</title>
31 <term><parameter>mask
</parameter></term>
34 Specifies a bit mask to enable and disable writing of individual bits
35 in the stencil planes.
36 Initially, the mask is all
1's.
42 <refsect1 id=
"description"><title>Description
</title>
44 <function>glStencilMask
</function> controls the writing of individual bits in the stencil planes.
46 <inlineequation><mml:math><mml:mi mathvariant=
"italic">n
</mml:mi></mml:math></inlineequation>
47 bits of
<parameter>mask
</parameter>,
49 <inlineequation><mml:math><mml:mi mathvariant=
"italic">n
</mml:mi></mml:math></inlineequation>
50 is the number of bits in the stencil buffer,
52 Where a
1 appears in the mask,
53 it's possible to write to the corresponding bit in the stencil buffer.
55 the corresponding bit is write-protected.
56 Initially, all bits are enabled for writing.
59 There can be two separate
<parameter>mask
</parameter> writemasks; one affects back-facing polygons, and the other
60 affects front-facing polygons as well as other non-polygon primitives.
61 <citerefentry><refentrytitle>glStencilMask
</refentrytitle></citerefentry> sets both front
62 and back stencil writemasks to the same values. Use
<citerefentry><refentrytitle>glStencilMaskSeparate
</refentrytitle></citerefentry>
63 to set front and back stencil writemasks to different values.
66 <refsect1 id=
"notes"><title>Notes
</title>
68 <citerefentry><refentrytitle>glStencilMask
</refentrytitle></citerefentry> is the same as
69 calling
<citerefentry><refentrytitle>glStencilMaskSeparate
</refentrytitle></citerefentry>
70 with
<parameter>face
</parameter> set to
<constant>GL_FRONT_AND_BACK
</constant>.
73 <refsect1 id=
"errors"><title>Errors
</title>
75 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glStencilMask
</function>
76 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
77 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
80 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
82 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
83 <constant>GL_STENCIL_WRITEMASK
</constant>,
<constant>GL_STENCIL_BACK_WRITEMASK
</constant>,
84 or
<constant>GL_STENCIL_BITS
</constant>
87 <refsect1 id=
"seealso"><title>See Also
</title>
89 <citerefentry><refentrytitle>glColorMask
</refentrytitle></citerefentry>,
90 <citerefentry><refentrytitle>glDepthMask
</refentrytitle></citerefentry>,
91 <citerefentry><refentrytitle>glIndexMask
</refentrytitle></citerefentry>,
92 <citerefentry><refentrytitle>glStencilFunc
</refentrytitle></citerefentry>,
93 <citerefentry><refentrytitle>glStencilFuncSeparate
</refentrytitle></citerefentry>,
94 <citerefentry><refentrytitle>glStencilMaskSeparate
</refentrytitle></citerefentry>,
95 <citerefentry><refentrytitle>glStencilOp
</refentrytitle></citerefentry>,
96 <citerefentry><refentrytitle>glStencilOpSeparate
</refentrytitle></citerefentry>
99 <refsect1 id=
"Copyright"><title>Copyright
</title>
101 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
102 Silicon Graphics, Inc. This document is licensed under the SGI
103 Free Software B License. For details, see
104 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.