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