Home | History | Annotate | Download | only in jni
      1 /*
      2 **
      3 ** Copyright 2013, The Android Open Source Project
      4 **
      5 ** Licensed under the Apache License, Version 2.0 (the "License");
      6 ** you may not use this file except in compliance with the License.
      7 ** You may obtain a copy of the License at
      8 **
      9 **     http://www.apache.org/licenses/LICENSE-2.0
     10 **
     11 ** Unless required by applicable law or agreed to in writing, software
     12 ** distributed under the License is distributed on an "AS IS" BASIS,
     13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 ** See the License for the specific language governing permissions and
     15 ** limitations under the License.
     16 */
     17 
     18 // This source file is automatically generated
     19 
     20 #include <GLES3/gl3.h>
     21 #include <GLES3/gl3ext.h>
     22 
     23 #include "jni.h"
     24 #include "JNIHelp.h"
     25 #include <android_runtime/AndroidRuntime.h>
     26 #include <utils/misc.h>
     27 #include <assert.h>
     28 
     29 static int initialized = 0;
     30 
     31 static jclass nioAccessClass;
     32 static jclass bufferClass;
     33 static jmethodID getBasePointerID;
     34 static jmethodID getBaseArrayID;
     35 static jmethodID getBaseArrayOffsetID;
     36 static jfieldID positionID;
     37 static jfieldID limitID;
     38 static jfieldID elementSizeShiftID;
     39 
     40 
     41 /* special calls implemented in Android's GLES wrapper used to more
     42  * efficiently bound-check passed arrays */
     43 extern "C" {
     44 #ifdef GL_VERSION_ES_CM_1_1
     45 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
     46         const GLvoid *ptr, GLsizei count);
     47 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
     48         const GLvoid *pointer, GLsizei count);
     49 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
     50         GLsizei stride, const GLvoid *pointer, GLsizei count);
     51 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
     52         GLsizei stride, const GLvoid *pointer, GLsizei count);
     53 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
     54         GLsizei stride, const GLvoid *pointer, GLsizei count);
     55 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
     56         GLsizei stride, const GLvoid *pointer, GLsizei count);
     57 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
     58         GLsizei stride, const GLvoid *pointer, GLsizei count);
     59 #endif
     60 #ifdef GL_ES_VERSION_2_0
     61 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
     62         GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
     63     glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
     64 }
     65 #endif
     66 #ifdef GL_ES_VERSION_3_0
     67 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
     68         GLsizei stride, const GLvoid *pointer, GLsizei count) {
     69     glVertexAttribIPointer(indx, size, type, stride, pointer);
     70 }
     71 #endif
     72 }
     73 
     74 /* Cache method IDs each time the class is loaded. */
     75 
     76 static void
     77 nativeClassInit(JNIEnv *_env, jclass glImplClass)
     78 {
     79     jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
     80     nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
     81 
     82     jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
     83     bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
     84 
     85     getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
     86             "getBasePointer", "(Ljava/nio/Buffer;)J");
     87     getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
     88             "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
     89     getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
     90             "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
     91 
     92     positionID = _env->GetFieldID(bufferClass, "position", "I");
     93     limitID = _env->GetFieldID(bufferClass, "limit", "I");
     94     elementSizeShiftID =
     95         _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
     96 }
     97 
     98 static void *
     99 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
    100 {
    101     jint position;
    102     jint limit;
    103     jint elementSizeShift;
    104     jlong pointer;
    105 
    106     position = _env->GetIntField(buffer, positionID);
    107     limit = _env->GetIntField(buffer, limitID);
    108     elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
    109     *remaining = (limit - position) << elementSizeShift;
    110     pointer = _env->CallStaticLongMethod(nioAccessClass,
    111             getBasePointerID, buffer);
    112     if (pointer != 0L) {
    113         *array = NULL;
    114         return (void *) (jint) pointer;
    115     }
    116 
    117     *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
    118             getBaseArrayID, buffer);
    119     *offset = _env->CallStaticIntMethod(nioAccessClass,
    120             getBaseArrayOffsetID, buffer);
    121 
    122     return NULL;
    123 }
    124 
    125 static void
    126 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
    127 {
    128     _env->ReleasePrimitiveArrayCritical(array, data,
    129                        commit ? 0 : JNI_ABORT);
    130 }
    131 
    132 static void *
    133 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
    134     char* buf = (char*) _env->GetDirectBufferAddress(buffer);
    135     if (buf) {
    136         jint position = _env->GetIntField(buffer, positionID);
    137         jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
    138         buf += position << elementSizeShift;
    139     } else {
    140         jniThrowException(_env, "java/lang/IllegalArgumentException",
    141                           "Must use a native order direct Buffer");
    142     }
    143     return (void*) buf;
    144 }
    145 
    146 // --------------------------------------------------------------------------
    147 
    148 /*
    149  * returns the number of values glGet returns for a given pname.
    150  *
    151  * The code below is written such that pnames requiring only one values
    152  * are the default (and are not explicitely tested for). This makes the
    153  * checking code much shorter/readable/efficient.
    154  *
    155  * This means that unknown pnames (e.g.: extensions) will default to 1. If
    156  * that unknown pname needs more than 1 value, then the validation check
    157  * is incomplete and the app may crash if it passed the wrong number params.
    158  */
    159 static int getNeededCount(GLint pname) {
    160     int needed = 1;
    161 #ifdef GL_ES_VERSION_2_0
    162     // GLES 2.x pnames
    163     switch (pname) {
    164         case GL_ALIASED_LINE_WIDTH_RANGE:
    165         case GL_ALIASED_POINT_SIZE_RANGE:
    166             needed = 2;
    167             break;
    168 
    169         case GL_BLEND_COLOR:
    170         case GL_COLOR_CLEAR_VALUE:
    171         case GL_COLOR_WRITEMASK:
    172         case GL_SCISSOR_BOX:
    173         case GL_VIEWPORT:
    174             needed = 4;
    175             break;
    176 
    177         case GL_COMPRESSED_TEXTURE_FORMATS:
    178             glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
    179             break;
    180 
    181         case GL_SHADER_BINARY_FORMATS:
    182             glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
    183             break;
    184     }
    185 #endif
    186 
    187 #ifdef GL_VERSION_ES_CM_1_1
    188     // GLES 1.x pnames
    189     switch (pname) {
    190         case GL_ALIASED_LINE_WIDTH_RANGE:
    191         case GL_ALIASED_POINT_SIZE_RANGE:
    192         case GL_DEPTH_RANGE:
    193         case GL_SMOOTH_LINE_WIDTH_RANGE:
    194         case GL_SMOOTH_POINT_SIZE_RANGE:
    195             needed = 2;
    196             break;
    197 
    198         case GL_CURRENT_NORMAL:
    199         case GL_POINT_DISTANCE_ATTENUATION:
    200             needed = 3;
    201             break;
    202 
    203         case GL_COLOR_CLEAR_VALUE:
    204         case GL_COLOR_WRITEMASK:
    205         case GL_CURRENT_COLOR:
    206         case GL_CURRENT_TEXTURE_COORDS:
    207         case GL_FOG_COLOR:
    208         case GL_LIGHT_MODEL_AMBIENT:
    209         case GL_SCISSOR_BOX:
    210         case GL_VIEWPORT:
    211             needed = 4;
    212             break;
    213 
    214         case GL_MODELVIEW_MATRIX:
    215         case GL_PROJECTION_MATRIX:
    216         case GL_TEXTURE_MATRIX:
    217             needed = 16;
    218             break;
    219 
    220         case GL_COMPRESSED_TEXTURE_FORMATS:
    221             glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
    222             break;
    223     }
    224 #endif
    225     return needed;
    226 }
    227 
    228 template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
    229 static void
    230 get
    231   (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
    232     jint _exception = 0;
    233     const char * _exceptionType;
    234     const char * _exceptionMessage;
    235     CTYPE *params_base = (CTYPE *) 0;
    236     jint _remaining;
    237     CTYPE *params = (CTYPE *) 0;
    238     int _needed = 0;
    239 
    240     if (!params_ref) {
    241         _exception = 1;
    242         _exceptionType = "java/lang/IllegalArgumentException";
    243         _exceptionMessage = "params == null";
    244         goto exit;
    245     }
    246     if (offset < 0) {
    247         _exception = 1;
    248         _exceptionType = "java/lang/IllegalArgumentException";
    249         _exceptionMessage = "offset < 0";
    250         goto exit;
    251     }
    252     _remaining = _env->GetArrayLength(params_ref) - offset;
    253     _needed = getNeededCount(pname);
    254     // if we didn't find this pname, we just assume the user passed
    255     // an array of the right size -- this might happen with extensions
    256     // or if we forget an enum here.
    257     if (_remaining < _needed) {
    258         _exception = 1;
    259         _exceptionType = "java/lang/IllegalArgumentException";
    260         _exceptionMessage = "length - offset < needed";
    261         goto exit;
    262     }
    263     params_base = (CTYPE *)
    264         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
    265     params = params_base + offset;
    266 
    267     GET(
    268         (GLenum)pname,
    269         (CTYPE *)params
    270     );
    271 
    272 exit:
    273     if (params_base) {
    274         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
    275             _exception ? JNI_ABORT: 0);
    276     }
    277     if (_exception) {
    278         jniThrowException(_env, _exceptionType, _exceptionMessage);
    279     }
    280 }
    281 
    282 
    283 template <typename CTYPE, void GET(GLenum, CTYPE*)>
    284 static void
    285 getarray
    286   (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
    287     jint _exception = 0;
    288     const char * _exceptionType;
    289     const char * _exceptionMessage;
    290     jarray _array = (jarray) 0;
    291     jint _bufferOffset = (jint) 0;
    292     jint _remaining;
    293     CTYPE *params = (CTYPE *) 0;
    294     int _needed = 0;
    295 
    296     params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
    297     _remaining /= sizeof(CTYPE);    // convert from bytes to item count
    298     _needed = getNeededCount(pname);
    299     // if we didn't find this pname, we just assume the user passed
    300     // an array of the right size -- this might happen with extensions
    301     // or if we forget an enum here.
    302     if (_needed>0 && _remaining < _needed) {
    303         _exception = 1;
    304         _exceptionType = "java/lang/IllegalArgumentException";
    305         _exceptionMessage = "remaining() < needed";
    306         goto exit;
    307     }
    308     if (params == NULL) {
    309         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    310         params = (CTYPE *) (_paramsBase + _bufferOffset);
    311     }
    312     GET(
    313         (GLenum)pname,
    314         (CTYPE *)params
    315     );
    316 
    317 exit:
    318     if (_array) {
    319         releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
    320     }
    321     if (_exception) {
    322         jniThrowException(_env, _exceptionType, _exceptionMessage);
    323     }
    324 }
    325 
    326 // --------------------------------------------------------------------------
    327 /* void glReadBuffer ( GLenum mode ) */
    328 static void
    329 android_glReadBuffer__I
    330   (JNIEnv *_env, jobject _this, jint mode) {
    331     glReadBuffer(
    332         (GLenum)mode
    333     );
    334 }
    335 
    336 /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
    337 static void
    338 android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
    339   (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
    340     jarray _array = (jarray) 0;
    341     jint _bufferOffset = (jint) 0;
    342     jint _remaining;
    343     GLvoid *indices = (GLvoid *) 0;
    344 
    345     indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
    346     if (indices == NULL) {
    347         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    348         indices = (GLvoid *) (_indicesBase + _bufferOffset);
    349     }
    350     glDrawRangeElements(
    351         (GLenum)mode,
    352         (GLuint)start,
    353         (GLuint)end,
    354         (GLsizei)count,
    355         (GLenum)type,
    356         (GLvoid *)indices
    357     );
    358     if (_array) {
    359         releasePointer(_env, _array, indices, JNI_FALSE);
    360     }
    361 }
    362 
    363 /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
    364 static void
    365 android_glDrawRangeElements__IIIIII
    366   (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
    367     glDrawRangeElements(
    368         (GLenum)mode,
    369         (GLuint)start,
    370         (GLuint)end,
    371         (GLsizei)count,
    372         (GLenum)type,
    373         (GLvoid *)offset
    374     );
    375 }
    376 
    377 /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
    378 static void
    379 android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
    380   (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jobject pixels_buf) {
    381     jarray _array = (jarray) 0;
    382     jint _bufferOffset = (jint) 0;
    383     jint _remaining;
    384     GLvoid *pixels = (GLvoid *) 0;
    385 
    386     pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
    387     if (pixels == NULL) {
    388         char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    389         pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
    390     }
    391     glTexImage3D(
    392         (GLenum)target,
    393         (GLint)level,
    394         (GLint)internalformat,
    395         (GLsizei)width,
    396         (GLsizei)height,
    397         (GLsizei)depth,
    398         (GLint)border,
    399         (GLenum)format,
    400         (GLenum)type,
    401         (GLvoid *)pixels
    402     );
    403     if (_array) {
    404         releasePointer(_env, _array, pixels, JNI_FALSE);
    405     }
    406 }
    407 
    408 /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
    409 static void
    410 android_glTexImage3D__IIIIIIIIII
    411   (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
    412     glTexImage3D(
    413         (GLenum)target,
    414         (GLint)level,
    415         (GLint)internalformat,
    416         (GLsizei)width,
    417         (GLsizei)height,
    418         (GLsizei)depth,
    419         (GLint)border,
    420         (GLenum)format,
    421         (GLenum)type,
    422         (GLvoid *)offset
    423     );
    424 }
    425 
    426 /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) */
    427 static void
    428 android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
    429   (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jobject pixels_buf) {
    430     jarray _array = (jarray) 0;
    431     jint _bufferOffset = (jint) 0;
    432     jint _remaining;
    433     GLvoid *pixels = (GLvoid *) 0;
    434 
    435     pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
    436     if (pixels == NULL) {
    437         char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    438         pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
    439     }
    440     glTexSubImage3D(
    441         (GLenum)target,
    442         (GLint)level,
    443         (GLint)xoffset,
    444         (GLint)yoffset,
    445         (GLint)zoffset,
    446         (GLsizei)width,
    447         (GLsizei)height,
    448         (GLsizei)depth,
    449         (GLenum)format,
    450         (GLenum)type,
    451         (GLvoid *)pixels
    452     );
    453     if (_array) {
    454         releasePointer(_env, _array, pixels, JNI_FALSE);
    455     }
    456 }
    457 
    458 /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
    459 static void
    460 android_glTexSubImage3D__IIIIIIIIIII
    461   (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint offset) {
    462     glTexSubImage3D(
    463         (GLenum)target,
    464         (GLint)level,
    465         (GLint)xoffset,
    466         (GLint)yoffset,
    467         (GLint)zoffset,
    468         (GLsizei)width,
    469         (GLsizei)height,
    470         (GLsizei)depth,
    471         (GLenum)format,
    472         (GLenum)type,
    473         (GLvoid *)offset
    474     );
    475 }
    476 
    477 /* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
    478 static void
    479 android_glCopyTexSubImage3D__IIIIIIIII
    480   (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
    481     glCopyTexSubImage3D(
    482         (GLenum)target,
    483         (GLint)level,
    484         (GLint)xoffset,
    485         (GLint)yoffset,
    486         (GLint)zoffset,
    487         (GLint)x,
    488         (GLint)y,
    489         (GLsizei)width,
    490         (GLsizei)height
    491     );
    492 }
    493 
    494 /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
    495 static void
    496 android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
    497   (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jobject data_buf) {
    498     jarray _array = (jarray) 0;
    499     jint _bufferOffset = (jint) 0;
    500     jint _remaining;
    501     GLvoid *data = (GLvoid *) 0;
    502 
    503     data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
    504     if (data == NULL) {
    505         char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    506         data = (GLvoid *) (_dataBase + _bufferOffset);
    507     }
    508     glCompressedTexImage3D(
    509         (GLenum)target,
    510         (GLint)level,
    511         (GLenum)internalformat,
    512         (GLsizei)width,
    513         (GLsizei)height,
    514         (GLsizei)depth,
    515         (GLint)border,
    516         (GLsizei)imageSize,
    517         (GLvoid *)data
    518     );
    519     if (_array) {
    520         releasePointer(_env, _array, data, JNI_FALSE);
    521     }
    522 }
    523 
    524 /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
    525 static void
    526 android_glCompressedTexImage3D__IIIIIIIII
    527   (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
    528     glCompressedTexImage3D(
    529         (GLenum)target,
    530         (GLint)level,
    531         (GLenum)internalformat,
    532         (GLsizei)width,
    533         (GLsizei)height,
    534         (GLsizei)depth,
    535         (GLint)border,
    536         (GLsizei)imageSize,
    537         (GLvoid *)offset
    538     );
    539 }
    540 
    541 /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) */
    542 static void
    543 android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
    544   (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jobject data_buf) {
    545     jarray _array = (jarray) 0;
    546     jint _bufferOffset = (jint) 0;
    547     jint _remaining;
    548     GLvoid *data = (GLvoid *) 0;
    549 
    550     data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
    551     if (data == NULL) {
    552         char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    553         data = (GLvoid *) (_dataBase + _bufferOffset);
    554     }
    555     glCompressedTexSubImage3D(
    556         (GLenum)target,
    557         (GLint)level,
    558         (GLint)xoffset,
    559         (GLint)yoffset,
    560         (GLint)zoffset,
    561         (GLsizei)width,
    562         (GLsizei)height,
    563         (GLsizei)depth,
    564         (GLenum)format,
    565         (GLsizei)imageSize,
    566         (GLvoid *)data
    567     );
    568     if (_array) {
    569         releasePointer(_env, _array, data, JNI_FALSE);
    570     }
    571 }
    572 
    573 /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
    574 static void
    575 android_glCompressedTexSubImage3D__IIIIIIIIIII
    576   (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jint offset) {
    577     glCompressedTexSubImage3D(
    578         (GLenum)target,
    579         (GLint)level,
    580         (GLint)xoffset,
    581         (GLint)yoffset,
    582         (GLint)zoffset,
    583         (GLsizei)width,
    584         (GLsizei)height,
    585         (GLsizei)depth,
    586         (GLenum)format,
    587         (GLsizei)imageSize,
    588         (GLvoid *)offset
    589     );
    590 }
    591 
    592 /* void glGenQueries ( GLsizei n, GLuint *ids ) */
    593 static void
    594 android_glGenQueries__I_3II
    595   (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
    596     jint _exception = 0;
    597     const char * _exceptionType = NULL;
    598     const char * _exceptionMessage = NULL;
    599     GLuint *ids_base = (GLuint *) 0;
    600     jint _remaining;
    601     GLuint *ids = (GLuint *) 0;
    602 
    603     if (!ids_ref) {
    604         _exception = 1;
    605         _exceptionType = "java/lang/IllegalArgumentException";
    606         _exceptionMessage = "ids == null";
    607         goto exit;
    608     }
    609     if (offset < 0) {
    610         _exception = 1;
    611         _exceptionType = "java/lang/IllegalArgumentException";
    612         _exceptionMessage = "offset < 0";
    613         goto exit;
    614     }
    615     _remaining = _env->GetArrayLength(ids_ref) - offset;
    616     ids_base = (GLuint *)
    617         _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0);
    618     ids = ids_base + offset;
    619 
    620     glGenQueries(
    621         (GLsizei)n,
    622         (GLuint *)ids
    623     );
    624 
    625 exit:
    626     if (ids_base) {
    627         _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base,
    628             _exception ? JNI_ABORT: 0);
    629     }
    630     if (_exception) {
    631         jniThrowException(_env, _exceptionType, _exceptionMessage);
    632     }
    633 }
    634 
    635 /* void glGenQueries ( GLsizei n, GLuint *ids ) */
    636 static void
    637 android_glGenQueries__ILjava_nio_IntBuffer_2
    638   (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
    639     jarray _array = (jarray) 0;
    640     jint _bufferOffset = (jint) 0;
    641     jint _remaining;
    642     GLuint *ids = (GLuint *) 0;
    643 
    644     ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset);
    645     if (ids == NULL) {
    646         char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    647         ids = (GLuint *) (_idsBase + _bufferOffset);
    648     }
    649     glGenQueries(
    650         (GLsizei)n,
    651         (GLuint *)ids
    652     );
    653     if (_array) {
    654         releasePointer(_env, _array, ids, JNI_TRUE);
    655     }
    656 }
    657 
    658 /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
    659 static void
    660 android_glDeleteQueries__I_3II
    661   (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
    662     jint _exception = 0;
    663     const char * _exceptionType = NULL;
    664     const char * _exceptionMessage = NULL;
    665     GLuint *ids_base = (GLuint *) 0;
    666     jint _remaining;
    667     GLuint *ids = (GLuint *) 0;
    668 
    669     if (!ids_ref) {
    670         _exception = 1;
    671         _exceptionType = "java/lang/IllegalArgumentException";
    672         _exceptionMessage = "ids == null";
    673         goto exit;
    674     }
    675     if (offset < 0) {
    676         _exception = 1;
    677         _exceptionType = "java/lang/IllegalArgumentException";
    678         _exceptionMessage = "offset < 0";
    679         goto exit;
    680     }
    681     _remaining = _env->GetArrayLength(ids_ref) - offset;
    682     ids_base = (GLuint *)
    683         _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0);
    684     ids = ids_base + offset;
    685 
    686     glDeleteQueries(
    687         (GLsizei)n,
    688         (GLuint *)ids
    689     );
    690 
    691 exit:
    692     if (ids_base) {
    693         _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base,
    694             JNI_ABORT);
    695     }
    696     if (_exception) {
    697         jniThrowException(_env, _exceptionType, _exceptionMessage);
    698     }
    699 }
    700 
    701 /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
    702 static void
    703 android_glDeleteQueries__ILjava_nio_IntBuffer_2
    704   (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
    705     jarray _array = (jarray) 0;
    706     jint _bufferOffset = (jint) 0;
    707     jint _remaining;
    708     GLuint *ids = (GLuint *) 0;
    709 
    710     ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset);
    711     if (ids == NULL) {
    712         char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    713         ids = (GLuint *) (_idsBase + _bufferOffset);
    714     }
    715     glDeleteQueries(
    716         (GLsizei)n,
    717         (GLuint *)ids
    718     );
    719     if (_array) {
    720         releasePointer(_env, _array, ids, JNI_FALSE);
    721     }
    722 }
    723 
    724 /* GLboolean glIsQuery ( GLuint id ) */
    725 static jboolean
    726 android_glIsQuery__I
    727   (JNIEnv *_env, jobject _this, jint id) {
    728     GLboolean _returnValue;
    729     _returnValue = glIsQuery(
    730         (GLuint)id
    731     );
    732     return (jboolean)_returnValue;
    733 }
    734 
    735 /* void glBeginQuery ( GLenum target, GLuint id ) */
    736 static void
    737 android_glBeginQuery__II
    738   (JNIEnv *_env, jobject _this, jint target, jint id) {
    739     glBeginQuery(
    740         (GLenum)target,
    741         (GLuint)id
    742     );
    743 }
    744 
    745 /* void glEndQuery ( GLenum target ) */
    746 static void
    747 android_glEndQuery__I
    748   (JNIEnv *_env, jobject _this, jint target) {
    749     glEndQuery(
    750         (GLenum)target
    751     );
    752 }
    753 
    754 /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
    755 static void
    756 android_glGetQueryiv__II_3II
    757   (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
    758     jint _exception = 0;
    759     const char * _exceptionType = NULL;
    760     const char * _exceptionMessage = NULL;
    761     GLint *params_base = (GLint *) 0;
    762     jint _remaining;
    763     GLint *params = (GLint *) 0;
    764 
    765     if (!params_ref) {
    766         _exception = 1;
    767         _exceptionType = "java/lang/IllegalArgumentException";
    768         _exceptionMessage = "params == null";
    769         goto exit;
    770     }
    771     if (offset < 0) {
    772         _exception = 1;
    773         _exceptionType = "java/lang/IllegalArgumentException";
    774         _exceptionMessage = "offset < 0";
    775         goto exit;
    776     }
    777     _remaining = _env->GetArrayLength(params_ref) - offset;
    778     params_base = (GLint *)
    779         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
    780     params = params_base + offset;
    781 
    782     glGetQueryiv(
    783         (GLenum)target,
    784         (GLenum)pname,
    785         (GLint *)params
    786     );
    787 
    788 exit:
    789     if (params_base) {
    790         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
    791             _exception ? JNI_ABORT: 0);
    792     }
    793     if (_exception) {
    794         jniThrowException(_env, _exceptionType, _exceptionMessage);
    795     }
    796 }
    797 
    798 /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
    799 static void
    800 android_glGetQueryiv__IILjava_nio_IntBuffer_2
    801   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
    802     jarray _array = (jarray) 0;
    803     jint _bufferOffset = (jint) 0;
    804     jint _remaining;
    805     GLint *params = (GLint *) 0;
    806 
    807     params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
    808     if (params == NULL) {
    809         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    810         params = (GLint *) (_paramsBase + _bufferOffset);
    811     }
    812     glGetQueryiv(
    813         (GLenum)target,
    814         (GLenum)pname,
    815         (GLint *)params
    816     );
    817     if (_array) {
    818         releasePointer(_env, _array, params, JNI_TRUE);
    819     }
    820 }
    821 
    822 /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
    823 static void
    824 android_glGetQueryObjectuiv__II_3II
    825   (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
    826     jint _exception = 0;
    827     const char * _exceptionType = NULL;
    828     const char * _exceptionMessage = NULL;
    829     GLuint *params_base = (GLuint *) 0;
    830     jint _remaining;
    831     GLuint *params = (GLuint *) 0;
    832 
    833     if (!params_ref) {
    834         _exception = 1;
    835         _exceptionType = "java/lang/IllegalArgumentException";
    836         _exceptionMessage = "params == null";
    837         goto exit;
    838     }
    839     if (offset < 0) {
    840         _exception = 1;
    841         _exceptionType = "java/lang/IllegalArgumentException";
    842         _exceptionMessage = "offset < 0";
    843         goto exit;
    844     }
    845     _remaining = _env->GetArrayLength(params_ref) - offset;
    846     params_base = (GLuint *)
    847         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
    848     params = params_base + offset;
    849 
    850     glGetQueryObjectuiv(
    851         (GLuint)id,
    852         (GLenum)pname,
    853         (GLuint *)params
    854     );
    855 
    856 exit:
    857     if (params_base) {
    858         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
    859             _exception ? JNI_ABORT: 0);
    860     }
    861     if (_exception) {
    862         jniThrowException(_env, _exceptionType, _exceptionMessage);
    863     }
    864 }
    865 
    866 /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
    867 static void
    868 android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
    869   (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
    870     jarray _array = (jarray) 0;
    871     jint _bufferOffset = (jint) 0;
    872     jint _remaining;
    873     GLuint *params = (GLuint *) 0;
    874 
    875     params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
    876     if (params == NULL) {
    877         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    878         params = (GLuint *) (_paramsBase + _bufferOffset);
    879     }
    880     glGetQueryObjectuiv(
    881         (GLuint)id,
    882         (GLenum)pname,
    883         (GLuint *)params
    884     );
    885     if (_array) {
    886         releasePointer(_env, _array, params, JNI_TRUE);
    887     }
    888 }
    889 
    890 /* GLboolean glUnmapBuffer ( GLenum target ) */
    891 static jboolean
    892 android_glUnmapBuffer__I
    893   (JNIEnv *_env, jobject _this, jint target) {
    894     GLboolean _returnValue;
    895     _returnValue = glUnmapBuffer(
    896         (GLenum)target
    897     );
    898     return (jboolean)_returnValue;
    899 }
    900 
    901 /* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
    902 static jobject
    903 android_glGetBufferPointerv__II
    904   (JNIEnv *_env, jobject _this, jint target, jint pname) {
    905     GLint64 _mapLength;
    906     GLvoid* _p;
    907     glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
    908     glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
    909     return _env->NewDirectByteBuffer(_p, _mapLength);
    910 }
    911 
    912 /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
    913 static void
    914 android_glDrawBuffers__I_3II
    915   (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
    916     jint _exception = 0;
    917     const char * _exceptionType = NULL;
    918     const char * _exceptionMessage = NULL;
    919     GLenum *bufs_base = (GLenum *) 0;
    920     jint _remaining;
    921     GLenum *bufs = (GLenum *) 0;
    922 
    923     if (!bufs_ref) {
    924         _exception = 1;
    925         _exceptionType = "java/lang/IllegalArgumentException";
    926         _exceptionMessage = "bufs == null";
    927         goto exit;
    928     }
    929     if (offset < 0) {
    930         _exception = 1;
    931         _exceptionType = "java/lang/IllegalArgumentException";
    932         _exceptionMessage = "offset < 0";
    933         goto exit;
    934     }
    935     _remaining = _env->GetArrayLength(bufs_ref) - offset;
    936     bufs_base = (GLenum *)
    937         _env->GetPrimitiveArrayCritical(bufs_ref, (jboolean *)0);
    938     bufs = bufs_base + offset;
    939 
    940     glDrawBuffers(
    941         (GLsizei)n,
    942         (GLenum *)bufs
    943     );
    944 
    945 exit:
    946     if (bufs_base) {
    947         _env->ReleasePrimitiveArrayCritical(bufs_ref, bufs_base,
    948             JNI_ABORT);
    949     }
    950     if (_exception) {
    951         jniThrowException(_env, _exceptionType, _exceptionMessage);
    952     }
    953 }
    954 
    955 /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
    956 static void
    957 android_glDrawBuffers__ILjava_nio_IntBuffer_2
    958   (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
    959     jarray _array = (jarray) 0;
    960     jint _bufferOffset = (jint) 0;
    961     jint _remaining;
    962     GLenum *bufs = (GLenum *) 0;
    963 
    964     bufs = (GLenum *)getPointer(_env, bufs_buf, &_array, &_remaining, &_bufferOffset);
    965     if (bufs == NULL) {
    966         char * _bufsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    967         bufs = (GLenum *) (_bufsBase + _bufferOffset);
    968     }
    969     glDrawBuffers(
    970         (GLsizei)n,
    971         (GLenum *)bufs
    972     );
    973     if (_array) {
    974         releasePointer(_env, _array, bufs, JNI_FALSE);
    975     }
    976 }
    977 
    978 /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
    979 static void
    980 android_glUniformMatrix2x3fv__IIZ_3FI
    981   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
    982     jint _exception = 0;
    983     const char * _exceptionType = NULL;
    984     const char * _exceptionMessage = NULL;
    985     GLfloat *value_base = (GLfloat *) 0;
    986     jint _remaining;
    987     GLfloat *value = (GLfloat *) 0;
    988 
    989     if (!value_ref) {
    990         _exception = 1;
    991         _exceptionType = "java/lang/IllegalArgumentException";
    992         _exceptionMessage = "value == null";
    993         goto exit;
    994     }
    995     if (offset < 0) {
    996         _exception = 1;
    997         _exceptionType = "java/lang/IllegalArgumentException";
    998         _exceptionMessage = "offset < 0";
    999         goto exit;
   1000     }
   1001     _remaining = _env->GetArrayLength(value_ref) - offset;
   1002     value_base = (GLfloat *)
   1003         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1004     value = value_base + offset;
   1005 
   1006     glUniformMatrix2x3fv(
   1007         (GLint)location,
   1008         (GLsizei)count,
   1009         (GLboolean)transpose,
   1010         (GLfloat *)value
   1011     );
   1012 
   1013 exit:
   1014     if (value_base) {
   1015         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1016             JNI_ABORT);
   1017     }
   1018     if (_exception) {
   1019         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1020     }
   1021 }
   1022 
   1023 /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1024 static void
   1025 android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
   1026   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1027     jarray _array = (jarray) 0;
   1028     jint _bufferOffset = (jint) 0;
   1029     jint _remaining;
   1030     GLfloat *value = (GLfloat *) 0;
   1031 
   1032     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1033     if (value == NULL) {
   1034         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1035         value = (GLfloat *) (_valueBase + _bufferOffset);
   1036     }
   1037     glUniformMatrix2x3fv(
   1038         (GLint)location,
   1039         (GLsizei)count,
   1040         (GLboolean)transpose,
   1041         (GLfloat *)value
   1042     );
   1043     if (_array) {
   1044         releasePointer(_env, _array, value, JNI_FALSE);
   1045     }
   1046 }
   1047 
   1048 /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1049 static void
   1050 android_glUniformMatrix3x2fv__IIZ_3FI
   1051   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
   1052     jint _exception = 0;
   1053     const char * _exceptionType = NULL;
   1054     const char * _exceptionMessage = NULL;
   1055     GLfloat *value_base = (GLfloat *) 0;
   1056     jint _remaining;
   1057     GLfloat *value = (GLfloat *) 0;
   1058 
   1059     if (!value_ref) {
   1060         _exception = 1;
   1061         _exceptionType = "java/lang/IllegalArgumentException";
   1062         _exceptionMessage = "value == null";
   1063         goto exit;
   1064     }
   1065     if (offset < 0) {
   1066         _exception = 1;
   1067         _exceptionType = "java/lang/IllegalArgumentException";
   1068         _exceptionMessage = "offset < 0";
   1069         goto exit;
   1070     }
   1071     _remaining = _env->GetArrayLength(value_ref) - offset;
   1072     value_base = (GLfloat *)
   1073         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1074     value = value_base + offset;
   1075 
   1076     glUniformMatrix3x2fv(
   1077         (GLint)location,
   1078         (GLsizei)count,
   1079         (GLboolean)transpose,
   1080         (GLfloat *)value
   1081     );
   1082 
   1083 exit:
   1084     if (value_base) {
   1085         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1086             JNI_ABORT);
   1087     }
   1088     if (_exception) {
   1089         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1090     }
   1091 }
   1092 
   1093 /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1094 static void
   1095 android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
   1096   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1097     jarray _array = (jarray) 0;
   1098     jint _bufferOffset = (jint) 0;
   1099     jint _remaining;
   1100     GLfloat *value = (GLfloat *) 0;
   1101 
   1102     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1103     if (value == NULL) {
   1104         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1105         value = (GLfloat *) (_valueBase + _bufferOffset);
   1106     }
   1107     glUniformMatrix3x2fv(
   1108         (GLint)location,
   1109         (GLsizei)count,
   1110         (GLboolean)transpose,
   1111         (GLfloat *)value
   1112     );
   1113     if (_array) {
   1114         releasePointer(_env, _array, value, JNI_FALSE);
   1115     }
   1116 }
   1117 
   1118 /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1119 static void
   1120 android_glUniformMatrix2x4fv__IIZ_3FI
   1121   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
   1122     jint _exception = 0;
   1123     const char * _exceptionType = NULL;
   1124     const char * _exceptionMessage = NULL;
   1125     GLfloat *value_base = (GLfloat *) 0;
   1126     jint _remaining;
   1127     GLfloat *value = (GLfloat *) 0;
   1128 
   1129     if (!value_ref) {
   1130         _exception = 1;
   1131         _exceptionType = "java/lang/IllegalArgumentException";
   1132         _exceptionMessage = "value == null";
   1133         goto exit;
   1134     }
   1135     if (offset < 0) {
   1136         _exception = 1;
   1137         _exceptionType = "java/lang/IllegalArgumentException";
   1138         _exceptionMessage = "offset < 0";
   1139         goto exit;
   1140     }
   1141     _remaining = _env->GetArrayLength(value_ref) - offset;
   1142     value_base = (GLfloat *)
   1143         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1144     value = value_base + offset;
   1145 
   1146     glUniformMatrix2x4fv(
   1147         (GLint)location,
   1148         (GLsizei)count,
   1149         (GLboolean)transpose,
   1150         (GLfloat *)value
   1151     );
   1152 
   1153 exit:
   1154     if (value_base) {
   1155         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1156             JNI_ABORT);
   1157     }
   1158     if (_exception) {
   1159         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1160     }
   1161 }
   1162 
   1163 /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1164 static void
   1165 android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
   1166   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1167     jarray _array = (jarray) 0;
   1168     jint _bufferOffset = (jint) 0;
   1169     jint _remaining;
   1170     GLfloat *value = (GLfloat *) 0;
   1171 
   1172     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1173     if (value == NULL) {
   1174         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1175         value = (GLfloat *) (_valueBase + _bufferOffset);
   1176     }
   1177     glUniformMatrix2x4fv(
   1178         (GLint)location,
   1179         (GLsizei)count,
   1180         (GLboolean)transpose,
   1181         (GLfloat *)value
   1182     );
   1183     if (_array) {
   1184         releasePointer(_env, _array, value, JNI_FALSE);
   1185     }
   1186 }
   1187 
   1188 /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1189 static void
   1190 android_glUniformMatrix4x2fv__IIZ_3FI
   1191   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
   1192     jint _exception = 0;
   1193     const char * _exceptionType = NULL;
   1194     const char * _exceptionMessage = NULL;
   1195     GLfloat *value_base = (GLfloat *) 0;
   1196     jint _remaining;
   1197     GLfloat *value = (GLfloat *) 0;
   1198 
   1199     if (!value_ref) {
   1200         _exception = 1;
   1201         _exceptionType = "java/lang/IllegalArgumentException";
   1202         _exceptionMessage = "value == null";
   1203         goto exit;
   1204     }
   1205     if (offset < 0) {
   1206         _exception = 1;
   1207         _exceptionType = "java/lang/IllegalArgumentException";
   1208         _exceptionMessage = "offset < 0";
   1209         goto exit;
   1210     }
   1211     _remaining = _env->GetArrayLength(value_ref) - offset;
   1212     value_base = (GLfloat *)
   1213         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1214     value = value_base + offset;
   1215 
   1216     glUniformMatrix4x2fv(
   1217         (GLint)location,
   1218         (GLsizei)count,
   1219         (GLboolean)transpose,
   1220         (GLfloat *)value
   1221     );
   1222 
   1223 exit:
   1224     if (value_base) {
   1225         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1226             JNI_ABORT);
   1227     }
   1228     if (_exception) {
   1229         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1230     }
   1231 }
   1232 
   1233 /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1234 static void
   1235 android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
   1236   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1237     jarray _array = (jarray) 0;
   1238     jint _bufferOffset = (jint) 0;
   1239     jint _remaining;
   1240     GLfloat *value = (GLfloat *) 0;
   1241 
   1242     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1243     if (value == NULL) {
   1244         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1245         value = (GLfloat *) (_valueBase + _bufferOffset);
   1246     }
   1247     glUniformMatrix4x2fv(
   1248         (GLint)location,
   1249         (GLsizei)count,
   1250         (GLboolean)transpose,
   1251         (GLfloat *)value
   1252     );
   1253     if (_array) {
   1254         releasePointer(_env, _array, value, JNI_FALSE);
   1255     }
   1256 }
   1257 
   1258 /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1259 static void
   1260 android_glUniformMatrix3x4fv__IIZ_3FI
   1261   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
   1262     jint _exception = 0;
   1263     const char * _exceptionType = NULL;
   1264     const char * _exceptionMessage = NULL;
   1265     GLfloat *value_base = (GLfloat *) 0;
   1266     jint _remaining;
   1267     GLfloat *value = (GLfloat *) 0;
   1268 
   1269     if (!value_ref) {
   1270         _exception = 1;
   1271         _exceptionType = "java/lang/IllegalArgumentException";
   1272         _exceptionMessage = "value == null";
   1273         goto exit;
   1274     }
   1275     if (offset < 0) {
   1276         _exception = 1;
   1277         _exceptionType = "java/lang/IllegalArgumentException";
   1278         _exceptionMessage = "offset < 0";
   1279         goto exit;
   1280     }
   1281     _remaining = _env->GetArrayLength(value_ref) - offset;
   1282     value_base = (GLfloat *)
   1283         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1284     value = value_base + offset;
   1285 
   1286     glUniformMatrix3x4fv(
   1287         (GLint)location,
   1288         (GLsizei)count,
   1289         (GLboolean)transpose,
   1290         (GLfloat *)value
   1291     );
   1292 
   1293 exit:
   1294     if (value_base) {
   1295         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1296             JNI_ABORT);
   1297     }
   1298     if (_exception) {
   1299         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1300     }
   1301 }
   1302 
   1303 /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1304 static void
   1305 android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
   1306   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1307     jarray _array = (jarray) 0;
   1308     jint _bufferOffset = (jint) 0;
   1309     jint _remaining;
   1310     GLfloat *value = (GLfloat *) 0;
   1311 
   1312     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1313     if (value == NULL) {
   1314         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1315         value = (GLfloat *) (_valueBase + _bufferOffset);
   1316     }
   1317     glUniformMatrix3x4fv(
   1318         (GLint)location,
   1319         (GLsizei)count,
   1320         (GLboolean)transpose,
   1321         (GLfloat *)value
   1322     );
   1323     if (_array) {
   1324         releasePointer(_env, _array, value, JNI_FALSE);
   1325     }
   1326 }
   1327 
   1328 /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1329 static void
   1330 android_glUniformMatrix4x3fv__IIZ_3FI
   1331   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
   1332     jint _exception = 0;
   1333     const char * _exceptionType = NULL;
   1334     const char * _exceptionMessage = NULL;
   1335     GLfloat *value_base = (GLfloat *) 0;
   1336     jint _remaining;
   1337     GLfloat *value = (GLfloat *) 0;
   1338 
   1339     if (!value_ref) {
   1340         _exception = 1;
   1341         _exceptionType = "java/lang/IllegalArgumentException";
   1342         _exceptionMessage = "value == null";
   1343         goto exit;
   1344     }
   1345     if (offset < 0) {
   1346         _exception = 1;
   1347         _exceptionType = "java/lang/IllegalArgumentException";
   1348         _exceptionMessage = "offset < 0";
   1349         goto exit;
   1350     }
   1351     _remaining = _env->GetArrayLength(value_ref) - offset;
   1352     value_base = (GLfloat *)
   1353         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   1354     value = value_base + offset;
   1355 
   1356     glUniformMatrix4x3fv(
   1357         (GLint)location,
   1358         (GLsizei)count,
   1359         (GLboolean)transpose,
   1360         (GLfloat *)value
   1361     );
   1362 
   1363 exit:
   1364     if (value_base) {
   1365         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   1366             JNI_ABORT);
   1367     }
   1368     if (_exception) {
   1369         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1370     }
   1371 }
   1372 
   1373 /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
   1374 static void
   1375 android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
   1376   (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
   1377     jarray _array = (jarray) 0;
   1378     jint _bufferOffset = (jint) 0;
   1379     jint _remaining;
   1380     GLfloat *value = (GLfloat *) 0;
   1381 
   1382     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   1383     if (value == NULL) {
   1384         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1385         value = (GLfloat *) (_valueBase + _bufferOffset);
   1386     }
   1387     glUniformMatrix4x3fv(
   1388         (GLint)location,
   1389         (GLsizei)count,
   1390         (GLboolean)transpose,
   1391         (GLfloat *)value
   1392     );
   1393     if (_array) {
   1394         releasePointer(_env, _array, value, JNI_FALSE);
   1395     }
   1396 }
   1397 
   1398 /* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
   1399 static void
   1400 android_glBlitFramebuffer__IIIIIIIIII
   1401   (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
   1402     glBlitFramebuffer(
   1403         (GLint)srcX0,
   1404         (GLint)srcY0,
   1405         (GLint)srcX1,
   1406         (GLint)srcY1,
   1407         (GLint)dstX0,
   1408         (GLint)dstY0,
   1409         (GLint)dstX1,
   1410         (GLint)dstY1,
   1411         (GLbitfield)mask,
   1412         (GLenum)filter
   1413     );
   1414 }
   1415 
   1416 /* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
   1417 static void
   1418 android_glRenderbufferStorageMultisample__IIIII
   1419   (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
   1420     glRenderbufferStorageMultisample(
   1421         (GLenum)target,
   1422         (GLsizei)samples,
   1423         (GLenum)internalformat,
   1424         (GLsizei)width,
   1425         (GLsizei)height
   1426     );
   1427 }
   1428 
   1429 /* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
   1430 static void
   1431 android_glFramebufferTextureLayer__IIIII
   1432   (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
   1433     glFramebufferTextureLayer(
   1434         (GLenum)target,
   1435         (GLenum)attachment,
   1436         (GLuint)texture,
   1437         (GLint)level,
   1438         (GLint)layer
   1439     );
   1440 }
   1441 
   1442 /* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
   1443 static jobject
   1444 android_glMapBufferRange__IIII
   1445   (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
   1446     GLvoid* _p = glMapBufferRange((GLenum)target,
   1447             (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
   1448     jobject _buf = (jobject)0;
   1449     if (_p) {
   1450         _buf = _env->NewDirectByteBuffer(_p, length);
   1451     }
   1452     return _buf;
   1453 }
   1454 
   1455 /* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
   1456 static void
   1457 android_glFlushMappedBufferRange__III
   1458   (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
   1459     glFlushMappedBufferRange(
   1460         (GLenum)target,
   1461         (GLintptr)offset,
   1462         (GLsizeiptr)length
   1463     );
   1464 }
   1465 
   1466 /* void glBindVertexArray ( GLuint array ) */
   1467 static void
   1468 android_glBindVertexArray__I
   1469   (JNIEnv *_env, jobject _this, jint array) {
   1470     glBindVertexArray(
   1471         (GLuint)array
   1472     );
   1473 }
   1474 
   1475 /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
   1476 static void
   1477 android_glDeleteVertexArrays__I_3II
   1478   (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
   1479     jint _exception = 0;
   1480     const char * _exceptionType = NULL;
   1481     const char * _exceptionMessage = NULL;
   1482     GLuint *arrays_base = (GLuint *) 0;
   1483     jint _remaining;
   1484     GLuint *arrays = (GLuint *) 0;
   1485 
   1486     if (!arrays_ref) {
   1487         _exception = 1;
   1488         _exceptionType = "java/lang/IllegalArgumentException";
   1489         _exceptionMessage = "arrays == null";
   1490         goto exit;
   1491     }
   1492     if (offset < 0) {
   1493         _exception = 1;
   1494         _exceptionType = "java/lang/IllegalArgumentException";
   1495         _exceptionMessage = "offset < 0";
   1496         goto exit;
   1497     }
   1498     _remaining = _env->GetArrayLength(arrays_ref) - offset;
   1499     arrays_base = (GLuint *)
   1500         _env->GetPrimitiveArrayCritical(arrays_ref, (jboolean *)0);
   1501     arrays = arrays_base + offset;
   1502 
   1503     glDeleteVertexArrays(
   1504         (GLsizei)n,
   1505         (GLuint *)arrays
   1506     );
   1507 
   1508 exit:
   1509     if (arrays_base) {
   1510         _env->ReleasePrimitiveArrayCritical(arrays_ref, arrays_base,
   1511             JNI_ABORT);
   1512     }
   1513     if (_exception) {
   1514         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1515     }
   1516 }
   1517 
   1518 /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
   1519 static void
   1520 android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
   1521   (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
   1522     jarray _array = (jarray) 0;
   1523     jint _bufferOffset = (jint) 0;
   1524     jint _remaining;
   1525     GLuint *arrays = (GLuint *) 0;
   1526 
   1527     arrays = (GLuint *)getPointer(_env, arrays_buf, &_array, &_remaining, &_bufferOffset);
   1528     if (arrays == NULL) {
   1529         char * _arraysBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1530         arrays = (GLuint *) (_arraysBase + _bufferOffset);
   1531     }
   1532     glDeleteVertexArrays(
   1533         (GLsizei)n,
   1534         (GLuint *)arrays
   1535     );
   1536     if (_array) {
   1537         releasePointer(_env, _array, arrays, JNI_FALSE);
   1538     }
   1539 }
   1540 
   1541 /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
   1542 static void
   1543 android_glGenVertexArrays__I_3II
   1544   (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
   1545     jint _exception = 0;
   1546     const char * _exceptionType = NULL;
   1547     const char * _exceptionMessage = NULL;
   1548     GLuint *arrays_base = (GLuint *) 0;
   1549     jint _remaining;
   1550     GLuint *arrays = (GLuint *) 0;
   1551 
   1552     if (!arrays_ref) {
   1553         _exception = 1;
   1554         _exceptionType = "java/lang/IllegalArgumentException";
   1555         _exceptionMessage = "arrays == null";
   1556         goto exit;
   1557     }
   1558     if (offset < 0) {
   1559         _exception = 1;
   1560         _exceptionType = "java/lang/IllegalArgumentException";
   1561         _exceptionMessage = "offset < 0";
   1562         goto exit;
   1563     }
   1564     _remaining = _env->GetArrayLength(arrays_ref) - offset;
   1565     arrays_base = (GLuint *)
   1566         _env->GetPrimitiveArrayCritical(arrays_ref, (jboolean *)0);
   1567     arrays = arrays_base + offset;
   1568 
   1569     glGenVertexArrays(
   1570         (GLsizei)n,
   1571         (GLuint *)arrays
   1572     );
   1573 
   1574 exit:
   1575     if (arrays_base) {
   1576         _env->ReleasePrimitiveArrayCritical(arrays_ref, arrays_base,
   1577             _exception ? JNI_ABORT: 0);
   1578     }
   1579     if (_exception) {
   1580         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1581     }
   1582 }
   1583 
   1584 /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
   1585 static void
   1586 android_glGenVertexArrays__ILjava_nio_IntBuffer_2
   1587   (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
   1588     jarray _array = (jarray) 0;
   1589     jint _bufferOffset = (jint) 0;
   1590     jint _remaining;
   1591     GLuint *arrays = (GLuint *) 0;
   1592 
   1593     arrays = (GLuint *)getPointer(_env, arrays_buf, &_array, &_remaining, &_bufferOffset);
   1594     if (arrays == NULL) {
   1595         char * _arraysBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1596         arrays = (GLuint *) (_arraysBase + _bufferOffset);
   1597     }
   1598     glGenVertexArrays(
   1599         (GLsizei)n,
   1600         (GLuint *)arrays
   1601     );
   1602     if (_array) {
   1603         releasePointer(_env, _array, arrays, JNI_TRUE);
   1604     }
   1605 }
   1606 
   1607 /* GLboolean glIsVertexArray ( GLuint array ) */
   1608 static jboolean
   1609 android_glIsVertexArray__I
   1610   (JNIEnv *_env, jobject _this, jint array) {
   1611     GLboolean _returnValue;
   1612     _returnValue = glIsVertexArray(
   1613         (GLuint)array
   1614     );
   1615     return (jboolean)_returnValue;
   1616 }
   1617 
   1618 /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
   1619 static void
   1620 android_glGetIntegeri_v__II_3II
   1621   (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
   1622     jint _exception = 0;
   1623     const char * _exceptionType = NULL;
   1624     const char * _exceptionMessage = NULL;
   1625     GLint *data_base = (GLint *) 0;
   1626     jint _remaining;
   1627     GLint *data = (GLint *) 0;
   1628 
   1629     if (!data_ref) {
   1630         _exception = 1;
   1631         _exceptionType = "java/lang/IllegalArgumentException";
   1632         _exceptionMessage = "data == null";
   1633         goto exit;
   1634     }
   1635     if (offset < 0) {
   1636         _exception = 1;
   1637         _exceptionType = "java/lang/IllegalArgumentException";
   1638         _exceptionMessage = "offset < 0";
   1639         goto exit;
   1640     }
   1641     _remaining = _env->GetArrayLength(data_ref) - offset;
   1642     data_base = (GLint *)
   1643         _env->GetPrimitiveArrayCritical(data_ref, (jboolean *)0);
   1644     data = data_base + offset;
   1645 
   1646     glGetIntegeri_v(
   1647         (GLenum)target,
   1648         (GLuint)index,
   1649         (GLint *)data
   1650     );
   1651 
   1652 exit:
   1653     if (data_base) {
   1654         _env->ReleasePrimitiveArrayCritical(data_ref, data_base,
   1655             _exception ? JNI_ABORT: 0);
   1656     }
   1657     if (_exception) {
   1658         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1659     }
   1660 }
   1661 
   1662 /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
   1663 static void
   1664 android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
   1665   (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
   1666     jarray _array = (jarray) 0;
   1667     jint _bufferOffset = (jint) 0;
   1668     jint _remaining;
   1669     GLint *data = (GLint *) 0;
   1670 
   1671     data = (GLint *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
   1672     if (data == NULL) {
   1673         char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1674         data = (GLint *) (_dataBase + _bufferOffset);
   1675     }
   1676     glGetIntegeri_v(
   1677         (GLenum)target,
   1678         (GLuint)index,
   1679         (GLint *)data
   1680     );
   1681     if (_array) {
   1682         releasePointer(_env, _array, data, JNI_TRUE);
   1683     }
   1684 }
   1685 
   1686 /* void glBeginTransformFeedback ( GLenum primitiveMode ) */
   1687 static void
   1688 android_glBeginTransformFeedback__I
   1689   (JNIEnv *_env, jobject _this, jint primitiveMode) {
   1690     glBeginTransformFeedback(
   1691         (GLenum)primitiveMode
   1692     );
   1693 }
   1694 
   1695 /* void glEndTransformFeedback ( void ) */
   1696 static void
   1697 android_glEndTransformFeedback__
   1698   (JNIEnv *_env, jobject _this) {
   1699     glEndTransformFeedback();
   1700 }
   1701 
   1702 /* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
   1703 static void
   1704 android_glBindBufferRange__IIIII
   1705   (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
   1706     glBindBufferRange(
   1707         (GLenum)target,
   1708         (GLuint)index,
   1709         (GLuint)buffer,
   1710         (GLintptr)offset,
   1711         (GLsizeiptr)size
   1712     );
   1713 }
   1714 
   1715 /* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
   1716 static void
   1717 android_glBindBufferBase__III
   1718   (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
   1719     glBindBufferBase(
   1720         (GLenum)target,
   1721         (GLuint)index,
   1722         (GLuint)buffer
   1723     );
   1724 }
   1725 
   1726 /* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
   1727 static
   1728 void
   1729 android_glTransformFeedbackVaryings
   1730     (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
   1731     jint _exception = 0;
   1732     const char* _exceptionType = NULL;
   1733     const char* _exceptionMessage = NULL;
   1734     jint _count = 0, _i;
   1735     const char** _varyings = NULL;
   1736     const char* _varying = NULL;
   1737 
   1738     if (!varyings_ref) {
   1739         _exception = 1;
   1740         _exceptionType = "java/lang/IllegalArgumentException";
   1741         _exceptionMessage = "varyings == null";
   1742         goto exit;
   1743     }
   1744 
   1745     _count = _env->GetArrayLength(varyings_ref);
   1746     _varyings = (const char**)calloc(_count, sizeof(const char*));
   1747     for (_i = 0; _i < _count; _i++) {
   1748         jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
   1749         if (!_varying) {
   1750             _exception = 1;
   1751             _exceptionType = "java/lang/IllegalArgumentException";
   1752             _exceptionMessage = "null varyings element";
   1753             goto exit;
   1754         }
   1755         _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
   1756     }
   1757 
   1758     glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
   1759 
   1760 exit:
   1761     for (_i = _count - 1; _i >= 0; _i--) {
   1762         if (_varyings[_i]) {
   1763             jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
   1764             if (_varying) {
   1765                 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
   1766             }
   1767         }
   1768     }
   1769     free(_varyings);
   1770     if (_exception) {
   1771         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1772     }
   1773 }
   1774 
   1775 /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
   1776 static void
   1777 android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
   1778   (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) {
   1779     jint _exception = 0;
   1780     const char * _exceptionType;
   1781     const char * _exceptionMessage;
   1782     GLsizei *length_base = (GLsizei *) 0;
   1783     jint _lengthRemaining;
   1784     GLsizei *length = (GLsizei *) 0;
   1785     GLint *size_base = (GLint *) 0;
   1786     jint _sizeRemaining;
   1787     GLint *size = (GLint *) 0;
   1788     GLenum *type_base = (GLenum *) 0;
   1789     jint _typeRemaining;
   1790     GLenum *type = (GLenum *) 0;
   1791     char *name_base = (char *) 0;
   1792     jint _nameRemaining;
   1793     char *name = (char *) 0;
   1794 
   1795     if (!length_ref) {
   1796         _exception = 1;
   1797         _exceptionType = "java/lang/IllegalArgumentException";
   1798         _exceptionMessage = "length == null";
   1799         goto exit;
   1800     }
   1801     if (lengthOffset < 0) {
   1802         _exception = 1;
   1803         _exceptionType = "java/lang/IllegalArgumentException";
   1804         _exceptionMessage = "lengthOffset < 0";
   1805         goto exit;
   1806     }
   1807     _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
   1808     length_base = (GLsizei *)
   1809         _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
   1810     length = length_base + lengthOffset;
   1811 
   1812     if (!size_ref) {
   1813         _exception = 1;
   1814         _exceptionType = "java/lang/IllegalArgumentException";
   1815         _exceptionMessage = "size == null";
   1816         goto exit;
   1817     }
   1818     if (sizeOffset < 0) {
   1819         _exception = 1;
   1820         _exceptionType = "java/lang/IllegalArgumentException";
   1821         _exceptionMessage = "sizeOffset < 0";
   1822         goto exit;
   1823     }
   1824     _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
   1825     size_base = (GLint *)
   1826         _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
   1827     size = size_base + sizeOffset;
   1828 
   1829     if (!type_ref) {
   1830         _exception = 1;
   1831         _exceptionType = "java/lang/IllegalArgumentException";
   1832         _exceptionMessage = "type == null";
   1833         goto exit;
   1834     }
   1835     if (typeOffset < 0) {
   1836         _exception = 1;
   1837         _exceptionType = "java/lang/IllegalArgumentException";
   1838         _exceptionMessage = "typeOffset < 0";
   1839         goto exit;
   1840     }
   1841     _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
   1842     type_base = (GLenum *)
   1843         _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
   1844     type = type_base + typeOffset;
   1845 
   1846     if (!name_ref) {
   1847         _exception = 1;
   1848         _exceptionType = "java/lang/IllegalArgumentException";
   1849         _exceptionMessage = "name == null";
   1850         goto exit;
   1851     }
   1852     if (nameOffset < 0) {
   1853         _exception = 1;
   1854         _exceptionType = "java/lang/IllegalArgumentException";
   1855         _exceptionMessage = "nameOffset < 0";
   1856         goto exit;
   1857     }
   1858     _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
   1859     name_base = (char *)
   1860         _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0);
   1861     name = name_base + nameOffset;
   1862 
   1863     glGetTransformFeedbackVarying(
   1864         (GLuint)program,
   1865         (GLuint)index,
   1866         (GLsizei)bufsize,
   1867         (GLsizei *)length,
   1868         (GLint *)size,
   1869         (GLenum *)type,
   1870         (char *)name
   1871     );
   1872 
   1873 exit:
   1874     if (name_base) {
   1875         _env->ReleasePrimitiveArrayCritical(name_ref, name_base,
   1876             _exception ? JNI_ABORT: 0);
   1877     }
   1878     if (type_base) {
   1879         _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
   1880             _exception ? JNI_ABORT: 0);
   1881     }
   1882     if (size_base) {
   1883         _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
   1884             _exception ? JNI_ABORT: 0);
   1885     }
   1886     if (length_base) {
   1887         _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
   1888             _exception ? JNI_ABORT: 0);
   1889     }
   1890     if (_exception) {
   1891         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1892     }
   1893 }
   1894 
   1895 /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
   1896 static void
   1897 android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
   1898   (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
   1899     jarray _lengthArray = (jarray) 0;
   1900     jint _lengthBufferOffset = (jint) 0;
   1901     jarray _sizeArray = (jarray) 0;
   1902     jint _sizeBufferOffset = (jint) 0;
   1903     jarray _typeArray = (jarray) 0;
   1904     jint _typeBufferOffset = (jint) 0;
   1905     jint _lengthRemaining;
   1906     GLsizei *length = (GLsizei *) 0;
   1907     jint _sizeRemaining;
   1908     GLint *size = (GLint *) 0;
   1909     jint _typeRemaining;
   1910     GLenum *type = (GLenum *) 0;
   1911 
   1912     length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
   1913     size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
   1914     type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
   1915     if (length == NULL) {
   1916         char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0);
   1917         length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
   1918     }
   1919     if (size == NULL) {
   1920         char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
   1921         size = (GLint *) (_sizeBase + _sizeBufferOffset);
   1922     }
   1923     if (type == NULL) {
   1924         char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
   1925         type = (GLenum *) (_typeBase + _typeBufferOffset);
   1926     }
   1927     glGetTransformFeedbackVarying(
   1928         (GLuint)program,
   1929         (GLuint)index,
   1930         (GLsizei)bufsize,
   1931         (GLsizei *)length,
   1932         (GLint *)size,
   1933         (GLenum *)type,
   1934         (char *)name
   1935     );
   1936     if (_typeArray) {
   1937         releasePointer(_env, _typeArray, type, JNI_TRUE);
   1938     }
   1939     if (_sizeArray) {
   1940         releasePointer(_env, _sizeArray, size, JNI_TRUE);
   1941     }
   1942     if (_lengthArray) {
   1943         releasePointer(_env, _lengthArray, length, JNI_TRUE);
   1944     }
   1945 }
   1946 
   1947 /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
   1948 static jstring
   1949 android_glGetTransformFeedbackVarying1
   1950   (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
   1951     jint _exception = 0;
   1952     const char * _exceptionType;
   1953     const char * _exceptionMessage;
   1954     GLint *size_base = (GLint *) 0;
   1955     jint _sizeRemaining;
   1956     GLint *size = (GLint *) 0;
   1957     GLenum *type_base = (GLenum *) 0;
   1958     jint _typeRemaining;
   1959     GLenum *type = (GLenum *) 0;
   1960 
   1961     jstring result = 0;
   1962 
   1963     GLint len = 0;
   1964     glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
   1965     if (!len) {
   1966         return _env->NewStringUTF("");
   1967     }
   1968     char* buf = (char*) malloc(len);
   1969 
   1970     if (buf == NULL) {
   1971         jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
   1972         return NULL;
   1973     }
   1974     if (!size_ref) {
   1975         _exception = 1;
   1976         _exceptionType = "java/lang/IllegalArgumentException";
   1977         _exceptionMessage = "size == null";
   1978         goto exit;
   1979     }
   1980     if (sizeOffset < 0) {
   1981         _exception = 1;
   1982         _exceptionType = "java/lang/IllegalArgumentException";
   1983         _exceptionMessage = "sizeOffset < 0";
   1984         goto exit;
   1985     }
   1986     _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
   1987     size_base = (GLint *)
   1988         _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
   1989     size = size_base + sizeOffset;
   1990 
   1991     if (!type_ref) {
   1992         _exception = 1;
   1993         _exceptionType = "java/lang/IllegalArgumentException";
   1994         _exceptionMessage = "type == null";
   1995         goto exit;
   1996     }
   1997     if (typeOffset < 0) {
   1998         _exception = 1;
   1999         _exceptionType = "java/lang/IllegalArgumentException";
   2000         _exceptionMessage = "typeOffset < 0";
   2001         goto exit;
   2002     }
   2003     _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
   2004     type_base = (GLenum *)
   2005         _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
   2006     type = type_base + typeOffset;
   2007 
   2008     glGetTransformFeedbackVarying(
   2009         (GLuint)program,
   2010         (GLuint)index,
   2011         (GLsizei)len,
   2012         NULL,
   2013         (GLint *)size,
   2014         (GLenum *)type,
   2015         (char *)buf
   2016     );
   2017 exit:
   2018     if (type_base) {
   2019         _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
   2020             _exception ? JNI_ABORT: 0);
   2021     }
   2022     if (size_base) {
   2023         _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
   2024             _exception ? JNI_ABORT: 0);
   2025     }
   2026     if (_exception != 1) {
   2027         result = _env->NewStringUTF(buf);
   2028     }
   2029     if (buf) {
   2030         free(buf);
   2031     }
   2032     if (_exception) {
   2033         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2034     }
   2035     if (result == 0) {
   2036         result = _env->NewStringUTF("");
   2037     }
   2038 
   2039     return result;
   2040 }
   2041 
   2042 /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
   2043 static jstring
   2044 android_glGetTransformFeedbackVarying2
   2045   (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
   2046     jarray _sizeArray = (jarray) 0;
   2047     jint _sizeBufferOffset = (jint) 0;
   2048     jarray _typeArray = (jarray) 0;
   2049     jint _typeBufferOffset = (jint) 0;
   2050     jint _lengthRemaining;
   2051     GLsizei *length = (GLsizei *) 0;
   2052     jint _sizeRemaining;
   2053     GLint *size = (GLint *) 0;
   2054     jint _typeRemaining;
   2055     GLenum *type = (GLenum *) 0;
   2056 
   2057     jstring result = 0;
   2058 
   2059     GLint len = 0;
   2060     glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
   2061     if (!len) {
   2062         return _env->NewStringUTF("");
   2063     }
   2064     char* buf = (char*) malloc(len);
   2065 
   2066     if (buf == NULL) {
   2067         jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
   2068         return NULL;
   2069     }
   2070 
   2071     size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
   2072     type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset);
   2073     if (size == NULL) {
   2074         char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0);
   2075         size = (GLint *) (_sizeBase + _sizeBufferOffset);
   2076     }
   2077     if (type == NULL) {
   2078         char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0);
   2079         type = (GLenum *) (_typeBase + _typeBufferOffset);
   2080     }
   2081     glGetTransformFeedbackVarying(
   2082         (GLuint)program,
   2083         (GLuint)index,
   2084         (GLsizei)len,
   2085         NULL,
   2086         (GLint *)size,
   2087         (GLenum *)type,
   2088         (char *)buf
   2089     );
   2090 
   2091     if (_typeArray) {
   2092         releasePointer(_env, _typeArray, type, JNI_TRUE);
   2093     }
   2094     if (_sizeArray) {
   2095         releasePointer(_env, _sizeArray, size, JNI_TRUE);
   2096     }
   2097     result = _env->NewStringUTF(buf);
   2098     if (buf) {
   2099         free(buf);
   2100     }
   2101     return result;
   2102 }
   2103 /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
   2104 static void
   2105 android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
   2106   (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
   2107     jarray _array = (jarray) 0;
   2108     jint _bufferOffset = (jint) 0;
   2109     jint _remaining;
   2110     GLvoid *pointer = (GLvoid *) 0;
   2111 
   2112     if (pointer_buf) {
   2113         pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
   2114         if ( ! pointer ) {
   2115             return;
   2116         }
   2117     }
   2118     glVertexAttribIPointerBounds(
   2119         (GLuint)index,
   2120         (GLint)size,
   2121         (GLenum)type,
   2122         (GLsizei)stride,
   2123         (GLvoid *)pointer,
   2124         (GLsizei)remaining
   2125     );
   2126 }
   2127 
   2128 /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
   2129 static void
   2130 android_glVertexAttribIPointer__IIIII
   2131   (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
   2132     glVertexAttribIPointer(
   2133         (GLuint)index,
   2134         (GLint)size,
   2135         (GLenum)type,
   2136         (GLsizei)stride,
   2137         (GLvoid *)offset
   2138     );
   2139 }
   2140 
   2141 /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
   2142 static void
   2143 android_glGetVertexAttribIiv__II_3II
   2144   (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
   2145     jint _exception = 0;
   2146     const char * _exceptionType = NULL;
   2147     const char * _exceptionMessage = NULL;
   2148     GLint *params_base = (GLint *) 0;
   2149     jint _remaining;
   2150     GLint *params = (GLint *) 0;
   2151 
   2152     if (!params_ref) {
   2153         _exception = 1;
   2154         _exceptionType = "java/lang/IllegalArgumentException";
   2155         _exceptionMessage = "params == null";
   2156         goto exit;
   2157     }
   2158     if (offset < 0) {
   2159         _exception = 1;
   2160         _exceptionType = "java/lang/IllegalArgumentException";
   2161         _exceptionMessage = "offset < 0";
   2162         goto exit;
   2163     }
   2164     _remaining = _env->GetArrayLength(params_ref) - offset;
   2165     params_base = (GLint *)
   2166         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   2167     params = params_base + offset;
   2168 
   2169     glGetVertexAttribIiv(
   2170         (GLuint)index,
   2171         (GLenum)pname,
   2172         (GLint *)params
   2173     );
   2174 
   2175 exit:
   2176     if (params_base) {
   2177         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   2178             _exception ? JNI_ABORT: 0);
   2179     }
   2180     if (_exception) {
   2181         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2182     }
   2183 }
   2184 
   2185 /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
   2186 static void
   2187 android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
   2188   (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
   2189     jarray _array = (jarray) 0;
   2190     jint _bufferOffset = (jint) 0;
   2191     jint _remaining;
   2192     GLint *params = (GLint *) 0;
   2193 
   2194     params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   2195     if (params == NULL) {
   2196         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2197         params = (GLint *) (_paramsBase + _bufferOffset);
   2198     }
   2199     glGetVertexAttribIiv(
   2200         (GLuint)index,
   2201         (GLenum)pname,
   2202         (GLint *)params
   2203     );
   2204     if (_array) {
   2205         releasePointer(_env, _array, params, JNI_TRUE);
   2206     }
   2207 }
   2208 
   2209 /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
   2210 static void
   2211 android_glGetVertexAttribIuiv__II_3II
   2212   (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
   2213     jint _exception = 0;
   2214     const char * _exceptionType = NULL;
   2215     const char * _exceptionMessage = NULL;
   2216     GLuint *params_base = (GLuint *) 0;
   2217     jint _remaining;
   2218     GLuint *params = (GLuint *) 0;
   2219 
   2220     if (!params_ref) {
   2221         _exception = 1;
   2222         _exceptionType = "java/lang/IllegalArgumentException";
   2223         _exceptionMessage = "params == null";
   2224         goto exit;
   2225     }
   2226     if (offset < 0) {
   2227         _exception = 1;
   2228         _exceptionType = "java/lang/IllegalArgumentException";
   2229         _exceptionMessage = "offset < 0";
   2230         goto exit;
   2231     }
   2232     _remaining = _env->GetArrayLength(params_ref) - offset;
   2233     params_base = (GLuint *)
   2234         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   2235     params = params_base + offset;
   2236 
   2237     glGetVertexAttribIuiv(
   2238         (GLuint)index,
   2239         (GLenum)pname,
   2240         (GLuint *)params
   2241     );
   2242 
   2243 exit:
   2244     if (params_base) {
   2245         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   2246             _exception ? JNI_ABORT: 0);
   2247     }
   2248     if (_exception) {
   2249         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2250     }
   2251 }
   2252 
   2253 /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
   2254 static void
   2255 android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
   2256   (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
   2257     jarray _array = (jarray) 0;
   2258     jint _bufferOffset = (jint) 0;
   2259     jint _remaining;
   2260     GLuint *params = (GLuint *) 0;
   2261 
   2262     params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   2263     if (params == NULL) {
   2264         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2265         params = (GLuint *) (_paramsBase + _bufferOffset);
   2266     }
   2267     glGetVertexAttribIuiv(
   2268         (GLuint)index,
   2269         (GLenum)pname,
   2270         (GLuint *)params
   2271     );
   2272     if (_array) {
   2273         releasePointer(_env, _array, params, JNI_TRUE);
   2274     }
   2275 }
   2276 
   2277 /* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
   2278 static void
   2279 android_glVertexAttribI4i__IIIII
   2280   (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
   2281     glVertexAttribI4i(
   2282         (GLuint)index,
   2283         (GLint)x,
   2284         (GLint)y,
   2285         (GLint)z,
   2286         (GLint)w
   2287     );
   2288 }
   2289 
   2290 /* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
   2291 static void
   2292 android_glVertexAttribI4ui__IIIII
   2293   (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
   2294     glVertexAttribI4ui(
   2295         (GLuint)index,
   2296         (GLuint)x,
   2297         (GLuint)y,
   2298         (GLuint)z,
   2299         (GLuint)w
   2300     );
   2301 }
   2302 
   2303 /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
   2304 static void
   2305 android_glVertexAttribI4iv__I_3II
   2306   (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
   2307     jint _exception = 0;
   2308     const char * _exceptionType = NULL;
   2309     const char * _exceptionMessage = NULL;
   2310     GLint *v_base = (GLint *) 0;
   2311     jint _remaining;
   2312     GLint *v = (GLint *) 0;
   2313 
   2314     if (!v_ref) {
   2315         _exception = 1;
   2316         _exceptionType = "java/lang/IllegalArgumentException";
   2317         _exceptionMessage = "v == null";
   2318         goto exit;
   2319     }
   2320     if (offset < 0) {
   2321         _exception = 1;
   2322         _exceptionType = "java/lang/IllegalArgumentException";
   2323         _exceptionMessage = "offset < 0";
   2324         goto exit;
   2325     }
   2326     _remaining = _env->GetArrayLength(v_ref) - offset;
   2327     v_base = (GLint *)
   2328         _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
   2329     v = v_base + offset;
   2330 
   2331     glVertexAttribI4iv(
   2332         (GLuint)index,
   2333         (GLint *)v
   2334     );
   2335 
   2336 exit:
   2337     if (v_base) {
   2338         _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
   2339             JNI_ABORT);
   2340     }
   2341     if (_exception) {
   2342         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2343     }
   2344 }
   2345 
   2346 /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
   2347 static void
   2348 android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
   2349   (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
   2350     jarray _array = (jarray) 0;
   2351     jint _bufferOffset = (jint) 0;
   2352     jint _remaining;
   2353     GLint *v = (GLint *) 0;
   2354 
   2355     v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
   2356     if (v == NULL) {
   2357         char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2358         v = (GLint *) (_vBase + _bufferOffset);
   2359     }
   2360     glVertexAttribI4iv(
   2361         (GLuint)index,
   2362         (GLint *)v
   2363     );
   2364     if (_array) {
   2365         releasePointer(_env, _array, v, JNI_FALSE);
   2366     }
   2367 }
   2368 
   2369 /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
   2370 static void
   2371 android_glVertexAttribI4uiv__I_3II
   2372   (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
   2373     jint _exception = 0;
   2374     const char * _exceptionType = NULL;
   2375     const char * _exceptionMessage = NULL;
   2376     GLuint *v_base = (GLuint *) 0;
   2377     jint _remaining;
   2378     GLuint *v = (GLuint *) 0;
   2379 
   2380     if (!v_ref) {
   2381         _exception = 1;
   2382         _exceptionType = "java/lang/IllegalArgumentException";
   2383         _exceptionMessage = "v == null";
   2384         goto exit;
   2385     }
   2386     if (offset < 0) {
   2387         _exception = 1;
   2388         _exceptionType = "java/lang/IllegalArgumentException";
   2389         _exceptionMessage = "offset < 0";
   2390         goto exit;
   2391     }
   2392     _remaining = _env->GetArrayLength(v_ref) - offset;
   2393     v_base = (GLuint *)
   2394         _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
   2395     v = v_base + offset;
   2396 
   2397     glVertexAttribI4uiv(
   2398         (GLuint)index,
   2399         (GLuint *)v
   2400     );
   2401 
   2402 exit:
   2403     if (v_base) {
   2404         _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
   2405             JNI_ABORT);
   2406     }
   2407     if (_exception) {
   2408         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2409     }
   2410 }
   2411 
   2412 /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
   2413 static void
   2414 android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
   2415   (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
   2416     jarray _array = (jarray) 0;
   2417     jint _bufferOffset = (jint) 0;
   2418     jint _remaining;
   2419     GLuint *v = (GLuint *) 0;
   2420 
   2421     v = (GLuint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset);
   2422     if (v == NULL) {
   2423         char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2424         v = (GLuint *) (_vBase + _bufferOffset);
   2425     }
   2426     glVertexAttribI4uiv(
   2427         (GLuint)index,
   2428         (GLuint *)v
   2429     );
   2430     if (_array) {
   2431         releasePointer(_env, _array, v, JNI_FALSE);
   2432     }
   2433 }
   2434 
   2435 /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
   2436 static void
   2437 android_glGetUniformuiv__II_3II
   2438   (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
   2439     jint _exception = 0;
   2440     const char * _exceptionType = NULL;
   2441     const char * _exceptionMessage = NULL;
   2442     GLuint *params_base = (GLuint *) 0;
   2443     jint _remaining;
   2444     GLuint *params = (GLuint *) 0;
   2445 
   2446     if (!params_ref) {
   2447         _exception = 1;
   2448         _exceptionType = "java/lang/IllegalArgumentException";
   2449         _exceptionMessage = "params == null";
   2450         goto exit;
   2451     }
   2452     if (offset < 0) {
   2453         _exception = 1;
   2454         _exceptionType = "java/lang/IllegalArgumentException";
   2455         _exceptionMessage = "offset < 0";
   2456         goto exit;
   2457     }
   2458     _remaining = _env->GetArrayLength(params_ref) - offset;
   2459     params_base = (GLuint *)
   2460         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   2461     params = params_base + offset;
   2462 
   2463     glGetUniformuiv(
   2464         (GLuint)program,
   2465         (GLint)location,
   2466         (GLuint *)params
   2467     );
   2468 
   2469 exit:
   2470     if (params_base) {
   2471         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   2472             _exception ? JNI_ABORT: 0);
   2473     }
   2474     if (_exception) {
   2475         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2476     }
   2477 }
   2478 
   2479 /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
   2480 static void
   2481 android_glGetUniformuiv__IILjava_nio_IntBuffer_2
   2482   (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
   2483     jarray _array = (jarray) 0;
   2484     jint _bufferOffset = (jint) 0;
   2485     jint _remaining;
   2486     GLuint *params = (GLuint *) 0;
   2487 
   2488     params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   2489     if (params == NULL) {
   2490         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2491         params = (GLuint *) (_paramsBase + _bufferOffset);
   2492     }
   2493     glGetUniformuiv(
   2494         (GLuint)program,
   2495         (GLint)location,
   2496         (GLuint *)params
   2497     );
   2498     if (_array) {
   2499         releasePointer(_env, _array, params, JNI_TRUE);
   2500     }
   2501 }
   2502 
   2503 /* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
   2504 static jint
   2505 android_glGetFragDataLocation__ILjava_lang_String_2
   2506   (JNIEnv *_env, jobject _this, jint program, jstring name) {
   2507     jint _exception = 0;
   2508     const char * _exceptionType = NULL;
   2509     const char * _exceptionMessage = NULL;
   2510     GLint _returnValue = 0;
   2511     const char* _nativename = 0;
   2512 
   2513     if (!name) {
   2514         _exceptionType = "java/lang/IllegalArgumentException";
   2515         _exceptionMessage = "name == null";
   2516         goto exit;
   2517     }
   2518     _nativename = _env->GetStringUTFChars(name, 0);
   2519 
   2520     _returnValue = glGetFragDataLocation(
   2521         (GLuint)program,
   2522         (GLchar *)_nativename
   2523     );
   2524 
   2525 exit:
   2526     if (_nativename) {
   2527         _env->ReleaseStringUTFChars(name, _nativename);
   2528     }
   2529 
   2530     if (_exception) {
   2531         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2532     }
   2533     return (jint)_returnValue;
   2534 }
   2535 
   2536 /* void glUniform1ui ( GLint location, GLuint v0 ) */
   2537 static void
   2538 android_glUniform1ui__II
   2539   (JNIEnv *_env, jobject _this, jint location, jint v0) {
   2540     glUniform1ui(
   2541         (GLint)location,
   2542         (GLuint)v0
   2543     );
   2544 }
   2545 
   2546 /* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
   2547 static void
   2548 android_glUniform2ui__III
   2549   (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
   2550     glUniform2ui(
   2551         (GLint)location,
   2552         (GLuint)v0,
   2553         (GLuint)v1
   2554     );
   2555 }
   2556 
   2557 /* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
   2558 static void
   2559 android_glUniform3ui__IIII
   2560   (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
   2561     glUniform3ui(
   2562         (GLint)location,
   2563         (GLuint)v0,
   2564         (GLuint)v1,
   2565         (GLuint)v2
   2566     );
   2567 }
   2568 
   2569 /* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
   2570 static void
   2571 android_glUniform4ui__IIIII
   2572   (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
   2573     glUniform4ui(
   2574         (GLint)location,
   2575         (GLuint)v0,
   2576         (GLuint)v1,
   2577         (GLuint)v2,
   2578         (GLuint)v3
   2579     );
   2580 }
   2581 
   2582 /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2583 static void
   2584 android_glUniform1uiv__II_3II
   2585   (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
   2586     jint _exception = 0;
   2587     const char * _exceptionType = NULL;
   2588     const char * _exceptionMessage = NULL;
   2589     GLuint *value_base = (GLuint *) 0;
   2590     jint _remaining;
   2591     GLuint *value = (GLuint *) 0;
   2592 
   2593     if (!value_ref) {
   2594         _exception = 1;
   2595         _exceptionType = "java/lang/IllegalArgumentException";
   2596         _exceptionMessage = "value == null";
   2597         goto exit;
   2598     }
   2599     if (offset < 0) {
   2600         _exception = 1;
   2601         _exceptionType = "java/lang/IllegalArgumentException";
   2602         _exceptionMessage = "offset < 0";
   2603         goto exit;
   2604     }
   2605     _remaining = _env->GetArrayLength(value_ref) - offset;
   2606     value_base = (GLuint *)
   2607         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2608     value = value_base + offset;
   2609 
   2610     glUniform1uiv(
   2611         (GLint)location,
   2612         (GLsizei)count,
   2613         (GLuint *)value
   2614     );
   2615 
   2616 exit:
   2617     if (value_base) {
   2618         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2619             JNI_ABORT);
   2620     }
   2621     if (_exception) {
   2622         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2623     }
   2624 }
   2625 
   2626 /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2627 static void
   2628 android_glUniform1uiv__IILjava_nio_IntBuffer_2
   2629   (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
   2630     jarray _array = (jarray) 0;
   2631     jint _bufferOffset = (jint) 0;
   2632     jint _remaining;
   2633     GLuint *value = (GLuint *) 0;
   2634 
   2635     value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2636     if (value == NULL) {
   2637         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2638         value = (GLuint *) (_valueBase + _bufferOffset);
   2639     }
   2640     glUniform1uiv(
   2641         (GLint)location,
   2642         (GLsizei)count,
   2643         (GLuint *)value
   2644     );
   2645     if (_array) {
   2646         releasePointer(_env, _array, value, JNI_FALSE);
   2647     }
   2648 }
   2649 
   2650 /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2651 static void
   2652 android_glUniform2uiv__II_3II
   2653   (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
   2654     jint _exception = 0;
   2655     const char * _exceptionType = NULL;
   2656     const char * _exceptionMessage = NULL;
   2657     GLuint *value_base = (GLuint *) 0;
   2658     jint _remaining;
   2659     GLuint *value = (GLuint *) 0;
   2660 
   2661     if (!value_ref) {
   2662         _exception = 1;
   2663         _exceptionType = "java/lang/IllegalArgumentException";
   2664         _exceptionMessage = "value == null";
   2665         goto exit;
   2666     }
   2667     if (offset < 0) {
   2668         _exception = 1;
   2669         _exceptionType = "java/lang/IllegalArgumentException";
   2670         _exceptionMessage = "offset < 0";
   2671         goto exit;
   2672     }
   2673     _remaining = _env->GetArrayLength(value_ref) - offset;
   2674     value_base = (GLuint *)
   2675         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2676     value = value_base + offset;
   2677 
   2678     glUniform2uiv(
   2679         (GLint)location,
   2680         (GLsizei)count,
   2681         (GLuint *)value
   2682     );
   2683 
   2684 exit:
   2685     if (value_base) {
   2686         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2687             JNI_ABORT);
   2688     }
   2689     if (_exception) {
   2690         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2691     }
   2692 }
   2693 
   2694 /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2695 static void
   2696 android_glUniform2uiv__IILjava_nio_IntBuffer_2
   2697   (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
   2698     jarray _array = (jarray) 0;
   2699     jint _bufferOffset = (jint) 0;
   2700     jint _remaining;
   2701     GLuint *value = (GLuint *) 0;
   2702 
   2703     value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2704     if (value == NULL) {
   2705         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2706         value = (GLuint *) (_valueBase + _bufferOffset);
   2707     }
   2708     glUniform2uiv(
   2709         (GLint)location,
   2710         (GLsizei)count,
   2711         (GLuint *)value
   2712     );
   2713     if (_array) {
   2714         releasePointer(_env, _array, value, JNI_FALSE);
   2715     }
   2716 }
   2717 
   2718 /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2719 static void
   2720 android_glUniform3uiv__II_3II
   2721   (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
   2722     jint _exception = 0;
   2723     const char * _exceptionType = NULL;
   2724     const char * _exceptionMessage = NULL;
   2725     GLuint *value_base = (GLuint *) 0;
   2726     jint _remaining;
   2727     GLuint *value = (GLuint *) 0;
   2728 
   2729     if (!value_ref) {
   2730         _exception = 1;
   2731         _exceptionType = "java/lang/IllegalArgumentException";
   2732         _exceptionMessage = "value == null";
   2733         goto exit;
   2734     }
   2735     if (offset < 0) {
   2736         _exception = 1;
   2737         _exceptionType = "java/lang/IllegalArgumentException";
   2738         _exceptionMessage = "offset < 0";
   2739         goto exit;
   2740     }
   2741     _remaining = _env->GetArrayLength(value_ref) - offset;
   2742     value_base = (GLuint *)
   2743         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2744     value = value_base + offset;
   2745 
   2746     glUniform3uiv(
   2747         (GLint)location,
   2748         (GLsizei)count,
   2749         (GLuint *)value
   2750     );
   2751 
   2752 exit:
   2753     if (value_base) {
   2754         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2755             JNI_ABORT);
   2756     }
   2757     if (_exception) {
   2758         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2759     }
   2760 }
   2761 
   2762 /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2763 static void
   2764 android_glUniform3uiv__IILjava_nio_IntBuffer_2
   2765   (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
   2766     jarray _array = (jarray) 0;
   2767     jint _bufferOffset = (jint) 0;
   2768     jint _remaining;
   2769     GLuint *value = (GLuint *) 0;
   2770 
   2771     value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2772     if (value == NULL) {
   2773         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2774         value = (GLuint *) (_valueBase + _bufferOffset);
   2775     }
   2776     glUniform3uiv(
   2777         (GLint)location,
   2778         (GLsizei)count,
   2779         (GLuint *)value
   2780     );
   2781     if (_array) {
   2782         releasePointer(_env, _array, value, JNI_FALSE);
   2783     }
   2784 }
   2785 
   2786 /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2787 static void
   2788 android_glUniform4uiv__II_3II
   2789   (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
   2790     jint _exception = 0;
   2791     const char * _exceptionType = NULL;
   2792     const char * _exceptionMessage = NULL;
   2793     GLuint *value_base = (GLuint *) 0;
   2794     jint _remaining;
   2795     GLuint *value = (GLuint *) 0;
   2796 
   2797     if (!value_ref) {
   2798         _exception = 1;
   2799         _exceptionType = "java/lang/IllegalArgumentException";
   2800         _exceptionMessage = "value == null";
   2801         goto exit;
   2802     }
   2803     if (offset < 0) {
   2804         _exception = 1;
   2805         _exceptionType = "java/lang/IllegalArgumentException";
   2806         _exceptionMessage = "offset < 0";
   2807         goto exit;
   2808     }
   2809     _remaining = _env->GetArrayLength(value_ref) - offset;
   2810     value_base = (GLuint *)
   2811         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2812     value = value_base + offset;
   2813 
   2814     glUniform4uiv(
   2815         (GLint)location,
   2816         (GLsizei)count,
   2817         (GLuint *)value
   2818     );
   2819 
   2820 exit:
   2821     if (value_base) {
   2822         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2823             JNI_ABORT);
   2824     }
   2825     if (_exception) {
   2826         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2827     }
   2828 }
   2829 
   2830 /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
   2831 static void
   2832 android_glUniform4uiv__IILjava_nio_IntBuffer_2
   2833   (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
   2834     jarray _array = (jarray) 0;
   2835     jint _bufferOffset = (jint) 0;
   2836     jint _remaining;
   2837     GLuint *value = (GLuint *) 0;
   2838 
   2839     value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2840     if (value == NULL) {
   2841         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2842         value = (GLuint *) (_valueBase + _bufferOffset);
   2843     }
   2844     glUniform4uiv(
   2845         (GLint)location,
   2846         (GLsizei)count,
   2847         (GLuint *)value
   2848     );
   2849     if (_array) {
   2850         releasePointer(_env, _array, value, JNI_FALSE);
   2851     }
   2852 }
   2853 
   2854 /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
   2855 static void
   2856 android_glClearBufferiv__II_3II
   2857   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
   2858     jint _exception = 0;
   2859     const char * _exceptionType = NULL;
   2860     const char * _exceptionMessage = NULL;
   2861     GLint *value_base = (GLint *) 0;
   2862     jint _remaining;
   2863     GLint *value = (GLint *) 0;
   2864 
   2865     if (!value_ref) {
   2866         _exception = 1;
   2867         _exceptionType = "java/lang/IllegalArgumentException";
   2868         _exceptionMessage = "value == null";
   2869         goto exit;
   2870     }
   2871     if (offset < 0) {
   2872         _exception = 1;
   2873         _exceptionType = "java/lang/IllegalArgumentException";
   2874         _exceptionMessage = "offset < 0";
   2875         goto exit;
   2876     }
   2877     _remaining = _env->GetArrayLength(value_ref) - offset;
   2878     value_base = (GLint *)
   2879         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2880     value = value_base + offset;
   2881 
   2882     glClearBufferiv(
   2883         (GLenum)buffer,
   2884         (GLint)drawbuffer,
   2885         (GLint *)value
   2886     );
   2887 
   2888 exit:
   2889     if (value_base) {
   2890         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2891             JNI_ABORT);
   2892     }
   2893     if (_exception) {
   2894         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2895     }
   2896 }
   2897 
   2898 /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
   2899 static void
   2900 android_glClearBufferiv__IILjava_nio_IntBuffer_2
   2901   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
   2902     jarray _array = (jarray) 0;
   2903     jint _bufferOffset = (jint) 0;
   2904     jint _remaining;
   2905     GLint *value = (GLint *) 0;
   2906 
   2907     value = (GLint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2908     if (value == NULL) {
   2909         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2910         value = (GLint *) (_valueBase + _bufferOffset);
   2911     }
   2912     glClearBufferiv(
   2913         (GLenum)buffer,
   2914         (GLint)drawbuffer,
   2915         (GLint *)value
   2916     );
   2917     if (_array) {
   2918         releasePointer(_env, _array, value, JNI_FALSE);
   2919     }
   2920 }
   2921 
   2922 /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
   2923 static void
   2924 android_glClearBufferuiv__II_3II
   2925   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
   2926     jint _exception = 0;
   2927     const char * _exceptionType = NULL;
   2928     const char * _exceptionMessage = NULL;
   2929     GLuint *value_base = (GLuint *) 0;
   2930     jint _remaining;
   2931     GLuint *value = (GLuint *) 0;
   2932 
   2933     if (!value_ref) {
   2934         _exception = 1;
   2935         _exceptionType = "java/lang/IllegalArgumentException";
   2936         _exceptionMessage = "value == null";
   2937         goto exit;
   2938     }
   2939     if (offset < 0) {
   2940         _exception = 1;
   2941         _exceptionType = "java/lang/IllegalArgumentException";
   2942         _exceptionMessage = "offset < 0";
   2943         goto exit;
   2944     }
   2945     _remaining = _env->GetArrayLength(value_ref) - offset;
   2946     value_base = (GLuint *)
   2947         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   2948     value = value_base + offset;
   2949 
   2950     glClearBufferuiv(
   2951         (GLenum)buffer,
   2952         (GLint)drawbuffer,
   2953         (GLuint *)value
   2954     );
   2955 
   2956 exit:
   2957     if (value_base) {
   2958         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   2959             JNI_ABORT);
   2960     }
   2961     if (_exception) {
   2962         jniThrowException(_env, _exceptionType, _exceptionMessage);
   2963     }
   2964 }
   2965 
   2966 /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
   2967 static void
   2968 android_glClearBufferuiv__IILjava_nio_IntBuffer_2
   2969   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
   2970     jarray _array = (jarray) 0;
   2971     jint _bufferOffset = (jint) 0;
   2972     jint _remaining;
   2973     GLuint *value = (GLuint *) 0;
   2974 
   2975     value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   2976     if (value == NULL) {
   2977         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   2978         value = (GLuint *) (_valueBase + _bufferOffset);
   2979     }
   2980     glClearBufferuiv(
   2981         (GLenum)buffer,
   2982         (GLint)drawbuffer,
   2983         (GLuint *)value
   2984     );
   2985     if (_array) {
   2986         releasePointer(_env, _array, value, JNI_FALSE);
   2987     }
   2988 }
   2989 
   2990 /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
   2991 static void
   2992 android_glClearBufferfv__II_3FI
   2993   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
   2994     jint _exception = 0;
   2995     const char * _exceptionType = NULL;
   2996     const char * _exceptionMessage = NULL;
   2997     GLfloat *value_base = (GLfloat *) 0;
   2998     jint _remaining;
   2999     GLfloat *value = (GLfloat *) 0;
   3000 
   3001     if (!value_ref) {
   3002         _exception = 1;
   3003         _exceptionType = "java/lang/IllegalArgumentException";
   3004         _exceptionMessage = "value == null";
   3005         goto exit;
   3006     }
   3007     if (offset < 0) {
   3008         _exception = 1;
   3009         _exceptionType = "java/lang/IllegalArgumentException";
   3010         _exceptionMessage = "offset < 0";
   3011         goto exit;
   3012     }
   3013     _remaining = _env->GetArrayLength(value_ref) - offset;
   3014     value_base = (GLfloat *)
   3015         _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
   3016     value = value_base + offset;
   3017 
   3018     glClearBufferfv(
   3019         (GLenum)buffer,
   3020         (GLint)drawbuffer,
   3021         (GLfloat *)value
   3022     );
   3023 
   3024 exit:
   3025     if (value_base) {
   3026         _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
   3027             JNI_ABORT);
   3028     }
   3029     if (_exception) {
   3030         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3031     }
   3032 }
   3033 
   3034 /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
   3035 static void
   3036 android_glClearBufferfv__IILjava_nio_FloatBuffer_2
   3037   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
   3038     jarray _array = (jarray) 0;
   3039     jint _bufferOffset = (jint) 0;
   3040     jint _remaining;
   3041     GLfloat *value = (GLfloat *) 0;
   3042 
   3043     value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset);
   3044     if (value == NULL) {
   3045         char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3046         value = (GLfloat *) (_valueBase + _bufferOffset);
   3047     }
   3048     glClearBufferfv(
   3049         (GLenum)buffer,
   3050         (GLint)drawbuffer,
   3051         (GLfloat *)value
   3052     );
   3053     if (_array) {
   3054         releasePointer(_env, _array, value, JNI_FALSE);
   3055     }
   3056 }
   3057 
   3058 /* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
   3059 static void
   3060 android_glClearBufferfi__IIFI
   3061   (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
   3062     glClearBufferfi(
   3063         (GLenum)buffer,
   3064         (GLint)drawbuffer,
   3065         (GLfloat)depth,
   3066         (GLint)stencil
   3067     );
   3068 }
   3069 
   3070 /* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
   3071 static jstring
   3072 android_glGetStringi__II
   3073   (JNIEnv *_env, jobject _this, jint name, jint index) {
   3074     const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
   3075     return _env->NewStringUTF((const char*)_chars);
   3076 }
   3077 
   3078 /* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
   3079 static void
   3080 android_glCopyBufferSubData__IIIII
   3081   (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
   3082     glCopyBufferSubData(
   3083         (GLenum)readTarget,
   3084         (GLenum)writeTarget,
   3085         (GLintptr)readOffset,
   3086         (GLintptr)writeOffset,
   3087         (GLsizeiptr)size
   3088     );
   3089 }
   3090 
   3091 /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
   3092 static
   3093 void
   3094 android_glGetUniformIndices_array
   3095     (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
   3096     jint _exception = 0;
   3097     const char* _exceptionType = NULL;
   3098     const char* _exceptionMessage = NULL;
   3099     jint _count = 0;
   3100     jint _i;
   3101     const char** _names = NULL;
   3102     GLuint* _indices_base = NULL;
   3103     GLuint* _indices = NULL;
   3104 
   3105     if (!uniformNames_ref) {
   3106         _exception = 1;
   3107         _exceptionType = "java/lang/IllegalArgumentException";
   3108         _exceptionMessage = "uniformNames == null";
   3109         goto exit;
   3110     }
   3111     _count = _env->GetArrayLength(uniformNames_ref);
   3112     _names = (const char**)calloc(_count, sizeof(const char*));
   3113     for (_i = 0; _i < _count; _i++) {
   3114         jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
   3115         if (!_name) {
   3116             _exception = 1;
   3117             _exceptionType = "java/lang/IllegalArgumentException";
   3118             _exceptionMessage = "null uniformNames element";
   3119             goto exit;
   3120         }
   3121         _names[_i] = _env->GetStringUTFChars(_name, 0);
   3122     }
   3123 
   3124     if (!uniformIndices_ref) {
   3125         _exception = 1;
   3126         _exceptionType = "java/lang/IllegalArgumentException";
   3127         _exceptionMessage = "uniformIndices == null";
   3128         goto exit;
   3129     }
   3130     if (uniformIndicesOffset < 0) {
   3131         _exception = 1;
   3132         _exceptionType = "java/lang/IllegalArgumentException";
   3133         _exceptionMessage = "uniformIndicesOffset < 0";
   3134         goto exit;
   3135     }
   3136     if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
   3137         _exception = 1;
   3138         _exceptionType = "java/lang/IllegalArgumentException";
   3139         _exceptionMessage = "not enough space in uniformIndices";
   3140         goto exit;
   3141     }
   3142     _indices_base = (GLuint*)_env->GetPrimitiveArrayCritical(
   3143             uniformIndices_ref, 0);
   3144     _indices = _indices_base + uniformIndicesOffset;
   3145 
   3146     glGetUniformIndices(program, _count, _names, _indices);
   3147 
   3148 exit:
   3149     if (_indices_base) {
   3150         _env->ReleasePrimitiveArrayCritical(uniformIndices_ref, _indices_base,
   3151                 _exception ? JNI_ABORT : 0);
   3152     }
   3153     for (_i = _count - 1; _i >= 0; _i--) {
   3154         if (_names[_i]) {
   3155             jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
   3156             if (_name) {
   3157                 _env->ReleaseStringUTFChars(_name, _names[_i]);
   3158             }
   3159         }
   3160     }
   3161     free(_names);
   3162     if (_exception) {
   3163         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3164     }
   3165 }
   3166 
   3167 /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
   3168 static
   3169 void
   3170 android_glGetUniformIndices_buffer
   3171     (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
   3172     jint _exception = 0;
   3173     const char* _exceptionType = NULL;
   3174     const char* _exceptionMessage = NULL;
   3175     jint _count = 0;
   3176     jint _i;
   3177     const char** _names = NULL;
   3178     jarray _uniformIndicesArray = (jarray)0;
   3179     jint _uniformIndicesRemaining;
   3180     jint _uniformIndicesOffset = 0;
   3181     GLuint* _indices = NULL;
   3182     char* _indicesBase = NULL;
   3183 
   3184     if (!uniformNames_ref) {
   3185         _exception = 1;
   3186         _exceptionType = "java/lang/IllegalArgumentException";
   3187         _exceptionMessage = "uniformNames == null";
   3188         goto exit;
   3189     }
   3190     if (!uniformIndices_buf) {
   3191         _exception = 1;
   3192         _exceptionType = "java/lang/IllegalArgumentException";
   3193         _exceptionMessage = "uniformIndices == null";
   3194         goto exit;
   3195     }
   3196 
   3197     _count = _env->GetArrayLength(uniformNames_ref);
   3198     _names = (const char**)calloc(_count, sizeof(const char*));
   3199     for (_i = 0; _i < _count; _i++) {
   3200         jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
   3201         if (!_name) {
   3202             _exception = 1;
   3203             _exceptionType = "java/lang/IllegalArgumentException";
   3204             _exceptionMessage = "null uniformNames element";
   3205             goto exit;
   3206         }
   3207         _names[_i] = _env->GetStringUTFChars(_name, 0);
   3208     }
   3209 
   3210     _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
   3211             &_uniformIndicesArray, &_uniformIndicesRemaining,
   3212             &_uniformIndicesOffset);
   3213     if (!_indices) {
   3214         _indicesBase = (char*)_env->GetPrimitiveArrayCritical(
   3215                 _uniformIndicesArray, 0);
   3216         _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
   3217     }
   3218     if (_uniformIndicesRemaining < _count) {
   3219         _exception = 1;
   3220         _exceptionType = "java/lang/IllegalArgumentException";
   3221         _exceptionMessage = "not enough space in uniformIndices";
   3222         goto exit;
   3223     }
   3224 
   3225     glGetUniformIndices(program, _count, _names, _indices);
   3226 
   3227 exit:
   3228     if (_uniformIndicesArray) {
   3229         releasePointer(_env, _uniformIndicesArray, _indicesBase, JNI_TRUE);
   3230     }
   3231     for (_i = _count - 1; _i >= 0; _i--) {
   3232         if (_names[_i]) {
   3233             jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
   3234             if (_name) {
   3235                 _env->ReleaseStringUTFChars(_name, _names[_i]);
   3236             }
   3237         }
   3238     }
   3239     free(_names);
   3240     if (_exception) {
   3241         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3242     }
   3243 }
   3244 
   3245 /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
   3246 static void
   3247 android_glGetActiveUniformsiv__II_3III_3II
   3248   (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
   3249     jint _exception = 0;
   3250     const char * _exceptionType = NULL;
   3251     const char * _exceptionMessage = NULL;
   3252     GLuint *uniformIndices_base = (GLuint *) 0;
   3253     jint _uniformIndicesRemaining;
   3254     GLuint *uniformIndices = (GLuint *) 0;
   3255     GLint *params_base = (GLint *) 0;
   3256     jint _paramsRemaining;
   3257     GLint *params = (GLint *) 0;
   3258 
   3259     if (!uniformIndices_ref) {
   3260         _exception = 1;
   3261         _exceptionType = "java/lang/IllegalArgumentException";
   3262         _exceptionMessage = "uniformIndices == null";
   3263         goto exit;
   3264     }
   3265     if (uniformIndicesOffset < 0) {
   3266         _exception = 1;
   3267         _exceptionType = "java/lang/IllegalArgumentException";
   3268         _exceptionMessage = "uniformIndicesOffset < 0";
   3269         goto exit;
   3270     }
   3271     _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
   3272     uniformIndices_base = (GLuint *)
   3273         _env->GetPrimitiveArrayCritical(uniformIndices_ref, (jboolean *)0);
   3274     uniformIndices = uniformIndices_base + uniformIndicesOffset;
   3275 
   3276     if (!params_ref) {
   3277         _exception = 1;
   3278         _exceptionType = "java/lang/IllegalArgumentException";
   3279         _exceptionMessage = "params == null";
   3280         goto exit;
   3281     }
   3282     if (paramsOffset < 0) {
   3283         _exception = 1;
   3284         _exceptionType = "java/lang/IllegalArgumentException";
   3285         _exceptionMessage = "paramsOffset < 0";
   3286         goto exit;
   3287     }
   3288     _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
   3289     params_base = (GLint *)
   3290         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   3291     params = params_base + paramsOffset;
   3292 
   3293     glGetActiveUniformsiv(
   3294         (GLuint)program,
   3295         (GLsizei)uniformCount,
   3296         (GLuint *)uniformIndices,
   3297         (GLenum)pname,
   3298         (GLint *)params
   3299     );
   3300 
   3301 exit:
   3302     if (params_base) {
   3303         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   3304             _exception ? JNI_ABORT: 0);
   3305     }
   3306     if (uniformIndices_base) {
   3307         _env->ReleasePrimitiveArrayCritical(uniformIndices_ref, uniformIndices_base,
   3308             JNI_ABORT);
   3309     }
   3310     if (_exception) {
   3311         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3312     }
   3313 }
   3314 
   3315 /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
   3316 static void
   3317 android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
   3318   (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
   3319     jarray _uniformIndicesArray = (jarray) 0;
   3320     jint _uniformIndicesBufferOffset = (jint) 0;
   3321     jarray _paramsArray = (jarray) 0;
   3322     jint _paramsBufferOffset = (jint) 0;
   3323     jint _uniformIndicesRemaining;
   3324     GLuint *uniformIndices = (GLuint *) 0;
   3325     jint _paramsRemaining;
   3326     GLint *params = (GLint *) 0;
   3327 
   3328     uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, &_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
   3329     params = (GLint *)getPointer(_env, params_buf, &_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
   3330     if (uniformIndices == NULL) {
   3331         char * _uniformIndicesBase = (char *)_env->GetPrimitiveArrayCritical(_uniformIndicesArray, (jboolean *) 0);
   3332         uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
   3333     }
   3334     if (params == NULL) {
   3335         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_paramsArray, (jboolean *) 0);
   3336         params = (GLint *) (_paramsBase + _paramsBufferOffset);
   3337     }
   3338     glGetActiveUniformsiv(
   3339         (GLuint)program,
   3340         (GLsizei)uniformCount,
   3341         (GLuint *)uniformIndices,
   3342         (GLenum)pname,
   3343         (GLint *)params
   3344     );
   3345     if (_paramsArray) {
   3346         releasePointer(_env, _paramsArray, params, JNI_TRUE);
   3347     }
   3348     if (_uniformIndicesArray) {
   3349         releasePointer(_env, _uniformIndicesArray, uniformIndices, JNI_FALSE);
   3350     }
   3351 }
   3352 
   3353 /* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
   3354 static jint
   3355 android_glGetUniformBlockIndex__ILjava_lang_String_2
   3356   (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
   3357     jint _exception = 0;
   3358     const char * _exceptionType = NULL;
   3359     const char * _exceptionMessage = NULL;
   3360     GLuint _returnValue = 0;
   3361     const char* _nativeuniformBlockName = 0;
   3362 
   3363     if (!uniformBlockName) {
   3364         _exceptionType = "java/lang/IllegalArgumentException";
   3365         _exceptionMessage = "uniformBlockName == null";
   3366         goto exit;
   3367     }
   3368     _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
   3369 
   3370     _returnValue = glGetUniformBlockIndex(
   3371         (GLuint)program,
   3372         (GLchar *)_nativeuniformBlockName
   3373     );
   3374 
   3375 exit:
   3376     if (_nativeuniformBlockName) {
   3377         _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
   3378     }
   3379 
   3380     if (_exception) {
   3381         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3382     }
   3383     return (jint)_returnValue;
   3384 }
   3385 
   3386 /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
   3387 static void
   3388 android_glGetActiveUniformBlockiv__III_3II
   3389   (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
   3390     jint _exception = 0;
   3391     const char * _exceptionType = NULL;
   3392     const char * _exceptionMessage = NULL;
   3393     GLint *params_base = (GLint *) 0;
   3394     jint _remaining;
   3395     GLint *params = (GLint *) 0;
   3396 
   3397     if (!params_ref) {
   3398         _exception = 1;
   3399         _exceptionType = "java/lang/IllegalArgumentException";
   3400         _exceptionMessage = "params == null";
   3401         goto exit;
   3402     }
   3403     if (offset < 0) {
   3404         _exception = 1;
   3405         _exceptionType = "java/lang/IllegalArgumentException";
   3406         _exceptionMessage = "offset < 0";
   3407         goto exit;
   3408     }
   3409     _remaining = _env->GetArrayLength(params_ref) - offset;
   3410     params_base = (GLint *)
   3411         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   3412     params = params_base + offset;
   3413 
   3414     glGetActiveUniformBlockiv(
   3415         (GLuint)program,
   3416         (GLuint)uniformBlockIndex,
   3417         (GLenum)pname,
   3418         (GLint *)params
   3419     );
   3420 
   3421 exit:
   3422     if (params_base) {
   3423         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   3424             _exception ? JNI_ABORT: 0);
   3425     }
   3426     if (_exception) {
   3427         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3428     }
   3429 }
   3430 
   3431 /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
   3432 static void
   3433 android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
   3434   (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
   3435     jarray _array = (jarray) 0;
   3436     jint _bufferOffset = (jint) 0;
   3437     jint _remaining;
   3438     GLint *params = (GLint *) 0;
   3439 
   3440     params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   3441     if (params == NULL) {
   3442         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3443         params = (GLint *) (_paramsBase + _bufferOffset);
   3444     }
   3445     glGetActiveUniformBlockiv(
   3446         (GLuint)program,
   3447         (GLuint)uniformBlockIndex,
   3448         (GLenum)pname,
   3449         (GLint *)params
   3450     );
   3451     if (_array) {
   3452         releasePointer(_env, _array, params, JNI_TRUE);
   3453     }
   3454 }
   3455 
   3456 /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
   3457 static void
   3458 android_glGetActiveUniformBlockName_III_3II_3BI
   3459     (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
   3460     jint _exception = 0;
   3461     const char* _exceptionType;
   3462     const char* _exceptionMessage;
   3463     GLsizei* _length_base = (GLsizei*)0;
   3464     jint _lengthRemaining;
   3465     GLsizei* _length = (GLsizei*)0;
   3466     GLchar* _name_base = (GLchar*)0;
   3467     jint _nameRemaining;
   3468     GLchar* _name = (GLchar*)0;
   3469 
   3470     if (!length_ref) {
   3471         _exception = 1;
   3472         _exceptionType = "java/lang/IllegalArgumentException";
   3473         _exceptionMessage = "length == null";
   3474         goto exit;
   3475     }
   3476     if (lengthOffset < 0) {
   3477         _exception = 1;
   3478         _exceptionType = "java/lang/IllegalArgumentException";
   3479         _exceptionMessage = "lengthOffset < 0";
   3480         goto exit;
   3481     }
   3482     _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
   3483     _length_base = (GLsizei*)_env->GetPrimitiveArrayCritical(
   3484             length_ref, (jboolean*)0);
   3485     _length = _length_base + lengthOffset;
   3486 
   3487     if (!name_ref) {
   3488         _exception = 1;
   3489         _exceptionType = "java/lang/IllegalArgumentException";
   3490         _exceptionMessage = "uniformBlockName == null";
   3491         goto exit;
   3492     }
   3493     if (nameOffset < 0) {
   3494         _exception = 1;
   3495         _exceptionType = "java/lang/IllegalArgumentException";
   3496         _exceptionMessage = "uniformBlockNameOffset < 0";
   3497         goto exit;
   3498     }
   3499     _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
   3500     _name_base = (GLchar*)_env->GetPrimitiveArrayCritical(
   3501             name_ref, (jboolean*)0);
   3502     _name = _name_base + nameOffset;
   3503 
   3504     glGetActiveUniformBlockName(
   3505         (GLuint)program,
   3506         (GLuint)uniformBlockIndex,
   3507         (GLsizei)bufSize,
   3508         (GLsizei*)_length,
   3509         (GLchar*)_name
   3510     );
   3511 
   3512 exit:
   3513     if (_name_base) {
   3514         _env->ReleasePrimitiveArrayCritical(name_ref, _name_base,
   3515             _exception ? JNI_ABORT: 0);
   3516     }
   3517     if (_length_base) {
   3518         _env->ReleasePrimitiveArrayCritical(length_ref, _length_base,
   3519             _exception ? JNI_ABORT: 0);
   3520     }
   3521     if (_exception) {
   3522         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3523     }
   3524 }
   3525 
   3526 /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
   3527 static void
   3528 android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
   3529     (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
   3530     jint _exception = 0;
   3531     const char* _exceptionType;
   3532     const char* _exceptionMessage;
   3533     jarray _lengthArray = (jarray)0;
   3534     jint _lengthBufferOffset = (jint)0;
   3535     GLsizei* _length = (GLsizei*)0;
   3536     jint _lengthRemaining;
   3537     jarray _nameArray = (jarray)0;
   3538     jint _nameBufferOffset = (jint)0;
   3539     GLchar* _name = (GLchar*)0;
   3540     jint _nameRemaining;
   3541 
   3542     _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
   3543     if (_length == NULL) {
   3544         GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
   3545         _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
   3546     }
   3547 
   3548     _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
   3549     if (_name == NULL) {
   3550         GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
   3551         _name = (GLchar*)(_nameBase + _nameBufferOffset);
   3552     }
   3553 
   3554     glGetActiveUniformBlockName(
   3555         (GLuint)program,
   3556         (GLuint)uniformBlockIndex,
   3557         (GLsizei)_nameRemaining,
   3558         _length, _name
   3559     );
   3560     if (_nameArray) {
   3561         releasePointer(_env, _nameArray, _name, JNI_TRUE);
   3562     }
   3563     if (_lengthArray) {
   3564         releasePointer(_env, _lengthArray, _length, JNI_TRUE);
   3565     }
   3566 }
   3567 
   3568 /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
   3569 static jstring
   3570 android_glGetActiveUniformBlockName_II
   3571     (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
   3572     GLint len = 0;
   3573     glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
   3574             GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
   3575     GLchar* name = (GLchar*)malloc(len);
   3576     glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
   3577         len, NULL, name);
   3578     jstring result = _env->NewStringUTF(name);
   3579     free(name);
   3580     return result;
   3581 }
   3582 
   3583 /* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
   3584 static void
   3585 android_glUniformBlockBinding__III
   3586   (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
   3587     glUniformBlockBinding(
   3588         (GLuint)program,
   3589         (GLuint)uniformBlockIndex,
   3590         (GLuint)uniformBlockBinding
   3591     );
   3592 }
   3593 
   3594 /* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
   3595 static void
   3596 android_glDrawArraysInstanced__IIII
   3597   (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
   3598     glDrawArraysInstanced(
   3599         (GLenum)mode,
   3600         (GLint)first,
   3601         (GLsizei)count,
   3602         (GLsizei)instanceCount
   3603     );
   3604 }
   3605 
   3606 /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
   3607 static void
   3608 android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
   3609   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
   3610     jarray _array = (jarray) 0;
   3611     jint _bufferOffset = (jint) 0;
   3612     jint _remaining;
   3613     GLvoid *indices = (GLvoid *) 0;
   3614 
   3615     indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
   3616     if (indices == NULL) {
   3617         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3618         indices = (GLvoid *) (_indicesBase + _bufferOffset);
   3619     }
   3620     glDrawElementsInstanced(
   3621         (GLenum)mode,
   3622         (GLsizei)count,
   3623         (GLenum)type,
   3624         (GLvoid *)indices,
   3625         (GLsizei)instanceCount
   3626     );
   3627     if (_array) {
   3628         releasePointer(_env, _array, indices, JNI_FALSE);
   3629     }
   3630 }
   3631 
   3632 /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
   3633 static void
   3634 android_glDrawElementsInstanced__IIIII
   3635   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
   3636     glDrawElementsInstanced(
   3637         (GLenum)mode,
   3638         (GLsizei)count,
   3639         (GLenum)type,
   3640         (GLvoid *)indicesOffset,
   3641         (GLsizei)instanceCount
   3642     );
   3643 }
   3644 
   3645 /* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
   3646 static jlong
   3647 android_glFenceSync__II
   3648   (JNIEnv *_env, jobject _this, jint condition, jint flags) {
   3649     GLsync _returnValue;
   3650     _returnValue = glFenceSync(
   3651         (GLenum)condition,
   3652         (GLbitfield)flags
   3653     );
   3654     return (jlong)_returnValue;
   3655 }
   3656 
   3657 /* GLboolean glIsSync ( GLsync sync ) */
   3658 static jboolean
   3659 android_glIsSync__J
   3660   (JNIEnv *_env, jobject _this, jlong sync) {
   3661     GLboolean _returnValue;
   3662     _returnValue = glIsSync(
   3663         (GLsync)sync
   3664     );
   3665     return (jboolean)_returnValue;
   3666 }
   3667 
   3668 /* void glDeleteSync ( GLsync sync ) */
   3669 static void
   3670 android_glDeleteSync__J
   3671   (JNIEnv *_env, jobject _this, jlong sync) {
   3672     glDeleteSync(
   3673         (GLsync)sync
   3674     );
   3675 }
   3676 
   3677 /* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
   3678 static jint
   3679 android_glClientWaitSync__JIJ
   3680   (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
   3681     GLenum _returnValue;
   3682     _returnValue = glClientWaitSync(
   3683         (GLsync)sync,
   3684         (GLbitfield)flags,
   3685         (GLuint64)timeout
   3686     );
   3687     return (jint)_returnValue;
   3688 }
   3689 
   3690 /* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
   3691 static void
   3692 android_glWaitSync__JIJ
   3693   (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
   3694     glWaitSync(
   3695         (GLsync)sync,
   3696         (GLbitfield)flags,
   3697         (GLuint64)timeout
   3698     );
   3699 }
   3700 
   3701 /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
   3702 static void
   3703 android_glGetInteger64v__I_3JI
   3704   (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
   3705     jint _exception = 0;
   3706     const char * _exceptionType = NULL;
   3707     const char * _exceptionMessage = NULL;
   3708     GLint64 *params_base = (GLint64 *) 0;
   3709     jint _remaining;
   3710     GLint64 *params = (GLint64 *) 0;
   3711 
   3712     if (!params_ref) {
   3713         _exception = 1;
   3714         _exceptionType = "java/lang/IllegalArgumentException";
   3715         _exceptionMessage = "params == null";
   3716         goto exit;
   3717     }
   3718     if (offset < 0) {
   3719         _exception = 1;
   3720         _exceptionType = "java/lang/IllegalArgumentException";
   3721         _exceptionMessage = "offset < 0";
   3722         goto exit;
   3723     }
   3724     _remaining = _env->GetArrayLength(params_ref) - offset;
   3725     params_base = (GLint64 *)
   3726         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   3727     params = params_base + offset;
   3728 
   3729     glGetInteger64v(
   3730         (GLenum)pname,
   3731         (GLint64 *)params
   3732     );
   3733 
   3734 exit:
   3735     if (params_base) {
   3736         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   3737             _exception ? JNI_ABORT: 0);
   3738     }
   3739     if (_exception) {
   3740         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3741     }
   3742 }
   3743 
   3744 /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
   3745 static void
   3746 android_glGetInteger64v__ILjava_nio_LongBuffer_2
   3747   (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
   3748     jarray _array = (jarray) 0;
   3749     jint _bufferOffset = (jint) 0;
   3750     jint _remaining;
   3751     GLint64 *params = (GLint64 *) 0;
   3752 
   3753     params = (GLint64 *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   3754     if (params == NULL) {
   3755         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3756         params = (GLint64 *) (_paramsBase + _bufferOffset);
   3757     }
   3758     glGetInteger64v(
   3759         (GLenum)pname,
   3760         (GLint64 *)params
   3761     );
   3762     if (_array) {
   3763         releasePointer(_env, _array, params, JNI_TRUE);
   3764     }
   3765 }
   3766 
   3767 /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
   3768 static void
   3769 android_glGetSynciv__JII_3II_3II
   3770   (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
   3771     jint _exception = 0;
   3772     const char * _exceptionType = NULL;
   3773     const char * _exceptionMessage = NULL;
   3774     GLsizei *length_base = (GLsizei *) 0;
   3775     jint _lengthRemaining;
   3776     GLsizei *length = (GLsizei *) 0;
   3777     GLint *values_base = (GLint *) 0;
   3778     jint _valuesRemaining;
   3779     GLint *values = (GLint *) 0;
   3780 
   3781     if (!length_ref) {
   3782         _exception = 1;
   3783         _exceptionType = "java/lang/IllegalArgumentException";
   3784         _exceptionMessage = "length == null";
   3785         goto exit;
   3786     }
   3787     if (lengthOffset < 0) {
   3788         _exception = 1;
   3789         _exceptionType = "java/lang/IllegalArgumentException";
   3790         _exceptionMessage = "lengthOffset < 0";
   3791         goto exit;
   3792     }
   3793     _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
   3794     length_base = (GLsizei *)
   3795         _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
   3796     length = length_base + lengthOffset;
   3797 
   3798     if (!values_ref) {
   3799         _exception = 1;
   3800         _exceptionType = "java/lang/IllegalArgumentException";
   3801         _exceptionMessage = "values == null";
   3802         goto exit;
   3803     }
   3804     if (valuesOffset < 0) {
   3805         _exception = 1;
   3806         _exceptionType = "java/lang/IllegalArgumentException";
   3807         _exceptionMessage = "valuesOffset < 0";
   3808         goto exit;
   3809     }
   3810     _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
   3811     values_base = (GLint *)
   3812         _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
   3813     values = values_base + valuesOffset;
   3814 
   3815     glGetSynciv(
   3816         (GLsync)sync,
   3817         (GLenum)pname,
   3818         (GLsizei)bufSize,
   3819         (GLsizei *)length,
   3820         (GLint *)values
   3821     );
   3822 
   3823 exit:
   3824     if (values_base) {
   3825         _env->ReleasePrimitiveArrayCritical(values_ref, values_base,
   3826             _exception ? JNI_ABORT: 0);
   3827     }
   3828     if (length_base) {
   3829         _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
   3830             _exception ? JNI_ABORT: 0);
   3831     }
   3832     if (_exception) {
   3833         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3834     }
   3835 }
   3836 
   3837 /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
   3838 static void
   3839 android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
   3840   (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
   3841     jarray _lengthArray = (jarray) 0;
   3842     jint _lengthBufferOffset = (jint) 0;
   3843     jarray _valuesArray = (jarray) 0;
   3844     jint _valuesBufferOffset = (jint) 0;
   3845     jint _lengthRemaining;
   3846     GLsizei *length = (GLsizei *) 0;
   3847     jint _valuesRemaining;
   3848     GLint *values = (GLint *) 0;
   3849 
   3850     length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
   3851     values = (GLint *)getPointer(_env, values_buf, &_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
   3852     if (length == NULL) {
   3853         char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0);
   3854         length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
   3855     }
   3856     if (values == NULL) {
   3857         char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_valuesArray, (jboolean *) 0);
   3858         values = (GLint *) (_valuesBase + _valuesBufferOffset);
   3859     }
   3860     glGetSynciv(
   3861         (GLsync)sync,
   3862         (GLenum)pname,
   3863         (GLsizei)bufSize,
   3864         (GLsizei *)length,
   3865         (GLint *)values
   3866     );
   3867     if (_valuesArray) {
   3868         releasePointer(_env, _valuesArray, values, JNI_TRUE);
   3869     }
   3870     if (_lengthArray) {
   3871         releasePointer(_env, _lengthArray, length, JNI_TRUE);
   3872     }
   3873 }
   3874 
   3875 /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
   3876 static void
   3877 android_glGetInteger64i_v__II_3JI
   3878   (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
   3879     jint _exception = 0;
   3880     const char * _exceptionType = NULL;
   3881     const char * _exceptionMessage = NULL;
   3882     GLint64 *data_base = (GLint64 *) 0;
   3883     jint _remaining;
   3884     GLint64 *data = (GLint64 *) 0;
   3885 
   3886     if (!data_ref) {
   3887         _exception = 1;
   3888         _exceptionType = "java/lang/IllegalArgumentException";
   3889         _exceptionMessage = "data == null";
   3890         goto exit;
   3891     }
   3892     if (offset < 0) {
   3893         _exception = 1;
   3894         _exceptionType = "java/lang/IllegalArgumentException";
   3895         _exceptionMessage = "offset < 0";
   3896         goto exit;
   3897     }
   3898     _remaining = _env->GetArrayLength(data_ref) - offset;
   3899     data_base = (GLint64 *)
   3900         _env->GetPrimitiveArrayCritical(data_ref, (jboolean *)0);
   3901     data = data_base + offset;
   3902 
   3903     glGetInteger64i_v(
   3904         (GLenum)target,
   3905         (GLuint)index,
   3906         (GLint64 *)data
   3907     );
   3908 
   3909 exit:
   3910     if (data_base) {
   3911         _env->ReleasePrimitiveArrayCritical(data_ref, data_base,
   3912             _exception ? JNI_ABORT: 0);
   3913     }
   3914     if (_exception) {
   3915         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3916     }
   3917 }
   3918 
   3919 /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
   3920 static void
   3921 android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
   3922   (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
   3923     jarray _array = (jarray) 0;
   3924     jint _bufferOffset = (jint) 0;
   3925     jint _remaining;
   3926     GLint64 *data = (GLint64 *) 0;
   3927 
   3928     data = (GLint64 *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
   3929     if (data == NULL) {
   3930         char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3931         data = (GLint64 *) (_dataBase + _bufferOffset);
   3932     }
   3933     glGetInteger64i_v(
   3934         (GLenum)target,
   3935         (GLuint)index,
   3936         (GLint64 *)data
   3937     );
   3938     if (_array) {
   3939         releasePointer(_env, _array, data, JNI_TRUE);
   3940     }
   3941 }
   3942 
   3943 /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
   3944 static void
   3945 android_glGetBufferParameteri64v__II_3JI
   3946   (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
   3947     jint _exception = 0;
   3948     const char * _exceptionType = NULL;
   3949     const char * _exceptionMessage = NULL;
   3950     GLint64 *params_base = (GLint64 *) 0;
   3951     jint _remaining;
   3952     GLint64 *params = (GLint64 *) 0;
   3953 
   3954     if (!params_ref) {
   3955         _exception = 1;
   3956         _exceptionType = "java/lang/IllegalArgumentException";
   3957         _exceptionMessage = "params == null";
   3958         goto exit;
   3959     }
   3960     if (offset < 0) {
   3961         _exception = 1;
   3962         _exceptionType = "java/lang/IllegalArgumentException";
   3963         _exceptionMessage = "offset < 0";
   3964         goto exit;
   3965     }
   3966     _remaining = _env->GetArrayLength(params_ref) - offset;
   3967     params_base = (GLint64 *)
   3968         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   3969     params = params_base + offset;
   3970 
   3971     glGetBufferParameteri64v(
   3972         (GLenum)target,
   3973         (GLenum)pname,
   3974         (GLint64 *)params
   3975     );
   3976 
   3977 exit:
   3978     if (params_base) {
   3979         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   3980             _exception ? JNI_ABORT: 0);
   3981     }
   3982     if (_exception) {
   3983         jniThrowException(_env, _exceptionType, _exceptionMessage);
   3984     }
   3985 }
   3986 
   3987 /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
   3988 static void
   3989 android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
   3990   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
   3991     jarray _array = (jarray) 0;
   3992     jint _bufferOffset = (jint) 0;
   3993     jint _remaining;
   3994     GLint64 *params = (GLint64 *) 0;
   3995 
   3996     params = (GLint64 *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   3997     if (params == NULL) {
   3998         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   3999         params = (GLint64 *) (_paramsBase + _bufferOffset);
   4000     }
   4001     glGetBufferParameteri64v(
   4002         (GLenum)target,
   4003         (GLenum)pname,
   4004         (GLint64 *)params
   4005     );
   4006     if (_array) {
   4007         releasePointer(_env, _array, params, JNI_TRUE);
   4008     }
   4009 }
   4010 
   4011 /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
   4012 static void
   4013 android_glGenSamplers__I_3II
   4014   (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
   4015     jint _exception = 0;
   4016     const char * _exceptionType = NULL;
   4017     const char * _exceptionMessage = NULL;
   4018     GLuint *samplers_base = (GLuint *) 0;
   4019     jint _remaining;
   4020     GLuint *samplers = (GLuint *) 0;
   4021 
   4022     if (!samplers_ref) {
   4023         _exception = 1;
   4024         _exceptionType = "java/lang/IllegalArgumentException";
   4025         _exceptionMessage = "samplers == null";
   4026         goto exit;
   4027     }
   4028     if (offset < 0) {
   4029         _exception = 1;
   4030         _exceptionType = "java/lang/IllegalArgumentException";
   4031         _exceptionMessage = "offset < 0";
   4032         goto exit;
   4033     }
   4034     _remaining = _env->GetArrayLength(samplers_ref) - offset;
   4035     samplers_base = (GLuint *)
   4036         _env->GetPrimitiveArrayCritical(samplers_ref, (jboolean *)0);
   4037     samplers = samplers_base + offset;
   4038 
   4039     glGenSamplers(
   4040         (GLsizei)count,
   4041         (GLuint *)samplers
   4042     );
   4043 
   4044 exit:
   4045     if (samplers_base) {
   4046         _env->ReleasePrimitiveArrayCritical(samplers_ref, samplers_base,
   4047             _exception ? JNI_ABORT: 0);
   4048     }
   4049     if (_exception) {
   4050         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4051     }
   4052 }
   4053 
   4054 /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
   4055 static void
   4056 android_glGenSamplers__ILjava_nio_IntBuffer_2
   4057   (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
   4058     jarray _array = (jarray) 0;
   4059     jint _bufferOffset = (jint) 0;
   4060     jint _remaining;
   4061     GLuint *samplers = (GLuint *) 0;
   4062 
   4063     samplers = (GLuint *)getPointer(_env, samplers_buf, &_array, &_remaining, &_bufferOffset);
   4064     if (samplers == NULL) {
   4065         char * _samplersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4066         samplers = (GLuint *) (_samplersBase + _bufferOffset);
   4067     }
   4068     glGenSamplers(
   4069         (GLsizei)count,
   4070         (GLuint *)samplers
   4071     );
   4072     if (_array) {
   4073         releasePointer(_env, _array, samplers, JNI_TRUE);
   4074     }
   4075 }
   4076 
   4077 /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
   4078 static void
   4079 android_glDeleteSamplers__I_3II
   4080   (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
   4081     jint _exception = 0;
   4082     const char * _exceptionType = NULL;
   4083     const char * _exceptionMessage = NULL;
   4084     GLuint *samplers_base = (GLuint *) 0;
   4085     jint _remaining;
   4086     GLuint *samplers = (GLuint *) 0;
   4087 
   4088     if (!samplers_ref) {
   4089         _exception = 1;
   4090         _exceptionType = "java/lang/IllegalArgumentException";
   4091         _exceptionMessage = "samplers == null";
   4092         goto exit;
   4093     }
   4094     if (offset < 0) {
   4095         _exception = 1;
   4096         _exceptionType = "java/lang/IllegalArgumentException";
   4097         _exceptionMessage = "offset < 0";
   4098         goto exit;
   4099     }
   4100     _remaining = _env->GetArrayLength(samplers_ref) - offset;
   4101     samplers_base = (GLuint *)
   4102         _env->GetPrimitiveArrayCritical(samplers_ref, (jboolean *)0);
   4103     samplers = samplers_base + offset;
   4104 
   4105     glDeleteSamplers(
   4106         (GLsizei)count,
   4107         (GLuint *)samplers
   4108     );
   4109 
   4110 exit:
   4111     if (samplers_base) {
   4112         _env->ReleasePrimitiveArrayCritical(samplers_ref, samplers_base,
   4113             JNI_ABORT);
   4114     }
   4115     if (_exception) {
   4116         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4117     }
   4118 }
   4119 
   4120 /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
   4121 static void
   4122 android_glDeleteSamplers__ILjava_nio_IntBuffer_2
   4123   (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
   4124     jarray _array = (jarray) 0;
   4125     jint _bufferOffset = (jint) 0;
   4126     jint _remaining;
   4127     GLuint *samplers = (GLuint *) 0;
   4128 
   4129     samplers = (GLuint *)getPointer(_env, samplers_buf, &_array, &_remaining, &_bufferOffset);
   4130     if (samplers == NULL) {
   4131         char * _samplersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4132         samplers = (GLuint *) (_samplersBase + _bufferOffset);
   4133     }
   4134     glDeleteSamplers(
   4135         (GLsizei)count,
   4136         (GLuint *)samplers
   4137     );
   4138     if (_array) {
   4139         releasePointer(_env, _array, samplers, JNI_FALSE);
   4140     }
   4141 }
   4142 
   4143 /* GLboolean glIsSampler ( GLuint sampler ) */
   4144 static jboolean
   4145 android_glIsSampler__I
   4146   (JNIEnv *_env, jobject _this, jint sampler) {
   4147     GLboolean _returnValue;
   4148     _returnValue = glIsSampler(
   4149         (GLuint)sampler
   4150     );
   4151     return (jboolean)_returnValue;
   4152 }
   4153 
   4154 /* void glBindSampler ( GLuint unit, GLuint sampler ) */
   4155 static void
   4156 android_glBindSampler__II
   4157   (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
   4158     glBindSampler(
   4159         (GLuint)unit,
   4160         (GLuint)sampler
   4161     );
   4162 }
   4163 
   4164 /* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
   4165 static void
   4166 android_glSamplerParameteri__III
   4167   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
   4168     glSamplerParameteri(
   4169         (GLuint)sampler,
   4170         (GLenum)pname,
   4171         (GLint)param
   4172     );
   4173 }
   4174 
   4175 /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
   4176 static void
   4177 android_glSamplerParameteriv__II_3II
   4178   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
   4179     jint _exception = 0;
   4180     const char * _exceptionType = NULL;
   4181     const char * _exceptionMessage = NULL;
   4182     GLint *param_base = (GLint *) 0;
   4183     jint _remaining;
   4184     GLint *param = (GLint *) 0;
   4185 
   4186     if (!param_ref) {
   4187         _exception = 1;
   4188         _exceptionType = "java/lang/IllegalArgumentException";
   4189         _exceptionMessage = "param == null";
   4190         goto exit;
   4191     }
   4192     if (offset < 0) {
   4193         _exception = 1;
   4194         _exceptionType = "java/lang/IllegalArgumentException";
   4195         _exceptionMessage = "offset < 0";
   4196         goto exit;
   4197     }
   4198     _remaining = _env->GetArrayLength(param_ref) - offset;
   4199     param_base = (GLint *)
   4200         _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0);
   4201     param = param_base + offset;
   4202 
   4203     glSamplerParameteriv(
   4204         (GLuint)sampler,
   4205         (GLenum)pname,
   4206         (GLint *)param
   4207     );
   4208 
   4209 exit:
   4210     if (param_base) {
   4211         _env->ReleasePrimitiveArrayCritical(param_ref, param_base,
   4212             JNI_ABORT);
   4213     }
   4214     if (_exception) {
   4215         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4216     }
   4217 }
   4218 
   4219 /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
   4220 static void
   4221 android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
   4222   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
   4223     jarray _array = (jarray) 0;
   4224     jint _bufferOffset = (jint) 0;
   4225     jint _remaining;
   4226     GLint *param = (GLint *) 0;
   4227 
   4228     param = (GLint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset);
   4229     if (param == NULL) {
   4230         char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4231         param = (GLint *) (_paramBase + _bufferOffset);
   4232     }
   4233     glSamplerParameteriv(
   4234         (GLuint)sampler,
   4235         (GLenum)pname,
   4236         (GLint *)param
   4237     );
   4238     if (_array) {
   4239         releasePointer(_env, _array, param, JNI_FALSE);
   4240     }
   4241 }
   4242 
   4243 /* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
   4244 static void
   4245 android_glSamplerParameterf__IIF
   4246   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
   4247     glSamplerParameterf(
   4248         (GLuint)sampler,
   4249         (GLenum)pname,
   4250         (GLfloat)param
   4251     );
   4252 }
   4253 
   4254 /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
   4255 static void
   4256 android_glSamplerParameterfv__II_3FI
   4257   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
   4258     jint _exception = 0;
   4259     const char * _exceptionType = NULL;
   4260     const char * _exceptionMessage = NULL;
   4261     GLfloat *param_base = (GLfloat *) 0;
   4262     jint _remaining;
   4263     GLfloat *param = (GLfloat *) 0;
   4264 
   4265     if (!param_ref) {
   4266         _exception = 1;
   4267         _exceptionType = "java/lang/IllegalArgumentException";
   4268         _exceptionMessage = "param == null";
   4269         goto exit;
   4270     }
   4271     if (offset < 0) {
   4272         _exception = 1;
   4273         _exceptionType = "java/lang/IllegalArgumentException";
   4274         _exceptionMessage = "offset < 0";
   4275         goto exit;
   4276     }
   4277     _remaining = _env->GetArrayLength(param_ref) - offset;
   4278     param_base = (GLfloat *)
   4279         _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0);
   4280     param = param_base + offset;
   4281 
   4282     glSamplerParameterfv(
   4283         (GLuint)sampler,
   4284         (GLenum)pname,
   4285         (GLfloat *)param
   4286     );
   4287 
   4288 exit:
   4289     if (param_base) {
   4290         _env->ReleasePrimitiveArrayCritical(param_ref, param_base,
   4291             JNI_ABORT);
   4292     }
   4293     if (_exception) {
   4294         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4295     }
   4296 }
   4297 
   4298 /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
   4299 static void
   4300 android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
   4301   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
   4302     jarray _array = (jarray) 0;
   4303     jint _bufferOffset = (jint) 0;
   4304     jint _remaining;
   4305     GLfloat *param = (GLfloat *) 0;
   4306 
   4307     param = (GLfloat *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset);
   4308     if (param == NULL) {
   4309         char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4310         param = (GLfloat *) (_paramBase + _bufferOffset);
   4311     }
   4312     glSamplerParameterfv(
   4313         (GLuint)sampler,
   4314         (GLenum)pname,
   4315         (GLfloat *)param
   4316     );
   4317     if (_array) {
   4318         releasePointer(_env, _array, param, JNI_FALSE);
   4319     }
   4320 }
   4321 
   4322 /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
   4323 static void
   4324 android_glGetSamplerParameteriv__II_3II
   4325   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
   4326     jint _exception = 0;
   4327     const char * _exceptionType = NULL;
   4328     const char * _exceptionMessage = NULL;
   4329     GLint *params_base = (GLint *) 0;
   4330     jint _remaining;
   4331     GLint *params = (GLint *) 0;
   4332 
   4333     if (!params_ref) {
   4334         _exception = 1;
   4335         _exceptionType = "java/lang/IllegalArgumentException";
   4336         _exceptionMessage = "params == null";
   4337         goto exit;
   4338     }
   4339     if (offset < 0) {
   4340         _exception = 1;
   4341         _exceptionType = "java/lang/IllegalArgumentException";
   4342         _exceptionMessage = "offset < 0";
   4343         goto exit;
   4344     }
   4345     _remaining = _env->GetArrayLength(params_ref) - offset;
   4346     params_base = (GLint *)
   4347         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   4348     params = params_base + offset;
   4349 
   4350     glGetSamplerParameteriv(
   4351         (GLuint)sampler,
   4352         (GLenum)pname,
   4353         (GLint *)params
   4354     );
   4355 
   4356 exit:
   4357     if (params_base) {
   4358         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   4359             _exception ? JNI_ABORT: 0);
   4360     }
   4361     if (_exception) {
   4362         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4363     }
   4364 }
   4365 
   4366 /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
   4367 static void
   4368 android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
   4369   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
   4370     jarray _array = (jarray) 0;
   4371     jint _bufferOffset = (jint) 0;
   4372     jint _remaining;
   4373     GLint *params = (GLint *) 0;
   4374 
   4375     params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   4376     if (params == NULL) {
   4377         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4378         params = (GLint *) (_paramsBase + _bufferOffset);
   4379     }
   4380     glGetSamplerParameteriv(
   4381         (GLuint)sampler,
   4382         (GLenum)pname,
   4383         (GLint *)params
   4384     );
   4385     if (_array) {
   4386         releasePointer(_env, _array, params, JNI_TRUE);
   4387     }
   4388 }
   4389 
   4390 /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
   4391 static void
   4392 android_glGetSamplerParameterfv__II_3FI
   4393   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
   4394     jint _exception = 0;
   4395     const char * _exceptionType = NULL;
   4396     const char * _exceptionMessage = NULL;
   4397     GLfloat *params_base = (GLfloat *) 0;
   4398     jint _remaining;
   4399     GLfloat *params = (GLfloat *) 0;
   4400 
   4401     if (!params_ref) {
   4402         _exception = 1;
   4403         _exceptionType = "java/lang/IllegalArgumentException";
   4404         _exceptionMessage = "params == null";
   4405         goto exit;
   4406     }
   4407     if (offset < 0) {
   4408         _exception = 1;
   4409         _exceptionType = "java/lang/IllegalArgumentException";
   4410         _exceptionMessage = "offset < 0";
   4411         goto exit;
   4412     }
   4413     _remaining = _env->GetArrayLength(params_ref) - offset;
   4414     params_base = (GLfloat *)
   4415         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   4416     params = params_base + offset;
   4417 
   4418     glGetSamplerParameterfv(
   4419         (GLuint)sampler,
   4420         (GLenum)pname,
   4421         (GLfloat *)params
   4422     );
   4423 
   4424 exit:
   4425     if (params_base) {
   4426         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   4427             _exception ? JNI_ABORT: 0);
   4428     }
   4429     if (_exception) {
   4430         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4431     }
   4432 }
   4433 
   4434 /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
   4435 static void
   4436 android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
   4437   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
   4438     jarray _array = (jarray) 0;
   4439     jint _bufferOffset = (jint) 0;
   4440     jint _remaining;
   4441     GLfloat *params = (GLfloat *) 0;
   4442 
   4443     params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   4444     if (params == NULL) {
   4445         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4446         params = (GLfloat *) (_paramsBase + _bufferOffset);
   4447     }
   4448     glGetSamplerParameterfv(
   4449         (GLuint)sampler,
   4450         (GLenum)pname,
   4451         (GLfloat *)params
   4452     );
   4453     if (_array) {
   4454         releasePointer(_env, _array, params, JNI_TRUE);
   4455     }
   4456 }
   4457 
   4458 /* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
   4459 static void
   4460 android_glVertexAttribDivisor__II
   4461   (JNIEnv *_env, jobject _this, jint index, jint divisor) {
   4462     glVertexAttribDivisor(
   4463         (GLuint)index,
   4464         (GLuint)divisor
   4465     );
   4466 }
   4467 
   4468 /* void glBindTransformFeedback ( GLenum target, GLuint id ) */
   4469 static void
   4470 android_glBindTransformFeedback__II
   4471   (JNIEnv *_env, jobject _this, jint target, jint id) {
   4472     glBindTransformFeedback(
   4473         (GLenum)target,
   4474         (GLuint)id
   4475     );
   4476 }
   4477 
   4478 /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
   4479 static void
   4480 android_glDeleteTransformFeedbacks__I_3II
   4481   (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
   4482     jint _exception = 0;
   4483     const char * _exceptionType = NULL;
   4484     const char * _exceptionMessage = NULL;
   4485     GLuint *ids_base = (GLuint *) 0;
   4486     jint _remaining;
   4487     GLuint *ids = (GLuint *) 0;
   4488 
   4489     if (!ids_ref) {
   4490         _exception = 1;
   4491         _exceptionType = "java/lang/IllegalArgumentException";
   4492         _exceptionMessage = "ids == null";
   4493         goto exit;
   4494     }
   4495     if (offset < 0) {
   4496         _exception = 1;
   4497         _exceptionType = "java/lang/IllegalArgumentException";
   4498         _exceptionMessage = "offset < 0";
   4499         goto exit;
   4500     }
   4501     _remaining = _env->GetArrayLength(ids_ref) - offset;
   4502     ids_base = (GLuint *)
   4503         _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0);
   4504     ids = ids_base + offset;
   4505 
   4506     glDeleteTransformFeedbacks(
   4507         (GLsizei)n,
   4508         (GLuint *)ids
   4509     );
   4510 
   4511 exit:
   4512     if (ids_base) {
   4513         _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base,
   4514             JNI_ABORT);
   4515     }
   4516     if (_exception) {
   4517         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4518     }
   4519 }
   4520 
   4521 /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
   4522 static void
   4523 android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
   4524   (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
   4525     jarray _array = (jarray) 0;
   4526     jint _bufferOffset = (jint) 0;
   4527     jint _remaining;
   4528     GLuint *ids = (GLuint *) 0;
   4529 
   4530     ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset);
   4531     if (ids == NULL) {
   4532         char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4533         ids = (GLuint *) (_idsBase + _bufferOffset);
   4534     }
   4535     glDeleteTransformFeedbacks(
   4536         (GLsizei)n,
   4537         (GLuint *)ids
   4538     );
   4539     if (_array) {
   4540         releasePointer(_env, _array, ids, JNI_FALSE);
   4541     }
   4542 }
   4543 
   4544 /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
   4545 static void
   4546 android_glGenTransformFeedbacks__I_3II
   4547   (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
   4548     jint _exception = 0;
   4549     const char * _exceptionType = NULL;
   4550     const char * _exceptionMessage = NULL;
   4551     GLuint *ids_base = (GLuint *) 0;
   4552     jint _remaining;
   4553     GLuint *ids = (GLuint *) 0;
   4554 
   4555     if (!ids_ref) {
   4556         _exception = 1;
   4557         _exceptionType = "java/lang/IllegalArgumentException";
   4558         _exceptionMessage = "ids == null";
   4559         goto exit;
   4560     }
   4561     if (offset < 0) {
   4562         _exception = 1;
   4563         _exceptionType = "java/lang/IllegalArgumentException";
   4564         _exceptionMessage = "offset < 0";
   4565         goto exit;
   4566     }
   4567     _remaining = _env->GetArrayLength(ids_ref) - offset;
   4568     ids_base = (GLuint *)
   4569         _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0);
   4570     ids = ids_base + offset;
   4571 
   4572     glGenTransformFeedbacks(
   4573         (GLsizei)n,
   4574         (GLuint *)ids
   4575     );
   4576 
   4577 exit:
   4578     if (ids_base) {
   4579         _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base,
   4580             _exception ? JNI_ABORT: 0);
   4581     }
   4582     if (_exception) {
   4583         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4584     }
   4585 }
   4586 
   4587 /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
   4588 static void
   4589 android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
   4590   (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
   4591     jarray _array = (jarray) 0;
   4592     jint _bufferOffset = (jint) 0;
   4593     jint _remaining;
   4594     GLuint *ids = (GLuint *) 0;
   4595 
   4596     ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset);
   4597     if (ids == NULL) {
   4598         char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4599         ids = (GLuint *) (_idsBase + _bufferOffset);
   4600     }
   4601     glGenTransformFeedbacks(
   4602         (GLsizei)n,
   4603         (GLuint *)ids
   4604     );
   4605     if (_array) {
   4606         releasePointer(_env, _array, ids, JNI_TRUE);
   4607     }
   4608 }
   4609 
   4610 /* GLboolean glIsTransformFeedback ( GLuint id ) */
   4611 static jboolean
   4612 android_glIsTransformFeedback__I
   4613   (JNIEnv *_env, jobject _this, jint id) {
   4614     GLboolean _returnValue;
   4615     _returnValue = glIsTransformFeedback(
   4616         (GLuint)id
   4617     );
   4618     return (jboolean)_returnValue;
   4619 }
   4620 
   4621 /* void glPauseTransformFeedback ( void ) */
   4622 static void
   4623 android_glPauseTransformFeedback__
   4624   (JNIEnv *_env, jobject _this) {
   4625     glPauseTransformFeedback();
   4626 }
   4627 
   4628 /* void glResumeTransformFeedback ( void ) */
   4629 static void
   4630 android_glResumeTransformFeedback__
   4631   (JNIEnv *_env, jobject _this) {
   4632     glResumeTransformFeedback();
   4633 }
   4634 
   4635 /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
   4636 static void
   4637 android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
   4638   (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
   4639     jint _exception = 0;
   4640     const char * _exceptionType = NULL;
   4641     const char * _exceptionMessage = NULL;
   4642     jarray _array = (jarray) 0;
   4643     jint _bufferOffset = (jint) 0;
   4644     GLsizei *length_base = (GLsizei *) 0;
   4645     jint _lengthRemaining;
   4646     GLsizei *length = (GLsizei *) 0;
   4647     GLenum *binaryFormat_base = (GLenum *) 0;
   4648     jint _binaryFormatRemaining;
   4649     GLenum *binaryFormat = (GLenum *) 0;
   4650     jint _binaryRemaining;
   4651     GLvoid *binary = (GLvoid *) 0;
   4652 
   4653     if (!length_ref) {
   4654         _exception = 1;
   4655         _exceptionType = "java/lang/IllegalArgumentException";
   4656         _exceptionMessage = "length == null";
   4657         goto exit;
   4658     }
   4659     if (lengthOffset < 0) {
   4660         _exception = 1;
   4661         _exceptionType = "java/lang/IllegalArgumentException";
   4662         _exceptionMessage = "lengthOffset < 0";
   4663         goto exit;
   4664     }
   4665     _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
   4666     length_base = (GLsizei *)
   4667         _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
   4668     length = length_base + lengthOffset;
   4669 
   4670     if (!binaryFormat_ref) {
   4671         _exception = 1;
   4672         _exceptionType = "java/lang/IllegalArgumentException";
   4673         _exceptionMessage = "binaryFormat == null";
   4674         goto exit;
   4675     }
   4676     if (binaryFormatOffset < 0) {
   4677         _exception = 1;
   4678         _exceptionType = "java/lang/IllegalArgumentException";
   4679         _exceptionMessage = "binaryFormatOffset < 0";
   4680         goto exit;
   4681     }
   4682     _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
   4683     binaryFormat_base = (GLenum *)
   4684         _env->GetPrimitiveArrayCritical(binaryFormat_ref, (jboolean *)0);
   4685     binaryFormat = binaryFormat_base + binaryFormatOffset;
   4686 
   4687     binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining, &_bufferOffset);
   4688     if (binary == NULL) {
   4689         char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4690         binary = (GLvoid *) (_binaryBase + _bufferOffset);
   4691     }
   4692     glGetProgramBinary(
   4693         (GLuint)program,
   4694         (GLsizei)bufSize,
   4695         (GLsizei *)length,
   4696         (GLenum *)binaryFormat,
   4697         (GLvoid *)binary
   4698     );
   4699 
   4700 exit:
   4701     if (_array) {
   4702         releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
   4703     }
   4704     if (binaryFormat_base) {
   4705         _env->ReleasePrimitiveArrayCritical(binaryFormat_ref, binaryFormat_base,
   4706             _exception ? JNI_ABORT: 0);
   4707     }
   4708     if (length_base) {
   4709         _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
   4710             _exception ? JNI_ABORT: 0);
   4711     }
   4712     if (_exception) {
   4713         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4714     }
   4715 }
   4716 
   4717 /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
   4718 static void
   4719 android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
   4720   (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
   4721     jarray _lengthArray = (jarray) 0;
   4722     jint _lengthBufferOffset = (jint) 0;
   4723     jarray _binaryFormatArray = (jarray) 0;
   4724     jint _binaryFormatBufferOffset = (jint) 0;
   4725     jarray _binaryArray = (jarray) 0;
   4726     jint _binaryBufferOffset = (jint) 0;
   4727     jint _lengthRemaining;
   4728     GLsizei *length = (GLsizei *) 0;
   4729     jint _binaryFormatRemaining;
   4730     GLenum *binaryFormat = (GLenum *) 0;
   4731     jint _binaryRemaining;
   4732     GLvoid *binary = (GLvoid *) 0;
   4733 
   4734     length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
   4735     binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, &_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
   4736     binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
   4737     if (length == NULL) {
   4738         char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0);
   4739         length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
   4740     }
   4741     if (binaryFormat == NULL) {
   4742         char * _binaryFormatBase = (char *)_env->GetPrimitiveArrayCritical(_binaryFormatArray, (jboolean *) 0);
   4743         binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
   4744     }
   4745     if (binary == NULL) {
   4746         char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
   4747         binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
   4748     }
   4749     glGetProgramBinary(
   4750         (GLuint)program,
   4751         (GLsizei)bufSize,
   4752         (GLsizei *)length,
   4753         (GLenum *)binaryFormat,
   4754         (GLvoid *)binary
   4755     );
   4756     if (_binaryArray) {
   4757         releasePointer(_env, _binaryArray, binary, JNI_TRUE);
   4758     }
   4759     if (_binaryFormatArray) {
   4760         releasePointer(_env, _binaryFormatArray, binaryFormat, JNI_TRUE);
   4761     }
   4762     if (_lengthArray) {
   4763         releasePointer(_env, _lengthArray, length, JNI_TRUE);
   4764     }
   4765 }
   4766 
   4767 /* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
   4768 static void
   4769 android_glProgramBinary__IILjava_nio_Buffer_2I
   4770   (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
   4771     jarray _array = (jarray) 0;
   4772     jint _bufferOffset = (jint) 0;
   4773     jint _remaining;
   4774     GLvoid *binary = (GLvoid *) 0;
   4775 
   4776     binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_remaining, &_bufferOffset);
   4777     if (binary == NULL) {
   4778         char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4779         binary = (GLvoid *) (_binaryBase + _bufferOffset);
   4780     }
   4781     glProgramBinary(
   4782         (GLuint)program,
   4783         (GLenum)binaryFormat,
   4784         (GLvoid *)binary,
   4785         (GLsizei)length
   4786     );
   4787     if (_array) {
   4788         releasePointer(_env, _array, binary, JNI_FALSE);
   4789     }
   4790 }
   4791 
   4792 /* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
   4793 static void
   4794 android_glProgramParameteri__III
   4795   (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
   4796     glProgramParameteri(
   4797         (GLuint)program,
   4798         (GLenum)pname,
   4799         (GLint)value
   4800     );
   4801 }
   4802 
   4803 /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
   4804 static void
   4805 android_glInvalidateFramebuffer__II_3II
   4806   (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
   4807     jint _exception = 0;
   4808     const char * _exceptionType = NULL;
   4809     const char * _exceptionMessage = NULL;
   4810     GLenum *attachments_base = (GLenum *) 0;
   4811     jint _remaining;
   4812     GLenum *attachments = (GLenum *) 0;
   4813 
   4814     if (!attachments_ref) {
   4815         _exception = 1;
   4816         _exceptionType = "java/lang/IllegalArgumentException";
   4817         _exceptionMessage = "attachments == null";
   4818         goto exit;
   4819     }
   4820     if (offset < 0) {
   4821         _exception = 1;
   4822         _exceptionType = "java/lang/IllegalArgumentException";
   4823         _exceptionMessage = "offset < 0";
   4824         goto exit;
   4825     }
   4826     _remaining = _env->GetArrayLength(attachments_ref) - offset;
   4827     attachments_base = (GLenum *)
   4828         _env->GetPrimitiveArrayCritical(attachments_ref, (jboolean *)0);
   4829     attachments = attachments_base + offset;
   4830 
   4831     glInvalidateFramebuffer(
   4832         (GLenum)target,
   4833         (GLsizei)numAttachments,
   4834         (GLenum *)attachments
   4835     );
   4836 
   4837 exit:
   4838     if (attachments_base) {
   4839         _env->ReleasePrimitiveArrayCritical(attachments_ref, attachments_base,
   4840             JNI_ABORT);
   4841     }
   4842     if (_exception) {
   4843         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4844     }
   4845 }
   4846 
   4847 /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
   4848 static void
   4849 android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
   4850   (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
   4851     jarray _array = (jarray) 0;
   4852     jint _bufferOffset = (jint) 0;
   4853     jint _remaining;
   4854     GLenum *attachments = (GLenum *) 0;
   4855 
   4856     attachments = (GLenum *)getPointer(_env, attachments_buf, &_array, &_remaining, &_bufferOffset);
   4857     if (attachments == NULL) {
   4858         char * _attachmentsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4859         attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
   4860     }
   4861     glInvalidateFramebuffer(
   4862         (GLenum)target,
   4863         (GLsizei)numAttachments,
   4864         (GLenum *)attachments
   4865     );
   4866     if (_array) {
   4867         releasePointer(_env, _array, attachments, JNI_FALSE);
   4868     }
   4869 }
   4870 
   4871 /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
   4872 static void
   4873 android_glInvalidateSubFramebuffer__II_3IIIIII
   4874   (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
   4875     jint _exception = 0;
   4876     const char * _exceptionType = NULL;
   4877     const char * _exceptionMessage = NULL;
   4878     GLenum *attachments_base = (GLenum *) 0;
   4879     jint _remaining;
   4880     GLenum *attachments = (GLenum *) 0;
   4881 
   4882     if (!attachments_ref) {
   4883         _exception = 1;
   4884         _exceptionType = "java/lang/IllegalArgumentException";
   4885         _exceptionMessage = "attachments == null";
   4886         goto exit;
   4887     }
   4888     if (offset < 0) {
   4889         _exception = 1;
   4890         _exceptionType = "java/lang/IllegalArgumentException";
   4891         _exceptionMessage = "offset < 0";
   4892         goto exit;
   4893     }
   4894     _remaining = _env->GetArrayLength(attachments_ref) - offset;
   4895     attachments_base = (GLenum *)
   4896         _env->GetPrimitiveArrayCritical(attachments_ref, (jboolean *)0);
   4897     attachments = attachments_base + offset;
   4898 
   4899     glInvalidateSubFramebuffer(
   4900         (GLenum)target,
   4901         (GLsizei)numAttachments,
   4902         (GLenum *)attachments,
   4903         (GLint)x,
   4904         (GLint)y,
   4905         (GLsizei)width,
   4906         (GLsizei)height
   4907     );
   4908 
   4909 exit:
   4910     if (attachments_base) {
   4911         _env->ReleasePrimitiveArrayCritical(attachments_ref, attachments_base,
   4912             JNI_ABORT);
   4913     }
   4914     if (_exception) {
   4915         jniThrowException(_env, _exceptionType, _exceptionMessage);
   4916     }
   4917 }
   4918 
   4919 /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
   4920 static void
   4921 android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
   4922   (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf, jint x, jint y, jint width, jint height) {
   4923     jarray _array = (jarray) 0;
   4924     jint _bufferOffset = (jint) 0;
   4925     jint _remaining;
   4926     GLenum *attachments = (GLenum *) 0;
   4927 
   4928     attachments = (GLenum *)getPointer(_env, attachments_buf, &_array, &_remaining, &_bufferOffset);
   4929     if (attachments == NULL) {
   4930         char * _attachmentsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   4931         attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
   4932     }
   4933     glInvalidateSubFramebuffer(
   4934         (GLenum)target,
   4935         (GLsizei)numAttachments,
   4936         (GLenum *)attachments,
   4937         (GLint)x,
   4938         (GLint)y,
   4939         (GLsizei)width,
   4940         (GLsizei)height
   4941     );
   4942     if (_array) {
   4943         releasePointer(_env, _array, attachments, JNI_FALSE);
   4944     }
   4945 }
   4946 
   4947 /* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
   4948 static void
   4949 android_glTexStorage2D__IIIII
   4950   (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
   4951     glTexStorage2D(
   4952         (GLenum)target,
   4953         (GLsizei)levels,
   4954         (GLenum)internalformat,
   4955         (GLsizei)width,
   4956         (GLsizei)height
   4957     );
   4958 }
   4959 
   4960 /* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
   4961 static void
   4962 android_glTexStorage3D__IIIIII
   4963   (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
   4964     glTexStorage3D(
   4965         (GLenum)target,
   4966         (GLsizei)levels,
   4967         (GLenum)internalformat,
   4968         (GLsizei)width,
   4969         (GLsizei)height,
   4970         (GLsizei)depth
   4971     );
   4972 }
   4973 
   4974 /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
   4975 static void
   4976 android_glGetInternalformativ__IIII_3II
   4977   (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
   4978     jint _exception = 0;
   4979     const char * _exceptionType = NULL;
   4980     const char * _exceptionMessage = NULL;
   4981     GLint *params_base = (GLint *) 0;
   4982     jint _remaining;
   4983     GLint *params = (GLint *) 0;
   4984 
   4985     if (!params_ref) {
   4986         _exception = 1;
   4987         _exceptionType = "java/lang/IllegalArgumentException";
   4988         _exceptionMessage = "params == null";
   4989         goto exit;
   4990     }
   4991     if (offset < 0) {
   4992         _exception = 1;
   4993         _exceptionType = "java/lang/IllegalArgumentException";
   4994         _exceptionMessage = "offset < 0";
   4995         goto exit;
   4996     }
   4997     _remaining = _env->GetArrayLength(params_ref) - offset;
   4998     params_base = (GLint *)
   4999         _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
   5000     params = params_base + offset;
   5001 
   5002     glGetInternalformativ(
   5003         (GLenum)target,
   5004         (GLenum)internalformat,
   5005         (GLenum)pname,
   5006         (GLsizei)bufSize,
   5007         (GLint *)params
   5008     );
   5009 
   5010 exit:
   5011     if (params_base) {
   5012         _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
   5013             _exception ? JNI_ABORT: 0);
   5014     }
   5015     if (_exception) {
   5016         jniThrowException(_env, _exceptionType, _exceptionMessage);
   5017     }
   5018 }
   5019 
   5020 /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
   5021 static void
   5022 android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
   5023   (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
   5024     jarray _array = (jarray) 0;
   5025     jint _bufferOffset = (jint) 0;
   5026     jint _remaining;
   5027     GLint *params = (GLint *) 0;
   5028 
   5029     params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
   5030     if (params == NULL) {
   5031         char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   5032         params = (GLint *) (_paramsBase + _bufferOffset);
   5033     }
   5034     glGetInternalformativ(
   5035         (GLenum)target,
   5036         (GLenum)internalformat,
   5037         (GLenum)pname,
   5038         (GLsizei)bufSize,
   5039         (GLint *)params
   5040     );
   5041     if (_array) {
   5042         releasePointer(_env, _array, params, JNI_TRUE);
   5043     }
   5044 }
   5045 
   5046 static const char *classPathName = "android/opengl/GLES30";
   5047 
   5048 static JNINativeMethod methods[] = {
   5049 {"_nativeClassInit", "()V", (void*)nativeClassInit },
   5050 {"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
   5051 {"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
   5052 {"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
   5053 {"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
   5054 {"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
   5055 {"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
   5056 {"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
   5057 {"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
   5058 {"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
   5059 {"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
   5060 {"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
   5061 {"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
   5062 {"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
   5063 {"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
   5064 {"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
   5065 {"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
   5066 {"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
   5067 {"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
   5068 {"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
   5069 {"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
   5070 {"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
   5071 {"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
   5072 {"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
   5073 {"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
   5074 {"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
   5075 {"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
   5076 {"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
   5077 {"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
   5078 {"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
   5079 {"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
   5080 {"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
   5081 {"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
   5082 {"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
   5083 {"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
   5084 {"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
   5085 {"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
   5086 {"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
   5087 {"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
   5088 {"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
   5089 {"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
   5090 {"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
   5091 {"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
   5092 {"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
   5093 {"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
   5094 {"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
   5095 {"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
   5096 {"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
   5097 {"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
   5098 {"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
   5099 {"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
   5100 {"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
   5101 {"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
   5102 {"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
   5103 {"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
   5104 {"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
   5105 {"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
   5106 {"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
   5107 {"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
   5108 {"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
   5109 {"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
   5110 {"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
   5111 {"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
   5112 {"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
   5113 {"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
   5114 {"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
   5115 {"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
   5116 {"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
   5117 {"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
   5118 {"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
   5119 {"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
   5120 {"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
   5121 {"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
   5122 {"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
   5123 {"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
   5124 {"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
   5125 {"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
   5126 {"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
   5127 {"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
   5128 {"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
   5129 {"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
   5130 {"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
   5131 {"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
   5132 {"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
   5133 {"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
   5134 {"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
   5135 {"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
   5136 {"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
   5137 {"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
   5138 {"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
   5139 {"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
   5140 {"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
   5141 {"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
   5142 {"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
   5143 {"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
   5144 {"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
   5145 {"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
   5146 {"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
   5147 {"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
   5148 {"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
   5149 {"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
   5150 {"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
   5151 {"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
   5152 {"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
   5153 {"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
   5154 {"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
   5155 {"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
   5156 {"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
   5157 {"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
   5158 {"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
   5159 {"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
   5160 {"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
   5161 {"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
   5162 {"glIsSync", "(J)Z", (void *) android_glIsSync__J },
   5163 {"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
   5164 {"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
   5165 {"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
   5166 {"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
   5167 {"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
   5168 {"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
   5169 {"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
   5170 {"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
   5171 {"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
   5172 {"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
   5173 {"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
   5174 {"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
   5175 {"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
   5176 {"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
   5177 {"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
   5178 {"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
   5179 {"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
   5180 {"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
   5181 {"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
   5182 {"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
   5183 {"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
   5184 {"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
   5185 {"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
   5186 {"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
   5187 {"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
   5188 {"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
   5189 {"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
   5190 {"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
   5191 {"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
   5192 {"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
   5193 {"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
   5194 {"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
   5195 {"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
   5196 {"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
   5197 {"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
   5198 {"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
   5199 {"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
   5200 {"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
   5201 {"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
   5202 {"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
   5203 {"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
   5204 {"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
   5205 {"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
   5206 {"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
   5207 {"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
   5208 {"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
   5209 {"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
   5210 {"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
   5211 };
   5212 
   5213 int register_android_opengl_jni_GLES30(JNIEnv *_env)
   5214 {
   5215     int err;
   5216     err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
   5217     return err;
   5218 }
   5219