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