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>
68Calls to this function are ignored when <span class="argument">size</span> is 0.
69            </P><P>
70This function generates the following errors.
71<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>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><!-- source                      offset、sizeが負の値の場合、offsetとsizeの和が、元のバッファのサイズを超える場合、dataがNULLの場合 エラーGL_INVALID_VALUEが生成されます。 コマンドリストオブジェクトをバインドしていない状態で呼び出すとエラーGL_INVALID_OPERATIONを生成します。 また、先に呼び出したglBufferDataで、転送処理方法に(NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP)を指定していた場合 エラーGL_INVALID_OPERATIONを生成します。この場合、バッファデータはアプリケーションの管理するメモリ領域にありますので データの更新はAPIを経由せずにアプリケーション側で行ってください。 オブジェクト0がカレントのターゲットにバインドされている場合エラーGL_INVALID_OPERATIONを生成します。glBufferDataを呼び出さずにglBufferSubDataを呼び出した場合エラーGL_INVALID_OPERATIONを生成します。                 --></P></div>
72<h2>Revision History</h2>
73    <div class="section">
74      <dl class="history">
75        <dt>2010/01/07</dt>
76<dd>Initial version.<br />
77        </dd>
78      </dl>
79    </div>
80  <hr><p>CONFIDENTIAL</p></body>
81</html>