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=
"glGetBufferSubData">
9 <holder>Sams Publishing
</holder>
12 <refentrytitle>glGetBufferSubData
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetBufferSubData
</refname>
17 <refpurpose>returns a subset of a buffer object's data store
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetBufferSubData
</function></funcdef>
23 <paramdef>GLenum
<parameter>target
</parameter></paramdef>
24 <paramdef>GLintptr
<parameter>offset
</parameter></paramdef>
25 <paramdef>GLsizeiptr
<parameter>size
</parameter></paramdef>
26 <paramdef>GLvoid *
<parameter>data
</parameter></paramdef>
30 <!-- eqn: ignoring delim $$ -->
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>target
</parameter></term>
37 Specifies the target buffer object.
38 The symbolic constant must be
39 <constant>GL_ARRAY_BUFFER
</constant>,
40 <constant>GL_ATOMIC_COUNTER_BUFFER
</constant>,
41 <constant>GL_COPY_READ_BUFFER
</constant>,
42 <constant>GL_COPY_WRITE_BUFFER
</constant>,
43 <constant>GL_DRAW_INDIRECT_BUFFER
</constant>,
44 <constant>GL_DISPATCH_INDIRECT_BUFFER
</constant>,
45 <constant>GL_ELEMENT_ARRAY_BUFFER
</constant>,
46 <constant>GL_PIXEL_PACK_BUFFER
</constant>,
47 <constant>GL_PIXEL_UNPACK_BUFFER
</constant>,
48 <constant>GL_TEXTURE_BUFFER
</constant>,
49 <constant>GL_TRANSFORM_FEEDBACK_BUFFER
</constant>, or
50 <constant>GL_UNIFORM_BUFFER
</constant>.
55 <term><parameter>offset
</parameter></term>
58 Specifies the offset into the buffer object's data store from which data will be returned,
64 <term><parameter>size
</parameter></term>
67 Specifies the size in bytes of the data store region being returned.
72 <term><parameter>data
</parameter></term>
75 Specifies a pointer to the location where buffer object data is returned.
81 <refsect1 id=
"description"><title>Description
</title>
83 <function>glGetBufferSubData
</function> returns some or all of the data from the buffer object currently
84 bound to
<parameter>target
</parameter>. Data starting at byte offset
<parameter>offset
</parameter> and
85 extending for
<parameter>size
</parameter> bytes is copied from the data store to the memory pointed to by
86 <parameter>data
</parameter>. An error is thrown if the buffer object is currently mapped, or if
87 <parameter>offset
</parameter> and
<parameter>size
</parameter> together define a range beyond the bounds
88 of the buffer object's data store.
91 <refsect1 id=
"notes"><title>Notes
</title>
93 If an error is generated,
94 no change is made to the contents of
<parameter>data
</parameter>.
97 The
<constant>GL_ATOMIC_COUNTER_BUFER
</constant> target is available only if the GL version is
4.2 or greater.
100 The
<constant>GL_DISPATCH_INDIRECT_BUFFER
</constant> target is available only if the GL version is
4.3 or greater.
103 <refsect1 id=
"errors"><title>Errors
</title>
105 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>target
</parameter> is not
106 <constant>GL_ARRAY_BUFFER
</constant>,
<constant>GL_ELEMENT_ARRAY_BUFFER
</constant>,
107 <constant>GL_PIXEL_PACK_BUFFER
</constant>, or
<constant>GL_PIXEL_UNPACK_BUFFER
</constant>.
110 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>offset
</parameter> or
111 <parameter>size
</parameter> is negative, or if together they define a region of memory
112 that extends beyond the buffer object's allocated data store.
115 <constant>GL_INVALID_OPERATION
</constant> is generated if the reserved buffer object name
0 is bound to
<parameter>target
</parameter>.
118 <constant>GL_INVALID_OPERATION
</constant> is generated if the buffer object being queried is mapped.
121 <refsect1 id=
"seealso"><title>See Also
</title>
123 <citerefentry><refentrytitle>glBindBuffer
</refentrytitle></citerefentry>,
124 <citerefentry><refentrytitle>glBufferData
</refentrytitle></citerefentry>,
125 <citerefentry><refentrytitle>glBufferSubData
</refentrytitle></citerefentry>,
126 <citerefentry><refentrytitle>glMapBuffer
</refentrytitle></citerefentry>,
127 <citerefentry><refentrytitle>glUnmapBuffer
</refentrytitle></citerefentry>
130 <refsect1 id=
"Copyright"><title>Copyright
</title>
132 Copyright
<trademark class=
"copyright"></trademark> 2005 Addison-Wesley.
133 This material may be distributed subject to the terms and conditions set forth in
134 the Open Publication License, v
1.0,
8 June
1999.
135 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.