svlad,
Do you mean in simple cases like:
sample.rs
#pragma version(1)
#pragma rs java_package_name(com.yoururl.packagename)
float4 someDataUsedInRs; // floats that we will set from Java and read
back from Java.
void printDataFromRs()
{
someDataUsedInRs.x += 1.0f;
someDataUsedInRs.y += 1.0f;
someDataUsedInRs.z += 1.0f;
someDataUsedInRs.w += 1.0f;
rsDebug("Values of someDataUsedInRs", someDataUsedInRs);
}
In your java code you would have something like:
Float4 valuesToStickIntoRs = new Float4(1.0f, 2.0f, 3.0f, 4.0f);
ScriptC_sample MySampleRenderScript = new ScriptC_sample(rsContext,
rsContext.getResources(), R.raw.sample);
.....
MySampleRenderScript.set_someDataUsedInRs(valuesToStickIntoRs); //
this passes the values into the RenderScript array
MySampleRenderScript.invoke_printDataFromRs();
Float4 afterRunningScript = MySampleRenderScript.get_someDataUsedInRs();
// this returns the modified values form the script
This are different if you are using arrays. Let me know if you need more
info. Also this is SDK 11-13 I have not got RenderScript code working for
SDK 14 yet.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en