1 /* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
2 static void
android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II(JNIEnv * _env,jobject _this,jint mode,jint count,jint type,jobject indices_buf,jint instanceCount,jint basevertex)3 android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II
4   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount, jint basevertex) {
5     jint _exception = 0;
6     const char * _exceptionType = NULL;
7     const char * _exceptionMessage = NULL;
8     jarray _array = (jarray) 0;
9     jint _bufferOffset = (jint) 0;
10     jint _remaining;
11     void *indices = (void *) 0;
12 
13     indices = (void *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
14     if (_remaining < count-basevertex) {
15         _exception = 1;
16         _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
17         _exceptionMessage = "remaining() < count-basevertex < needed";
18         goto exit;
19     }
20     if (indices == NULL) {
21         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
22         indices = (void *) (_indicesBase + _bufferOffset);
23     }
24     glDrawElementsInstancedBaseVertex(
25         (GLenum)mode,
26         (GLsizei)count,
27         (GLenum)type,
28         (void *)indices,
29         (GLsizei)instanceCount,
30         (GLint) basevertex
31     );
32 
33 exit:
34     if (_array) {
35         releasePointer(_env, _array, indices, JNI_FALSE);
36     }
37 }
38 
39 /* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
40 static void
android_glDrawElementsInstancedBaseVertex__IIIIII(JNIEnv * _env,jobject _this,jint mode,jint count,jint type,jint indicesOffset,jint instanceCount,jint basevertex)41 android_glDrawElementsInstancedBaseVertex__IIIIII
42   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount, jint basevertex) {
43     glDrawElementsInstancedBaseVertex(
44         (GLenum)mode,
45         (GLsizei)count,
46         (GLenum)type,
47         (void *)static_cast<uintptr_t>(indicesOffset),
48         (GLsizei)instanceCount,
49         (GLint)basevertex
50     );
51 }
52