update upstream sources
[clinton/guile-figl.git] / upstream-doc / man3 / glClearBuffer.xml
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="glClearBuffer">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2010</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glClearBuffer</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glClearBuffer</refname>
17 <refpurpose>clear individual buffers of the currently bound draw framebuffer</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glClearBufferiv</function></funcdef>
23 <paramdef>GLenum <parameter>buffer</parameter></paramdef>
24 <paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
25 <paramdef>const GLint * <parameter>value</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 <funcsynopsis>
29 <funcprototype>
30 <funcdef>void <function>glClearBufferuiv</function></funcdef>
31 <paramdef>GLenum <parameter>buffer</parameter></paramdef>
32 <paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
33 <paramdef>const GLuint * <parameter>value</parameter></paramdef>
34 </funcprototype>
35 </funcsynopsis>
36 <funcsynopsis>
37 <funcprototype>
38 <funcdef>void <function>glClearBufferfv</function></funcdef>
39 <paramdef>GLenum <parameter>buffer</parameter></paramdef>
40 <paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
41 <paramdef>const GLfloat * <parameter>value</parameter></paramdef>
42 </funcprototype>
43 </funcsynopsis>
44 <funcsynopsis>
45 <funcprototype>
46 <funcdef>void <function>glClearBufferfi</function></funcdef>
47 <paramdef>GLenum <parameter>buffer</parameter></paramdef>
48 <paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
49 <paramdef>GLfloat <parameter>depth</parameter></paramdef>
50 <paramdef>GLint <parameter>stencil</parameter></paramdef>
51 </funcprototype>
52 </funcsynopsis>
53 </refsynopsisdiv>
54 <refsect1 id="parameters"><title>Parameters</title>
55 <variablelist>
56 <varlistentry>
57 <term><parameter>buffer</parameter></term>
58 <listitem>
59 <para>
60 Specify the buffer to clear.
61 </para>
62 </listitem>
63 </varlistentry>
64 <varlistentry>
65 <term><parameter>drawBuffer</parameter></term>
66 <listitem>
67 <para>
68 Specify a particular draw buffer to clear.
69 </para>
70 </listitem>
71 </varlistentry>
72 <varlistentry>
73 <term><parameter>value</parameter></term>
74 <listitem>
75 <para>
76 For color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to.
77 For depth buffers, a pointer to a single depth value to clear the buffer to.
78 For stencil buffers, a pointer to a single stencil value to clear the buffer to.
79 </para>
80 </listitem>
81 </varlistentry>
82 <varlistentry>
83 <term><parameter>depth</parameter></term>
84 <listitem>
85 <para>
86 The value to clear a depth render buffer to.
87 </para>
88 </listitem>
89 </varlistentry>
90 <varlistentry>
91 <term><parameter>stencil</parameter></term>
92 <listitem>
93 <para>
94 The value to clear a stencil render buffer to.
95 </para>
96 </listitem>
97 </varlistentry>
98 </variablelist>
99 </refsect1>
100 <refsect1 id="description"><title>Description</title>
101 <para>
102 <function>glClearBuffer*</function> clears the specified buffer to the specified value(s). If <parameter>buffer</parameter> is
103 <constant>GL_COLOR</constant>, a particular draw buffer <constant>GL_DRAW_BUFFER<parameter>i</parameter></constant> is specified
104 by passing <parameter>i</parameter> as <parameter>drawBuffer</parameter>. In this case, <parameter>value</parameter> points to
105 a four-element vector specifying the R, G, B and A color to clear that draw buffer to. If <parameter>buffer</parameter> is
106 one of <constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
107 or <constant>GL_FRONT_AND_BACK</constant>, identifying multiple buffers, each selected buffer is cleared to the same value.
108 Clamping and conversion for fixed-point color buffers are performed in the same fashion as
109 <citerefentry><refentrytitle>glClearColor</refentrytitle></citerefentry>.
110 </para>
111 <para>
112 If <parameter>buffer</parameter> is <constant>GL_DEPTH</constant>, <parameter>drawBuffer</parameter> must be zero, and <parameter>value</parameter>
113 points to a single value to clear the depth buffer to. Only <function>glClearBufferfv</function> should be used to clear
114 depth buffers. Clamping and conversion for fixed-point depth buffers are performed in the same fashion as
115 <citerefentry><refentrytitle>glClearDepth</refentrytitle></citerefentry>.
116 </para>
117 <para>
118 If <parameter>buffer</parameter> is <constant>GL_STENCIL</constant>, <parameter>drawBuffer</parameter> must be zero, and <parameter>value</parameter>
119 points to a single value to clear the stencil buffer to. Only <function>glClearBufferiv</function> should be used to clear
120 stencil buffers. Masking and type conversion are performed in the same fashion as
121 <citerefentry><refentrytitle>glClearStencil</refentrytitle></citerefentry>.
122 </para>
123 <para>
124 <function>glClearBufferfi</function> may be used to clear the depth and stencil buffers. <parameter>buffer</parameter> must be
125 <constant>GL_DEPTH_STENCIL</constant> and <parameter>drawBuffer</parameter> must be zero. <parameter>depth</parameter> and
126 <parameter>stencil</parameter> are the depth and stencil values, respectively.
127 </para>
128 <para>
129 The result of <function>glClearBuffer</function> is undefined if no conversion between the type of <parameter>value</parameter>
130 and the buffer being cleared is defined. However, this is not an error.
131 </para>
132 </refsect1>
133 <refsect1 id="errors"><title>Errors</title>
134 <para>
135 <constant>GL_INVALID_ENUM</constant> is generated by <function>glClearBufferif</function>, <function>glClearBufferfv</function>
136 and <function>glClearBufferuiv</function> if <parameter>buffer</parameter> is not <constant>GL_COLOR</constant>,
137 <constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
138 <constant>GL_FRONT_AND_BACK</constant>, <constant>GL_DEPTH</constant> or <constant>GL_STENCIL</constant>.
139 </para>
140 <para>
141 <constant>GL_INVALID_ENUM</constant> is generated by <function>glClearBufferfi</function> if <parameter>buffer</parameter>
142 is not <constant>GL_DEPTH_STENCIL</constant>.
143 </para>
144 <para>
145 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>buffer</parameter> is <constant>GL_COLOR</constant>,
146 <constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
147 or <constant>GL_FRONT_AND_BACK</constant> and <parameter>drawBuffer</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.
148 </para>
149 <para>
150 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>buffer</parameter> is <constant>GL_DEPTH</constant>,
151 <constant>GL_STENCIL</constant> or <constant>GL_DEPTH_STENCIL</constant> and <parameter>drawBuffer</parameter> is not zero.
152 </para>
153 </refsect1>
154 <refsect1 id="seealso"><title>See Also</title>
155 <para>
156 <citerefentry><refentrytitle>glClearColor</refentrytitle></citerefentry>,
157 <citerefentry><refentrytitle>glClearDepth</refentrytitle></citerefentry>,
158 <citerefentry><refentrytitle>glClearStencil</refentrytitle></citerefentry>,
159 <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry>
160 </para>
161 </refsect1>
162 <refsect1 id="Copyright"><title>Copyright</title>
163 <para>
164 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
165 This material may be distributed subject to the terms and conditions set forth in
166 the Open Publication License, v 1.0, 8 June 1999.
167 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
168 </para>
169 </refsect1>
170 </refentry>