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