c1688be1893eb62658ec5623cec74802d572461a
[clinton/guile-figl.git] / upstream-man-pages / man4 / xhtml / glCopyBufferSubData.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3 <!-- saved from url=(0013)about:internet -->
4 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glCopyBufferSubData - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glCopyBufferSubData"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glCopyBufferSubData — copy part of the data store of a buffer object to the data store of another buffer object</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glCopyBufferSubData</b>(</code></td><td>GLenum  </td><td><var class="pdparam">readtarget</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">writetarget</var>, </td></tr><tr><td> </td><td>GLintptr  </td><td><var class="pdparam">readoffset</var>, </td></tr><tr><td> </td><td>GLintptr  </td><td><var class="pdparam">writeoffset</var>, </td></tr><tr><td> </td><td>GLsizeiptr  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>readtarget</code></em></span></dt><dd><p>
5 Specifies the target from whose data store data should be read.
6 </p></dd><dt><span class="term"><em class="parameter"><code>writetarget</code></em></span></dt><dd><p>
7 Specifies the target to whose data store data should be written.
8 </p></dd><dt><span class="term"><em class="parameter"><code>readoffset</code></em></span></dt><dd><p>
9 Specifies the offset, in basic machine units, within the data store of <em class="parameter"><code>readtarget</code></em> from which data should be read.
10 </p></dd><dt><span class="term"><em class="parameter"><code>writeoffset</code></em></span></dt><dd><p>
11 Specifies the offset, in basic machine units, within the data store of <em class="parameter"><code>writetarget</code></em> to which data should be written.
12 </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
13 Specifies the size, in basic machine units, of the data to be copied from <em class="parameter"><code>readtarget</code></em> to <em class="parameter"><code>writetarget</code></em>.
14 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
15 <code class="function">glCopyBufferSubData</code> copies part of the data store attached to <em class="parameter"><code>readtarget</code></em> to the
16 data store attached to <em class="parameter"><code>writetarget</code></em>. The number of basic machine units indicated by <em class="parameter"><code>size</code></em>
17 is copied from the source, at offset <em class="parameter"><code>readoffset</code></em> to the destination at <em class="parameter"><code>writeoffset</code></em>,
18 also in basic machine units.
19 </p><p>
20 <em class="parameter"><code>readtarget</code></em> and <em class="parameter"><code>writetarget</code></em> must be <code class="constant">GL_ARRAY_BUFFER</code>,
21 <code class="constant">GL_COPY_READ_BUFFER</code>, <code class="constant">GL_COPY_WRITE_BUFFER</code>, <code class="constant">GL_ELEMENT_ARRAY_BUFFER</code>,
22 <code class="constant">GL_PIXEL_PACK_BUFFER</code>, <code class="constant">GL_PIXEL_UNPACK_BUFFER</code>, <code class="constant">GL_TEXTURE_BUFFER</code>,
23 <code class="constant">GL_TRANSFORM_FEEDBACK_BUFFER</code> or <code class="constant">GL_UNIFORM_BUFFER</code>. Any of these targets may be used,
24 although the targets <code class="constant">GL_COPY_READ_BUFFER</code> and <code class="constant">GL_COPY_WRITE_BUFFER</code> are provided
25 specifically to allow copies between buffers without disturbing other GL state.
26 </p><p>
27 <em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em> and <em class="parameter"><code>size</code></em> must all be greater than or equal to
28 zero. Furthermore, <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> must not exceeed the size of the buffer
29 object bound to <em class="parameter"><code>readtarget</code></em>, and <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> must not exceeed the
30 size of the buffer bound to <em class="parameter"><code>writetarget</code></em>. If the same buffer object is bound to both <em class="parameter"><code>readtarget</code></em>
31 and <em class="parameter"><code>writetarget</code></em>, then the ranges specified by <em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em>
32 and <em class="parameter"><code>size</code></em> must not overlap.
33 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
34 <code class="function">glCopyBufferSubData</code> is available only if the GL version is 3.1 or greater.
35 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
36 <code class="constant">GL_INVALID_VALUE</code> is generated if any of <em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>writeoffset</code></em>
37 or <em class="parameter"><code>size</code></em> is negative, if <em class="parameter"><code>readoffset</code></em> + <em class="parameter"><code>size</code></em> exceeds the
38 size of the buffer object bound to <em class="parameter"><code>readtarget</code></em> or if <em class="parameter"><code>writeoffset</code></em> + <em class="parameter"><code>size</code></em>
39 exceeds the size of the buffer object bound to <em class="parameter"><code>writetarget</code></em>.
40 </p><p>
41 <code class="constant">GL_INVALID_VALUE</code> is generated if the same buffer object is bound to both <em class="parameter"><code>readtarget</code></em>
42 and <em class="parameter"><code>writetarget</code></em> and the ranges [<em class="parameter"><code>readoffset</code></em>, <em class="parameter"><code>readoffset</code></em> +
43 <em class="parameter"><code>size</code></em>) and [<em class="parameter"><code>writeoffset</code></em>, <em class="parameter"><code>writeoffset</code></em> + <em class="parameter"><code>size</code></em>)
44 overlap.
45 </p><p>
46 <code class="constant">GL_INVALID_OPERATION</code> is generated if zero is bound to <em class="parameter"><code>readtarget</code></em> or <em class="parameter"><code>writetarget</code></em>.
47 </p><p>
48 <code class="constant">GL_INVALID_OPERATION</code> is generated if the buffer object bound to either <em class="parameter"><code>readtarget</code></em> or <em class="parameter"><code>writetarget</code></em>
49 is mapped.
50 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
51 <a href="glGenBuffers.xml"><span class="citerefentry"><span class="refentrytitle">glGenBuffers</span></span></a>,
52 <a href="glBindBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>,
53 <a href="glBufferData.xml"><span class="citerefentry"><span class="refentrytitle">glBufferData</span></span></a>,
54 <a href="glBufferSubData.xml"><span class="citerefentry"><span class="refentrytitle">glBufferSubData</span></span></a>,
55 <a href="glGetBufferSubData.xml"><span class="citerefentry"><span class="refentrytitle">glGetBufferSubData</span></span></a>
56 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
57 Copyright <span class="trademark"></span>© 2010 Khronos Group.
58 This material may be distributed subject to the terms and conditions set forth in
59 the Open Publication License, v 1.0, 8 June 1999.
60 <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
61 </p></div></div></body></html>