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