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">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glClearBuffer
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glClearBuffer
</refname>
17 <refpurpose>clear individual buffers of the currently bound draw framebuffer
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
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>
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>
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>
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>
54 <refsect1 id=
"parameters"><title>Parameters
</title>
57 <term><parameter>buffer
</parameter></term>
60 Specify the buffer to clear.
65 <term><parameter>drawBuffer
</parameter></term>
68 Specify a particular draw buffer to clear.
73 <term><parameter>value
</parameter></term>
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.
83 <term><parameter>depth
</parameter></term>
86 The value to clear a depth render buffer to.
91 <term><parameter>stencil
</parameter></term>
94 The value to clear a stencil render buffer to.
100 <refsect1 id=
"description"><title>Description
</title>
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_DRAWBUFFER
<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>.
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>.
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>.
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.
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.
133 <refsect1 id=
"errors"><title>Errors
</title>
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>.
141 <constant>GL_INVALID_ENUM
</constant> is generated by
<function>glClearBufferfi
</function> if
<parameter>buffer
</parameter>
142 is not
<constant>GL_DEPTH_STENCIL
</constant>.
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>.
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.
154 <refsect1 id=
"seealso"><title>See Also
</title>
156 <citerefentry><refentrytitle>glClearColor
</refentrytitle></citerefentry>,
157 <citerefentry><refentrytitle>glClearDepth
</refentrytitle></citerefentry>,
158 <citerefentry><refentrytitle>glClearStencil
</refentrytitle></citerefentry>,
159 <citerefentry><refentrytitle>glClear
</refentrytitle></citerefentry>
162 <refsect1 id=
"Copyright"><title>Copyright
</title>
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>.