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=
"glClear">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glClear
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glClear
</refname>
17 <refpurpose>clear buffers to preset values
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glClear
</function></funcdef>
23 <paramdef>GLbitfield
<parameter>mask
</parameter></paramdef>
27 <refsect1 id=
"parameters"><title>Parameters
</title>
30 <term><parameter>mask
</parameter></term>
33 Bitwise OR of masks that indicate the buffers to be cleared.
35 <constant>GL_COLOR_BUFFER_BIT
</constant>,
36 <constant>GL_DEPTH_BUFFER_BIT
</constant>, and
37 <constant>GL_STENCIL_BUFFER_BIT
</constant>.
43 <refsect1 id=
"description"><title>Description
</title>
45 <function>glClear
</function> sets the bitplane area of the window to values previously selected
46 by
<function>glClearColor
</function>,
<function>glClearDepth
</function>, and
47 <function>glClearStencil
</function>.
48 Multiple color buffers can be cleared simultaneously by selecting
49 more than one buffer at a time using
<citerefentry><refentrytitle>glDrawBuffer
</refentrytitle></citerefentry>.
52 The pixel ownership test,
54 dithering, and the buffer writemasks affect the operation of
<function>glClear
</function>.
55 The scissor box bounds the cleared region.
61 and depth-buffering are ignored by
<function>glClear
</function>.
64 <function>glClear
</function> takes a single argument that is the bitwise OR of several
65 values indicating which buffer is to be cleared.
68 The values are as follows:
72 <term><constant>GL_COLOR_BUFFER_BIT
</constant></term>
75 Indicates the buffers currently enabled for color
81 <term><constant>GL_DEPTH_BUFFER_BIT
</constant></term>
84 Indicates the depth buffer.
89 <term><constant>GL_STENCIL_BUFFER_BIT
</constant></term>
92 Indicates the stencil buffer.
98 The value to which each buffer is cleared depends on the setting of the
99 clear value for that buffer.
102 <refsect1 id=
"notes"><title>Notes
</title>
104 If a buffer is not present,
105 then a
<function>glClear
</function> directed at that buffer has no effect.
108 <refsect1 id=
"errors"><title>Errors
</title>
110 <constant>GL_INVALID_VALUE
</constant> is generated if any bit other than the three defined
111 bits is set in
<parameter>mask
</parameter>.
114 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
116 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_DEPTH_CLEAR_VALUE
</constant>
119 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_CLEAR_VALUE
</constant>
122 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_STENCIL_CLEAR_VALUE
</constant>
125 <refsect1 id=
"seealso"><title>See Also
</title>
127 <function>glClearColor
</function>,
128 <function>glClearDepth
</function>,
129 <function>glClearStencil
</function>,
130 <citerefentry><refentrytitle>glColorMask
</refentrytitle></citerefentry>,
131 <citerefentry><refentrytitle>glDepthMask
</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>glDrawBuffer
</refentrytitle></citerefentry>,
133 <citerefentry><refentrytitle>glScissor
</refentrytitle></citerefentry>,
134 <citerefentry><refentrytitle>glStencilMask
</refentrytitle></citerefentry>
137 <refsect1 id=
"Copyright"><title>Copyright
</title>
139 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
140 Silicon Graphics, Inc. This document is licensed under the SGI
141 Free Software B License. For details, see
142 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.