1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7<title>glBufferSubData</title>
8  </head>
9  <body>
10<h1>glBufferSubData Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14GL_APICALL void GL_APIENTRY glBufferSubData(
15     GLenum target,
16     GLintptr offset,
17     GLsizeiptr size,
18     const void * data
19);
20</pre>
21    </div>
22<h2>Arguments</h2>
23    <div class="section">
24      <table class="arguments">
25        <thead>
26          <tr>
27            <td width="15" />
28<th>Name</th>
29<td>Description</td>
30          </tr>
31        </thead>
32        <tr>
33<td>in</td>
34<th>target</th>
35<td>Target</td>
36        </tr>
37        <tr>
38<td>in</td>
39<th>offset</th>
40<td>Offset (in bytes) to the partial region</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th>size</th>
45<td>Size of the partial region</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th>data</th>
50<td>Pointer to the vertex data</td>
51        </tr> </table>
52    </div>
53<h2>Return Values</h2>
54<div class="section">No values are returned. </div>
55<h2>Description</h2>
56    <div class="section">
57<p>Updates a partial vertex data region in the current vertex buffer object.</p><P>
58Set <span class="argument">target</span> equal to <code>GL_ARRAY_BUFFER</code> or <code>GL_ELEMENT_ARRAY_BUFFER</code>.
59            </P><P>
60Set <span class="argument">offset</span> to the offset of the partial region to update.
61            </P><P>
62Set <span class="argument">size</span> to the size of the partial region.
63            </P><P>
64Set <span class="argument">data</span> to a pointer to the data to update.
65            </P><P>
66The partial region is transferred using the method configured by a previous call to <code>glBufferData</code>. You must call <code>glBufferData</code> to allocate a vertex buffer region before you call this function. A <code>GL_INVALID_OPERATION</code> error occurs when you call <code>glBufferSubData</code> without first calling <code>glBufferData</code>.
67            </P><P>
68If you set <CODE>(NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP)</CODE> using <CODE>glBufferData</CODE> (the value specified in the <SPAN class="argument">target</SPAN> parameter), then the vertex buffer area will be in application memory. As a result, this function will only flush the cache for the partial region, and will not update the data therein. Update the data itself in the application.
69            </P><P>
70Calls to this function are ignored when <span class="argument">size</span> is 0.
71            </P><P>
72If you set <CODE>(NN_GX_MEM_VRAMA{B} | GL_NO_COPY_FCRAM_DMP)</CODE> using this function, then you must guarantee that the area specified in <SPAN class="argument">data</SPAN> will be retained until DMA transfer completes.
73            </P><P>
74This function generates the following errors.
75<TABLE><TR><TH>GL_INVALID_VALUE</TH><TD>The <span class="argument">offset</span> or <span class="argument">size</span> argument is negative; the sum of <span class="argument">offset</span> and <span class="argument">size</span> exceeds the size of the original buffer; or <span class="argument">data</span> is NULL.</TD></TR><TR><TH><CODE>GL_INVALID_VALUE</CODE></TH><TD>If you set <CODE>(NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP)</CODE> using <CODE>glBufferData</CODE>, and the sum of the original buffer address specified in <CODE>glBufferData</CODE> and <SPAN class="argument">offset</SPAN> is not specified in <SPAN class="argument">data</SPAN></TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>This function was called without any command-list objects bound.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>A previous call to <code>glBufferData</code> set the transfer method to <code>(NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP)</code>.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>Object 0 is bound to the current target.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>The <code>glBufferSubData</code> function was called without first calling <code>glBufferData</code>.</TD></TR></TABLE></P></div>
76<h2>Revision History</h2>
77    <div class="section">
78      <dl class="history">
79        <dt>2011/10/03</dt>
80<dd>Added limitations and error conditions due to <CODE>glBufferData</CODE> settings.
81        </dd>
82        <dt>2010/01/07</dt>
83<dd>Initial version.<br />
84        </dd>
85      </dl>
86    </div>
87  <hr><p>CONFIDENTIAL</p></body>
88</html>