Skip to content

Commit

Permalink
using method 2 for JNI calls
Browse files Browse the repository at this point in the history
  • Loading branch information
johnty committed Oct 28, 2014
1 parent d8af132 commit ea04810
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ofAppAndroidWindow.cpp
Expand Up @@ -596,12 +596,15 @@ Java_cc_openframeworks_OFAndroid_passArray(JNIEnv *env, jclass thiz, jbyteArray
//end method 1
*/



//method 2: with less JNI calls:
jsize len = env->GetArrayLength(a);
jbyte* data = new jbyte[len];
env->GetByteArrayRegion(a, 0, len, data);
androidApp->onArray((char*)data, len);
delete data;

}
}

Expand Down

0 comments on commit ea04810

Please sign in to comment.