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
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glClear</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glCallLists.3G.xml" title="glCallLists"/><link rel="next" href="glClearAccum.3G.xml" title="glClearAccum"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glClear</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glCallLists.3G.xml">Prev</a></td><th width="60%" align="center">GL</th><td width="20%" align="right"><a accesskey="n" href="glClearAccum.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glClear.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glClear.3G-name"/><h2>Name</h2><p>glClear — clear buffers to preset values</p></div><div class="refsynopsisdiv"><a name="glClear.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void<tt>glClear</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLbitfield<i><tt>mask</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glClear.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glClear</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>mask</tt></i>) →<tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glClear.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>mask</tt></i></span></dt><dd>
Bitwise OR of masks that indicate the buffers to be cleared. The four masks are
<tt>GL_COLOR_BUFFER_BIT</tt>, <tt>GL_DEPTH_BUFFER_BIT</tt>,
<tt>GL_ACCUM_BUFFER_BIT</tt>, and <tt>GL_STENCIL_BUFFER_BIT</tt>.
</dd></dl></div></div><div class="refsect1" lang="en"><a name="glClear.3G-description"/><h2>Description</h2><p>
<tt>glClear</tt> sets the bitplane area of the window to values previously selected by <a href="glClearColor.3G.xml"><tt>glClearColor</tt></a>, <a href="glClearIndex.3G.xml"><tt>glClearIndex</tt></a>, <a href="glClearDepth.3G.xml"><tt>glClearDepth</tt></a>, <a href="glClearStencil.3G.xml"><tt>glClearStencil</tt></a>, and <a href="glClearAccum.3G.xml"><tt>glClearAccum</tt></a>. Multiple color buffers can be cleared simultaneously by selecting more
than one buffer at a time using <a href="glDrawBuffer.3G.xml"><tt>glDrawBuffer</tt></a>.
</p><p>
The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of
<tt>glClear</tt>. The scissor box bounds the cleared region. Alpha function, blend function, logical
operation, stenciling, texture mapping, and depth-buffering are ignored by <tt>glClear</tt>.
</p><p>
<tt>glClear</tt> 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"><tt>GL_COLOR_BUFFER_BIT</tt></span></dt><dd>
Indicates the buffers currently enabled for color writing.
</dd><dt><span class="term"><tt>GL_DEPTH_BUFFER_BIT</tt></span></dt><dd>
Indicates the depth buffer.
</dd><dt><span class="term"><tt>GL_ACCUM_BUFFER_BIT</tt></span></dt><dd>
Indicates the accumulation buffer.
</dd><dt><span class="term"><tt>GL_STENCIL_BUFFER_BIT</tt></span></dt><dd>
Indicates the stencil buffer.
</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"><a name="glClear.3G-notes"/><h2>Notes</h2><p>
If a buffer is not present, then a <tt>glClear</tt> directed at that buffer has no effect.
</p></div><div class="refsect1" lang="en"><a name="glClear.3G-errors"/><h2>Errors</h2><p>
<tt>GL_INVALID_VALUE</tt> is generated if any bit other than the four defined bits is set in
<i><tt>mask</tt></i>.
</p><p>
<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glClear</tt> is executed between the
execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
</p></div><div class="refsect1" lang="en"><a name="glClear.3G-associated_gets"/><h2>Associated Gets</h2><p>
<tt>glGet</tt> with argument <tt>GL_ACCUM_CLEAR_VALUE</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_DEPTH_CLEAR_VALUE</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_INDEX_CLEAR_VALUE</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_COLOR_CLEAR_VALUE</tt>
</p><p>
<tt>glGet</tt> with argument <tt>GL_STENCIL_CLEAR_VALUE</tt>
</p></div><div class="refsect1" lang="en"><a name="glClear.3G-see_also"/><h2>See Also</h2><p>
<span class="simplelist"><a href="glClearAccum.3G.xml">glClearAccum</a>, <a href="glClearColor.3G.xml">glClearColor</a>, <a href="glClearDepth.3G.xml">glClearDepth</a>, <a href="glClearIndex.3G.xml">glClearIndex</a>, <a href="glClearStencil.3G.xml">glClearStencil</a>, <a href="glColorMask.3G.xml">glColorMask</a>, <a href="glDepthMask.3G.xml">glDepthMask</a>, <a href="glDrawBuffer.3G.xml">glDrawBuffer</a>, <a href="glScissor.3G.xml">glScissor</a>, <a href="glStencilMask.3G.xml">glStencilMask</a></span>
</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glCallLists.3G.xml">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"><a accesskey="n" href="glClearAccum.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glCallLists</td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top">glClearAccum</td></tr></table></div></body></html>
|