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