Home | History | Annotate | Download | only in jni
      1 /*
      2  * Copyright 2015 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 // This source file is automatically generated
     18 
     19 #pragma GCC diagnostic ignored "-Wunused-variable"
     20 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
     21 #pragma GCC diagnostic ignored "-Wunused-function"
     22 
     23 #include <stdint.h>
     24 #include <GLES3/gl32.h>
     25 #include <jni.h>
     26 #include <JNIHelp.h>
     27 #include <android_runtime/AndroidRuntime.h>
     28 #include <utils/misc.h>
     29 #include <assert.h>
     30 
     31 static int initialized = 0;
     32 
     33 static jclass nioAccessClass;
     34 static jclass bufferClass;
     35 static jmethodID getBasePointerID;
     36 static jmethodID getBaseArrayID;
     37 static jmethodID getBaseArrayOffsetID;
     38 static jfieldID positionID;
     39 static jfieldID limitID;
     40 static jfieldID elementSizeShiftID;
     41 
     42 
     43 /* special calls implemented in Android's GLES wrapper used to more
     44  * efficiently bound-check passed arrays */
     45 extern "C" {
     46 #ifdef GL_VERSION_ES_CM_1_1
     47 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
     48         const GLvoid *ptr, GLsizei count);
     49 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
     50         const GLvoid *pointer, GLsizei count);
     51 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
     52         GLsizei stride, const GLvoid *pointer, GLsizei count);
     53 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
     54         GLsizei stride, const GLvoid *pointer, GLsizei count);
     55 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
     56         GLsizei stride, const GLvoid *pointer, GLsizei count);
     57 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
     58         GLsizei stride, const GLvoid *pointer, GLsizei count);
     59 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
     60         GLsizei stride, const GLvoid *pointer, GLsizei count);
     61 #endif
     62 #ifdef GL_ES_VERSION_2_0
     63 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
     64         GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
     65     glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
     66 }
     67 #endif
     68 #ifdef GL_ES_VERSION_3_0
     69 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
     70         GLsizei stride, const GLvoid *pointer, GLsizei count) {
     71     glVertexAttribIPointer(indx, size, type, stride, pointer);
     72 }
     73 #endif
     74 }
     75 
     76 /* Cache method IDs each time the class is loaded. */
     77 
     78 static void
     79 nativeClassInit(JNIEnv *_env, jclass glImplClass)
     80 {
     81     jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
     82     nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
     83 
     84     jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
     85     bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
     86 
     87     getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
     88             "getBasePointer", "(Ljava/nio/Buffer;)J");
     89     getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
     90             "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
     91     getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
     92             "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
     93 
     94     positionID = _env->GetFieldID(bufferClass, "position", "I");
     95     limitID = _env->GetFieldID(bufferClass, "limit", "I");
     96     elementSizeShiftID =
     97         _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
     98 }
     99 
    100 static void *
    101 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
    102 {
    103     jint position;
    104     jint limit;
    105     jint elementSizeShift;
    106     jlong pointer;
    107 
    108     position = _env->GetIntField(buffer, positionID);
    109     limit = _env->GetIntField(buffer, limitID);
    110     elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
    111     *remaining = (limit - position) << elementSizeShift;
    112     pointer = _env->CallStaticLongMethod(nioAccessClass,
    113             getBasePointerID, buffer);
    114     if (pointer != 0L) {
    115         *array = NULL;
    116         return reinterpret_cast<void*>(pointer);
    117     }
    118 
    119     *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
    120             getBaseArrayID, buffer);
    121     *offset = _env->CallStaticIntMethod(nioAccessClass,
    122             getBaseArrayOffsetID, buffer);
    123 
    124     return NULL;
    125 }
    126 
    127 class ByteArrayGetter {
    128 public:
    129     static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
    130         return _env->GetByteArrayElements(array, is_copy);
    131     }
    132 };
    133 class BooleanArrayGetter {
    134 public:
    135     static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
    136         return _env->GetBooleanArrayElements(array, is_copy);
    137     }
    138 };
    139 class CharArrayGetter {
    140 public:
    141     static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
    142         return _env->GetCharArrayElements(array, is_copy);
    143     }
    144 };
    145 class ShortArrayGetter {
    146 public:
    147     static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
    148         return _env->GetShortArrayElements(array, is_copy);
    149     }
    150 };
    151 class IntArrayGetter {
    152 public:
    153     static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
    154         return _env->GetIntArrayElements(array, is_copy);
    155     }
    156 };
    157 class LongArrayGetter {
    158 public:
    159     static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
    160         return _env->GetLongArrayElements(array, is_copy);
    161     }
    162 };
    163 class FloatArrayGetter {
    164 public:
    165     static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
    166         return _env->GetFloatArrayElements(array, is_copy);
    167     }
    168 };
    169 class DoubleArrayGetter {
    170 public:
    171     static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
    172         return _env->GetDoubleArrayElements(array, is_copy);
    173     }
    174 };
    175 
    176 template<typename JTYPEARRAY, typename ARRAYGETTER>
    177 static void*
    178 getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
    179     return ARRAYGETTER::Get(_env, array, is_copy);
    180 }
    181 
    182 class ByteArrayReleaser {
    183 public:
    184     static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
    185         _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
    186     }
    187 };
    188 class BooleanArrayReleaser {
    189 public:
    190     static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
    191         _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
    192     }
    193 };
    194 class CharArrayReleaser {
    195 public:
    196     static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
    197         _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
    198     }
    199 };
    200 class ShortArrayReleaser {
    201 public:
    202     static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
    203         _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
    204     }
    205 };
    206 class IntArrayReleaser {
    207 public:
    208     static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
    209         _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
    210     }
    211 };
    212 class LongArrayReleaser {
    213 public:
    214     static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
    215         _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
    216     }
    217 };
    218 class FloatArrayReleaser {
    219 public:
    220     static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
    221         _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
    222     }
    223 };
    224 class DoubleArrayReleaser {
    225 public:
    226     static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
    227         _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
    228     }
    229 };
    230 
    231 template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
    232 static void
    233 releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
    234     ARRAYRELEASER::Release(_env, array, data, commit);
    235 }
    236 
    237 static void
    238 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
    239 {
    240     _env->ReleasePrimitiveArrayCritical(array, data,
    241                        commit ? 0 : JNI_ABORT);
    242 }
    243 
    244 static void *
    245 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
    246     char* buf = (char*) _env->GetDirectBufferAddress(buffer);
    247     if (buf) {
    248         jint position = _env->GetIntField(buffer, positionID);
    249         jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
    250         buf += position << elementSizeShift;
    251     } else {
    252         jniThrowException(_env, "java/lang/IllegalArgumentException",
    253                           "Must use a native order direct Buffer");
    254     }
    255     return (void*) buf;
    256 }
    257 
    258 // --------------------------------------------------------------------------
    259 
    260 /*
    261  * returns the number of values glGet returns for a given pname.
    262  *
    263  * The code below is written such that pnames requiring only one values
    264  * are the default (and are not explicitely tested for). This makes the
    265  * checking code much shorter/readable/efficient.
    266  *
    267  * This means that unknown pnames (e.g.: extensions) will default to 1. If
    268  * that unknown pname needs more than 1 value, then the validation check
    269  * is incomplete and the app may crash if it passed the wrong number params.
    270  */
    271 static int getNeededCount(GLint pname) {
    272     int needed = 1;
    273 #ifdef GL_ES_VERSION_2_0
    274     // GLES 2.x pnames
    275     switch (pname) {
    276         case GL_ALIASED_LINE_WIDTH_RANGE:
    277         case GL_ALIASED_POINT_SIZE_RANGE:
    278             needed = 2;
    279             break;
    280 
    281         case GL_BLEND_COLOR:
    282         case GL_COLOR_CLEAR_VALUE:
    283         case GL_COLOR_WRITEMASK:
    284         case GL_SCISSOR_BOX:
    285         case GL_VIEWPORT:
    286             needed = 4;
    287             break;
    288 
    289         case GL_COMPRESSED_TEXTURE_FORMATS:
    290             glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
    291             break;
    292 
    293         case GL_SHADER_BINARY_FORMATS:
    294             glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
    295             break;
    296     }
    297 #endif
    298 
    299 #ifdef GL_VERSION_ES_CM_1_1
    300     // GLES 1.x pnames
    301     switch (pname) {
    302         case GL_ALIASED_LINE_WIDTH_RANGE:
    303         case GL_ALIASED_POINT_SIZE_RANGE:
    304         case GL_DEPTH_RANGE:
    305         case GL_SMOOTH_LINE_WIDTH_RANGE:
    306         case GL_SMOOTH_POINT_SIZE_RANGE:
    307             needed = 2;
    308             break;
    309 
    310         case GL_CURRENT_NORMAL:
    311         case GL_POINT_DISTANCE_ATTENUATION:
    312             needed = 3;
    313             break;
    314 
    315         case GL_COLOR_CLEAR_VALUE:
    316         case GL_COLOR_WRITEMASK:
    317         case GL_CURRENT_COLOR:
    318         case GL_CURRENT_TEXTURE_COORDS:
    319         case GL_FOG_COLOR:
    320         case GL_LIGHT_MODEL_AMBIENT:
    321         case GL_SCISSOR_BOX:
    322         case GL_VIEWPORT:
    323             needed = 4;
    324             break;
    325 
    326         case GL_MODELVIEW_MATRIX:
    327         case GL_PROJECTION_MATRIX:
    328         case GL_TEXTURE_MATRIX:
    329             needed = 16;
    330             break;
    331 
    332         case GL_COMPRESSED_TEXTURE_FORMATS:
    333             glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
    334             break;
    335     }
    336 #endif
    337     return needed;
    338 }
    339 
    340 template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
    341           typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
    342 static void
    343 get
    344   (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
    345     jint _exception = 0;
    346     const char * _exceptionType;
    347     const char * _exceptionMessage;
    348     CTYPE *params_base = (CTYPE *) 0;
    349     jint _remaining;
    350     CTYPE *params = (CTYPE *) 0;
    351     int _needed = 0;
    352 
    353     if (!params_ref) {
    354         _exception = 1;
    355         _exceptionType = "java/lang/IllegalArgumentException";
    356         _exceptionMessage = "params == null";
    357         goto exit;
    358     }
    359     if (offset < 0) {
    360         _exception = 1;
    361         _exceptionType = "java/lang/IllegalArgumentException";
    362         _exceptionMessage = "offset < 0";
    363         goto exit;
    364     }
    365     _remaining = _env->GetArrayLength(params_ref) - offset;
    366     _needed = getNeededCount(pname);
    367     // if we didn't find this pname, we just assume the user passed
    368     // an array of the right size -- this might happen with extensions
    369     // or if we forget an enum here.
    370     if (_remaining < _needed) {
    371         _exception = 1;
    372         _exceptionType = "java/lang/IllegalArgumentException";
    373         _exceptionMessage = "length - offset < needed";
    374         goto exit;
    375     }
    376     params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
    377         _env, params_ref, (jboolean *)0);
    378     params = params_base + offset;
    379 
    380     GET(
    381         (GLenum)pname,
    382         (CTYPE *)params
    383     );
    384 
    385 exit:
    386     if (params_base) {
    387         releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
    388             _env, params_ref, params_base, !_exception);
    389     }
    390     if (_exception) {
    391         jniThrowException(_env, _exceptionType, _exceptionMessage);
    392     }
    393 }
    394 
    395 
    396 template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
    397           typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
    398 static void
    399 getarray
    400   (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
    401     jint _exception = 0;
    402     const char * _exceptionType;
    403     const char * _exceptionMessage;
    404     JTYPEARRAY _array = (JTYPEARRAY) 0;
    405     jint _bufferOffset = (jint) 0;
    406     jint _remaining;
    407     CTYPE *params = (CTYPE *) 0;
    408     int _needed = 0;
    409 
    410     params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
    411     _remaining /= sizeof(CTYPE);    // convert from bytes to item count
    412     _needed = getNeededCount(pname);
    413     // if we didn't find this pname, we just assume the user passed
    414     // an array of the right size -- this might happen with extensions
    415     // or if we forget an enum here.
    416     if (_needed>0 && _remaining < _needed) {
    417         _exception = 1;
    418         _exceptionType = "java/lang/IllegalArgumentException";
    419         _exceptionMessage = "remaining() < needed";
    420         goto exit;
    421     }
    422     if (params == NULL) {
    423         char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
    424             _env, _array, (jboolean *) 0);
    425         params = (CTYPE *) (_paramsBase + _bufferOffset);
    426     }
    427     GET(
    428         (GLenum)pname,
    429         (CTYPE *)params
    430     );
    431 
    432 exit:
    433     if (_array) {
    434         releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
    435             _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
    436     }
    437     if (_exception) {
    438         jniThrowException(_env, _exceptionType, _exceptionMessage);
    439     }
    440 }
    441 
    442 // --------------------------------------------------------------------------
    443 /* void glBlendBarrier ( void ) */
    444 static void
    445 android_glBlendBarrier__
    446   (JNIEnv *_env, jobject _this) {
    447     glBlendBarrier();
    448 }
    449 
    450 /* void glCopyImageSubData ( GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth ) */
    451 static void
    452 android_glCopyImageSubData__IIIIIIIIIIIIIII
    453   (JNIEnv *_env, jobject _this, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth) {
    454     glCopyImageSubData(
    455         (GLuint)srcName,
    456         (GLenum)srcTarget,
    457         (GLint)srcLevel,
    458         (GLint)srcX,
    459         (GLint)srcY,
    460         (GLint)srcZ,
    461         (GLuint)dstName,
    462         (GLenum)dstTarget,
    463         (GLint)dstLevel,
    464         (GLint)dstX,
    465         (GLint)dstY,
    466         (GLint)dstZ,
    467         (GLsizei)srcWidth,
    468         (GLsizei)srcHeight,
    469         (GLsizei)srcDepth
    470     );
    471 }
    472 
    473 /* void glDebugMessageControl ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
    474 static void
    475 android_glDebugMessageControl__IIII_3IIZ
    476   (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jintArray ids_ref, jint offset, jboolean enabled) {
    477     jint _exception = 0;
    478     const char * _exceptionType = NULL;
    479     const char * _exceptionMessage = NULL;
    480     GLuint *ids_base = (GLuint *) 0;
    481     jint _remaining;
    482     GLuint *ids = (GLuint *) 0;
    483 
    484     if (!ids_ref) {
    485         _exception = 1;
    486         _exceptionType = "java/lang/IllegalArgumentException";
    487         _exceptionMessage = "ids == null";
    488         goto exit;
    489     }
    490     if (offset < 0) {
    491         _exception = 1;
    492         _exceptionType = "java/lang/IllegalArgumentException";
    493         _exceptionMessage = "offset < 0";
    494         goto exit;
    495     }
    496     _remaining = _env->GetArrayLength(ids_ref) - offset;
    497     if (_remaining < count) {
    498         _exception = 1;
    499         _exceptionType = "java/lang/IllegalArgumentException";
    500         _exceptionMessage = "length - offset < count < needed";
    501         goto exit;
    502     }
    503     ids_base = (GLuint *)
    504         _env->GetIntArrayElements(ids_ref, (jboolean *)0);
    505     ids = ids_base + offset;
    506 
    507     glDebugMessageControl(
    508         (GLenum)source,
    509         (GLenum)type,
    510         (GLenum)severity,
    511         (GLsizei)count,
    512         (GLuint *)ids,
    513         (GLboolean)enabled
    514     );
    515 
    516 exit:
    517     if (ids_base) {
    518         _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
    519             JNI_ABORT);
    520     }
    521     if (_exception) {
    522         jniThrowException(_env, _exceptionType, _exceptionMessage);
    523     }
    524 }
    525 
    526 /* void glDebugMessageControl ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
    527 static void
    528 android_glDebugMessageControl__IIIILjava_nio_IntBuffer_2Z
    529   (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jobject ids_buf, jboolean enabled) {
    530     jint _exception = 0;
    531     const char * _exceptionType = NULL;
    532     const char * _exceptionMessage = NULL;
    533     jintArray _array = (jintArray) 0;
    534     jint _bufferOffset = (jint) 0;
    535     jint _remaining;
    536     GLuint *ids = (GLuint *) 0;
    537 
    538     ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
    539     if (_remaining < count) {
    540         _exception = 1;
    541         _exceptionType = "java/lang/IllegalArgumentException";
    542         _exceptionMessage = "remaining() < count < needed";
    543         goto exit;
    544     }
    545     if (ids == NULL) {
    546         char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
    547         ids = (GLuint *) (_idsBase + _bufferOffset);
    548     }
    549     glDebugMessageControl(
    550         (GLenum)source,
    551         (GLenum)type,
    552         (GLenum)severity,
    553         (GLsizei)count,
    554         (GLuint *)ids,
    555         (GLboolean)enabled
    556     );
    557 
    558 exit:
    559     if (_array) {
    560         _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
    561     }
    562     if (_exception) {
    563         jniThrowException(_env, _exceptionType, _exceptionMessage);
    564     }
    565 }
    566 
    567 /* void glDebugMessageInsert ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf ) */
    568 static void
    569 android_glDebugMessageInsert__IIIIILjava_lang_String_2
    570   (JNIEnv *_env, jobject _this, jint source, jint type, jint id, jint severity, jint length, jstring buf) {
    571     jint _exception = 0;
    572     const char * _exceptionType = NULL;
    573     const char * _exceptionMessage = NULL;
    574     const char* _nativebuf = 0;
    575 
    576     if (!buf) {
    577         _exception = 1;
    578         _exceptionType = "java/lang/IllegalArgumentException";
    579         _exceptionMessage = "buf == null";
    580         goto exit;
    581     }
    582     _nativebuf = _env->GetStringUTFChars(buf, 0);
    583 
    584     glDebugMessageInsert(
    585         (GLenum)source,
    586         (GLenum)type,
    587         (GLuint)id,
    588         (GLenum)severity,
    589         (GLsizei)length,
    590         (GLchar *)_nativebuf
    591     );
    592 
    593 exit:
    594     if (_nativebuf) {
    595         _env->ReleaseStringUTFChars(buf, _nativebuf);
    596     }
    597 
    598     if (_exception) {
    599         jniThrowException(_env, _exceptionType, _exceptionMessage);
    600     }
    601 }
    602 
    603 /* void glDebugMessageCallback ( GLDEBUGPROC callback, const void *userParam ) */
    604 static void
    605 android_glDebugMessageCallback(JNIEnv *_env, jobject _this, jobject callback) {
    606     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    607 }
    608 /* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
    609 static jint
    610 android_glGetDebugMessageLog__II_3II_3II_3II_3II_3II_3BI
    611   (JNIEnv *_env, jobject _this, jint count, jint bufSize, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset, jintArray lengths_ref, jint lengthsOffset, jbyteArray messageLog_ref, jint messageLogOffset) {
    612     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    613     return 0;
    614 }
    615 
    616 /* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
    617 static uint
    618 android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
    619   (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref, jobject lengths_ref, jobject messageLog_ref) {
    620     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    621     return 0;
    622 }
    623 
    624 /* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
    625 static jobjectArray
    626 android_glGetDebugMessageLog__I_3II_3II_3II_3II
    627   (JNIEnv *_env, jobject _this, jint count, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset) {
    628     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    629     return 0;
    630 }
    631 
    632 /* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
    633 static jobjectArray
    634 android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
    635   (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref) {
    636     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    637     return 0;
    638 }
    639 /* void glPushDebugGroup ( GLenum source, GLuint id, GLsizei length, const GLchar *message ) */
    640 static void
    641 android_glPushDebugGroup__IIILjava_lang_String_2
    642   (JNIEnv *_env, jobject _this, jint source, jint id, jint length, jstring message) {
    643     jint _exception = 0;
    644     const char * _exceptionType = NULL;
    645     const char * _exceptionMessage = NULL;
    646     const char* _nativemessage = 0;
    647     jsize _stringlen = 0;
    648 
    649     if (!message) {
    650         _exception = 1;
    651         _exceptionType = "java/lang/IllegalArgumentException";
    652         _exceptionMessage = "message == null";
    653         goto exit;
    654     }
    655     _nativemessage = _env->GetStringUTFChars(message, 0);
    656     _stringlen = _env->GetStringUTFLength(message);
    657     if (length > _stringlen) {
    658         _exception = 1;
    659         _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
    660         _exceptionMessage = "length of message is shorter than length argument";
    661         goto exit;
    662     }
    663 
    664     glPushDebugGroup(
    665         (GLenum)source,
    666         (GLuint)id,
    667         (GLsizei)length,
    668         (GLchar *)_nativemessage
    669     );
    670 
    671 exit:
    672     if (_nativemessage) {
    673         _env->ReleaseStringUTFChars(message, _nativemessage);
    674     }
    675 
    676     if (_exception) {
    677         jniThrowException(_env, _exceptionType, _exceptionMessage);
    678     }
    679 }
    680 
    681 /* void glPopDebugGroup ( void ) */
    682 static void
    683 android_glPopDebugGroup__
    684   (JNIEnv *_env, jobject _this) {
    685     glPopDebugGroup();
    686 }
    687 
    688 /* void glObjectLabel ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label ) */
    689 static void
    690 android_glObjectLabel__IIILjava_lang_String_2
    691   (JNIEnv *_env, jobject _this, jint identifier, jint name, jint length, jstring label) {
    692     jint _exception = 0;
    693     const char * _exceptionType = NULL;
    694     const char * _exceptionMessage = NULL;
    695     const char* _nativelabel = 0;
    696     jsize _stringlen = 0;
    697 
    698     if (label) {
    699         _nativelabel = _env->GetStringUTFChars(label, 0);
    700         _stringlen = _env->GetStringUTFLength(label);
    701         if (length > _stringlen) {
    702             _exception = 1;
    703             _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
    704             _exceptionMessage = "length of label is shorter than length argument";
    705             goto exit;
    706         }
    707     }
    708 
    709     glObjectLabel(
    710         (GLenum)identifier,
    711         (GLuint)name,
    712         (GLsizei)length,
    713         (GLchar *)_nativelabel
    714     );
    715 
    716 exit:
    717     if (_nativelabel) {
    718         _env->ReleaseStringUTFChars(label, _nativelabel);
    719     }
    720 
    721     if (_exception) {
    722         jniThrowException(_env, _exceptionType, _exceptionMessage);
    723     }
    724 }
    725 
    726 /* void glGetObjectLabel ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label ) */
    727 static jstring
    728 android_glGetObjectLabel(JNIEnv *_env, jobject _this, jint identifier, jint name) {
    729     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    730     return NULL;
    731 }
    732 
    733 /* void glObjectPtrLabel ( const void *ptr, GLsizei length, const GLchar *label ) */
    734 static void
    735 android_glObjectPtrLabel(JNIEnv *_env, jobject _this, jlong ptr, jstring label) {
    736     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    737 }
    738 
    739 /* void glGetObjectPtrLabel ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label ) */
    740 static jstring
    741 android_glGetObjectPtrLabel(JNIEnv *_env, jobject _this, jlong ptr) {
    742     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    743     return NULL;
    744 }
    745 
    746 /* void glGetPointerv ( GLenum pname, void **params ) */
    747 static jlong
    748 android_glGetPointerv(JNIEnv *_env, jobject _this, jint pname) {
    749     jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
    750     return NULL;
    751 }
    752 
    753 /* void glEnablei ( GLenum target, GLuint index ) */
    754 static void
    755 android_glEnablei__II
    756   (JNIEnv *_env, jobject _this, jint target, jint index) {
    757     glEnablei(
    758         (GLenum)target,
    759         (GLuint)index
    760     );
    761 }
    762 
    763 /* void glDisablei ( GLenum target, GLuint index ) */
    764 static void
    765 android_glDisablei__II
    766   (JNIEnv *_env, jobject _this, jint target, jint index) {
    767     glDisablei(
    768         (GLenum)target,
    769         (GLuint)index
    770     );
    771 }
    772 
    773 /* void glBlendEquationi ( GLuint buf, GLenum mode ) */
    774 static void
    775 android_glBlendEquationi__II
    776   (JNIEnv *_env, jobject _this, jint buf, jint mode) {
    777     glBlendEquationi(
    778         (GLuint)buf,
    779         (GLenum)mode
    780     );
    781 }
    782 
    783 /* void glBlendEquationSeparatei ( GLuint buf, GLenum modeRGB, GLenum modeAlpha ) */
    784 static void
    785 android_glBlendEquationSeparatei__III
    786   (JNIEnv *_env, jobject _this, jint buf, jint modeRGB, jint modeAlpha) {
    787     glBlendEquationSeparatei(
    788         (GLuint)buf,
    789         (GLenum)modeRGB,
    790         (GLenum)modeAlpha
    791     );
    792 }
    793 
    794 /* void glBlendFunci ( GLuint buf, GLenum src, GLenum dst ) */
    795 static void
    796 android_glBlendFunci__III
    797   (JNIEnv *_env, jobject _this, jint buf, jint src, jint dst) {
    798     glBlendFunci(
    799         (GLuint)buf,
    800         (GLenum)src,
    801         (GLenum)dst
    802     );
    803 }
    804 
    805 /* void glBlendFuncSeparatei ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */
    806 static void
    807 android_glBlendFuncSeparatei__IIIII
    808   (JNIEnv *_env, jobject _this, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
    809     glBlendFuncSeparatei(
    810         (GLuint)buf,
    811         (GLenum)srcRGB,
    812         (GLenum)dstRGB,
    813         (GLenum)srcAlpha,
    814         (GLenum)dstAlpha
    815     );
    816 }
    817 
    818 /* void glColorMaski ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) */
    819 static void
    820 android_glColorMaski__IZZZZ
    821   (JNIEnv *_env, jobject _this, jint index, jboolean r, jboolean g, jboolean b, jboolean a) {
    822     glColorMaski(
    823         (GLuint)index,
    824         (GLboolean)r,
    825         (GLboolean)g,
    826         (GLboolean)b,
    827         (GLboolean)a
    828     );
    829 }
    830 
    831 /* GLboolean glIsEnabledi ( GLenum target, GLuint index ) */
    832 static jboolean
    833 android_glIsEnabledi__II
    834   (JNIEnv *_env, jobject _this, jint target, jint index) {
    835     GLboolean _returnValue;
    836     _returnValue = glIsEnabledi(
    837         (GLenum)target,
    838         (GLuint)index
    839     );
    840     return (jboolean)_returnValue;
    841 }
    842 
    843 /* void glDrawElementsBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex ) */
    844 static void
    845 android_glDrawElementsBaseVertex__IIILjava_nio_Buffer_2I
    846   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint basevertex) {
    847     jint _exception = 0;
    848     const char * _exceptionType = NULL;
    849     const char * _exceptionMessage = NULL;
    850     jarray _array = (jarray) 0;
    851     jint _bufferOffset = (jint) 0;
    852     jint _remaining;
    853     void *indices = (void *) 0;
    854 
    855     indices = (void *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
    856     if (_remaining < count-basevertex) {
    857         _exception = 1;
    858         _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
    859         _exceptionMessage = "remaining() < count-basevertex < needed";
    860         goto exit;
    861     }
    862     if (indices == NULL) {
    863         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    864         indices = (void *) (_indicesBase + _bufferOffset);
    865     }
    866     glDrawElementsBaseVertex(
    867         (GLenum)mode,
    868         (GLsizei)count,
    869         (GLenum)type,
    870         (void *)indices,
    871         (GLint)basevertex
    872     );
    873 
    874 exit:
    875     if (_array) {
    876         releasePointer(_env, _array, indices, JNI_FALSE);
    877     }
    878     if (_exception) {
    879         jniThrowException(_env, _exceptionType, _exceptionMessage);
    880     }
    881 }
    882 
    883 /* void glDrawRangeElementsBaseVertex ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex ) */
    884 static void
    885 android_glDrawRangeElementsBaseVertex__IIIIILjava_nio_Buffer_2I
    886   (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf, jint basevertex) {
    887     jint _exception = 0;
    888     const char * _exceptionType = NULL;
    889     const char * _exceptionMessage = NULL;
    890     jarray _array = (jarray) 0;
    891     jint _bufferOffset = (jint) 0;
    892     jint _remaining;
    893     void *indices = (void *) 0;
    894 
    895     indices = (void *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
    896     if (_remaining < count-basevertex) {
    897         _exception = 1;
    898         _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
    899         _exceptionMessage = "remaining() < count-basevertex < needed";
    900         goto exit;
    901     }
    902     if (indices == NULL) {
    903         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    904         indices = (void *) (_indicesBase + _bufferOffset);
    905     }
    906     glDrawRangeElementsBaseVertex(
    907         (GLenum)mode,
    908         (GLuint)start,
    909         (GLuint)end,
    910         (GLsizei)count,
    911         (GLenum)type,
    912         (void *)indices,
    913         (GLint)basevertex
    914     );
    915 
    916 exit:
    917     if (_array) {
    918         releasePointer(_env, _array, indices, JNI_FALSE);
    919     }
    920     if (_exception) {
    921         jniThrowException(_env, _exceptionType, _exceptionMessage);
    922     }
    923 }
    924 
    925 /* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
    926 static void
    927 android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II
    928   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount, jint basevertex) {
    929     jint _exception = 0;
    930     const char * _exceptionType = NULL;
    931     const char * _exceptionMessage = NULL;
    932     jarray _array = (jarray) 0;
    933     jint _bufferOffset = (jint) 0;
    934     jint _remaining;
    935     void *indices = (void *) 0;
    936 
    937     indices = (void *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
    938     if (_remaining < count-basevertex) {
    939         _exception = 1;
    940         _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
    941         _exceptionMessage = "remaining() < count-basevertex < needed";
    942         goto exit;
    943     }
    944     if (indices == NULL) {
    945         char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
    946         indices = (void *) (_indicesBase + _bufferOffset);
    947     }
    948     glDrawElementsInstancedBaseVertex(
    949         (GLenum)mode,
    950         (GLsizei)count,
    951         (GLenum)type,
    952         (void *)indices,
    953         (GLsizei)instanceCount,
    954         (GLint) basevertex
    955     );
    956 
    957 exit:
    958     if (_array) {
    959         releasePointer(_env, _array, indices, JNI_FALSE);
    960     }
    961 }
    962 
    963 /* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
    964 static void
    965 android_glDrawElementsInstancedBaseVertex__IIIIII
    966   (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount, jint basevertex) {
    967     glDrawElementsInstancedBaseVertex(
    968         (GLenum)mode,
    969         (GLsizei)count,
    970         (GLenum)type,
    971         (void *)static_cast<uintptr_t>(indicesOffset),
    972         (GLsizei)instanceCount,
    973         (GLint)basevertex
    974     );
    975 }
    976 /* void glFramebufferTexture ( GLenum target, GLenum attachment, GLuint texture, GLint level ) */
    977 static void
    978 android_glFramebufferTexture__IIII
    979   (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level) {
    980     glFramebufferTexture(
    981         (GLenum)target,
    982         (GLenum)attachment,
    983         (GLuint)texture,
    984         (GLint)level
    985     );
    986 }
    987 
    988 /* void glPrimitiveBoundingBox ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW ) */
    989 static void
    990 android_glPrimitiveBoundingBox__FFFFFFFF
    991   (JNIEnv *_env, jobject _this, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) {
    992     glPrimitiveBoundingBox(
    993         (GLfloat)minX,
    994         (GLfloat)minY,
    995         (GLfloat)minZ,
    996         (GLfloat)minW,
    997         (GLfloat)maxX,
    998         (GLfloat)maxY,
    999         (GLfloat)maxZ,
   1000         (GLfloat)maxW
   1001     );
   1002 }
   1003 
   1004 /* GLenum glGetGraphicsResetStatus ( void ) */
   1005 static jint
   1006 android_glGetGraphicsResetStatus__
   1007   (JNIEnv *_env, jobject _this) {
   1008     GLenum _returnValue;
   1009     _returnValue = glGetGraphicsResetStatus();
   1010     return (jint)_returnValue;
   1011 }
   1012 
   1013 /* void glReadnPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data ) */
   1014 static void
   1015 android_glReadnPixels__IIIIIIILjava_nio_Buffer_2
   1016   (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint bufSize, jobject data_buf) {
   1017     jint _exception = 0;
   1018     const char * _exceptionType = NULL;
   1019     const char * _exceptionMessage = NULL;
   1020     jarray _array = (jarray) 0;
   1021     jint _bufferOffset = (jint) 0;
   1022     jint _remaining;
   1023     void *data = (void *) 0;
   1024 
   1025     data = (void *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1026     if (_remaining < bufSize) {
   1027         _exception = 1;
   1028         _exceptionType = "java/lang/IllegalArgumentException";
   1029         _exceptionMessage = "remaining() < bufSize < needed";
   1030         goto exit;
   1031     }
   1032     if (data == NULL) {
   1033         char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
   1034         data = (void *) (_dataBase + _bufferOffset);
   1035     }
   1036     glReadnPixels(
   1037         (GLint)x,
   1038         (GLint)y,
   1039         (GLsizei)width,
   1040         (GLsizei)height,
   1041         (GLenum)format,
   1042         (GLenum)type,
   1043         (GLsizei)bufSize,
   1044         (void *)data
   1045     );
   1046 
   1047 exit:
   1048     if (_array) {
   1049         releasePointer(_env, _array, data, _exception ? JNI_FALSE : JNI_TRUE);
   1050     }
   1051     if (_exception) {
   1052         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1053     }
   1054 }
   1055 
   1056 /* void glGetnUniformfv ( GLuint program, GLint location, GLsizei bufSize, GLfloat *params ) */
   1057 static void
   1058 android_glGetnUniformfv__III_3FI
   1059   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jfloatArray params_ref, jint offset) {
   1060     jint _exception = 0;
   1061     const char * _exceptionType = NULL;
   1062     const char * _exceptionMessage = NULL;
   1063     GLfloat *params_base = (GLfloat *) 0;
   1064     jint _remaining;
   1065     GLfloat *params = (GLfloat *) 0;
   1066 
   1067     if (!params_ref) {
   1068         _exception = 1;
   1069         _exceptionType = "java/lang/IllegalArgumentException";
   1070         _exceptionMessage = "params == null";
   1071         goto exit;
   1072     }
   1073     if (offset < 0) {
   1074         _exception = 1;
   1075         _exceptionType = "java/lang/IllegalArgumentException";
   1076         _exceptionMessage = "offset < 0";
   1077         goto exit;
   1078     }
   1079     _remaining = _env->GetArrayLength(params_ref) - offset;
   1080     if (_remaining < bufSize) {
   1081         _exception = 1;
   1082         _exceptionType = "java/lang/IllegalArgumentException";
   1083         _exceptionMessage = "length - offset < bufSize < needed";
   1084         goto exit;
   1085     }
   1086     params_base = (GLfloat *)
   1087         _env->GetFloatArrayElements(params_ref, (jboolean *)0);
   1088     params = params_base + offset;
   1089 
   1090     glGetnUniformfv(
   1091         (GLuint)program,
   1092         (GLint)location,
   1093         (GLsizei)bufSize,
   1094         (GLfloat *)params
   1095     );
   1096 
   1097 exit:
   1098     if (params_base) {
   1099         _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
   1100             _exception ? JNI_ABORT: 0);
   1101     }
   1102     if (_exception) {
   1103         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1104     }
   1105 }
   1106 
   1107 /* void glGetnUniformfv ( GLuint program, GLint location, GLsizei bufSize, GLfloat *params ) */
   1108 static void
   1109 android_glGetnUniformfv__IIILjava_nio_FloatBuffer_2
   1110   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
   1111     jint _exception = 0;
   1112     const char * _exceptionType = NULL;
   1113     const char * _exceptionMessage = NULL;
   1114     jfloatArray _array = (jfloatArray) 0;
   1115     jint _bufferOffset = (jint) 0;
   1116     jint _remaining;
   1117     GLfloat *params = (GLfloat *) 0;
   1118 
   1119     params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1120     if (_remaining < bufSize) {
   1121         _exception = 1;
   1122         _exceptionType = "java/lang/IllegalArgumentException";
   1123         _exceptionMessage = "remaining() < bufSize < needed";
   1124         goto exit;
   1125     }
   1126     if (params == NULL) {
   1127         char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
   1128         params = (GLfloat *) (_paramsBase + _bufferOffset);
   1129     }
   1130     glGetnUniformfv(
   1131         (GLuint)program,
   1132         (GLint)location,
   1133         (GLsizei)bufSize,
   1134         (GLfloat *)params
   1135     );
   1136 
   1137 exit:
   1138     if (_array) {
   1139         _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
   1140     }
   1141     if (_exception) {
   1142         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1143     }
   1144 }
   1145 
   1146 /* void glGetnUniformiv ( GLuint program, GLint location, GLsizei bufSize, GLint *params ) */
   1147 static void
   1148 android_glGetnUniformiv__III_3II
   1149   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jintArray params_ref, jint offset) {
   1150     jint _exception = 0;
   1151     const char * _exceptionType = NULL;
   1152     const char * _exceptionMessage = NULL;
   1153     GLint *params_base = (GLint *) 0;
   1154     jint _remaining;
   1155     GLint *params = (GLint *) 0;
   1156 
   1157     if (!params_ref) {
   1158         _exception = 1;
   1159         _exceptionType = "java/lang/IllegalArgumentException";
   1160         _exceptionMessage = "params == null";
   1161         goto exit;
   1162     }
   1163     if (offset < 0) {
   1164         _exception = 1;
   1165         _exceptionType = "java/lang/IllegalArgumentException";
   1166         _exceptionMessage = "offset < 0";
   1167         goto exit;
   1168     }
   1169     _remaining = _env->GetArrayLength(params_ref) - offset;
   1170     if (_remaining < bufSize) {
   1171         _exception = 1;
   1172         _exceptionType = "java/lang/IllegalArgumentException";
   1173         _exceptionMessage = "length - offset < bufSize < needed";
   1174         goto exit;
   1175     }
   1176     params_base = (GLint *)
   1177         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1178     params = params_base + offset;
   1179 
   1180     glGetnUniformiv(
   1181         (GLuint)program,
   1182         (GLint)location,
   1183         (GLsizei)bufSize,
   1184         (GLint *)params
   1185     );
   1186 
   1187 exit:
   1188     if (params_base) {
   1189         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1190             _exception ? JNI_ABORT: 0);
   1191     }
   1192     if (_exception) {
   1193         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1194     }
   1195 }
   1196 
   1197 /* void glGetnUniformiv ( GLuint program, GLint location, GLsizei bufSize, GLint *params ) */
   1198 static void
   1199 android_glGetnUniformiv__IIILjava_nio_IntBuffer_2
   1200   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
   1201     jint _exception = 0;
   1202     const char * _exceptionType = NULL;
   1203     const char * _exceptionMessage = NULL;
   1204     jintArray _array = (jintArray) 0;
   1205     jint _bufferOffset = (jint) 0;
   1206     jint _remaining;
   1207     GLint *params = (GLint *) 0;
   1208 
   1209     params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1210     if (_remaining < bufSize) {
   1211         _exception = 1;
   1212         _exceptionType = "java/lang/IllegalArgumentException";
   1213         _exceptionMessage = "remaining() < bufSize < needed";
   1214         goto exit;
   1215     }
   1216     if (params == NULL) {
   1217         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1218         params = (GLint *) (_paramsBase + _bufferOffset);
   1219     }
   1220     glGetnUniformiv(
   1221         (GLuint)program,
   1222         (GLint)location,
   1223         (GLsizei)bufSize,
   1224         (GLint *)params
   1225     );
   1226 
   1227 exit:
   1228     if (_array) {
   1229         _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
   1230     }
   1231     if (_exception) {
   1232         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1233     }
   1234 }
   1235 
   1236 /* void glGetnUniformuiv ( GLuint program, GLint location, GLsizei bufSize, GLuint *params ) */
   1237 static void
   1238 android_glGetnUniformuiv__III_3II
   1239   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jintArray params_ref, jint offset) {
   1240     jint _exception = 0;
   1241     const char * _exceptionType = NULL;
   1242     const char * _exceptionMessage = NULL;
   1243     GLuint *params_base = (GLuint *) 0;
   1244     jint _remaining;
   1245     GLuint *params = (GLuint *) 0;
   1246 
   1247     if (!params_ref) {
   1248         _exception = 1;
   1249         _exceptionType = "java/lang/IllegalArgumentException";
   1250         _exceptionMessage = "params == null";
   1251         goto exit;
   1252     }
   1253     if (offset < 0) {
   1254         _exception = 1;
   1255         _exceptionType = "java/lang/IllegalArgumentException";
   1256         _exceptionMessage = "offset < 0";
   1257         goto exit;
   1258     }
   1259     _remaining = _env->GetArrayLength(params_ref) - offset;
   1260     if (_remaining < bufSize) {
   1261         _exception = 1;
   1262         _exceptionType = "java/lang/IllegalArgumentException";
   1263         _exceptionMessage = "length - offset < bufSize < needed";
   1264         goto exit;
   1265     }
   1266     params_base = (GLuint *)
   1267         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1268     params = params_base + offset;
   1269 
   1270     glGetnUniformuiv(
   1271         (GLuint)program,
   1272         (GLint)location,
   1273         (GLsizei)bufSize,
   1274         (GLuint *)params
   1275     );
   1276 
   1277 exit:
   1278     if (params_base) {
   1279         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1280             _exception ? JNI_ABORT: 0);
   1281     }
   1282     if (_exception) {
   1283         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1284     }
   1285 }
   1286 
   1287 /* void glGetnUniformuiv ( GLuint program, GLint location, GLsizei bufSize, GLuint *params ) */
   1288 static void
   1289 android_glGetnUniformuiv__IIILjava_nio_IntBuffer_2
   1290   (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
   1291     jint _exception = 0;
   1292     const char * _exceptionType = NULL;
   1293     const char * _exceptionMessage = NULL;
   1294     jintArray _array = (jintArray) 0;
   1295     jint _bufferOffset = (jint) 0;
   1296     jint _remaining;
   1297     GLuint *params = (GLuint *) 0;
   1298 
   1299     params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1300     if (_remaining < bufSize) {
   1301         _exception = 1;
   1302         _exceptionType = "java/lang/IllegalArgumentException";
   1303         _exceptionMessage = "remaining() < bufSize < needed";
   1304         goto exit;
   1305     }
   1306     if (params == NULL) {
   1307         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1308         params = (GLuint *) (_paramsBase + _bufferOffset);
   1309     }
   1310     glGetnUniformuiv(
   1311         (GLuint)program,
   1312         (GLint)location,
   1313         (GLsizei)bufSize,
   1314         (GLuint *)params
   1315     );
   1316 
   1317 exit:
   1318     if (_array) {
   1319         _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
   1320     }
   1321     if (_exception) {
   1322         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1323     }
   1324 }
   1325 
   1326 /* void glMinSampleShading ( GLfloat value ) */
   1327 static void
   1328 android_glMinSampleShading__F
   1329   (JNIEnv *_env, jobject _this, jfloat value) {
   1330     glMinSampleShading(
   1331         (GLfloat)value
   1332     );
   1333 }
   1334 
   1335 /* void glPatchParameteri ( GLenum pname, GLint value ) */
   1336 static void
   1337 android_glPatchParameteri__II
   1338   (JNIEnv *_env, jobject _this, jint pname, jint value) {
   1339     glPatchParameteri(
   1340         (GLenum)pname,
   1341         (GLint)value
   1342     );
   1343 }
   1344 
   1345 /* void glTexParameterIiv ( GLenum target, GLenum pname, const GLint *params ) */
   1346 static void
   1347 android_glTexParameterIiv__II_3II
   1348   (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
   1349     jint _exception = 0;
   1350     const char * _exceptionType = NULL;
   1351     const char * _exceptionMessage = NULL;
   1352     GLint *params_base = (GLint *) 0;
   1353     jint _remaining;
   1354     GLint *params = (GLint *) 0;
   1355 
   1356     if (!params_ref) {
   1357         _exception = 1;
   1358         _exceptionType = "java/lang/IllegalArgumentException";
   1359         _exceptionMessage = "params == null";
   1360         goto exit;
   1361     }
   1362     if (offset < 0) {
   1363         _exception = 1;
   1364         _exceptionType = "java/lang/IllegalArgumentException";
   1365         _exceptionMessage = "offset < 0";
   1366         goto exit;
   1367     }
   1368     _remaining = _env->GetArrayLength(params_ref) - offset;
   1369     params_base = (GLint *)
   1370         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1371     params = params_base + offset;
   1372 
   1373     glTexParameterIiv(
   1374         (GLenum)target,
   1375         (GLenum)pname,
   1376         (GLint *)params
   1377     );
   1378 
   1379 exit:
   1380     if (params_base) {
   1381         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1382             JNI_ABORT);
   1383     }
   1384     if (_exception) {
   1385         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1386     }
   1387 }
   1388 
   1389 /* void glTexParameterIiv ( GLenum target, GLenum pname, const GLint *params ) */
   1390 static void
   1391 android_glTexParameterIiv__IILjava_nio_IntBuffer_2
   1392   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
   1393     jintArray _array = (jintArray) 0;
   1394     jint _bufferOffset = (jint) 0;
   1395     jint _remaining;
   1396     GLint *params = (GLint *) 0;
   1397 
   1398     params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1399     if (params == NULL) {
   1400         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1401         params = (GLint *) (_paramsBase + _bufferOffset);
   1402     }
   1403     glTexParameterIiv(
   1404         (GLenum)target,
   1405         (GLenum)pname,
   1406         (GLint *)params
   1407     );
   1408     if (_array) {
   1409         _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
   1410     }
   1411 }
   1412 
   1413 /* void glTexParameterIuiv ( GLenum target, GLenum pname, const GLuint *params ) */
   1414 static void
   1415 android_glTexParameterIuiv__II_3II
   1416   (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
   1417     jint _exception = 0;
   1418     const char * _exceptionType = NULL;
   1419     const char * _exceptionMessage = NULL;
   1420     GLuint *params_base = (GLuint *) 0;
   1421     jint _remaining;
   1422     GLuint *params = (GLuint *) 0;
   1423 
   1424     if (!params_ref) {
   1425         _exception = 1;
   1426         _exceptionType = "java/lang/IllegalArgumentException";
   1427         _exceptionMessage = "params == null";
   1428         goto exit;
   1429     }
   1430     if (offset < 0) {
   1431         _exception = 1;
   1432         _exceptionType = "java/lang/IllegalArgumentException";
   1433         _exceptionMessage = "offset < 0";
   1434         goto exit;
   1435     }
   1436     _remaining = _env->GetArrayLength(params_ref) - offset;
   1437     params_base = (GLuint *)
   1438         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1439     params = params_base + offset;
   1440 
   1441     glTexParameterIuiv(
   1442         (GLenum)target,
   1443         (GLenum)pname,
   1444         (GLuint *)params
   1445     );
   1446 
   1447 exit:
   1448     if (params_base) {
   1449         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1450             JNI_ABORT);
   1451     }
   1452     if (_exception) {
   1453         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1454     }
   1455 }
   1456 
   1457 /* void glTexParameterIuiv ( GLenum target, GLenum pname, const GLuint *params ) */
   1458 static void
   1459 android_glTexParameterIuiv__IILjava_nio_IntBuffer_2
   1460   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
   1461     jintArray _array = (jintArray) 0;
   1462     jint _bufferOffset = (jint) 0;
   1463     jint _remaining;
   1464     GLuint *params = (GLuint *) 0;
   1465 
   1466     params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1467     if (params == NULL) {
   1468         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1469         params = (GLuint *) (_paramsBase + _bufferOffset);
   1470     }
   1471     glTexParameterIuiv(
   1472         (GLenum)target,
   1473         (GLenum)pname,
   1474         (GLuint *)params
   1475     );
   1476     if (_array) {
   1477         _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
   1478     }
   1479 }
   1480 
   1481 /* void glGetTexParameterIiv ( GLenum target, GLenum pname, GLint *params ) */
   1482 static void
   1483 android_glGetTexParameterIiv__II_3II
   1484   (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
   1485     jint _exception = 0;
   1486     const char * _exceptionType = NULL;
   1487     const char * _exceptionMessage = NULL;
   1488     GLint *params_base = (GLint *) 0;
   1489     jint _remaining;
   1490     GLint *params = (GLint *) 0;
   1491 
   1492     if (!params_ref) {
   1493         _exception = 1;
   1494         _exceptionType = "java/lang/IllegalArgumentException";
   1495         _exceptionMessage = "params == null";
   1496         goto exit;
   1497     }
   1498     if (offset < 0) {
   1499         _exception = 1;
   1500         _exceptionType = "java/lang/IllegalArgumentException";
   1501         _exceptionMessage = "offset < 0";
   1502         goto exit;
   1503     }
   1504     _remaining = _env->GetArrayLength(params_ref) - offset;
   1505     params_base = (GLint *)
   1506         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1507     params = params_base + offset;
   1508 
   1509     glGetTexParameterIiv(
   1510         (GLenum)target,
   1511         (GLenum)pname,
   1512         (GLint *)params
   1513     );
   1514 
   1515 exit:
   1516     if (params_base) {
   1517         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1518             _exception ? JNI_ABORT: 0);
   1519     }
   1520     if (_exception) {
   1521         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1522     }
   1523 }
   1524 
   1525 /* void glGetTexParameterIiv ( GLenum target, GLenum pname, GLint *params ) */
   1526 static void
   1527 android_glGetTexParameterIiv__IILjava_nio_IntBuffer_2
   1528   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
   1529     jintArray _array = (jintArray) 0;
   1530     jint _bufferOffset = (jint) 0;
   1531     jint _remaining;
   1532     GLint *params = (GLint *) 0;
   1533 
   1534     params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1535     if (params == NULL) {
   1536         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1537         params = (GLint *) (_paramsBase + _bufferOffset);
   1538     }
   1539     glGetTexParameterIiv(
   1540         (GLenum)target,
   1541         (GLenum)pname,
   1542         (GLint *)params
   1543     );
   1544     if (_array) {
   1545         _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
   1546     }
   1547 }
   1548 
   1549 /* void glGetTexParameterIuiv ( GLenum target, GLenum pname, GLuint *params ) */
   1550 static void
   1551 android_glGetTexParameterIuiv__II_3II
   1552   (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
   1553     jint _exception = 0;
   1554     const char * _exceptionType = NULL;
   1555     const char * _exceptionMessage = NULL;
   1556     GLuint *params_base = (GLuint *) 0;
   1557     jint _remaining;
   1558     GLuint *params = (GLuint *) 0;
   1559 
   1560     if (!params_ref) {
   1561         _exception = 1;
   1562         _exceptionType = "java/lang/IllegalArgumentException";
   1563         _exceptionMessage = "params == null";
   1564         goto exit;
   1565     }
   1566     if (offset < 0) {
   1567         _exception = 1;
   1568         _exceptionType = "java/lang/IllegalArgumentException";
   1569         _exceptionMessage = "offset < 0";
   1570         goto exit;
   1571     }
   1572     _remaining = _env->GetArrayLength(params_ref) - offset;
   1573     params_base = (GLuint *)
   1574         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1575     params = params_base + offset;
   1576 
   1577     glGetTexParameterIuiv(
   1578         (GLenum)target,
   1579         (GLenum)pname,
   1580         (GLuint *)params
   1581     );
   1582 
   1583 exit:
   1584     if (params_base) {
   1585         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1586             _exception ? JNI_ABORT: 0);
   1587     }
   1588     if (_exception) {
   1589         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1590     }
   1591 }
   1592 
   1593 /* void glGetTexParameterIuiv ( GLenum target, GLenum pname, GLuint *params ) */
   1594 static void
   1595 android_glGetTexParameterIuiv__IILjava_nio_IntBuffer_2
   1596   (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
   1597     jintArray _array = (jintArray) 0;
   1598     jint _bufferOffset = (jint) 0;
   1599     jint _remaining;
   1600     GLuint *params = (GLuint *) 0;
   1601 
   1602     params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1603     if (params == NULL) {
   1604         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1605         params = (GLuint *) (_paramsBase + _bufferOffset);
   1606     }
   1607     glGetTexParameterIuiv(
   1608         (GLenum)target,
   1609         (GLenum)pname,
   1610         (GLuint *)params
   1611     );
   1612     if (_array) {
   1613         _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
   1614     }
   1615 }
   1616 
   1617 /* void glSamplerParameterIiv ( GLuint sampler, GLenum pname, const GLint *param ) */
   1618 static void
   1619 android_glSamplerParameterIiv__II_3II
   1620   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
   1621     jint _exception = 0;
   1622     const char * _exceptionType = NULL;
   1623     const char * _exceptionMessage = NULL;
   1624     GLint *param_base = (GLint *) 0;
   1625     jint _remaining;
   1626     GLint *param = (GLint *) 0;
   1627 
   1628     if (!param_ref) {
   1629         _exception = 1;
   1630         _exceptionType = "java/lang/IllegalArgumentException";
   1631         _exceptionMessage = "param == null";
   1632         goto exit;
   1633     }
   1634     if (offset < 0) {
   1635         _exception = 1;
   1636         _exceptionType = "java/lang/IllegalArgumentException";
   1637         _exceptionMessage = "offset < 0";
   1638         goto exit;
   1639     }
   1640     _remaining = _env->GetArrayLength(param_ref) - offset;
   1641     param_base = (GLint *)
   1642         _env->GetIntArrayElements(param_ref, (jboolean *)0);
   1643     param = param_base + offset;
   1644 
   1645     glSamplerParameterIiv(
   1646         (GLuint)sampler,
   1647         (GLenum)pname,
   1648         (GLint *)param
   1649     );
   1650 
   1651 exit:
   1652     if (param_base) {
   1653         _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
   1654             JNI_ABORT);
   1655     }
   1656     if (_exception) {
   1657         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1658     }
   1659 }
   1660 
   1661 /* void glSamplerParameterIiv ( GLuint sampler, GLenum pname, const GLint *param ) */
   1662 static void
   1663 android_glSamplerParameterIiv__IILjava_nio_IntBuffer_2
   1664   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
   1665     jintArray _array = (jintArray) 0;
   1666     jint _bufferOffset = (jint) 0;
   1667     jint _remaining;
   1668     GLint *param = (GLint *) 0;
   1669 
   1670     param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1671     if (param == NULL) {
   1672         char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1673         param = (GLint *) (_paramBase + _bufferOffset);
   1674     }
   1675     glSamplerParameterIiv(
   1676         (GLuint)sampler,
   1677         (GLenum)pname,
   1678         (GLint *)param
   1679     );
   1680     if (_array) {
   1681         _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
   1682     }
   1683 }
   1684 
   1685 /* void glSamplerParameterIuiv ( GLuint sampler, GLenum pname, const GLuint *param ) */
   1686 static void
   1687 android_glSamplerParameterIuiv__II_3II
   1688   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
   1689     jint _exception = 0;
   1690     const char * _exceptionType = NULL;
   1691     const char * _exceptionMessage = NULL;
   1692     GLuint *param_base = (GLuint *) 0;
   1693     jint _remaining;
   1694     GLuint *param = (GLuint *) 0;
   1695 
   1696     if (!param_ref) {
   1697         _exception = 1;
   1698         _exceptionType = "java/lang/IllegalArgumentException";
   1699         _exceptionMessage = "param == null";
   1700         goto exit;
   1701     }
   1702     if (offset < 0) {
   1703         _exception = 1;
   1704         _exceptionType = "java/lang/IllegalArgumentException";
   1705         _exceptionMessage = "offset < 0";
   1706         goto exit;
   1707     }
   1708     _remaining = _env->GetArrayLength(param_ref) - offset;
   1709     param_base = (GLuint *)
   1710         _env->GetIntArrayElements(param_ref, (jboolean *)0);
   1711     param = param_base + offset;
   1712 
   1713     glSamplerParameterIuiv(
   1714         (GLuint)sampler,
   1715         (GLenum)pname,
   1716         (GLuint *)param
   1717     );
   1718 
   1719 exit:
   1720     if (param_base) {
   1721         _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
   1722             JNI_ABORT);
   1723     }
   1724     if (_exception) {
   1725         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1726     }
   1727 }
   1728 
   1729 /* void glSamplerParameterIuiv ( GLuint sampler, GLenum pname, const GLuint *param ) */
   1730 static void
   1731 android_glSamplerParameterIuiv__IILjava_nio_IntBuffer_2
   1732   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
   1733     jintArray _array = (jintArray) 0;
   1734     jint _bufferOffset = (jint) 0;
   1735     jint _remaining;
   1736     GLuint *param = (GLuint *) 0;
   1737 
   1738     param = (GLuint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1739     if (param == NULL) {
   1740         char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1741         param = (GLuint *) (_paramBase + _bufferOffset);
   1742     }
   1743     glSamplerParameterIuiv(
   1744         (GLuint)sampler,
   1745         (GLenum)pname,
   1746         (GLuint *)param
   1747     );
   1748     if (_array) {
   1749         _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
   1750     }
   1751 }
   1752 
   1753 /* void glGetSamplerParameterIiv ( GLuint sampler, GLenum pname, GLint *params ) */
   1754 static void
   1755 android_glGetSamplerParameterIiv__II_3II
   1756   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
   1757     jint _exception = 0;
   1758     const char * _exceptionType = NULL;
   1759     const char * _exceptionMessage = NULL;
   1760     GLint *params_base = (GLint *) 0;
   1761     jint _remaining;
   1762     GLint *params = (GLint *) 0;
   1763 
   1764     if (!params_ref) {
   1765         _exception = 1;
   1766         _exceptionType = "java/lang/IllegalArgumentException";
   1767         _exceptionMessage = "params == null";
   1768         goto exit;
   1769     }
   1770     if (offset < 0) {
   1771         _exception = 1;
   1772         _exceptionType = "java/lang/IllegalArgumentException";
   1773         _exceptionMessage = "offset < 0";
   1774         goto exit;
   1775     }
   1776     _remaining = _env->GetArrayLength(params_ref) - offset;
   1777     params_base = (GLint *)
   1778         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1779     params = params_base + offset;
   1780 
   1781     glGetSamplerParameterIiv(
   1782         (GLuint)sampler,
   1783         (GLenum)pname,
   1784         (GLint *)params
   1785     );
   1786 
   1787 exit:
   1788     if (params_base) {
   1789         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1790             _exception ? JNI_ABORT: 0);
   1791     }
   1792     if (_exception) {
   1793         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1794     }
   1795 }
   1796 
   1797 /* void glGetSamplerParameterIiv ( GLuint sampler, GLenum pname, GLint *params ) */
   1798 static void
   1799 android_glGetSamplerParameterIiv__IILjava_nio_IntBuffer_2
   1800   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
   1801     jintArray _array = (jintArray) 0;
   1802     jint _bufferOffset = (jint) 0;
   1803     jint _remaining;
   1804     GLint *params = (GLint *) 0;
   1805 
   1806     params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1807     if (params == NULL) {
   1808         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1809         params = (GLint *) (_paramsBase + _bufferOffset);
   1810     }
   1811     glGetSamplerParameterIiv(
   1812         (GLuint)sampler,
   1813         (GLenum)pname,
   1814         (GLint *)params
   1815     );
   1816     if (_array) {
   1817         _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
   1818     }
   1819 }
   1820 
   1821 /* void glGetSamplerParameterIuiv ( GLuint sampler, GLenum pname, GLuint *params ) */
   1822 static void
   1823 android_glGetSamplerParameterIuiv__II_3II
   1824   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
   1825     jint _exception = 0;
   1826     const char * _exceptionType = NULL;
   1827     const char * _exceptionMessage = NULL;
   1828     GLuint *params_base = (GLuint *) 0;
   1829     jint _remaining;
   1830     GLuint *params = (GLuint *) 0;
   1831 
   1832     if (!params_ref) {
   1833         _exception = 1;
   1834         _exceptionType = "java/lang/IllegalArgumentException";
   1835         _exceptionMessage = "params == null";
   1836         goto exit;
   1837     }
   1838     if (offset < 0) {
   1839         _exception = 1;
   1840         _exceptionType = "java/lang/IllegalArgumentException";
   1841         _exceptionMessage = "offset < 0";
   1842         goto exit;
   1843     }
   1844     _remaining = _env->GetArrayLength(params_ref) - offset;
   1845     params_base = (GLuint *)
   1846         _env->GetIntArrayElements(params_ref, (jboolean *)0);
   1847     params = params_base + offset;
   1848 
   1849     glGetSamplerParameterIuiv(
   1850         (GLuint)sampler,
   1851         (GLenum)pname,
   1852         (GLuint *)params
   1853     );
   1854 
   1855 exit:
   1856     if (params_base) {
   1857         _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
   1858             _exception ? JNI_ABORT: 0);
   1859     }
   1860     if (_exception) {
   1861         jniThrowException(_env, _exceptionType, _exceptionMessage);
   1862     }
   1863 }
   1864 
   1865 /* void glGetSamplerParameterIuiv ( GLuint sampler, GLenum pname, GLuint *params ) */
   1866 static void
   1867 android_glGetSamplerParameterIuiv__IILjava_nio_IntBuffer_2
   1868   (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
   1869     jintArray _array = (jintArray) 0;
   1870     jint _bufferOffset = (jint) 0;
   1871     jint _remaining;
   1872     GLuint *params = (GLuint *) 0;
   1873 
   1874     params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
   1875     if (params == NULL) {
   1876         char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
   1877         params = (GLuint *) (_paramsBase + _bufferOffset);
   1878     }
   1879     glGetSamplerParameterIuiv(
   1880         (GLuint)sampler,
   1881         (GLenum)pname,
   1882         (GLuint *)params
   1883     );
   1884     if (_array) {
   1885         _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
   1886     }
   1887 }
   1888 
   1889 /* void glTexBuffer ( GLenum target, GLenum internalformat, GLuint buffer ) */
   1890 static void
   1891 android_glTexBuffer__III
   1892   (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer) {
   1893     glTexBuffer(
   1894         (GLenum)target,
   1895         (GLenum)internalformat,
   1896         (GLuint)buffer
   1897     );
   1898 }
   1899 
   1900 /* void glTexBufferRange ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
   1901 static void
   1902 android_glTexBufferRange__IIIII
   1903   (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer, jint offset, jint size) {
   1904     glTexBufferRange(
   1905         (GLenum)target,
   1906         (GLenum)internalformat,
   1907         (GLuint)buffer,
   1908         (GLintptr)offset,
   1909         (GLsizeiptr)size
   1910     );
   1911 }
   1912 
   1913 /* void glTexStorage3DMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations ) */
   1914 static void
   1915 android_glTexStorage3DMultisample__IIIIIIZ
   1916   (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) {
   1917     glTexStorage3DMultisample(
   1918         (GLenum)target,
   1919         (GLsizei)samples,
   1920         (GLenum)internalformat,
   1921         (GLsizei)width,
   1922         (GLsizei)height,
   1923         (GLsizei)depth,
   1924         (GLboolean)fixedsamplelocations
   1925     );
   1926 }
   1927 
   1928 static const char *classPathName = "android/opengl/GLES32";
   1929 
   1930 static const JNINativeMethod methods[] = {
   1931 {"_nativeClassInit", "()V", (void*)nativeClassInit },
   1932 {"glBlendBarrier", "()V", (void *) android_glBlendBarrier__ },
   1933 {"glCopyImageSubData", "(IIIIIIIIIIIIIII)V", (void *) android_glCopyImageSubData__IIIIIIIIIIIIIII },
   1934 {"glDebugMessageControl", "(IIII[IIZ)V", (void *) android_glDebugMessageControl__IIII_3IIZ },
   1935 {"glDebugMessageControl", "(IIIILjava/nio/IntBuffer;Z)V", (void *) android_glDebugMessageControl__IIIILjava_nio_IntBuffer_2Z },
   1936 {"glDebugMessageInsert", "(IIIIILjava/lang/String;)V", (void *) android_glDebugMessageInsert__IIIIILjava_lang_String_2 },
   1937 {"glDebugMessageCallback", "(Landroid/opengl/GLES32$DebugProc;)V", (void *) android_glDebugMessageCallback },
   1938 {"glGetDebugMessageLog", "(II[II[II[II[II[II[BI)I", (void *) android_glGetDebugMessageLog__II_3II_3II_3II_3II_3II_3BI },
   1939 {"glGetDebugMessageLog", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)I", (void *) android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
   1940 {"glGetDebugMessageLog", "(I[II[II[II[II)[Ljava/lang/String;", (void *) android_glGetDebugMessageLog__I_3II_3II_3II_3II },
   1941 {"glGetDebugMessageLog", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)[Ljava/lang/String;", (void *) android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
   1942 {"glPushDebugGroup", "(IIILjava/lang/String;)V", (void *) android_glPushDebugGroup__IIILjava_lang_String_2 },
   1943 {"glPopDebugGroup", "()V", (void *) android_glPopDebugGroup__ },
   1944 {"glObjectLabel", "(IIILjava/lang/String;)V", (void *) android_glObjectLabel__IIILjava_lang_String_2 },
   1945 {"glGetObjectLabel", "(II)Ljava/lang/String;", (void *) android_glGetObjectLabel },
   1946 {"glObjectPtrLabel", "(JLjava/lang/String;)V", (void *) android_glObjectPtrLabel },
   1947 {"glGetObjectPtrLabel", "(J)Ljava/lang/String;", (void *) android_glGetObjectPtrLabel },
   1948 {"glGetPointerv", "(I)J", (void *) android_glGetPointerv },
   1949 {"glEnablei", "(II)V", (void *) android_glEnablei__II },
   1950 {"glDisablei", "(II)V", (void *) android_glDisablei__II },
   1951 {"glBlendEquationi", "(II)V", (void *) android_glBlendEquationi__II },
   1952 {"glBlendEquationSeparatei", "(III)V", (void *) android_glBlendEquationSeparatei__III },
   1953 {"glBlendFunci", "(III)V", (void *) android_glBlendFunci__III },
   1954 {"glBlendFuncSeparatei", "(IIIII)V", (void *) android_glBlendFuncSeparatei__IIIII },
   1955 {"glColorMaski", "(IZZZZ)V", (void *) android_glColorMaski__IZZZZ },
   1956 {"glIsEnabledi", "(II)Z", (void *) android_glIsEnabledi__II },
   1957 {"glDrawElementsBaseVertex", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsBaseVertex__IIILjava_nio_Buffer_2I },
   1958 {"glDrawRangeElementsBaseVertex", "(IIIIILjava/nio/Buffer;I)V", (void *) android_glDrawRangeElementsBaseVertex__IIIIILjava_nio_Buffer_2I },
   1959 {"glDrawElementsInstancedBaseVertex", "(IIILjava/nio/Buffer;II)V", (void *) android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II },
   1960 {"glDrawElementsInstancedBaseVertex", "(IIIIII)V", (void *) android_glDrawElementsInstancedBaseVertex__IIIIII },
   1961 {"glFramebufferTexture", "(IIII)V", (void *) android_glFramebufferTexture__IIII },
   1962 {"glPrimitiveBoundingBox", "(FFFFFFFF)V", (void *) android_glPrimitiveBoundingBox__FFFFFFFF },
   1963 {"glGetGraphicsResetStatus", "()I", (void *) android_glGetGraphicsResetStatus__ },
   1964 {"glReadnPixels", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glReadnPixels__IIIIIIILjava_nio_Buffer_2 },
   1965 {"glGetnUniformfv", "(III[FI)V", (void *) android_glGetnUniformfv__III_3FI },
   1966 {"glGetnUniformfv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glGetnUniformfv__IIILjava_nio_FloatBuffer_2 },
   1967 {"glGetnUniformiv", "(III[II)V", (void *) android_glGetnUniformiv__III_3II },
   1968 {"glGetnUniformiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetnUniformiv__IIILjava_nio_IntBuffer_2 },
   1969 {"glGetnUniformuiv", "(III[II)V", (void *) android_glGetnUniformuiv__III_3II },
   1970 {"glGetnUniformuiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetnUniformuiv__IIILjava_nio_IntBuffer_2 },
   1971 {"glMinSampleShading", "(F)V", (void *) android_glMinSampleShading__F },
   1972 {"glPatchParameteri", "(II)V", (void *) android_glPatchParameteri__II },
   1973 {"glTexParameterIiv", "(II[II)V", (void *) android_glTexParameterIiv__II_3II },
   1974 {"glTexParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIiv__IILjava_nio_IntBuffer_2 },
   1975 {"glTexParameterIuiv", "(II[II)V", (void *) android_glTexParameterIuiv__II_3II },
   1976 {"glTexParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIuiv__IILjava_nio_IntBuffer_2 },
   1977 {"glGetTexParameterIiv", "(II[II)V", (void *) android_glGetTexParameterIiv__II_3II },
   1978 {"glGetTexParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIiv__IILjava_nio_IntBuffer_2 },
   1979 {"glGetTexParameterIuiv", "(II[II)V", (void *) android_glGetTexParameterIuiv__II_3II },
   1980 {"glGetTexParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIuiv__IILjava_nio_IntBuffer_2 },
   1981 {"glSamplerParameterIiv", "(II[II)V", (void *) android_glSamplerParameterIiv__II_3II },
   1982 {"glSamplerParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIiv__IILjava_nio_IntBuffer_2 },
   1983 {"glSamplerParameterIuiv", "(II[II)V", (void *) android_glSamplerParameterIuiv__II_3II },
   1984 {"glSamplerParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIuiv__IILjava_nio_IntBuffer_2 },
   1985 {"glGetSamplerParameterIiv", "(II[II)V", (void *) android_glGetSamplerParameterIiv__II_3II },
   1986 {"glGetSamplerParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIiv__IILjava_nio_IntBuffer_2 },
   1987 {"glGetSamplerParameterIuiv", "(II[II)V", (void *) android_glGetSamplerParameterIuiv__II_3II },
   1988 {"glGetSamplerParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIuiv__IILjava_nio_IntBuffer_2 },
   1989 {"glTexBuffer", "(III)V", (void *) android_glTexBuffer__III },
   1990 {"glTexBufferRange", "(IIIII)V", (void *) android_glTexBufferRange__IIIII },
   1991 {"glTexStorage3DMultisample", "(IIIIIIZ)V", (void *) android_glTexStorage3DMultisample__IIIIIIZ },
   1992 };
   1993 
   1994 int register_android_opengl_jni_GLES32(JNIEnv *_env)
   1995 {
   1996     int err;
   1997     err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
   1998     return err;
   1999 }
   2000