-
Notifications
You must be signed in to change notification settings - Fork 94
/
glClear.xhtml
80 lines (80 loc) · 7.1 KB
/
glClear.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<div class="refentry" lang="en" xml:lang="en"><a id="glClear"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glClear — clear buffers to preset values</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">void <b class="fsfunc">glClear</b>(</code></td><td>GLbitfield </td><td><var class="pdparam">mask</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>mask</code></em></span></dt><dd><p>
Bitwise OR of masks that indicate the buffers to be cleared.
The four masks are
<code class="constant">GL_COLOR_BUFFER_BIT</code>,
<code class="constant">GL_DEPTH_BUFFER_BIT</code>,
<code class="constant">GL_ACCUM_BUFFER_BIT</code>, and
<code class="constant">GL_STENCIL_BUFFER_BIT</code>.
</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
<code class="function">glClear</code> sets the bitplane area of the window to values previously selected
by <code class="function">glClearColor</code>, <code class="function">glClearIndex</code>, <code class="function">glClearDepth</code>,
<code class="function">glClearStencil</code>, and <code class="function">glClearAccum</code>.
Multiple color buffers can be cleared simultaneously by selecting
more than one buffer at a time using <a class="citerefentry" href="glDrawBuffer"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>.
</p><p>
The pixel ownership test,
the scissor test,
dithering, and the buffer writemasks affect the operation of <code class="function">glClear</code>.
The scissor box bounds the cleared region.
Alpha function,
blend function,
logical operation,
stenciling,
texture mapping,
and depth-buffering are ignored by <code class="function">glClear</code>.
</p><p>
<code class="function">glClear</code> takes a single argument that is the bitwise OR of several
values indicating which buffer is to be cleared.
</p><p>
The values are as follows:
</p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_COLOR_BUFFER_BIT</code></span></dt><dd><p>
Indicates the buffers currently enabled for color
writing.
</p></dd><dt><span class="term"><code class="constant">GL_DEPTH_BUFFER_BIT</code></span></dt><dd><p>
Indicates the depth buffer.
</p></dd><dt><span class="term"><code class="constant">GL_ACCUM_BUFFER_BIT</code></span></dt><dd><p>
Indicates the accumulation buffer.
</p></dd><dt><span class="term"><code class="constant">GL_STENCIL_BUFFER_BIT</code></span></dt><dd><p>
Indicates the stencil buffer.
</p></dd></dl></div><p>
The value to which each buffer is cleared depends on the setting of the
clear value for that buffer.
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
If a buffer is not present,
then a <code class="function">glClear</code> directed at that buffer has no effect.
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
<code class="constant">GL_INVALID_VALUE</code> is generated if any bit other than the four defined
bits is set in <em class="parameter"><code>mask</code></em>.
</p><p>
<code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glClear</code>
is executed between the execution of <a class="citerefentry" href="glBegin"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
and the corresponding execution of <a class="citerefentry" href="glEnd"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ACCUM_CLEAR_VALUE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_DEPTH_CLEAR_VALUE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_INDEX_CLEAR_VALUE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_COLOR_CLEAR_VALUE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_STENCIL_CLEAR_VALUE</code>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
<code class="function">glClearAccum</code>,
<code class="function">glClearColor</code>,
<code class="function">glClearDepth</code>,
<code class="function">glClearIndex</code>,
<code class="function">glClearStencil</code>,
<a class="citerefentry" href="glColorMask"><span class="citerefentry"><span class="refentrytitle">glColorMask</span></span></a>,
<a class="citerefentry" href="glDepthMask"><span class="citerefentry"><span class="refentrytitle">glDepthMask</span></span></a>,
<a class="citerefentry" href="glDrawBuffer"><span class="citerefentry"><span class="refentrytitle">glDrawBuffer</span></span></a>,
<a class="citerefentry" href="glScissor"><span class="citerefentry"><span class="refentrytitle">glScissor</span></span></a>,
<a class="citerefentry" href="glStencilMask"><span class="citerefentry"><span class="refentrytitle">glStencilMask</span></span></a>
</p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
Copyright © 1991-2006
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
<a class="ulink" href="https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/" target="_top">https://web.archive.org/web/20171022161616/http://oss.sgi.com/projects/FreeB/</a>.
</p></div></div></div>