Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>1991-2006</year> | |
9 | <holder>Silicon Graphics, Inc.</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glClear</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glClear</refname> | |
17 | <refpurpose>clear buffers to preset values</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glClear</function></funcdef> | |
23 | <paramdef>GLbitfield <parameter>mask</parameter></paramdef> | |
24 | </funcprototype> | |
25 | </funcsynopsis> | |
26 | </refsynopsisdiv> | |
27 | <refsect1 id="parameters"><title>Parameters</title> | |
28 | <variablelist> | |
29 | <varlistentry> | |
30 | <term><parameter>mask</parameter></term> | |
31 | <listitem> | |
32 | <para> | |
33 | Bitwise OR of masks that indicate the buffers to be cleared. | |
34 | The three masks are | |
35 | <constant>GL_COLOR_BUFFER_BIT</constant>, | |
36 | <constant>GL_DEPTH_BUFFER_BIT</constant>, and | |
37 | <constant>GL_STENCIL_BUFFER_BIT</constant>. | |
38 | </para> | |
39 | </listitem> | |
40 | </varlistentry> | |
41 | </variablelist> | |
42 | </refsect1> | |
43 | <refsect1 id="description"><title>Description</title> | |
44 | <para> | |
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>. | |
50 | </para> | |
51 | <para> | |
52 | The pixel ownership test, | |
53 | the scissor test, | |
54 | dithering, and the buffer writemasks affect the operation of <function>glClear</function>. | |
55 | The scissor box bounds the cleared region. | |
56 | Alpha function, | |
57 | blend function, | |
58 | logical operation, | |
59 | stenciling, | |
60 | texture mapping, | |
61 | and depth-buffering are ignored by <function>glClear</function>. | |
62 | </para> | |
63 | <para> | |
64 | <function>glClear</function> takes a single argument that is the bitwise OR of several | |
65 | values indicating which buffer is to be cleared. | |
66 | </para> | |
67 | <para> | |
68 | The values are as follows: | |
69 | </para> | |
70 | <variablelist> | |
71 | <varlistentry> | |
72 | <term><constant>GL_COLOR_BUFFER_BIT</constant></term> | |
73 | <listitem> | |
74 | <para> | |
75 | Indicates the buffers currently enabled for color | |
76 | writing. | |
77 | </para> | |
78 | </listitem> | |
79 | </varlistentry> | |
80 | <varlistentry> | |
81 | <term><constant>GL_DEPTH_BUFFER_BIT</constant></term> | |
82 | <listitem> | |
83 | <para> | |
84 | Indicates the depth buffer. | |
85 | </para> | |
86 | </listitem> | |
87 | </varlistentry> | |
88 | <varlistentry> | |
89 | <term><constant>GL_STENCIL_BUFFER_BIT</constant></term> | |
90 | <listitem> | |
91 | <para> | |
92 | Indicates the stencil buffer. | |
93 | </para> | |
94 | </listitem> | |
95 | </varlistentry> | |
96 | </variablelist> | |
97 | <para> | |
98 | The value to which each buffer is cleared depends on the setting of the | |
99 | clear value for that buffer. | |
100 | </para> | |
101 | </refsect1> | |
102 | <refsect1 id="notes"><title>Notes</title> | |
103 | <para> | |
104 | If a buffer is not present, | |
105 | then a <function>glClear</function> directed at that buffer has no effect. | |
106 | </para> | |
107 | </refsect1> | |
108 | <refsect1 id="errors"><title>Errors</title> | |
109 | <para> | |
110 | <constant>GL_INVALID_VALUE</constant> is generated if any bit other than the three defined | |
111 | bits is set in <parameter>mask</parameter>. | |
112 | </para> | |
113 | </refsect1> | |
114 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
115 | <para> | |
116 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_CLEAR_VALUE</constant> | |
117 | </para> | |
118 | <para> | |
119 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_CLEAR_VALUE</constant> | |
120 | </para> | |
121 | <para> | |
122 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_STENCIL_CLEAR_VALUE</constant> | |
123 | </para> | |
124 | </refsect1> | |
125 | <refsect1 id="seealso"><title>See Also</title> | |
126 | <para> | |
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> | |
135 | </para> | |
136 | </refsect1> | |
137 | <refsect1 id="Copyright"><title>Copyright</title> | |
138 | <para> | |
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>. | |
143 | </para> | |
144 | </refsect1> | |
145 | </refentry> |