Home | History | Annotate | Download | only in gles11
      1 /* void glDrawElementsIndirect ( GLenum mode, GLenum type, const void *indirect ) */
      2 static void android_glDrawElementsIndirect(JNIEnv *_env, jobject, jint mode, jint type, 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     glDrawElementsIndirect(mode, type, (const void*)indirect);
     11 }
     12 
     13