@@ -231,7 +231,8 @@ would block until the value was returned.</p>
231231
232232<p>
233233If you want the Renderscript code to send a value back to the Android framework, use the
234- <code>rsSendToClient()</code> function.
234+ <a href="{@docRoot}reference/renderscript/rs__core_8rsh.html"><code>rsSendToClient()</code></a>
235+ function.
235236</p>
236237
237238<h3 id="var">Variables</h3>
@@ -256,53 +257,6 @@ public long get_unsignedInteger(){
256257}
257258 </pre>
258259
259- <h3 id="pointer">Pointers</h3>
260- <p>Pointers are reflected into the script class itself, located in
261- <code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
262- can declare pointers to a <code>struct</code> or any of the supported Renderscript types, but a
263- <code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
264- following pointers to a <code>struct</code> and <code>int32_t</code></p>
265-
266- <pre>
267- typedef struct Point {
268- float2 point;
269- } Point_t;
270-
271- Point_t *touchPoints;
272- int32_t *intPointer;
273- </pre>
274- <p>then the following code is generated in:</p>
275-
276- <pre>
277- private ScriptField_Point mExportVar_touchPoints;
278- public void bind_touchPoints(ScriptField_Point v) {
279- mExportVar_touchPoints = v;
280- if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
281- else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
282- }
283-
284- public ScriptField_Point get_touchPoints() {
285- return mExportVar_touchPoints;
286- }
287-
288- private Allocation mExportVar_intPointer;
289- public void bind_intPointer(Allocation v) {
290- mExportVar_intPointer = v;
291- if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
292- else bindAllocation(v, mExportVarIdx_intPointer);
293- }
294-
295- public Allocation get_intPointer() {
296- return mExportVar_intPointer;
297- }
298- </pre>
299-
300- <p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
301- (instead of a <code>set()</code> method) is generated. This method allows you to bind the memory
302- that is allocated in the Android VM to the Renderscript runtime (you cannot allocate
303- memory in your <code>.rs</code> file). For more information, see <a href="#memory">Working
304- with Allocated Memory</a>.
305- </p>
306260
307261 <h3 id="struct">Structs</h3>
308262 <p>Structs are reflected into their own classes, located in
@@ -311,7 +265,8 @@ with Allocated Memory</a>.
311265 specified number of <code>struct</code>s. For example, if you declare the following struct:</p>
312266<pre>
313267typedef struct Point {
314- float2 point;
268+ float2 position;
269+ float size;
315270} Point_t;
316271</pre>
317272
@@ -478,7 +433,8 @@ in memory. Each <code>struct</code>'s class defines the following methods and co
478433 </pre>
479434
480435 <p>If you modify the memory in one memory space and want to push the updates to the rest of
481- the memory spaces, call <code>rsgAllocationSyncAll()</code> in your Renderscript code to
436+ the memory spaces, call <a href="{@docRoot}reference/renderscript/rs__graphics_8rsh.html">
437+ <code>rsgAllocationSyncAll()</code></a> in your Renderscript code to
482438 synchronize the memory.</p>
483439 </li>
484440
@@ -511,6 +467,56 @@ Renderscript runtime. When you call a set accessor method on a member, there is
511467properties that are not yet synchronized.</li>
512468 </ul>
513469
470+ <h3 id="pointer">Pointers</h3>
471+ <p>Pointers are reflected into the script class itself, located in
472+ <code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
473+ can declare pointers to a <code>struct</code> or any of the supported Renderscript types, but a
474+ <code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
475+ following pointers to a <code>struct</code> and <code>int32_t</code></p>
476+
477+ <pre>
478+ typedef struct Point {
479+ float2 position;
480+ float size;
481+ } Point_t;
482+
483+ Point_t *touchPoints;
484+ int32_t *intPointer;
485+ </pre>
486+ <p>then the following code is generated in:</p>
487+
488+ <pre>
489+ private ScriptField_Point mExportVar_touchPoints;
490+ public void bind_touchPoints(ScriptField_Point v) {
491+ mExportVar_touchPoints = v;
492+ if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
493+ else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
494+ }
495+
496+ public ScriptField_Point get_touchPoints() {
497+ return mExportVar_touchPoints;
498+ }
499+
500+ private Allocation mExportVar_intPointer;
501+ public void bind_intPointer(Allocation v) {
502+ mExportVar_intPointer = v;
503+ if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
504+ else bindAllocation(v, mExportVarIdx_intPointer);
505+ }
506+
507+ public Allocation get_intPointer() {
508+ return mExportVar_intPointer;
509+ }
510+ </pre>
511+
512+ <p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
513+ (instead of a <code>set()</code> method) is generated. This method allows you to bind the memory
514+ that is allocated in the Android VM to the Renderscript runtime (you cannot allocate
515+ memory in your <code>.rs</code> file). For more information, see <a href="#memory">Working
516+ with Allocated Memory</a>.
517+ </p>
518+
519+
514520 <h2 id="mem-allocation">Memory Allocation APIs</h2>
515521
516522 <p>Applications that use Renderscript still run in the Android VM. The actual Renderscript code, however, runs natively and
@@ -693,7 +699,8 @@ communicated back to the Android framework layer for efficiency purposes. The la
693699that is set from the Android framework is always returned during a call to a <code>get</code>
694700method. However, when Android framework code modifies a variable, that change can be communicated to
695701the Renderscript runtime automatically or synchronized at a later time. If you need to send data
696- from the Renderscript runtime to the Android framework layer, you can use the <code>rsSendToClient()</code> function
702+ from the Renderscript runtime to the Android framework layer, you can use the
703+ <a href="{@docRoot}reference/renderscript/rs__core_8rsh.html"><code>rsSendToClient()</code></a> function
697704to overcome this limitation.
698705</p>
699706<p>When working with dynamically allocated memory, any changes at the Renderscript runtime layer are propagated
0 commit comments