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