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=
"glClearBufferData">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glClearBufferData
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glClearBufferData
</refname>
17 <refpurpose>fill a buffer object's data store with a fixed value
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glClearBufferData
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLenum
<parameter>internalformat
</parameter></paramdef>
25 <paramdef>GLenum
<parameter>format
</parameter></paramdef>
26 <paramdef>GLenum
<parameter>type
</parameter></paramdef>
27 <paramdef>const void *
<parameter>data
</parameter></paramdef>
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>target
</parameter></term>
37 Specify the target of the operation.
<parameter>target
</parameter> must be
38 one of the global buffer binding targets.
43 <term><parameter>internalformat
</parameter></term>
46 The internal format with which the data will be stored in the buffer object.
51 <term><parameter>size
</parameter></term>
54 The size, in basic machine units of the range of the data store to fill.
59 <term><parameter>format
</parameter></term>
62 The format of the data in memory addressed by
<parameter>data
</parameter>.
67 <term><parameter>type
</parameter></term>
70 The type of the data in memory addressed by
<parameter>data
</parameter>.
75 <term><parameter>data
</parameter></term>
78 The address of a memory location storing the data to be replicated into the
85 <refsect1 id=
"description"><title>Description
</title>
87 <function>glClearBufferData
</function> fills the entirety of a buffer object's
88 data store with data from client memory. Data, initially supplied in a format
89 specified by
<parameter>format
</parameter> in data type
<parameter>type
</parameter> is
90 read from the memory address given by
<parameter>data
</parameter> and converted into
91 the internal representation given by
<parameter>internalforamt
</parameter>.
92 This converted data is then replicated throughout the buffer object's
96 If
<parameter>data
</parameter> is NULL, then the buffer's data store
100 <refsect1 id=
"errors"><title>Errors
</title>
102 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> not one of the generic buffer binding targets.
105 <constant>GL_INVALID_VALUE
</constant> is generated if no buffer is bound to
<parameter>target
</parameter>.
108 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>internalformat
</parameter> is not a sized internal format.
111 <constant>GL_INVALID_OPERATION
</constant> is generated if any part of the buffer's data store is
112 mapped with
<citerefentry><refentrytitle>glMapBufferRange
</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glMapBuffer.
</refentrytitle></citerefentry>
115 <refsect1 id=
"seealso"><title>See Also
</title>
117 <citerefentry><refentrytitle>glClearBufferSubData
</refentrytitle></citerefentry>.
120 <refsect1 id=
"Copyright"><title>Copyright
</title>
122 Copyright
<trademark class=
"copyright"></trademark> 2011-
2012 Khronos Group.
123 This material may be distributed subject to the terms and conditions set forth in
124 the Open Publication License, v
1.0,
8 June
1999.
125 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.