rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man3 / glCopyBufferSubData.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="glCopyBufferSubData">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2010</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glCopyBufferSubData</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glCopyBufferSubData</refname>
17 <refpurpose>copy part of the data store of a buffer object to the data store of another buffer object</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glCopyBufferSubData</function></funcdef>
23 <paramdef>GLenum <parameter>readtarget</parameter></paramdef>
24 <paramdef>GLenum <parameter>writetarget</parameter></paramdef>
25 <paramdef>GLintptr <parameter>readoffset</parameter></paramdef>
26 <paramdef>GLintptr <parameter>writeoffset</parameter></paramdef>
27 <paramdef>GLsizeiptr <parameter>size</parameter></paramdef>
28 </funcprototype>
29 </funcsynopsis>
30 </refsynopsisdiv>
31 <!-- eqn: ignoring delim $$ -->
32 <refsect1 id="parameters"><title>Parameters</title>
33 <variablelist>
34 <varlistentry>
35 <term><parameter>readtarget</parameter></term>
36 <listitem>
37 <para>
38 Specifies the target from whose data store data should be read.
39 </para>
40 </listitem>
41 </varlistentry>
42 <varlistentry>
43 <term><parameter>writetarget</parameter></term>
44 <listitem>
45 <para>
46 Specifies the target to whose data store data should be written.
47 </para>
48 </listitem>
49 </varlistentry>
50 <varlistentry>
51 <term><parameter>readoffset</parameter></term>
52 <listitem>
53 <para>
54 Specifies the offset, in basic machine units, within the data store of <parameter>readtarget</parameter> from which data should be read.
55 </para>
56 </listitem>
57 </varlistentry>
58 <varlistentry>
59 <term><parameter>writeoffset</parameter></term>
60 <listitem>
61 <para>
62 Specifies the offset, in basic machine units, within the data store of <parameter>writetarget</parameter> to which data should be written.
63 </para>
64 </listitem>
65 </varlistentry>
66 <varlistentry>
67 <term><parameter>size</parameter></term>
68 <listitem>
69 <para>
70 Specifies the size, in basic machine units, of the data to be copied from <parameter>readtarget</parameter> to <parameter>writetarget</parameter>.
71 </para>
72 </listitem>
73 </varlistentry>
74 </variablelist>
75 </refsect1>
76 <refsect1 id="description"><title>Description</title>
77 <para>
78 <function>glCopyBufferSubData</function> copies part of the data store attached to <parameter>readtarget</parameter> to the
79 data store attached to <parameter>writetarget</parameter>. The number of basic machine units indicated by <parameter>size</parameter>
80 is copied from the source, at offset <parameter>readoffset</parameter> to the destination at <parameter>writeoffset</parameter>,
81 also in basic machine units.
82 </para>
83 <para>
84 <parameter>readtarget</parameter> and <parameter>writetarget</parameter> must be <constant>GL_ARRAY_BUFFER</constant>,
85 <constant>GL_COPY_READ_BUFFER</constant>, <constant>GL_COPY_WRITE_BUFFER</constant>, <constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
86 <constant>GL_PIXEL_PACK_BUFFER</constant>, <constant>GL_PIXEL_UNPACK_BUFFER</constant>, <constant>GL_TEXTURE_BUFFER</constant>,
87 <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>. Any of these targets may be used,
88 although the targets <constant>GL_COPY_READ_BUFFER</constant> and <constant>GL_COPY_WRITE_BUFFER</constant> are provided
89 specifically to allow copies between buffers without disturbing other GL state.
90 </para>
91 <para>
92 <parameter>readoffset</parameter>, <parameter>writeoffset</parameter> and <parameter>size</parameter> must all be greater than or equal to
93 zero. Furthermore, <parameter>readoffset</parameter> + <parameter>size</parameter> must not exceeed the size of the buffer
94 object bound to <parameter>readtarget</parameter>, and <parameter>readoffset</parameter> + <parameter>size</parameter> must not exceeed the
95 size of the buffer bound to <parameter>writetarget</parameter>. If the same buffer object is bound to both <parameter>readtarget</parameter>
96 and <parameter>writetarget</parameter>, then the ranges specified by <parameter>readoffset</parameter>, <parameter>writeoffset</parameter>
97 and <parameter>size</parameter> must not overlap.
98 </para>
99 </refsect1>
100 <refsect1 id="notes"><title>Notes</title>
101 <para>
102 <function>glCopyBufferSubData</function> is available only if the GL version is 3.1 or greater.
103 </para>
104 </refsect1>
105 <refsect1 id="errors"><title>Errors</title>
106 <para>
107 <constant>GL_INVALID_VALUE</constant> is generated if any of <parameter>readoffset</parameter>, <parameter>writeoffset</parameter>
108 or <parameter>size</parameter> is negative, if <parameter>readoffset</parameter> + <parameter>size</parameter> exceeds the
109 size of the buffer object bound to <parameter>readtarget</parameter> or if <parameter>writeoffset</parameter> + <parameter>size</parameter>
110 exceeds the size of the buffer object bound to <parameter>writetarget</parameter>.
111 </para>
112 <para>
113 <constant>GL_INVALID_VALUE</constant> is generated if the same buffer object is bound to both <parameter>readtarget</parameter>
114 and <parameter>writetarget</parameter> and the ranges [<parameter>readoffset</parameter>, <parameter>readoffset</parameter> +
115 <parameter>size</parameter>) and [<parameter>writeoffset</parameter>, <parameter>writeoffset</parameter> + <parameter>size</parameter>)
116 overlap.
117 </para>
118 <para>
119 <constant>GL_INVALID_OPERATION</constant> is generated if zero is bound to <parameter>readtarget</parameter> or <parameter>writetarget</parameter>.
120 </para>
121 <para>
122 <constant>GL_INVALID_OPERATION</constant> is generated if the buffer object bound to either <parameter>readtarget</parameter> or <parameter>writetarget</parameter>
123 is mapped.
124 </para>
125 </refsect1>
126 <refsect1 id="seealso"><title>See Also</title>
127 <para>
128 <citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>,
129 <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>,
130 <citerefentry><refentrytitle>glBufferData</refentrytitle></citerefentry>,
131 <citerefentry><refentrytitle>glBufferSubData</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>glGetBufferSubData</refentrytitle></citerefentry>
133 </para>
134 </refsect1>
135 <refsect1 id="Copyright"><title>Copyright</title>
136 <para>
137 Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
138 This material may be distributed subject to the terms and conditions set forth in
139 the Open Publication License, v 1.0, 8 June 1999.
140 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
141 </para>
142 </refsect1>
143 </refentry>