1 /* void glDrawArraysIndirect ( GLenum mode, const void *indirect ) */ 2 static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, jlong indirect) { 3 // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer. 4 // GL checks for too-large values. Here we only need to check for successful signed 64-bit 5 // to unsigned 32-bit conversion. 6 if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) { 7 jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large"); 8 return; 9 } 10 glDrawArraysIndirect(mode, (const void*)indirect); 11 } 12 13