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