2009-03-08 00:46:58 +00:00
<?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id= "glClear" >
<refmeta >
2014-03-28 19:06:55 +00:00
<refmetainfo >
<copyright >
<year > 1991-2006</year>
<holder > Silicon Graphics, Inc.</holder>
</copyright>
</refmetainfo>
2009-03-08 00:46:58 +00:00
<refentrytitle > glClear</refentrytitle>
<manvolnum > 3G</manvolnum>
</refmeta>
<refnamediv >
<refname > glClear</refname>
<refpurpose > clear buffers to preset values</refpurpose>
</refnamediv>
<refsynopsisdiv > <title > C Specification</title>
<funcsynopsis >
<funcprototype >
<funcdef > void <function > glClear</function> </funcdef>
<paramdef > GLbitfield <parameter > mask</parameter> </paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id= "parameters" > <title > Parameters</title>
<variablelist >
<varlistentry >
<term > <parameter > mask</parameter> </term>
<listitem >
<para >
Bitwise OR of masks that indicate the buffers to be cleared.
2010-11-21 14:34:29 +00:00
The three masks are
2009-03-08 00:46:58 +00:00
<constant > GL_COLOR_BUFFER_BIT</constant> ,
2010-11-21 14:34:29 +00:00
<constant > GL_DEPTH_BUFFER_BIT</constant> , and
2009-03-08 00:46:58 +00:00
<constant > GL_STENCIL_BUFFER_BIT</constant> .
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id= "description" > <title > Description</title>
<para >
<function > glClear</function> sets the bitplane area of the window to values previously selected
2014-03-28 19:06:55 +00:00
by <citerefentry > <refentrytitle > glClearColor</refentrytitle> </citerefentry> , <citerefentry > <refentrytitle > glClearDepthf</refentrytitle> </citerefentry> , and
<citerefentry > <refentrytitle > glClearStencil</refentrytitle> </citerefentry> .
2009-03-08 00:46:58 +00:00
</para>
<para >
The pixel ownership test,
the scissor test,
dithering, and the buffer writemasks affect the operation of <function > glClear</function> .
The scissor box bounds the cleared region.
2014-03-28 19:06:55 +00:00
Blend function,
2009-03-08 00:46:58 +00:00
stenciling,
2014-03-28 19:06:55 +00:00
fragment shading,
2009-03-08 00:46:58 +00:00
and depth-buffering are ignored by <function > glClear</function> .
</para>
<para >
<function > glClear</function> takes a single argument that is the bitwise OR of several
values indicating which buffer is to be cleared.
</para>
<para >
The values are as follows:
</para>
<variablelist >
<varlistentry >
<term > <constant > GL_COLOR_BUFFER_BIT</constant> </term>
<listitem >
<para >
Indicates the buffers currently enabled for color
writing.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <constant > GL_DEPTH_BUFFER_BIT</constant> </term>
<listitem >
<para >
Indicates the depth buffer.
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <constant > GL_STENCIL_BUFFER_BIT</constant> </term>
<listitem >
<para >
Indicates the stencil buffer.
</para>
</listitem>
</varlistentry>
</variablelist>
<para >
The value to which each buffer is cleared depends on the setting of the
clear value for that buffer.
</para>
</refsect1>
<refsect1 id= "notes" > <title > Notes</title>
<para >
If a buffer is not present,
then a <function > glClear</function> directed at that buffer has no effect.
</para>
</refsect1>
<refsect1 id= "errors" > <title > Errors</title>
<para >
2010-11-21 14:34:29 +00:00
<constant > GL_INVALID_VALUE</constant> is generated if any bit other than the three defined
2009-03-08 00:46:58 +00:00
bits is set in <parameter > mask</parameter> .
</para>
</refsect1>
<refsect1 id= "associatedgets" > <title > Associated Gets</title>
<para >
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with argument <constant > GL_DEPTH_CLEAR_VALUE</constant>
</para>
<para >
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with argument <constant > GL_COLOR_CLEAR_VALUE</constant>
</para>
<para >
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with argument <constant > GL_STENCIL_CLEAR_VALUE</constant>
</para>
</refsect1>
<refsect1 id= "seealso" > <title > See Also</title>
<para >
2014-03-28 19:06:55 +00:00
<citerefentry > <refentrytitle > glClearColor</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glClearDepthf</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glClearStencil</refentrytitle> </citerefentry> ,
2009-03-08 00:46:58 +00:00
<citerefentry > <refentrytitle > glColorMask</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glDepthMask</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glScissor</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glStencilMask</refentrytitle> </citerefentry>
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 id= "copyright" > <title > Copyright</title>
2009-03-08 00:46:58 +00:00
<para >
2014-03-28 19:06:55 +00:00
Copyright <trademark class= "copyright" > </trademark> 1991-2006
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
2009-03-08 00:46:58 +00:00
<ulink url= "http://oss.sgi.com/projects/FreeB/" > http://oss.sgi.com/projects/FreeB/</ulink> .
</para>
</refsect1>
</refentry>