1/* //device/libs/android_runtime/com_google_android_gles_jni_GLImpl.cpp
2**
3** Copyright 2006, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9**     http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18// This source file is automatically generated
19
20#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-function"
22
23#include "jni.h"
24#include <nativehelper/JNIHelp.h>
25#include <android_runtime/AndroidRuntime.h>
26#include <utils/misc.h>
27
28#include <assert.h>
29#include <GLES/gl.h>
30#include <GLES/glext.h>
31
32// Work around differences between the generated name and the actual name.
33
34#define glBlendEquation glBlendEquationOES
35#define glBlendEquationSeparate glBlendEquationSeparateOES
36#define glBlendFuncSeparate glBlendFuncSeparateOES
37#define glGetTexGenfv glGetTexGenfvOES
38#define glGetTexGeniv glGetTexGenivOES
39#define glGetTexGenxv glGetTexGenxvOES
40#define glTexGenf glTexGenfOES
41#define glTexGenfv glTexGenfvOES
42#define glTexGeni glTexGeniOES
43#define glTexGeniv glTexGenivOES
44#define glTexGenx glTexGenxOES
45#define glTexGenxv glTexGenxvOES
46
47
48
49/* special calls implemented in Android's GLES wrapper used to more
50 * efficiently bound-check passed arrays */
51extern "C" {
52GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
53        const GLvoid *ptr, GLsizei count);
54GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
55        const GLvoid *pointer, GLsizei count);
56GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
57        GLsizei stride, const GLvoid *pointer, GLsizei count);
58GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
59        GLsizei stride, const GLvoid *pointer, GLsizei count);
60GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
61        GLsizei stride, const GLvoid *pointer, GLsizei count);
62GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
63        GLsizei stride, const GLvoid *pointer, GLsizei count);
64GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
65        GLsizei stride, const GLvoid *pointer, GLsizei count);
66}
67
68static int initialized = 0;
69
70static jclass nioAccessClass;
71static jclass bufferClass;
72static jclass G11ImplClass;
73static jmethodID getBasePointerID;
74static jmethodID getBaseArrayID;
75static jmethodID getBaseArrayOffsetID;
76static jmethodID allowIndirectBuffersID;
77static jfieldID positionID;
78static jfieldID limitID;
79static jfieldID elementSizeShiftID;
80static jfieldID haveCheckedExtensionsID;
81static jfieldID have_OES_blend_equation_separateID;
82static jfieldID have_OES_blend_subtractID;
83static jfieldID have_OES_framebuffer_objectID;
84static jfieldID have_OES_texture_cube_mapID;
85
86/* Cache method IDs each time the class is loaded. */
87
88static void
89nativeClassInit(JNIEnv *_env, jclass glImplClass)
90{
91    jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
92    nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
93
94    jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
95    bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
96
97    jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
98    G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
99    haveCheckedExtensionsID =  _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
100    have_OES_blend_equation_separateID =  _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
101    have_OES_blend_subtractID =  _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
102    have_OES_framebuffer_objectID =  _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
103    have_OES_texture_cube_mapID =  _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
104
105    getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
106            "getBasePointer", "(Ljava/nio/Buffer;)J");
107    getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
108            "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
109    getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
110            "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
111    allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
112            "allowIndirectBuffers", "(Ljava/lang/String;)Z");
113    positionID = _env->GetFieldID(bufferClass, "position", "I");
114    limitID = _env->GetFieldID(bufferClass, "limit", "I");
115    elementSizeShiftID =
116        _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
117}
118
119static void *
120getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
121{
122    jint position;
123    jint limit;
124    jint elementSizeShift;
125    jlong pointer;
126
127    position = _env->GetIntField(buffer, positionID);
128    limit = _env->GetIntField(buffer, limitID);
129    elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
130    *remaining = (limit - position) << elementSizeShift;
131    pointer = _env->CallStaticLongMethod(nioAccessClass,
132            getBasePointerID, buffer);
133    if (pointer != 0L) {
134        *offset = 0;
135        *array = NULL;
136        return reinterpret_cast<void *>(pointer);
137    }
138
139    *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
140            getBaseArrayID, buffer);
141    if (*array == NULL) {
142        *offset = 0;
143        return (void*) NULL;
144    }
145    *offset = _env->CallStaticIntMethod(nioAccessClass,
146            getBaseArrayOffsetID, buffer);
147
148    return NULL;
149}
150
151static void
152releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
153{
154    _env->ReleasePrimitiveArrayCritical(array, data,
155					   commit ? 0 : JNI_ABORT);
156}
157
158extern "C" {
159extern char*  __progname;
160}
161
162static bool
163allowIndirectBuffers(JNIEnv *_env) {
164    static jint sIndirectBufferCompatability;
165    if (sIndirectBufferCompatability == 0) {
166        jobject appName = _env->NewStringUTF(::__progname);
167        sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
168    }
169    return sIndirectBufferCompatability == 2;
170}
171
172static void *
173getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
174    if (!buffer) {
175        return NULL;
176    }
177    void* buf = _env->GetDirectBufferAddress(buffer);
178    if (buf) {
179        jint position = _env->GetIntField(buffer, positionID);
180        jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
181        buf = ((char*) buf) + (position << elementSizeShift);
182    } else {
183        if (allowIndirectBuffers(_env)) {
184            jarray array = 0;
185            jint remaining;
186            jint offset;
187            buf = getPointer(_env, buffer, &array, &remaining, &offset);
188            if (array) {
189                releasePointer(_env, array, buf, 0);
190            }
191            buf = (char*)buf + offset;
192        } else {
193            jniThrowException(_env, "java/lang/IllegalArgumentException",
194                              "Must use a native order direct Buffer");
195        }
196    }
197    return buf;
198}
199
200static int
201getNumCompressedTextureFormats() {
202    int numCompressedTextureFormats = 0;
203    glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
204    return numCompressedTextureFormats;
205}
206
207// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
208// terminated by either 0 or space, while pExtension is terminated by 0.
209
210static bool
211extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
212    while (true) {
213        char a = *pExtensions++;
214        char b = *pExtension++;
215        bool aEnd = a == '\0' || a == ' ';
216        bool bEnd = b == '\0';
217        if ( aEnd || bEnd) {
218            return aEnd == bEnd;
219        }
220        if ( a != b ) {
221            return false;
222        }
223    }
224}
225
226static const GLubyte*
227nextExtension(const GLubyte* pExtensions) {
228    while (true) {
229        char a = *pExtensions++;
230        if ( a == '\0') {
231            return pExtensions-1;
232        } else if ( a == ' ') {
233            return pExtensions;
234        }
235    }
236}
237
238static bool
239checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
240    for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
241        if (extensionEqual(pExtensions, pExtension)) {
242            return true;
243        }
244    }
245    return false;
246}
247
248static bool
249supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
250    if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
251        _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
252        const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
253        _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
254            checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
255        _env->SetBooleanField(impl, have_OES_blend_subtractID,
256            checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
257        _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
258            checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
259        _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
260            checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
261    }
262    return _env->GetBooleanField(impl, fieldId);
263}
264
265// --------------------------------------------------------------------------
266/* void glActiveTexture ( GLenum texture ) */
267static void
268android_glActiveTexture__I
269  (JNIEnv *_env, jobject _this, jint texture) {
270    glActiveTexture(
271        (GLenum)texture
272    );
273}
274
275/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
276static void
277android_glAlphaFunc__IF
278  (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
279    glAlphaFunc(
280        (GLenum)func,
281        (GLclampf)ref
282    );
283}
284
285/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
286static void
287android_glAlphaFuncx__II
288  (JNIEnv *_env, jobject _this, jint func, jint ref) {
289    glAlphaFuncx(
290        (GLenum)func,
291        (GLclampx)ref
292    );
293}
294
295/* void glBindTexture ( GLenum target, GLuint texture ) */
296static void
297android_glBindTexture__II
298  (JNIEnv *_env, jobject _this, jint target, jint texture) {
299    glBindTexture(
300        (GLenum)target,
301        (GLuint)texture
302    );
303}
304
305/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
306static void
307android_glBlendFunc__II
308  (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
309    glBlendFunc(
310        (GLenum)sfactor,
311        (GLenum)dfactor
312    );
313}
314
315/* void glClear ( GLbitfield mask ) */
316static void
317android_glClear__I
318  (JNIEnv *_env, jobject _this, jint mask) {
319    glClear(
320        (GLbitfield)mask
321    );
322}
323
324/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
325static void
326android_glClearColor__FFFF
327  (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
328    glClearColor(
329        (GLclampf)red,
330        (GLclampf)green,
331        (GLclampf)blue,
332        (GLclampf)alpha
333    );
334}
335
336/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
337static void
338android_glClearColorx__IIII
339  (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
340    glClearColorx(
341        (GLclampx)red,
342        (GLclampx)green,
343        (GLclampx)blue,
344        (GLclampx)alpha
345    );
346}
347
348/* void glClearDepthf ( GLclampf depth ) */
349static void
350android_glClearDepthf__F
351  (JNIEnv *_env, jobject _this, jfloat depth) {
352    glClearDepthf(
353        (GLclampf)depth
354    );
355}
356
357/* void glClearDepthx ( GLclampx depth ) */
358static void
359android_glClearDepthx__I
360  (JNIEnv *_env, jobject _this, jint depth) {
361    glClearDepthx(
362        (GLclampx)depth
363    );
364}
365
366/* void glClearStencil ( GLint s ) */
367static void
368android_glClearStencil__I
369  (JNIEnv *_env, jobject _this, jint s) {
370    glClearStencil(
371        (GLint)s
372    );
373}
374
375/* void glClientActiveTexture ( GLenum texture ) */
376static void
377android_glClientActiveTexture__I
378  (JNIEnv *_env, jobject _this, jint texture) {
379    glClientActiveTexture(
380        (GLenum)texture
381    );
382}
383
384/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
385static void
386android_glColor4f__FFFF
387  (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
388    glColor4f(
389        (GLfloat)red,
390        (GLfloat)green,
391        (GLfloat)blue,
392        (GLfloat)alpha
393    );
394}
395
396/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
397static void
398android_glColor4x__IIII
399  (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
400    glColor4x(
401        (GLfixed)red,
402        (GLfixed)green,
403        (GLfixed)blue,
404        (GLfixed)alpha
405    );
406}
407
408/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
409static void
410android_glColorMask__ZZZZ
411  (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
412    glColorMask(
413        (GLboolean)red,
414        (GLboolean)green,
415        (GLboolean)blue,
416        (GLboolean)alpha
417    );
418}
419
420/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
421static void
422android_glColorPointerBounds__IIILjava_nio_Buffer_2I
423  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
424    jint _exception = 0;
425    const char * _exceptionType = NULL;
426    const char * _exceptionMessage = NULL;
427    jarray _array = (jarray) 0;
428    jint _bufferOffset = (jint) 0;
429    jint _remaining;
430    GLvoid *pointer = (GLvoid *) 0;
431
432    if (pointer_buf) {
433        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
434        if ( ! pointer ) {
435            return;
436        }
437    }
438    glColorPointerBounds(
439        (GLint)size,
440        (GLenum)type,
441        (GLsizei)stride,
442        (GLvoid *)pointer,
443        (GLsizei)remaining
444    );
445    if (_exception) {
446        jniThrowException(_env, _exceptionType, _exceptionMessage);
447    }
448}
449
450/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
451static void
452android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
453  (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
454    jint _exception = 0;
455    const char * _exceptionType = NULL;
456    const char * _exceptionMessage = NULL;
457    jarray _array = (jarray) 0;
458    jint _bufferOffset = (jint) 0;
459    jint _remaining;
460    GLvoid *data = (GLvoid *) 0;
461
462    if (!data_buf) {
463        _exception = 1;
464        _exceptionType = "java/lang/IllegalArgumentException";
465        _exceptionMessage = "data == null";
466        goto exit;
467    }
468    data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
469    if (data == NULL) {
470        char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
471        data = (GLvoid *) (_dataBase + _bufferOffset);
472    }
473    glCompressedTexImage2D(
474        (GLenum)target,
475        (GLint)level,
476        (GLenum)internalformat,
477        (GLsizei)width,
478        (GLsizei)height,
479        (GLint)border,
480        (GLsizei)imageSize,
481        (GLvoid *)data
482    );
483
484exit:
485    if (_array) {
486        releasePointer(_env, _array, data, JNI_FALSE);
487    }
488    if (_exception) {
489        jniThrowException(_env, _exceptionType, _exceptionMessage);
490    }
491}
492
493/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
494static void
495android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
496  (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
497    jint _exception = 0;
498    const char * _exceptionType = NULL;
499    const char * _exceptionMessage = NULL;
500    jarray _array = (jarray) 0;
501    jint _bufferOffset = (jint) 0;
502    jint _remaining;
503    GLvoid *data = (GLvoid *) 0;
504
505    if (!data_buf) {
506        _exception = 1;
507        _exceptionType = "java/lang/IllegalArgumentException";
508        _exceptionMessage = "data == null";
509        goto exit;
510    }
511    data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
512    if (data == NULL) {
513        char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
514        data = (GLvoid *) (_dataBase + _bufferOffset);
515    }
516    glCompressedTexSubImage2D(
517        (GLenum)target,
518        (GLint)level,
519        (GLint)xoffset,
520        (GLint)yoffset,
521        (GLsizei)width,
522        (GLsizei)height,
523        (GLenum)format,
524        (GLsizei)imageSize,
525        (GLvoid *)data
526    );
527
528exit:
529    if (_array) {
530        releasePointer(_env, _array, data, JNI_FALSE);
531    }
532    if (_exception) {
533        jniThrowException(_env, _exceptionType, _exceptionMessage);
534    }
535}
536
537/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
538static void
539android_glCopyTexImage2D__IIIIIIII
540  (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
541    glCopyTexImage2D(
542        (GLenum)target,
543        (GLint)level,
544        (GLenum)internalformat,
545        (GLint)x,
546        (GLint)y,
547        (GLsizei)width,
548        (GLsizei)height,
549        (GLint)border
550    );
551}
552
553/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
554static void
555android_glCopyTexSubImage2D__IIIIIIII
556  (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
557    glCopyTexSubImage2D(
558        (GLenum)target,
559        (GLint)level,
560        (GLint)xoffset,
561        (GLint)yoffset,
562        (GLint)x,
563        (GLint)y,
564        (GLsizei)width,
565        (GLsizei)height
566    );
567}
568
569/* void glCullFace ( GLenum mode ) */
570static void
571android_glCullFace__I
572  (JNIEnv *_env, jobject _this, jint mode) {
573    glCullFace(
574        (GLenum)mode
575    );
576}
577
578/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
579static void
580android_glDeleteTextures__I_3II
581  (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
582    jint _exception = 0;
583    const char * _exceptionType = NULL;
584    const char * _exceptionMessage = NULL;
585    GLuint *textures_base = (GLuint *) 0;
586    jint _remaining;
587    GLuint *textures = (GLuint *) 0;
588
589    if (!textures_ref) {
590        _exception = 1;
591        _exceptionType = "java/lang/IllegalArgumentException";
592        _exceptionMessage = "textures == null";
593        goto exit;
594    }
595    if (offset < 0) {
596        _exception = 1;
597        _exceptionType = "java/lang/IllegalArgumentException";
598        _exceptionMessage = "offset < 0";
599        goto exit;
600    }
601    _remaining = _env->GetArrayLength(textures_ref) - offset;
602    if (_remaining < n) {
603        _exception = 1;
604        _exceptionType = "java/lang/IllegalArgumentException";
605        _exceptionMessage = "length - offset < n < needed";
606        goto exit;
607    }
608    textures_base = (GLuint *)
609        _env->GetIntArrayElements(textures_ref, (jboolean *)0);
610    textures = textures_base + offset;
611
612    glDeleteTextures(
613        (GLsizei)n,
614        (GLuint *)textures
615    );
616
617exit:
618    if (textures_base) {
619        _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
620            JNI_ABORT);
621    }
622    if (_exception) {
623        jniThrowException(_env, _exceptionType, _exceptionMessage);
624    }
625}
626
627/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
628static void
629android_glDeleteTextures__ILjava_nio_IntBuffer_2
630  (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
631    jint _exception = 0;
632    const char * _exceptionType = NULL;
633    const char * _exceptionMessage = NULL;
634    jintArray _array = (jintArray) 0;
635    jint _bufferOffset = (jint) 0;
636    jint _remaining;
637    GLuint *textures = (GLuint *) 0;
638
639    if (!textures_buf) {
640        _exception = 1;
641        _exceptionType = "java/lang/IllegalArgumentException";
642        _exceptionMessage = "textures == null";
643        goto exit;
644    }
645    textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
646    if (_remaining < n) {
647        _exception = 1;
648        _exceptionType = "java/lang/IllegalArgumentException";
649        _exceptionMessage = "remaining() < n < needed";
650        goto exit;
651    }
652    if (textures == NULL) {
653        char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
654        textures = (GLuint *) (_texturesBase + _bufferOffset);
655    }
656    glDeleteTextures(
657        (GLsizei)n,
658        (GLuint *)textures
659    );
660
661exit:
662    if (_array) {
663        _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
664    }
665    if (_exception) {
666        jniThrowException(_env, _exceptionType, _exceptionMessage);
667    }
668}
669
670/* void glDepthFunc ( GLenum func ) */
671static void
672android_glDepthFunc__I
673  (JNIEnv *_env, jobject _this, jint func) {
674    glDepthFunc(
675        (GLenum)func
676    );
677}
678
679/* void glDepthMask ( GLboolean flag ) */
680static void
681android_glDepthMask__Z
682  (JNIEnv *_env, jobject _this, jboolean flag) {
683    glDepthMask(
684        (GLboolean)flag
685    );
686}
687
688/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
689static void
690android_glDepthRangef__FF
691  (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
692    glDepthRangef(
693        (GLclampf)zNear,
694        (GLclampf)zFar
695    );
696}
697
698/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
699static void
700android_glDepthRangex__II
701  (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
702    glDepthRangex(
703        (GLclampx)zNear,
704        (GLclampx)zFar
705    );
706}
707
708/* void glDisable ( GLenum cap ) */
709static void
710android_glDisable__I
711  (JNIEnv *_env, jobject _this, jint cap) {
712    glDisable(
713        (GLenum)cap
714    );
715}
716
717/* void glDisableClientState ( GLenum array ) */
718static void
719android_glDisableClientState__I
720  (JNIEnv *_env, jobject _this, jint array) {
721    glDisableClientState(
722        (GLenum)array
723    );
724}
725
726/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
727static void
728android_glDrawArrays__III
729  (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
730    glDrawArrays(
731        (GLenum)mode,
732        (GLint)first,
733        (GLsizei)count
734    );
735}
736
737/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
738static void
739android_glDrawElements__IIILjava_nio_Buffer_2
740  (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
741    jint _exception = 0;
742    const char * _exceptionType = NULL;
743    const char * _exceptionMessage = NULL;
744    jarray _array = (jarray) 0;
745    jint _bufferOffset = (jint) 0;
746    jint _remaining;
747    GLvoid *indices = (GLvoid *) 0;
748
749    if (!indices_buf) {
750        _exception = 1;
751        _exceptionType = "java/lang/IllegalArgumentException";
752        _exceptionMessage = "indices == null";
753        goto exit;
754    }
755    indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
756    if (_remaining < count) {
757        _exception = 1;
758        _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
759        _exceptionMessage = "remaining() < count < needed";
760        goto exit;
761    }
762    if (indices == NULL) {
763        char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
764        indices = (GLvoid *) (_indicesBase + _bufferOffset);
765    }
766    glDrawElements(
767        (GLenum)mode,
768        (GLsizei)count,
769        (GLenum)type,
770        (GLvoid *)indices
771    );
772
773exit:
774    if (_array) {
775        releasePointer(_env, _array, indices, JNI_FALSE);
776    }
777    if (_exception) {
778        jniThrowException(_env, _exceptionType, _exceptionMessage);
779    }
780}
781
782/* void glEnable ( GLenum cap ) */
783static void
784android_glEnable__I
785  (JNIEnv *_env, jobject _this, jint cap) {
786    glEnable(
787        (GLenum)cap
788    );
789}
790
791/* void glEnableClientState ( GLenum array ) */
792static void
793android_glEnableClientState__I
794  (JNIEnv *_env, jobject _this, jint array) {
795    glEnableClientState(
796        (GLenum)array
797    );
798}
799
800/* void glFinish ( void ) */
801static void
802android_glFinish__
803  (JNIEnv *_env, jobject _this) {
804    glFinish();
805}
806
807/* void glFlush ( void ) */
808static void
809android_glFlush__
810  (JNIEnv *_env, jobject _this) {
811    glFlush();
812}
813
814/* void glFogf ( GLenum pname, GLfloat param ) */
815static void
816android_glFogf__IF
817  (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
818    glFogf(
819        (GLenum)pname,
820        (GLfloat)param
821    );
822}
823
824/* void glFogfv ( GLenum pname, const GLfloat *params ) */
825static void
826android_glFogfv__I_3FI
827  (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
828    jint _exception = 0;
829    const char * _exceptionType = NULL;
830    const char * _exceptionMessage = NULL;
831    GLfloat *params_base = (GLfloat *) 0;
832    jint _remaining;
833    GLfloat *params = (GLfloat *) 0;
834
835    if (!params_ref) {
836        _exception = 1;
837        _exceptionType = "java/lang/IllegalArgumentException";
838        _exceptionMessage = "params == null";
839        goto exit;
840    }
841    if (offset < 0) {
842        _exception = 1;
843        _exceptionType = "java/lang/IllegalArgumentException";
844        _exceptionMessage = "offset < 0";
845        goto exit;
846    }
847    _remaining = _env->GetArrayLength(params_ref) - offset;
848    int _needed;
849    switch (pname) {
850#if defined(GL_FOG_MODE)
851        case GL_FOG_MODE:
852#endif // defined(GL_FOG_MODE)
853#if defined(GL_FOG_DENSITY)
854        case GL_FOG_DENSITY:
855#endif // defined(GL_FOG_DENSITY)
856#if defined(GL_FOG_START)
857        case GL_FOG_START:
858#endif // defined(GL_FOG_START)
859#if defined(GL_FOG_END)
860        case GL_FOG_END:
861#endif // defined(GL_FOG_END)
862            _needed = 1;
863            break;
864#if defined(GL_FOG_COLOR)
865        case GL_FOG_COLOR:
866#endif // defined(GL_FOG_COLOR)
867            _needed = 4;
868            break;
869        default:
870            _needed = 1;
871            break;
872    }
873    if (_remaining < _needed) {
874        _exception = 1;
875        _exceptionType = "java/lang/IllegalArgumentException";
876        _exceptionMessage = "length - offset < needed";
877        goto exit;
878    }
879    params_base = (GLfloat *)
880        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
881    params = params_base + offset;
882
883    glFogfv(
884        (GLenum)pname,
885        (GLfloat *)params
886    );
887
888exit:
889    if (params_base) {
890        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
891            JNI_ABORT);
892    }
893    if (_exception) {
894        jniThrowException(_env, _exceptionType, _exceptionMessage);
895    }
896}
897
898/* void glFogfv ( GLenum pname, const GLfloat *params ) */
899static void
900android_glFogfv__ILjava_nio_FloatBuffer_2
901  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
902    jint _exception = 0;
903    const char * _exceptionType = NULL;
904    const char * _exceptionMessage = NULL;
905    jfloatArray _array = (jfloatArray) 0;
906    jint _bufferOffset = (jint) 0;
907    jint _remaining;
908    GLfloat *params = (GLfloat *) 0;
909
910    if (!params_buf) {
911        _exception = 1;
912        _exceptionType = "java/lang/IllegalArgumentException";
913        _exceptionMessage = "params == null";
914        goto exit;
915    }
916    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
917    int _needed;
918    switch (pname) {
919#if defined(GL_FOG_MODE)
920        case GL_FOG_MODE:
921#endif // defined(GL_FOG_MODE)
922#if defined(GL_FOG_DENSITY)
923        case GL_FOG_DENSITY:
924#endif // defined(GL_FOG_DENSITY)
925#if defined(GL_FOG_START)
926        case GL_FOG_START:
927#endif // defined(GL_FOG_START)
928#if defined(GL_FOG_END)
929        case GL_FOG_END:
930#endif // defined(GL_FOG_END)
931            _needed = 1;
932            break;
933#if defined(GL_FOG_COLOR)
934        case GL_FOG_COLOR:
935#endif // defined(GL_FOG_COLOR)
936            _needed = 4;
937            break;
938        default:
939            _needed = 1;
940            break;
941    }
942    if (_remaining < _needed) {
943        _exception = 1;
944        _exceptionType = "java/lang/IllegalArgumentException";
945        _exceptionMessage = "remaining() < needed";
946        goto exit;
947    }
948    if (params == NULL) {
949        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
950        params = (GLfloat *) (_paramsBase + _bufferOffset);
951    }
952    glFogfv(
953        (GLenum)pname,
954        (GLfloat *)params
955    );
956
957exit:
958    if (_array) {
959        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
960    }
961    if (_exception) {
962        jniThrowException(_env, _exceptionType, _exceptionMessage);
963    }
964}
965
966/* void glFogx ( GLenum pname, GLfixed param ) */
967static void
968android_glFogx__II
969  (JNIEnv *_env, jobject _this, jint pname, jint param) {
970    glFogx(
971        (GLenum)pname,
972        (GLfixed)param
973    );
974}
975
976/* void glFogxv ( GLenum pname, const GLfixed *params ) */
977static void
978android_glFogxv__I_3II
979  (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
980    jint _exception = 0;
981    const char * _exceptionType = NULL;
982    const char * _exceptionMessage = NULL;
983    GLfixed *params_base = (GLfixed *) 0;
984    jint _remaining;
985    GLfixed *params = (GLfixed *) 0;
986
987    if (!params_ref) {
988        _exception = 1;
989        _exceptionType = "java/lang/IllegalArgumentException";
990        _exceptionMessage = "params == null";
991        goto exit;
992    }
993    if (offset < 0) {
994        _exception = 1;
995        _exceptionType = "java/lang/IllegalArgumentException";
996        _exceptionMessage = "offset < 0";
997        goto exit;
998    }
999    _remaining = _env->GetArrayLength(params_ref) - offset;
1000    int _needed;
1001    switch (pname) {
1002#if defined(GL_FOG_MODE)
1003        case GL_FOG_MODE:
1004#endif // defined(GL_FOG_MODE)
1005#if defined(GL_FOG_DENSITY)
1006        case GL_FOG_DENSITY:
1007#endif // defined(GL_FOG_DENSITY)
1008#if defined(GL_FOG_START)
1009        case GL_FOG_START:
1010#endif // defined(GL_FOG_START)
1011#if defined(GL_FOG_END)
1012        case GL_FOG_END:
1013#endif // defined(GL_FOG_END)
1014            _needed = 1;
1015            break;
1016#if defined(GL_FOG_COLOR)
1017        case GL_FOG_COLOR:
1018#endif // defined(GL_FOG_COLOR)
1019            _needed = 4;
1020            break;
1021        default:
1022            _needed = 1;
1023            break;
1024    }
1025    if (_remaining < _needed) {
1026        _exception = 1;
1027        _exceptionType = "java/lang/IllegalArgumentException";
1028        _exceptionMessage = "length - offset < needed";
1029        goto exit;
1030    }
1031    params_base = (GLfixed *)
1032        _env->GetIntArrayElements(params_ref, (jboolean *)0);
1033    params = params_base + offset;
1034
1035    glFogxv(
1036        (GLenum)pname,
1037        (GLfixed *)params
1038    );
1039
1040exit:
1041    if (params_base) {
1042        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1043            JNI_ABORT);
1044    }
1045    if (_exception) {
1046        jniThrowException(_env, _exceptionType, _exceptionMessage);
1047    }
1048}
1049
1050/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1051static void
1052android_glFogxv__ILjava_nio_IntBuffer_2
1053  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1054    jint _exception = 0;
1055    const char * _exceptionType = NULL;
1056    const char * _exceptionMessage = NULL;
1057    jintArray _array = (jintArray) 0;
1058    jint _bufferOffset = (jint) 0;
1059    jint _remaining;
1060    GLfixed *params = (GLfixed *) 0;
1061
1062    if (!params_buf) {
1063        _exception = 1;
1064        _exceptionType = "java/lang/IllegalArgumentException";
1065        _exceptionMessage = "params == null";
1066        goto exit;
1067    }
1068    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1069    int _needed;
1070    switch (pname) {
1071#if defined(GL_FOG_MODE)
1072        case GL_FOG_MODE:
1073#endif // defined(GL_FOG_MODE)
1074#if defined(GL_FOG_DENSITY)
1075        case GL_FOG_DENSITY:
1076#endif // defined(GL_FOG_DENSITY)
1077#if defined(GL_FOG_START)
1078        case GL_FOG_START:
1079#endif // defined(GL_FOG_START)
1080#if defined(GL_FOG_END)
1081        case GL_FOG_END:
1082#endif // defined(GL_FOG_END)
1083            _needed = 1;
1084            break;
1085#if defined(GL_FOG_COLOR)
1086        case GL_FOG_COLOR:
1087#endif // defined(GL_FOG_COLOR)
1088            _needed = 4;
1089            break;
1090        default:
1091            _needed = 1;
1092            break;
1093    }
1094    if (_remaining < _needed) {
1095        _exception = 1;
1096        _exceptionType = "java/lang/IllegalArgumentException";
1097        _exceptionMessage = "remaining() < needed";
1098        goto exit;
1099    }
1100    if (params == NULL) {
1101        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1102        params = (GLfixed *) (_paramsBase + _bufferOffset);
1103    }
1104    glFogxv(
1105        (GLenum)pname,
1106        (GLfixed *)params
1107    );
1108
1109exit:
1110    if (_array) {
1111        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1112    }
1113    if (_exception) {
1114        jniThrowException(_env, _exceptionType, _exceptionMessage);
1115    }
1116}
1117
1118/* void glFrontFace ( GLenum mode ) */
1119static void
1120android_glFrontFace__I
1121  (JNIEnv *_env, jobject _this, jint mode) {
1122    glFrontFace(
1123        (GLenum)mode
1124    );
1125}
1126
1127/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1128static void
1129android_glFrustumf__FFFFFF
1130  (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1131    glFrustumf(
1132        (GLfloat)left,
1133        (GLfloat)right,
1134        (GLfloat)bottom,
1135        (GLfloat)top,
1136        (GLfloat)zNear,
1137        (GLfloat)zFar
1138    );
1139}
1140
1141/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1142static void
1143android_glFrustumx__IIIIII
1144  (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1145    glFrustumx(
1146        (GLfixed)left,
1147        (GLfixed)right,
1148        (GLfixed)bottom,
1149        (GLfixed)top,
1150        (GLfixed)zNear,
1151        (GLfixed)zFar
1152    );
1153}
1154
1155/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1156static void
1157android_glGenTextures__I_3II
1158  (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1159    jint _exception = 0;
1160    const char * _exceptionType = NULL;
1161    const char * _exceptionMessage = NULL;
1162    GLuint *textures_base = (GLuint *) 0;
1163    jint _remaining;
1164    GLuint *textures = (GLuint *) 0;
1165
1166    if (!textures_ref) {
1167        _exception = 1;
1168        _exceptionType = "java/lang/IllegalArgumentException";
1169        _exceptionMessage = "textures == null";
1170        goto exit;
1171    }
1172    if (offset < 0) {
1173        _exception = 1;
1174        _exceptionType = "java/lang/IllegalArgumentException";
1175        _exceptionMessage = "offset < 0";
1176        goto exit;
1177    }
1178    _remaining = _env->GetArrayLength(textures_ref) - offset;
1179    if (_remaining < n) {
1180        _exception = 1;
1181        _exceptionType = "java/lang/IllegalArgumentException";
1182        _exceptionMessage = "length - offset < n < needed";
1183        goto exit;
1184    }
1185    textures_base = (GLuint *)
1186        _env->GetIntArrayElements(textures_ref, (jboolean *)0);
1187    textures = textures_base + offset;
1188
1189    glGenTextures(
1190        (GLsizei)n,
1191        (GLuint *)textures
1192    );
1193
1194exit:
1195    if (textures_base) {
1196        _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
1197            _exception ? JNI_ABORT: 0);
1198    }
1199    if (_exception) {
1200        jniThrowException(_env, _exceptionType, _exceptionMessage);
1201    }
1202}
1203
1204/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1205static void
1206android_glGenTextures__ILjava_nio_IntBuffer_2
1207  (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1208    jint _exception = 0;
1209    const char * _exceptionType = NULL;
1210    const char * _exceptionMessage = NULL;
1211    jintArray _array = (jintArray) 0;
1212    jint _bufferOffset = (jint) 0;
1213    jint _remaining;
1214    GLuint *textures = (GLuint *) 0;
1215
1216    if (!textures_buf) {
1217        _exception = 1;
1218        _exceptionType = "java/lang/IllegalArgumentException";
1219        _exceptionMessage = "textures == null";
1220        goto exit;
1221    }
1222    textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1223    if (_remaining < n) {
1224        _exception = 1;
1225        _exceptionType = "java/lang/IllegalArgumentException";
1226        _exceptionMessage = "remaining() < n < needed";
1227        goto exit;
1228    }
1229    if (textures == NULL) {
1230        char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1231        textures = (GLuint *) (_texturesBase + _bufferOffset);
1232    }
1233    glGenTextures(
1234        (GLsizei)n,
1235        (GLuint *)textures
1236    );
1237
1238exit:
1239    if (_array) {
1240        _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
1241    }
1242    if (_exception) {
1243        jniThrowException(_env, _exceptionType, _exceptionMessage);
1244    }
1245}
1246
1247/* GLenum glGetError ( void ) */
1248static jint
1249android_glGetError__
1250  (JNIEnv *_env, jobject _this) {
1251    GLenum _returnValue;
1252    _returnValue = glGetError();
1253    return (jint)_returnValue;
1254}
1255
1256/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1257static void
1258android_glGetIntegerv__I_3II
1259  (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1260    jint _exception = 0;
1261    const char * _exceptionType = NULL;
1262    const char * _exceptionMessage = NULL;
1263    GLint *params_base = (GLint *) 0;
1264    jint _remaining;
1265    GLint *params = (GLint *) 0;
1266
1267    if (!params_ref) {
1268        _exception = 1;
1269        _exceptionType = "java/lang/IllegalArgumentException";
1270        _exceptionMessage = "params == null";
1271        goto exit;
1272    }
1273    if (offset < 0) {
1274        _exception = 1;
1275        _exceptionType = "java/lang/IllegalArgumentException";
1276        _exceptionMessage = "offset < 0";
1277        goto exit;
1278    }
1279    _remaining = _env->GetArrayLength(params_ref) - offset;
1280    int _needed;
1281    switch (pname) {
1282#if defined(GL_ALPHA_BITS)
1283        case GL_ALPHA_BITS:
1284#endif // defined(GL_ALPHA_BITS)
1285#if defined(GL_ALPHA_TEST_FUNC)
1286        case GL_ALPHA_TEST_FUNC:
1287#endif // defined(GL_ALPHA_TEST_FUNC)
1288#if defined(GL_ALPHA_TEST_REF)
1289        case GL_ALPHA_TEST_REF:
1290#endif // defined(GL_ALPHA_TEST_REF)
1291#if defined(GL_BLEND_DST)
1292        case GL_BLEND_DST:
1293#endif // defined(GL_BLEND_DST)
1294#if defined(GL_BLUE_BITS)
1295        case GL_BLUE_BITS:
1296#endif // defined(GL_BLUE_BITS)
1297#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1298        case GL_COLOR_ARRAY_BUFFER_BINDING:
1299#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1300#if defined(GL_COLOR_ARRAY_SIZE)
1301        case GL_COLOR_ARRAY_SIZE:
1302#endif // defined(GL_COLOR_ARRAY_SIZE)
1303#if defined(GL_COLOR_ARRAY_STRIDE)
1304        case GL_COLOR_ARRAY_STRIDE:
1305#endif // defined(GL_COLOR_ARRAY_STRIDE)
1306#if defined(GL_COLOR_ARRAY_TYPE)
1307        case GL_COLOR_ARRAY_TYPE:
1308#endif // defined(GL_COLOR_ARRAY_TYPE)
1309#if defined(GL_CULL_FACE)
1310        case GL_CULL_FACE:
1311#endif // defined(GL_CULL_FACE)
1312#if defined(GL_DEPTH_BITS)
1313        case GL_DEPTH_BITS:
1314#endif // defined(GL_DEPTH_BITS)
1315#if defined(GL_DEPTH_CLEAR_VALUE)
1316        case GL_DEPTH_CLEAR_VALUE:
1317#endif // defined(GL_DEPTH_CLEAR_VALUE)
1318#if defined(GL_DEPTH_FUNC)
1319        case GL_DEPTH_FUNC:
1320#endif // defined(GL_DEPTH_FUNC)
1321#if defined(GL_DEPTH_WRITEMASK)
1322        case GL_DEPTH_WRITEMASK:
1323#endif // defined(GL_DEPTH_WRITEMASK)
1324#if defined(GL_FOG_DENSITY)
1325        case GL_FOG_DENSITY:
1326#endif // defined(GL_FOG_DENSITY)
1327#if defined(GL_FOG_END)
1328        case GL_FOG_END:
1329#endif // defined(GL_FOG_END)
1330#if defined(GL_FOG_MODE)
1331        case GL_FOG_MODE:
1332#endif // defined(GL_FOG_MODE)
1333#if defined(GL_FOG_START)
1334        case GL_FOG_START:
1335#endif // defined(GL_FOG_START)
1336#if defined(GL_FRONT_FACE)
1337        case GL_FRONT_FACE:
1338#endif // defined(GL_FRONT_FACE)
1339#if defined(GL_GREEN_BITS)
1340        case GL_GREEN_BITS:
1341#endif // defined(GL_GREEN_BITS)
1342#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1343        case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1344#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1345#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1346        case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1347#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1348#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1349        case GL_LIGHT_MODEL_COLOR_CONTROL:
1350#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1351#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1352        case GL_LIGHT_MODEL_LOCAL_VIEWER:
1353#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1354#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1355        case GL_LIGHT_MODEL_TWO_SIDE:
1356#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1357#if defined(GL_LINE_SMOOTH_HINT)
1358        case GL_LINE_SMOOTH_HINT:
1359#endif // defined(GL_LINE_SMOOTH_HINT)
1360#if defined(GL_LINE_WIDTH)
1361        case GL_LINE_WIDTH:
1362#endif // defined(GL_LINE_WIDTH)
1363#if defined(GL_LOGIC_OP_MODE)
1364        case GL_LOGIC_OP_MODE:
1365#endif // defined(GL_LOGIC_OP_MODE)
1366#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1367        case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1368#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1369#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1370        case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1371#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1372#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1373        case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1374#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1375#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1376        case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1377#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1378#if defined(GL_MATRIX_MODE)
1379        case GL_MATRIX_MODE:
1380#endif // defined(GL_MATRIX_MODE)
1381#if defined(GL_MAX_CLIP_PLANES)
1382        case GL_MAX_CLIP_PLANES:
1383#endif // defined(GL_MAX_CLIP_PLANES)
1384#if defined(GL_MAX_ELEMENTS_INDICES)
1385        case GL_MAX_ELEMENTS_INDICES:
1386#endif // defined(GL_MAX_ELEMENTS_INDICES)
1387#if defined(GL_MAX_ELEMENTS_VERTICES)
1388        case GL_MAX_ELEMENTS_VERTICES:
1389#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1390#if defined(GL_MAX_LIGHTS)
1391        case GL_MAX_LIGHTS:
1392#endif // defined(GL_MAX_LIGHTS)
1393#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1394        case GL_MAX_MODELVIEW_STACK_DEPTH:
1395#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1396#if defined(GL_MAX_PALETTE_MATRICES_OES)
1397        case GL_MAX_PALETTE_MATRICES_OES:
1398#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1399#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1400        case GL_MAX_PROJECTION_STACK_DEPTH:
1401#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1402#if defined(GL_MAX_TEXTURE_SIZE)
1403        case GL_MAX_TEXTURE_SIZE:
1404#endif // defined(GL_MAX_TEXTURE_SIZE)
1405#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1406        case GL_MAX_TEXTURE_STACK_DEPTH:
1407#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1408#if defined(GL_MAX_TEXTURE_UNITS)
1409        case GL_MAX_TEXTURE_UNITS:
1410#endif // defined(GL_MAX_TEXTURE_UNITS)
1411#if defined(GL_MAX_VERTEX_UNITS_OES)
1412        case GL_MAX_VERTEX_UNITS_OES:
1413#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1414#if defined(GL_MODELVIEW_STACK_DEPTH)
1415        case GL_MODELVIEW_STACK_DEPTH:
1416#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1417#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1418        case GL_NORMAL_ARRAY_BUFFER_BINDING:
1419#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1420#if defined(GL_NORMAL_ARRAY_STRIDE)
1421        case GL_NORMAL_ARRAY_STRIDE:
1422#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1423#if defined(GL_NORMAL_ARRAY_TYPE)
1424        case GL_NORMAL_ARRAY_TYPE:
1425#endif // defined(GL_NORMAL_ARRAY_TYPE)
1426#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1427        case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1428#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1429#if defined(GL_PACK_ALIGNMENT)
1430        case GL_PACK_ALIGNMENT:
1431#endif // defined(GL_PACK_ALIGNMENT)
1432#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1433        case GL_PERSPECTIVE_CORRECTION_HINT:
1434#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1435#if defined(GL_POINT_SIZE)
1436        case GL_POINT_SIZE:
1437#endif // defined(GL_POINT_SIZE)
1438#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1439        case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1440#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1441#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1442        case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1443#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1444#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1445        case GL_POINT_SIZE_ARRAY_TYPE_OES:
1446#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1447#if defined(GL_POINT_SMOOTH_HINT)
1448        case GL_POINT_SMOOTH_HINT:
1449#endif // defined(GL_POINT_SMOOTH_HINT)
1450#if defined(GL_POLYGON_OFFSET_FACTOR)
1451        case GL_POLYGON_OFFSET_FACTOR:
1452#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1453#if defined(GL_POLYGON_OFFSET_UNITS)
1454        case GL_POLYGON_OFFSET_UNITS:
1455#endif // defined(GL_POLYGON_OFFSET_UNITS)
1456#if defined(GL_PROJECTION_STACK_DEPTH)
1457        case GL_PROJECTION_STACK_DEPTH:
1458#endif // defined(GL_PROJECTION_STACK_DEPTH)
1459#if defined(GL_RED_BITS)
1460        case GL_RED_BITS:
1461#endif // defined(GL_RED_BITS)
1462#if defined(GL_SHADE_MODEL)
1463        case GL_SHADE_MODEL:
1464#endif // defined(GL_SHADE_MODEL)
1465#if defined(GL_STENCIL_BITS)
1466        case GL_STENCIL_BITS:
1467#endif // defined(GL_STENCIL_BITS)
1468#if defined(GL_STENCIL_CLEAR_VALUE)
1469        case GL_STENCIL_CLEAR_VALUE:
1470#endif // defined(GL_STENCIL_CLEAR_VALUE)
1471#if defined(GL_STENCIL_FAIL)
1472        case GL_STENCIL_FAIL:
1473#endif // defined(GL_STENCIL_FAIL)
1474#if defined(GL_STENCIL_FUNC)
1475        case GL_STENCIL_FUNC:
1476#endif // defined(GL_STENCIL_FUNC)
1477#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1478        case GL_STENCIL_PASS_DEPTH_FAIL:
1479#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1480#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1481        case GL_STENCIL_PASS_DEPTH_PASS:
1482#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1483#if defined(GL_STENCIL_REF)
1484        case GL_STENCIL_REF:
1485#endif // defined(GL_STENCIL_REF)
1486#if defined(GL_STENCIL_VALUE_MASK)
1487        case GL_STENCIL_VALUE_MASK:
1488#endif // defined(GL_STENCIL_VALUE_MASK)
1489#if defined(GL_STENCIL_WRITEMASK)
1490        case GL_STENCIL_WRITEMASK:
1491#endif // defined(GL_STENCIL_WRITEMASK)
1492#if defined(GL_SUBPIXEL_BITS)
1493        case GL_SUBPIXEL_BITS:
1494#endif // defined(GL_SUBPIXEL_BITS)
1495#if defined(GL_TEXTURE_BINDING_2D)
1496        case GL_TEXTURE_BINDING_2D:
1497#endif // defined(GL_TEXTURE_BINDING_2D)
1498#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1499        case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1500#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1501#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1502        case GL_TEXTURE_COORD_ARRAY_SIZE:
1503#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1504#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1505        case GL_TEXTURE_COORD_ARRAY_STRIDE:
1506#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1507#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1508        case GL_TEXTURE_COORD_ARRAY_TYPE:
1509#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1510#if defined(GL_TEXTURE_STACK_DEPTH)
1511        case GL_TEXTURE_STACK_DEPTH:
1512#endif // defined(GL_TEXTURE_STACK_DEPTH)
1513#if defined(GL_UNPACK_ALIGNMENT)
1514        case GL_UNPACK_ALIGNMENT:
1515#endif // defined(GL_UNPACK_ALIGNMENT)
1516#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1517        case GL_VERTEX_ARRAY_BUFFER_BINDING:
1518#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1519#if defined(GL_VERTEX_ARRAY_SIZE)
1520        case GL_VERTEX_ARRAY_SIZE:
1521#endif // defined(GL_VERTEX_ARRAY_SIZE)
1522#if defined(GL_VERTEX_ARRAY_STRIDE)
1523        case GL_VERTEX_ARRAY_STRIDE:
1524#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1525#if defined(GL_VERTEX_ARRAY_TYPE)
1526        case GL_VERTEX_ARRAY_TYPE:
1527#endif // defined(GL_VERTEX_ARRAY_TYPE)
1528#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1529        case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1530#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1531#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1532        case GL_WEIGHT_ARRAY_SIZE_OES:
1533#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1534#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1535        case GL_WEIGHT_ARRAY_STRIDE_OES:
1536#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1537#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1538        case GL_WEIGHT_ARRAY_TYPE_OES:
1539#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1540            _needed = 1;
1541            break;
1542#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1543        case GL_ALIASED_POINT_SIZE_RANGE:
1544#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1545#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1546        case GL_ALIASED_LINE_WIDTH_RANGE:
1547#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1548#if defined(GL_DEPTH_RANGE)
1549        case GL_DEPTH_RANGE:
1550#endif // defined(GL_DEPTH_RANGE)
1551#if defined(GL_MAX_VIEWPORT_DIMS)
1552        case GL_MAX_VIEWPORT_DIMS:
1553#endif // defined(GL_MAX_VIEWPORT_DIMS)
1554#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1555        case GL_SMOOTH_LINE_WIDTH_RANGE:
1556#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1557#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1558        case GL_SMOOTH_POINT_SIZE_RANGE:
1559#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1560            _needed = 2;
1561            break;
1562#if defined(GL_COLOR_CLEAR_VALUE)
1563        case GL_COLOR_CLEAR_VALUE:
1564#endif // defined(GL_COLOR_CLEAR_VALUE)
1565#if defined(GL_COLOR_WRITEMASK)
1566        case GL_COLOR_WRITEMASK:
1567#endif // defined(GL_COLOR_WRITEMASK)
1568#if defined(GL_FOG_COLOR)
1569        case GL_FOG_COLOR:
1570#endif // defined(GL_FOG_COLOR)
1571#if defined(GL_LIGHT_MODEL_AMBIENT)
1572        case GL_LIGHT_MODEL_AMBIENT:
1573#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1574#if defined(GL_SCISSOR_BOX)
1575        case GL_SCISSOR_BOX:
1576#endif // defined(GL_SCISSOR_BOX)
1577#if defined(GL_VIEWPORT)
1578        case GL_VIEWPORT:
1579#endif // defined(GL_VIEWPORT)
1580            _needed = 4;
1581            break;
1582#if defined(GL_MODELVIEW_MATRIX)
1583        case GL_MODELVIEW_MATRIX:
1584#endif // defined(GL_MODELVIEW_MATRIX)
1585#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1586        case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1587#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1588#if defined(GL_PROJECTION_MATRIX)
1589        case GL_PROJECTION_MATRIX:
1590#endif // defined(GL_PROJECTION_MATRIX)
1591#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1592        case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1593#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1594#if defined(GL_TEXTURE_MATRIX)
1595        case GL_TEXTURE_MATRIX:
1596#endif // defined(GL_TEXTURE_MATRIX)
1597#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1598        case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1599#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1600            _needed = 16;
1601            break;
1602#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1603        case GL_COMPRESSED_TEXTURE_FORMATS:
1604#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
1605            _needed = getNumCompressedTextureFormats();
1606            break;
1607        default:
1608            _needed = 1;
1609            break;
1610    }
1611    if (_remaining < _needed) {
1612        _exception = 1;
1613        _exceptionType = "java/lang/IllegalArgumentException";
1614        _exceptionMessage = "length - offset < needed";
1615        goto exit;
1616    }
1617    params_base = (GLint *)
1618        _env->GetIntArrayElements(params_ref, (jboolean *)0);
1619    params = params_base + offset;
1620
1621    glGetIntegerv(
1622        (GLenum)pname,
1623        (GLint *)params
1624    );
1625
1626exit:
1627    if (params_base) {
1628        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1629            _exception ? JNI_ABORT: 0);
1630    }
1631    if (_exception) {
1632        jniThrowException(_env, _exceptionType, _exceptionMessage);
1633    }
1634}
1635
1636/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1637static void
1638android_glGetIntegerv__ILjava_nio_IntBuffer_2
1639  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1640    jint _exception = 0;
1641    const char * _exceptionType = NULL;
1642    const char * _exceptionMessage = NULL;
1643    jintArray _array = (jintArray) 0;
1644    jint _bufferOffset = (jint) 0;
1645    jint _remaining;
1646    GLint *params = (GLint *) 0;
1647
1648    if (!params_buf) {
1649        _exception = 1;
1650        _exceptionType = "java/lang/IllegalArgumentException";
1651        _exceptionMessage = "params == null";
1652        goto exit;
1653    }
1654    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1655    int _needed;
1656    switch (pname) {
1657#if defined(GL_ALPHA_BITS)
1658        case GL_ALPHA_BITS:
1659#endif // defined(GL_ALPHA_BITS)
1660#if defined(GL_ALPHA_TEST_FUNC)
1661        case GL_ALPHA_TEST_FUNC:
1662#endif // defined(GL_ALPHA_TEST_FUNC)
1663#if defined(GL_ALPHA_TEST_REF)
1664        case GL_ALPHA_TEST_REF:
1665#endif // defined(GL_ALPHA_TEST_REF)
1666#if defined(GL_BLEND_DST)
1667        case GL_BLEND_DST:
1668#endif // defined(GL_BLEND_DST)
1669#if defined(GL_BLUE_BITS)
1670        case GL_BLUE_BITS:
1671#endif // defined(GL_BLUE_BITS)
1672#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1673        case GL_COLOR_ARRAY_BUFFER_BINDING:
1674#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1675#if defined(GL_COLOR_ARRAY_SIZE)
1676        case GL_COLOR_ARRAY_SIZE:
1677#endif // defined(GL_COLOR_ARRAY_SIZE)
1678#if defined(GL_COLOR_ARRAY_STRIDE)
1679        case GL_COLOR_ARRAY_STRIDE:
1680#endif // defined(GL_COLOR_ARRAY_STRIDE)
1681#if defined(GL_COLOR_ARRAY_TYPE)
1682        case GL_COLOR_ARRAY_TYPE:
1683#endif // defined(GL_COLOR_ARRAY_TYPE)
1684#if defined(GL_CULL_FACE)
1685        case GL_CULL_FACE:
1686#endif // defined(GL_CULL_FACE)
1687#if defined(GL_DEPTH_BITS)
1688        case GL_DEPTH_BITS:
1689#endif // defined(GL_DEPTH_BITS)
1690#if defined(GL_DEPTH_CLEAR_VALUE)
1691        case GL_DEPTH_CLEAR_VALUE:
1692#endif // defined(GL_DEPTH_CLEAR_VALUE)
1693#if defined(GL_DEPTH_FUNC)
1694        case GL_DEPTH_FUNC:
1695#endif // defined(GL_DEPTH_FUNC)
1696#if defined(GL_DEPTH_WRITEMASK)
1697        case GL_DEPTH_WRITEMASK:
1698#endif // defined(GL_DEPTH_WRITEMASK)
1699#if defined(GL_FOG_DENSITY)
1700        case GL_FOG_DENSITY:
1701#endif // defined(GL_FOG_DENSITY)
1702#if defined(GL_FOG_END)
1703        case GL_FOG_END:
1704#endif // defined(GL_FOG_END)
1705#if defined(GL_FOG_MODE)
1706        case GL_FOG_MODE:
1707#endif // defined(GL_FOG_MODE)
1708#if defined(GL_FOG_START)
1709        case GL_FOG_START:
1710#endif // defined(GL_FOG_START)
1711#if defined(GL_FRONT_FACE)
1712        case GL_FRONT_FACE:
1713#endif // defined(GL_FRONT_FACE)
1714#if defined(GL_GREEN_BITS)
1715        case GL_GREEN_BITS:
1716#endif // defined(GL_GREEN_BITS)
1717#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1718        case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1719#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1720#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1721        case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1722#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1723#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1724        case GL_LIGHT_MODEL_COLOR_CONTROL:
1725#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1726#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1727        case GL_LIGHT_MODEL_LOCAL_VIEWER:
1728#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1729#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1730        case GL_LIGHT_MODEL_TWO_SIDE:
1731#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1732#if defined(GL_LINE_SMOOTH_HINT)
1733        case GL_LINE_SMOOTH_HINT:
1734#endif // defined(GL_LINE_SMOOTH_HINT)
1735#if defined(GL_LINE_WIDTH)
1736        case GL_LINE_WIDTH:
1737#endif // defined(GL_LINE_WIDTH)
1738#if defined(GL_LOGIC_OP_MODE)
1739        case GL_LOGIC_OP_MODE:
1740#endif // defined(GL_LOGIC_OP_MODE)
1741#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1742        case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1743#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1744#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1745        case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1746#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1747#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1748        case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1749#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1750#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1751        case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1752#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1753#if defined(GL_MATRIX_MODE)
1754        case GL_MATRIX_MODE:
1755#endif // defined(GL_MATRIX_MODE)
1756#if defined(GL_MAX_CLIP_PLANES)
1757        case GL_MAX_CLIP_PLANES:
1758#endif // defined(GL_MAX_CLIP_PLANES)
1759#if defined(GL_MAX_ELEMENTS_INDICES)
1760        case GL_MAX_ELEMENTS_INDICES:
1761#endif // defined(GL_MAX_ELEMENTS_INDICES)
1762#if defined(GL_MAX_ELEMENTS_VERTICES)
1763        case GL_MAX_ELEMENTS_VERTICES:
1764#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1765#if defined(GL_MAX_LIGHTS)
1766        case GL_MAX_LIGHTS:
1767#endif // defined(GL_MAX_LIGHTS)
1768#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1769        case GL_MAX_MODELVIEW_STACK_DEPTH:
1770#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1771#if defined(GL_MAX_PALETTE_MATRICES_OES)
1772        case GL_MAX_PALETTE_MATRICES_OES:
1773#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1774#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1775        case GL_MAX_PROJECTION_STACK_DEPTH:
1776#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1777#if defined(GL_MAX_TEXTURE_SIZE)
1778        case GL_MAX_TEXTURE_SIZE:
1779#endif // defined(GL_MAX_TEXTURE_SIZE)
1780#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1781        case GL_MAX_TEXTURE_STACK_DEPTH:
1782#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1783#if defined(GL_MAX_TEXTURE_UNITS)
1784        case GL_MAX_TEXTURE_UNITS:
1785#endif // defined(GL_MAX_TEXTURE_UNITS)
1786#if defined(GL_MAX_VERTEX_UNITS_OES)
1787        case GL_MAX_VERTEX_UNITS_OES:
1788#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1789#if defined(GL_MODELVIEW_STACK_DEPTH)
1790        case GL_MODELVIEW_STACK_DEPTH:
1791#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1792#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1793        case GL_NORMAL_ARRAY_BUFFER_BINDING:
1794#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1795#if defined(GL_NORMAL_ARRAY_STRIDE)
1796        case GL_NORMAL_ARRAY_STRIDE:
1797#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1798#if defined(GL_NORMAL_ARRAY_TYPE)
1799        case GL_NORMAL_ARRAY_TYPE:
1800#endif // defined(GL_NORMAL_ARRAY_TYPE)
1801#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1802        case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1803#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1804#if defined(GL_PACK_ALIGNMENT)
1805        case GL_PACK_ALIGNMENT:
1806#endif // defined(GL_PACK_ALIGNMENT)
1807#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1808        case GL_PERSPECTIVE_CORRECTION_HINT:
1809#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1810#if defined(GL_POINT_SIZE)
1811        case GL_POINT_SIZE:
1812#endif // defined(GL_POINT_SIZE)
1813#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1814        case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1815#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1816#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1817        case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1818#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1819#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1820        case GL_POINT_SIZE_ARRAY_TYPE_OES:
1821#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1822#if defined(GL_POINT_SMOOTH_HINT)
1823        case GL_POINT_SMOOTH_HINT:
1824#endif // defined(GL_POINT_SMOOTH_HINT)
1825#if defined(GL_POLYGON_OFFSET_FACTOR)
1826        case GL_POLYGON_OFFSET_FACTOR:
1827#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1828#if defined(GL_POLYGON_OFFSET_UNITS)
1829        case GL_POLYGON_OFFSET_UNITS:
1830#endif // defined(GL_POLYGON_OFFSET_UNITS)
1831#if defined(GL_PROJECTION_STACK_DEPTH)
1832        case GL_PROJECTION_STACK_DEPTH:
1833#endif // defined(GL_PROJECTION_STACK_DEPTH)
1834#if defined(GL_RED_BITS)
1835        case GL_RED_BITS:
1836#endif // defined(GL_RED_BITS)
1837#if defined(GL_SHADE_MODEL)
1838        case GL_SHADE_MODEL:
1839#endif // defined(GL_SHADE_MODEL)
1840#if defined(GL_STENCIL_BITS)
1841        case GL_STENCIL_BITS:
1842#endif // defined(GL_STENCIL_BITS)
1843#if defined(GL_STENCIL_CLEAR_VALUE)
1844        case GL_STENCIL_CLEAR_VALUE:
1845#endif // defined(GL_STENCIL_CLEAR_VALUE)
1846#if defined(GL_STENCIL_FAIL)
1847        case GL_STENCIL_FAIL:
1848#endif // defined(GL_STENCIL_FAIL)
1849#if defined(GL_STENCIL_FUNC)
1850        case GL_STENCIL_FUNC:
1851#endif // defined(GL_STENCIL_FUNC)
1852#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1853        case GL_STENCIL_PASS_DEPTH_FAIL:
1854#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1855#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1856        case GL_STENCIL_PASS_DEPTH_PASS:
1857#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1858#if defined(GL_STENCIL_REF)
1859        case GL_STENCIL_REF:
1860#endif // defined(GL_STENCIL_REF)
1861#if defined(GL_STENCIL_VALUE_MASK)
1862        case GL_STENCIL_VALUE_MASK:
1863#endif // defined(GL_STENCIL_VALUE_MASK)
1864#if defined(GL_STENCIL_WRITEMASK)
1865        case GL_STENCIL_WRITEMASK:
1866#endif // defined(GL_STENCIL_WRITEMASK)
1867#if defined(GL_SUBPIXEL_BITS)
1868        case GL_SUBPIXEL_BITS:
1869#endif // defined(GL_SUBPIXEL_BITS)
1870#if defined(GL_TEXTURE_BINDING_2D)
1871        case GL_TEXTURE_BINDING_2D:
1872#endif // defined(GL_TEXTURE_BINDING_2D)
1873#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1874        case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1875#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1876#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1877        case GL_TEXTURE_COORD_ARRAY_SIZE:
1878#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1879#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1880        case GL_TEXTURE_COORD_ARRAY_STRIDE:
1881#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1882#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1883        case GL_TEXTURE_COORD_ARRAY_TYPE:
1884#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1885#if defined(GL_TEXTURE_STACK_DEPTH)
1886        case GL_TEXTURE_STACK_DEPTH:
1887#endif // defined(GL_TEXTURE_STACK_DEPTH)
1888#if defined(GL_UNPACK_ALIGNMENT)
1889        case GL_UNPACK_ALIGNMENT:
1890#endif // defined(GL_UNPACK_ALIGNMENT)
1891#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1892        case GL_VERTEX_ARRAY_BUFFER_BINDING:
1893#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1894#if defined(GL_VERTEX_ARRAY_SIZE)
1895        case GL_VERTEX_ARRAY_SIZE:
1896#endif // defined(GL_VERTEX_ARRAY_SIZE)
1897#if defined(GL_VERTEX_ARRAY_STRIDE)
1898        case GL_VERTEX_ARRAY_STRIDE:
1899#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1900#if defined(GL_VERTEX_ARRAY_TYPE)
1901        case GL_VERTEX_ARRAY_TYPE:
1902#endif // defined(GL_VERTEX_ARRAY_TYPE)
1903#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1904        case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1905#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1906#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1907        case GL_WEIGHT_ARRAY_SIZE_OES:
1908#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1909#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1910        case GL_WEIGHT_ARRAY_STRIDE_OES:
1911#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1912#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1913        case GL_WEIGHT_ARRAY_TYPE_OES:
1914#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1915            _needed = 1;
1916            break;
1917#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1918        case GL_ALIASED_POINT_SIZE_RANGE:
1919#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1920#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1921        case GL_ALIASED_LINE_WIDTH_RANGE:
1922#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1923#if defined(GL_DEPTH_RANGE)
1924        case GL_DEPTH_RANGE:
1925#endif // defined(GL_DEPTH_RANGE)
1926#if defined(GL_MAX_VIEWPORT_DIMS)
1927        case GL_MAX_VIEWPORT_DIMS:
1928#endif // defined(GL_MAX_VIEWPORT_DIMS)
1929#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1930        case GL_SMOOTH_LINE_WIDTH_RANGE:
1931#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1932#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1933        case GL_SMOOTH_POINT_SIZE_RANGE:
1934#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1935            _needed = 2;
1936            break;
1937#if defined(GL_COLOR_CLEAR_VALUE)
1938        case GL_COLOR_CLEAR_VALUE:
1939#endif // defined(GL_COLOR_CLEAR_VALUE)
1940#if defined(GL_COLOR_WRITEMASK)
1941        case GL_COLOR_WRITEMASK:
1942#endif // defined(GL_COLOR_WRITEMASK)
1943#if defined(GL_FOG_COLOR)
1944        case GL_FOG_COLOR:
1945#endif // defined(GL_FOG_COLOR)
1946#if defined(GL_LIGHT_MODEL_AMBIENT)
1947        case GL_LIGHT_MODEL_AMBIENT:
1948#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1949#if defined(GL_SCISSOR_BOX)
1950        case GL_SCISSOR_BOX:
1951#endif // defined(GL_SCISSOR_BOX)
1952#if defined(GL_VIEWPORT)
1953        case GL_VIEWPORT:
1954#endif // defined(GL_VIEWPORT)
1955            _needed = 4;
1956            break;
1957#if defined(GL_MODELVIEW_MATRIX)
1958        case GL_MODELVIEW_MATRIX:
1959#endif // defined(GL_MODELVIEW_MATRIX)
1960#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1961        case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1962#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1963#if defined(GL_PROJECTION_MATRIX)
1964        case GL_PROJECTION_MATRIX:
1965#endif // defined(GL_PROJECTION_MATRIX)
1966#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1967        case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1968#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1969#if defined(GL_TEXTURE_MATRIX)
1970        case GL_TEXTURE_MATRIX:
1971#endif // defined(GL_TEXTURE_MATRIX)
1972#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1973        case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1974#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1975            _needed = 16;
1976            break;
1977#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1978        case GL_COMPRESSED_TEXTURE_FORMATS:
1979#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
1980            _needed = getNumCompressedTextureFormats();
1981            break;
1982        default:
1983            _needed = 1;
1984            break;
1985    }
1986    if (_remaining < _needed) {
1987        _exception = 1;
1988        _exceptionType = "java/lang/IllegalArgumentException";
1989        _exceptionMessage = "remaining() < needed";
1990        goto exit;
1991    }
1992    if (params == NULL) {
1993        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1994        params = (GLint *) (_paramsBase + _bufferOffset);
1995    }
1996    glGetIntegerv(
1997        (GLenum)pname,
1998        (GLint *)params
1999    );
2000
2001exit:
2002    if (_array) {
2003        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2004    }
2005    if (_exception) {
2006        jniThrowException(_env, _exceptionType, _exceptionMessage);
2007    }
2008}
2009
2010/* const GLubyte * glGetString ( GLenum name ) */
2011static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
2012    const char* chars = (const char*) glGetString((GLenum) name);
2013    return _env->NewStringUTF(chars);
2014}
2015/* void glHint ( GLenum target, GLenum mode ) */
2016static void
2017android_glHint__II
2018  (JNIEnv *_env, jobject _this, jint target, jint mode) {
2019    glHint(
2020        (GLenum)target,
2021        (GLenum)mode
2022    );
2023}
2024
2025/* void glLightModelf ( GLenum pname, GLfloat param ) */
2026static void
2027android_glLightModelf__IF
2028  (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
2029    glLightModelf(
2030        (GLenum)pname,
2031        (GLfloat)param
2032    );
2033}
2034
2035/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2036static void
2037android_glLightModelfv__I_3FI
2038  (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
2039    jint _exception = 0;
2040    const char * _exceptionType = NULL;
2041    const char * _exceptionMessage = NULL;
2042    GLfloat *params_base = (GLfloat *) 0;
2043    jint _remaining;
2044    GLfloat *params = (GLfloat *) 0;
2045
2046    if (!params_ref) {
2047        _exception = 1;
2048        _exceptionType = "java/lang/IllegalArgumentException";
2049        _exceptionMessage = "params == null";
2050        goto exit;
2051    }
2052    if (offset < 0) {
2053        _exception = 1;
2054        _exceptionType = "java/lang/IllegalArgumentException";
2055        _exceptionMessage = "offset < 0";
2056        goto exit;
2057    }
2058    _remaining = _env->GetArrayLength(params_ref) - offset;
2059    int _needed;
2060    switch (pname) {
2061#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2062        case GL_LIGHT_MODEL_TWO_SIDE:
2063#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2064            _needed = 1;
2065            break;
2066#if defined(GL_LIGHT_MODEL_AMBIENT)
2067        case GL_LIGHT_MODEL_AMBIENT:
2068#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2069            _needed = 4;
2070            break;
2071        default:
2072            _needed = 1;
2073            break;
2074    }
2075    if (_remaining < _needed) {
2076        _exception = 1;
2077        _exceptionType = "java/lang/IllegalArgumentException";
2078        _exceptionMessage = "length - offset < needed";
2079        goto exit;
2080    }
2081    params_base = (GLfloat *)
2082        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2083    params = params_base + offset;
2084
2085    glLightModelfv(
2086        (GLenum)pname,
2087        (GLfloat *)params
2088    );
2089
2090exit:
2091    if (params_base) {
2092        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2093            JNI_ABORT);
2094    }
2095    if (_exception) {
2096        jniThrowException(_env, _exceptionType, _exceptionMessage);
2097    }
2098}
2099
2100/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2101static void
2102android_glLightModelfv__ILjava_nio_FloatBuffer_2
2103  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2104    jint _exception = 0;
2105    const char * _exceptionType = NULL;
2106    const char * _exceptionMessage = NULL;
2107    jfloatArray _array = (jfloatArray) 0;
2108    jint _bufferOffset = (jint) 0;
2109    jint _remaining;
2110    GLfloat *params = (GLfloat *) 0;
2111
2112    if (!params_buf) {
2113        _exception = 1;
2114        _exceptionType = "java/lang/IllegalArgumentException";
2115        _exceptionMessage = "params == null";
2116        goto exit;
2117    }
2118    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2119    int _needed;
2120    switch (pname) {
2121#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2122        case GL_LIGHT_MODEL_TWO_SIDE:
2123#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2124            _needed = 1;
2125            break;
2126#if defined(GL_LIGHT_MODEL_AMBIENT)
2127        case GL_LIGHT_MODEL_AMBIENT:
2128#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2129            _needed = 4;
2130            break;
2131        default:
2132            _needed = 1;
2133            break;
2134    }
2135    if (_remaining < _needed) {
2136        _exception = 1;
2137        _exceptionType = "java/lang/IllegalArgumentException";
2138        _exceptionMessage = "remaining() < needed";
2139        goto exit;
2140    }
2141    if (params == NULL) {
2142        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2143        params = (GLfloat *) (_paramsBase + _bufferOffset);
2144    }
2145    glLightModelfv(
2146        (GLenum)pname,
2147        (GLfloat *)params
2148    );
2149
2150exit:
2151    if (_array) {
2152        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2153    }
2154    if (_exception) {
2155        jniThrowException(_env, _exceptionType, _exceptionMessage);
2156    }
2157}
2158
2159/* void glLightModelx ( GLenum pname, GLfixed param ) */
2160static void
2161android_glLightModelx__II
2162  (JNIEnv *_env, jobject _this, jint pname, jint param) {
2163    glLightModelx(
2164        (GLenum)pname,
2165        (GLfixed)param
2166    );
2167}
2168
2169/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2170static void
2171android_glLightModelxv__I_3II
2172  (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
2173    jint _exception = 0;
2174    const char * _exceptionType = NULL;
2175    const char * _exceptionMessage = NULL;
2176    GLfixed *params_base = (GLfixed *) 0;
2177    jint _remaining;
2178    GLfixed *params = (GLfixed *) 0;
2179
2180    if (!params_ref) {
2181        _exception = 1;
2182        _exceptionType = "java/lang/IllegalArgumentException";
2183        _exceptionMessage = "params == null";
2184        goto exit;
2185    }
2186    if (offset < 0) {
2187        _exception = 1;
2188        _exceptionType = "java/lang/IllegalArgumentException";
2189        _exceptionMessage = "offset < 0";
2190        goto exit;
2191    }
2192    _remaining = _env->GetArrayLength(params_ref) - offset;
2193    int _needed;
2194    switch (pname) {
2195#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2196        case GL_LIGHT_MODEL_TWO_SIDE:
2197#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2198            _needed = 1;
2199            break;
2200#if defined(GL_LIGHT_MODEL_AMBIENT)
2201        case GL_LIGHT_MODEL_AMBIENT:
2202#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2203            _needed = 4;
2204            break;
2205        default:
2206            _needed = 1;
2207            break;
2208    }
2209    if (_remaining < _needed) {
2210        _exception = 1;
2211        _exceptionType = "java/lang/IllegalArgumentException";
2212        _exceptionMessage = "length - offset < needed";
2213        goto exit;
2214    }
2215    params_base = (GLfixed *)
2216        _env->GetIntArrayElements(params_ref, (jboolean *)0);
2217    params = params_base + offset;
2218
2219    glLightModelxv(
2220        (GLenum)pname,
2221        (GLfixed *)params
2222    );
2223
2224exit:
2225    if (params_base) {
2226        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2227            JNI_ABORT);
2228    }
2229    if (_exception) {
2230        jniThrowException(_env, _exceptionType, _exceptionMessage);
2231    }
2232}
2233
2234/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2235static void
2236android_glLightModelxv__ILjava_nio_IntBuffer_2
2237  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2238    jint _exception = 0;
2239    const char * _exceptionType = NULL;
2240    const char * _exceptionMessage = NULL;
2241    jintArray _array = (jintArray) 0;
2242    jint _bufferOffset = (jint) 0;
2243    jint _remaining;
2244    GLfixed *params = (GLfixed *) 0;
2245
2246    if (!params_buf) {
2247        _exception = 1;
2248        _exceptionType = "java/lang/IllegalArgumentException";
2249        _exceptionMessage = "params == null";
2250        goto exit;
2251    }
2252    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2253    int _needed;
2254    switch (pname) {
2255#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2256        case GL_LIGHT_MODEL_TWO_SIDE:
2257#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2258            _needed = 1;
2259            break;
2260#if defined(GL_LIGHT_MODEL_AMBIENT)
2261        case GL_LIGHT_MODEL_AMBIENT:
2262#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2263            _needed = 4;
2264            break;
2265        default:
2266            _needed = 1;
2267            break;
2268    }
2269    if (_remaining < _needed) {
2270        _exception = 1;
2271        _exceptionType = "java/lang/IllegalArgumentException";
2272        _exceptionMessage = "remaining() < needed";
2273        goto exit;
2274    }
2275    if (params == NULL) {
2276        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2277        params = (GLfixed *) (_paramsBase + _bufferOffset);
2278    }
2279    glLightModelxv(
2280        (GLenum)pname,
2281        (GLfixed *)params
2282    );
2283
2284exit:
2285    if (_array) {
2286        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2287    }
2288    if (_exception) {
2289        jniThrowException(_env, _exceptionType, _exceptionMessage);
2290    }
2291}
2292
2293/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2294static void
2295android_glLightf__IIF
2296  (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2297    glLightf(
2298        (GLenum)light,
2299        (GLenum)pname,
2300        (GLfloat)param
2301    );
2302}
2303
2304/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2305static void
2306android_glLightfv__II_3FI
2307  (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
2308    jint _exception = 0;
2309    const char * _exceptionType = NULL;
2310    const char * _exceptionMessage = NULL;
2311    GLfloat *params_base = (GLfloat *) 0;
2312    jint _remaining;
2313    GLfloat *params = (GLfloat *) 0;
2314
2315    if (!params_ref) {
2316        _exception = 1;
2317        _exceptionType = "java/lang/IllegalArgumentException";
2318        _exceptionMessage = "params == null";
2319        goto exit;
2320    }
2321    if (offset < 0) {
2322        _exception = 1;
2323        _exceptionType = "java/lang/IllegalArgumentException";
2324        _exceptionMessage = "offset < 0";
2325        goto exit;
2326    }
2327    _remaining = _env->GetArrayLength(params_ref) - offset;
2328    int _needed;
2329    switch (pname) {
2330#if defined(GL_SPOT_EXPONENT)
2331        case GL_SPOT_EXPONENT:
2332#endif // defined(GL_SPOT_EXPONENT)
2333#if defined(GL_SPOT_CUTOFF)
2334        case GL_SPOT_CUTOFF:
2335#endif // defined(GL_SPOT_CUTOFF)
2336#if defined(GL_CONSTANT_ATTENUATION)
2337        case GL_CONSTANT_ATTENUATION:
2338#endif // defined(GL_CONSTANT_ATTENUATION)
2339#if defined(GL_LINEAR_ATTENUATION)
2340        case GL_LINEAR_ATTENUATION:
2341#endif // defined(GL_LINEAR_ATTENUATION)
2342#if defined(GL_QUADRATIC_ATTENUATION)
2343        case GL_QUADRATIC_ATTENUATION:
2344#endif // defined(GL_QUADRATIC_ATTENUATION)
2345            _needed = 1;
2346            break;
2347#if defined(GL_SPOT_DIRECTION)
2348        case GL_SPOT_DIRECTION:
2349#endif // defined(GL_SPOT_DIRECTION)
2350            _needed = 3;
2351            break;
2352#if defined(GL_AMBIENT)
2353        case GL_AMBIENT:
2354#endif // defined(GL_AMBIENT)
2355#if defined(GL_DIFFUSE)
2356        case GL_DIFFUSE:
2357#endif // defined(GL_DIFFUSE)
2358#if defined(GL_SPECULAR)
2359        case GL_SPECULAR:
2360#endif // defined(GL_SPECULAR)
2361#if defined(GL_EMISSION)
2362        case GL_EMISSION:
2363#endif // defined(GL_EMISSION)
2364            _needed = 4;
2365            break;
2366        default:
2367            _needed = 1;
2368            break;
2369    }
2370    if (_remaining < _needed) {
2371        _exception = 1;
2372        _exceptionType = "java/lang/IllegalArgumentException";
2373        _exceptionMessage = "length - offset < needed";
2374        goto exit;
2375    }
2376    params_base = (GLfloat *)
2377        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2378    params = params_base + offset;
2379
2380    glLightfv(
2381        (GLenum)light,
2382        (GLenum)pname,
2383        (GLfloat *)params
2384    );
2385
2386exit:
2387    if (params_base) {
2388        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2389            JNI_ABORT);
2390    }
2391    if (_exception) {
2392        jniThrowException(_env, _exceptionType, _exceptionMessage);
2393    }
2394}
2395
2396/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2397static void
2398android_glLightfv__IILjava_nio_FloatBuffer_2
2399  (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
2400    jint _exception = 0;
2401    const char * _exceptionType = NULL;
2402    const char * _exceptionMessage = NULL;
2403    jfloatArray _array = (jfloatArray) 0;
2404    jint _bufferOffset = (jint) 0;
2405    jint _remaining;
2406    GLfloat *params = (GLfloat *) 0;
2407
2408    if (!params_buf) {
2409        _exception = 1;
2410        _exceptionType = "java/lang/IllegalArgumentException";
2411        _exceptionMessage = "params == null";
2412        goto exit;
2413    }
2414    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2415    int _needed;
2416    switch (pname) {
2417#if defined(GL_SPOT_EXPONENT)
2418        case GL_SPOT_EXPONENT:
2419#endif // defined(GL_SPOT_EXPONENT)
2420#if defined(GL_SPOT_CUTOFF)
2421        case GL_SPOT_CUTOFF:
2422#endif // defined(GL_SPOT_CUTOFF)
2423#if defined(GL_CONSTANT_ATTENUATION)
2424        case GL_CONSTANT_ATTENUATION:
2425#endif // defined(GL_CONSTANT_ATTENUATION)
2426#if defined(GL_LINEAR_ATTENUATION)
2427        case GL_LINEAR_ATTENUATION:
2428#endif // defined(GL_LINEAR_ATTENUATION)
2429#if defined(GL_QUADRATIC_ATTENUATION)
2430        case GL_QUADRATIC_ATTENUATION:
2431#endif // defined(GL_QUADRATIC_ATTENUATION)
2432            _needed = 1;
2433            break;
2434#if defined(GL_SPOT_DIRECTION)
2435        case GL_SPOT_DIRECTION:
2436#endif // defined(GL_SPOT_DIRECTION)
2437            _needed = 3;
2438            break;
2439#if defined(GL_AMBIENT)
2440        case GL_AMBIENT:
2441#endif // defined(GL_AMBIENT)
2442#if defined(GL_DIFFUSE)
2443        case GL_DIFFUSE:
2444#endif // defined(GL_DIFFUSE)
2445#if defined(GL_SPECULAR)
2446        case GL_SPECULAR:
2447#endif // defined(GL_SPECULAR)
2448#if defined(GL_EMISSION)
2449        case GL_EMISSION:
2450#endif // defined(GL_EMISSION)
2451            _needed = 4;
2452            break;
2453        default:
2454            _needed = 1;
2455            break;
2456    }
2457    if (_remaining < _needed) {
2458        _exception = 1;
2459        _exceptionType = "java/lang/IllegalArgumentException";
2460        _exceptionMessage = "remaining() < needed";
2461        goto exit;
2462    }
2463    if (params == NULL) {
2464        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2465        params = (GLfloat *) (_paramsBase + _bufferOffset);
2466    }
2467    glLightfv(
2468        (GLenum)light,
2469        (GLenum)pname,
2470        (GLfloat *)params
2471    );
2472
2473exit:
2474    if (_array) {
2475        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2476    }
2477    if (_exception) {
2478        jniThrowException(_env, _exceptionType, _exceptionMessage);
2479    }
2480}
2481
2482/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2483static void
2484android_glLightx__III
2485  (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2486    glLightx(
2487        (GLenum)light,
2488        (GLenum)pname,
2489        (GLfixed)param
2490    );
2491}
2492
2493/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2494static void
2495android_glLightxv__II_3II
2496  (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
2497    jint _exception = 0;
2498    const char * _exceptionType = NULL;
2499    const char * _exceptionMessage = NULL;
2500    GLfixed *params_base = (GLfixed *) 0;
2501    jint _remaining;
2502    GLfixed *params = (GLfixed *) 0;
2503
2504    if (!params_ref) {
2505        _exception = 1;
2506        _exceptionType = "java/lang/IllegalArgumentException";
2507        _exceptionMessage = "params == null";
2508        goto exit;
2509    }
2510    if (offset < 0) {
2511        _exception = 1;
2512        _exceptionType = "java/lang/IllegalArgumentException";
2513        _exceptionMessage = "offset < 0";
2514        goto exit;
2515    }
2516    _remaining = _env->GetArrayLength(params_ref) - offset;
2517    int _needed;
2518    switch (pname) {
2519#if defined(GL_SPOT_EXPONENT)
2520        case GL_SPOT_EXPONENT:
2521#endif // defined(GL_SPOT_EXPONENT)
2522#if defined(GL_SPOT_CUTOFF)
2523        case GL_SPOT_CUTOFF:
2524#endif // defined(GL_SPOT_CUTOFF)
2525#if defined(GL_CONSTANT_ATTENUATION)
2526        case GL_CONSTANT_ATTENUATION:
2527#endif // defined(GL_CONSTANT_ATTENUATION)
2528#if defined(GL_LINEAR_ATTENUATION)
2529        case GL_LINEAR_ATTENUATION:
2530#endif // defined(GL_LINEAR_ATTENUATION)
2531#if defined(GL_QUADRATIC_ATTENUATION)
2532        case GL_QUADRATIC_ATTENUATION:
2533#endif // defined(GL_QUADRATIC_ATTENUATION)
2534            _needed = 1;
2535            break;
2536#if defined(GL_SPOT_DIRECTION)
2537        case GL_SPOT_DIRECTION:
2538#endif // defined(GL_SPOT_DIRECTION)
2539            _needed = 3;
2540            break;
2541#if defined(GL_AMBIENT)
2542        case GL_AMBIENT:
2543#endif // defined(GL_AMBIENT)
2544#if defined(GL_DIFFUSE)
2545        case GL_DIFFUSE:
2546#endif // defined(GL_DIFFUSE)
2547#if defined(GL_SPECULAR)
2548        case GL_SPECULAR:
2549#endif // defined(GL_SPECULAR)
2550#if defined(GL_EMISSION)
2551        case GL_EMISSION:
2552#endif // defined(GL_EMISSION)
2553            _needed = 4;
2554            break;
2555        default:
2556            _needed = 1;
2557            break;
2558    }
2559    if (_remaining < _needed) {
2560        _exception = 1;
2561        _exceptionType = "java/lang/IllegalArgumentException";
2562        _exceptionMessage = "length - offset < needed";
2563        goto exit;
2564    }
2565    params_base = (GLfixed *)
2566        _env->GetIntArrayElements(params_ref, (jboolean *)0);
2567    params = params_base + offset;
2568
2569    glLightxv(
2570        (GLenum)light,
2571        (GLenum)pname,
2572        (GLfixed *)params
2573    );
2574
2575exit:
2576    if (params_base) {
2577        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2578            JNI_ABORT);
2579    }
2580    if (_exception) {
2581        jniThrowException(_env, _exceptionType, _exceptionMessage);
2582    }
2583}
2584
2585/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2586static void
2587android_glLightxv__IILjava_nio_IntBuffer_2
2588  (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
2589    jint _exception = 0;
2590    const char * _exceptionType = NULL;
2591    const char * _exceptionMessage = NULL;
2592    jintArray _array = (jintArray) 0;
2593    jint _bufferOffset = (jint) 0;
2594    jint _remaining;
2595    GLfixed *params = (GLfixed *) 0;
2596
2597    if (!params_buf) {
2598        _exception = 1;
2599        _exceptionType = "java/lang/IllegalArgumentException";
2600        _exceptionMessage = "params == null";
2601        goto exit;
2602    }
2603    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2604    int _needed;
2605    switch (pname) {
2606#if defined(GL_SPOT_EXPONENT)
2607        case GL_SPOT_EXPONENT:
2608#endif // defined(GL_SPOT_EXPONENT)
2609#if defined(GL_SPOT_CUTOFF)
2610        case GL_SPOT_CUTOFF:
2611#endif // defined(GL_SPOT_CUTOFF)
2612#if defined(GL_CONSTANT_ATTENUATION)
2613        case GL_CONSTANT_ATTENUATION:
2614#endif // defined(GL_CONSTANT_ATTENUATION)
2615#if defined(GL_LINEAR_ATTENUATION)
2616        case GL_LINEAR_ATTENUATION:
2617#endif // defined(GL_LINEAR_ATTENUATION)
2618#if defined(GL_QUADRATIC_ATTENUATION)
2619        case GL_QUADRATIC_ATTENUATION:
2620#endif // defined(GL_QUADRATIC_ATTENUATION)
2621            _needed = 1;
2622            break;
2623#if defined(GL_SPOT_DIRECTION)
2624        case GL_SPOT_DIRECTION:
2625#endif // defined(GL_SPOT_DIRECTION)
2626            _needed = 3;
2627            break;
2628#if defined(GL_AMBIENT)
2629        case GL_AMBIENT:
2630#endif // defined(GL_AMBIENT)
2631#if defined(GL_DIFFUSE)
2632        case GL_DIFFUSE:
2633#endif // defined(GL_DIFFUSE)
2634#if defined(GL_SPECULAR)
2635        case GL_SPECULAR:
2636#endif // defined(GL_SPECULAR)
2637#if defined(GL_EMISSION)
2638        case GL_EMISSION:
2639#endif // defined(GL_EMISSION)
2640            _needed = 4;
2641            break;
2642        default:
2643            _needed = 1;
2644            break;
2645    }
2646    if (_remaining < _needed) {
2647        _exception = 1;
2648        _exceptionType = "java/lang/IllegalArgumentException";
2649        _exceptionMessage = "remaining() < needed";
2650        goto exit;
2651    }
2652    if (params == NULL) {
2653        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2654        params = (GLfixed *) (_paramsBase + _bufferOffset);
2655    }
2656    glLightxv(
2657        (GLenum)light,
2658        (GLenum)pname,
2659        (GLfixed *)params
2660    );
2661
2662exit:
2663    if (_array) {
2664        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2665    }
2666    if (_exception) {
2667        jniThrowException(_env, _exceptionType, _exceptionMessage);
2668    }
2669}
2670
2671/* void glLineWidth ( GLfloat width ) */
2672static void
2673android_glLineWidth__F
2674  (JNIEnv *_env, jobject _this, jfloat width) {
2675    glLineWidth(
2676        (GLfloat)width
2677    );
2678}
2679
2680/* void glLineWidthx ( GLfixed width ) */
2681static void
2682android_glLineWidthx__I
2683  (JNIEnv *_env, jobject _this, jint width) {
2684    glLineWidthx(
2685        (GLfixed)width
2686    );
2687}
2688
2689/* void glLoadIdentity ( void ) */
2690static void
2691android_glLoadIdentity__
2692  (JNIEnv *_env, jobject _this) {
2693    glLoadIdentity();
2694}
2695
2696/* void glLoadMatrixf ( const GLfloat *m ) */
2697static void
2698android_glLoadMatrixf___3FI
2699  (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
2700    jint _exception = 0;
2701    const char * _exceptionType = NULL;
2702    const char * _exceptionMessage = NULL;
2703    GLfloat *m_base = (GLfloat *) 0;
2704    jint _remaining;
2705    GLfloat *m = (GLfloat *) 0;
2706
2707    if (!m_ref) {
2708        _exception = 1;
2709        _exceptionType = "java/lang/IllegalArgumentException";
2710        _exceptionMessage = "m == null";
2711        goto exit;
2712    }
2713    if (offset < 0) {
2714        _exception = 1;
2715        _exceptionType = "java/lang/IllegalArgumentException";
2716        _exceptionMessage = "offset < 0";
2717        goto exit;
2718    }
2719    _remaining = _env->GetArrayLength(m_ref) - offset;
2720    m_base = (GLfloat *)
2721        _env->GetFloatArrayElements(m_ref, (jboolean *)0);
2722    m = m_base + offset;
2723
2724    glLoadMatrixf(
2725        (GLfloat *)m
2726    );
2727
2728exit:
2729    if (m_base) {
2730        _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
2731            JNI_ABORT);
2732    }
2733    if (_exception) {
2734        jniThrowException(_env, _exceptionType, _exceptionMessage);
2735    }
2736}
2737
2738/* void glLoadMatrixf ( const GLfloat *m ) */
2739static void
2740android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2741  (JNIEnv *_env, jobject _this, jobject m_buf) {
2742    jint _exception = 0;
2743    const char * _exceptionType = NULL;
2744    const char * _exceptionMessage = NULL;
2745    jfloatArray _array = (jfloatArray) 0;
2746    jint _bufferOffset = (jint) 0;
2747    jint _remaining;
2748    GLfloat *m = (GLfloat *) 0;
2749
2750    if (!m_buf) {
2751        _exception = 1;
2752        _exceptionType = "java/lang/IllegalArgumentException";
2753        _exceptionMessage = "m == null";
2754        goto exit;
2755    }
2756    m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2757    if (m == NULL) {
2758        char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2759        m = (GLfloat *) (_mBase + _bufferOffset);
2760    }
2761    glLoadMatrixf(
2762        (GLfloat *)m
2763    );
2764
2765exit:
2766    if (_array) {
2767        _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
2768    }
2769    if (_exception) {
2770        jniThrowException(_env, _exceptionType, _exceptionMessage);
2771    }
2772}
2773
2774/* void glLoadMatrixx ( const GLfixed *m ) */
2775static void
2776android_glLoadMatrixx___3II
2777  (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
2778    jint _exception = 0;
2779    const char * _exceptionType = NULL;
2780    const char * _exceptionMessage = NULL;
2781    GLfixed *m_base = (GLfixed *) 0;
2782    jint _remaining;
2783    GLfixed *m = (GLfixed *) 0;
2784
2785    if (!m_ref) {
2786        _exception = 1;
2787        _exceptionType = "java/lang/IllegalArgumentException";
2788        _exceptionMessage = "m == null";
2789        goto exit;
2790    }
2791    if (offset < 0) {
2792        _exception = 1;
2793        _exceptionType = "java/lang/IllegalArgumentException";
2794        _exceptionMessage = "offset < 0";
2795        goto exit;
2796    }
2797    _remaining = _env->GetArrayLength(m_ref) - offset;
2798    m_base = (GLfixed *)
2799        _env->GetIntArrayElements(m_ref, (jboolean *)0);
2800    m = m_base + offset;
2801
2802    glLoadMatrixx(
2803        (GLfixed *)m
2804    );
2805
2806exit:
2807    if (m_base) {
2808        _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
2809            JNI_ABORT);
2810    }
2811    if (_exception) {
2812        jniThrowException(_env, _exceptionType, _exceptionMessage);
2813    }
2814}
2815
2816/* void glLoadMatrixx ( const GLfixed *m ) */
2817static void
2818android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2819  (JNIEnv *_env, jobject _this, jobject m_buf) {
2820    jint _exception = 0;
2821    const char * _exceptionType = NULL;
2822    const char * _exceptionMessage = NULL;
2823    jintArray _array = (jintArray) 0;
2824    jint _bufferOffset = (jint) 0;
2825    jint _remaining;
2826    GLfixed *m = (GLfixed *) 0;
2827
2828    if (!m_buf) {
2829        _exception = 1;
2830        _exceptionType = "java/lang/IllegalArgumentException";
2831        _exceptionMessage = "m == null";
2832        goto exit;
2833    }
2834    m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2835    if (m == NULL) {
2836        char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2837        m = (GLfixed *) (_mBase + _bufferOffset);
2838    }
2839    glLoadMatrixx(
2840        (GLfixed *)m
2841    );
2842
2843exit:
2844    if (_array) {
2845        _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
2846    }
2847    if (_exception) {
2848        jniThrowException(_env, _exceptionType, _exceptionMessage);
2849    }
2850}
2851
2852/* void glLogicOp ( GLenum opcode ) */
2853static void
2854android_glLogicOp__I
2855  (JNIEnv *_env, jobject _this, jint opcode) {
2856    glLogicOp(
2857        (GLenum)opcode
2858    );
2859}
2860
2861/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2862static void
2863android_glMaterialf__IIF
2864  (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2865    glMaterialf(
2866        (GLenum)face,
2867        (GLenum)pname,
2868        (GLfloat)param
2869    );
2870}
2871
2872/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2873static void
2874android_glMaterialfv__II_3FI
2875  (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
2876    jint _exception = 0;
2877    const char * _exceptionType = NULL;
2878    const char * _exceptionMessage = NULL;
2879    GLfloat *params_base = (GLfloat *) 0;
2880    jint _remaining;
2881    GLfloat *params = (GLfloat *) 0;
2882
2883    if (!params_ref) {
2884        _exception = 1;
2885        _exceptionType = "java/lang/IllegalArgumentException";
2886        _exceptionMessage = "params == null";
2887        goto exit;
2888    }
2889    if (offset < 0) {
2890        _exception = 1;
2891        _exceptionType = "java/lang/IllegalArgumentException";
2892        _exceptionMessage = "offset < 0";
2893        goto exit;
2894    }
2895    _remaining = _env->GetArrayLength(params_ref) - offset;
2896    int _needed;
2897    switch (pname) {
2898#if defined(GL_SHININESS)
2899        case GL_SHININESS:
2900#endif // defined(GL_SHININESS)
2901            _needed = 1;
2902            break;
2903#if defined(GL_AMBIENT)
2904        case GL_AMBIENT:
2905#endif // defined(GL_AMBIENT)
2906#if defined(GL_DIFFUSE)
2907        case GL_DIFFUSE:
2908#endif // defined(GL_DIFFUSE)
2909#if defined(GL_SPECULAR)
2910        case GL_SPECULAR:
2911#endif // defined(GL_SPECULAR)
2912#if defined(GL_EMISSION)
2913        case GL_EMISSION:
2914#endif // defined(GL_EMISSION)
2915#if defined(GL_AMBIENT_AND_DIFFUSE)
2916        case GL_AMBIENT_AND_DIFFUSE:
2917#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2918            _needed = 4;
2919            break;
2920        default:
2921            _needed = 1;
2922            break;
2923    }
2924    if (_remaining < _needed) {
2925        _exception = 1;
2926        _exceptionType = "java/lang/IllegalArgumentException";
2927        _exceptionMessage = "length - offset < needed";
2928        goto exit;
2929    }
2930    params_base = (GLfloat *)
2931        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2932    params = params_base + offset;
2933
2934    glMaterialfv(
2935        (GLenum)face,
2936        (GLenum)pname,
2937        (GLfloat *)params
2938    );
2939
2940exit:
2941    if (params_base) {
2942        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2943            JNI_ABORT);
2944    }
2945    if (_exception) {
2946        jniThrowException(_env, _exceptionType, _exceptionMessage);
2947    }
2948}
2949
2950/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2951static void
2952android_glMaterialfv__IILjava_nio_FloatBuffer_2
2953  (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
2954    jint _exception = 0;
2955    const char * _exceptionType = NULL;
2956    const char * _exceptionMessage = NULL;
2957    jfloatArray _array = (jfloatArray) 0;
2958    jint _bufferOffset = (jint) 0;
2959    jint _remaining;
2960    GLfloat *params = (GLfloat *) 0;
2961
2962    if (!params_buf) {
2963        _exception = 1;
2964        _exceptionType = "java/lang/IllegalArgumentException";
2965        _exceptionMessage = "params == null";
2966        goto exit;
2967    }
2968    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2969    int _needed;
2970    switch (pname) {
2971#if defined(GL_SHININESS)
2972        case GL_SHININESS:
2973#endif // defined(GL_SHININESS)
2974            _needed = 1;
2975            break;
2976#if defined(GL_AMBIENT)
2977        case GL_AMBIENT:
2978#endif // defined(GL_AMBIENT)
2979#if defined(GL_DIFFUSE)
2980        case GL_DIFFUSE:
2981#endif // defined(GL_DIFFUSE)
2982#if defined(GL_SPECULAR)
2983        case GL_SPECULAR:
2984#endif // defined(GL_SPECULAR)
2985#if defined(GL_EMISSION)
2986        case GL_EMISSION:
2987#endif // defined(GL_EMISSION)
2988#if defined(GL_AMBIENT_AND_DIFFUSE)
2989        case GL_AMBIENT_AND_DIFFUSE:
2990#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2991            _needed = 4;
2992            break;
2993        default:
2994            _needed = 1;
2995            break;
2996    }
2997    if (_remaining < _needed) {
2998        _exception = 1;
2999        _exceptionType = "java/lang/IllegalArgumentException";
3000        _exceptionMessage = "remaining() < needed";
3001        goto exit;
3002    }
3003    if (params == NULL) {
3004        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
3005        params = (GLfloat *) (_paramsBase + _bufferOffset);
3006    }
3007    glMaterialfv(
3008        (GLenum)face,
3009        (GLenum)pname,
3010        (GLfloat *)params
3011    );
3012
3013exit:
3014    if (_array) {
3015        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
3016    }
3017    if (_exception) {
3018        jniThrowException(_env, _exceptionType, _exceptionMessage);
3019    }
3020}
3021
3022/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
3023static void
3024android_glMaterialx__III
3025  (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
3026    glMaterialx(
3027        (GLenum)face,
3028        (GLenum)pname,
3029        (GLfixed)param
3030    );
3031}
3032
3033/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3034static void
3035android_glMaterialxv__II_3II
3036  (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
3037    jint _exception = 0;
3038    const char * _exceptionType = NULL;
3039    const char * _exceptionMessage = NULL;
3040    GLfixed *params_base = (GLfixed *) 0;
3041    jint _remaining;
3042    GLfixed *params = (GLfixed *) 0;
3043
3044    if (!params_ref) {
3045        _exception = 1;
3046        _exceptionType = "java/lang/IllegalArgumentException";
3047        _exceptionMessage = "params == null";
3048        goto exit;
3049    }
3050    if (offset < 0) {
3051        _exception = 1;
3052        _exceptionType = "java/lang/IllegalArgumentException";
3053        _exceptionMessage = "offset < 0";
3054        goto exit;
3055    }
3056    _remaining = _env->GetArrayLength(params_ref) - offset;
3057    int _needed;
3058    switch (pname) {
3059#if defined(GL_SHININESS)
3060        case GL_SHININESS:
3061#endif // defined(GL_SHININESS)
3062            _needed = 1;
3063            break;
3064#if defined(GL_AMBIENT)
3065        case GL_AMBIENT:
3066#endif // defined(GL_AMBIENT)
3067#if defined(GL_DIFFUSE)
3068        case GL_DIFFUSE:
3069#endif // defined(GL_DIFFUSE)
3070#if defined(GL_SPECULAR)
3071        case GL_SPECULAR:
3072#endif // defined(GL_SPECULAR)
3073#if defined(GL_EMISSION)
3074        case GL_EMISSION:
3075#endif // defined(GL_EMISSION)
3076#if defined(GL_AMBIENT_AND_DIFFUSE)
3077        case GL_AMBIENT_AND_DIFFUSE:
3078#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3079            _needed = 4;
3080            break;
3081        default:
3082            _needed = 1;
3083            break;
3084    }
3085    if (_remaining < _needed) {
3086        _exception = 1;
3087        _exceptionType = "java/lang/IllegalArgumentException";
3088        _exceptionMessage = "length - offset < needed";
3089        goto exit;
3090    }
3091    params_base = (GLfixed *)
3092        _env->GetIntArrayElements(params_ref, (jboolean *)0);
3093    params = params_base + offset;
3094
3095    glMaterialxv(
3096        (GLenum)face,
3097        (GLenum)pname,
3098        (GLfixed *)params
3099    );
3100
3101exit:
3102    if (params_base) {
3103        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3104            JNI_ABORT);
3105    }
3106    if (_exception) {
3107        jniThrowException(_env, _exceptionType, _exceptionMessage);
3108    }
3109}
3110
3111/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3112static void
3113android_glMaterialxv__IILjava_nio_IntBuffer_2
3114  (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
3115    jint _exception = 0;
3116    const char * _exceptionType = NULL;
3117    const char * _exceptionMessage = NULL;
3118    jintArray _array = (jintArray) 0;
3119    jint _bufferOffset = (jint) 0;
3120    jint _remaining;
3121    GLfixed *params = (GLfixed *) 0;
3122
3123    if (!params_buf) {
3124        _exception = 1;
3125        _exceptionType = "java/lang/IllegalArgumentException";
3126        _exceptionMessage = "params == null";
3127        goto exit;
3128    }
3129    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3130    int _needed;
3131    switch (pname) {
3132#if defined(GL_SHININESS)
3133        case GL_SHININESS:
3134#endif // defined(GL_SHININESS)
3135            _needed = 1;
3136            break;
3137#if defined(GL_AMBIENT)
3138        case GL_AMBIENT:
3139#endif // defined(GL_AMBIENT)
3140#if defined(GL_DIFFUSE)
3141        case GL_DIFFUSE:
3142#endif // defined(GL_DIFFUSE)
3143#if defined(GL_SPECULAR)
3144        case GL_SPECULAR:
3145#endif // defined(GL_SPECULAR)
3146#if defined(GL_EMISSION)
3147        case GL_EMISSION:
3148#endif // defined(GL_EMISSION)
3149#if defined(GL_AMBIENT_AND_DIFFUSE)
3150        case GL_AMBIENT_AND_DIFFUSE:
3151#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3152            _needed = 4;
3153            break;
3154        default:
3155            _needed = 1;
3156            break;
3157    }
3158    if (_remaining < _needed) {
3159        _exception = 1;
3160        _exceptionType = "java/lang/IllegalArgumentException";
3161        _exceptionMessage = "remaining() < needed";
3162        goto exit;
3163    }
3164    if (params == NULL) {
3165        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3166        params = (GLfixed *) (_paramsBase + _bufferOffset);
3167    }
3168    glMaterialxv(
3169        (GLenum)face,
3170        (GLenum)pname,
3171        (GLfixed *)params
3172    );
3173
3174exit:
3175    if (_array) {
3176        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3177    }
3178    if (_exception) {
3179        jniThrowException(_env, _exceptionType, _exceptionMessage);
3180    }
3181}
3182
3183/* void glMatrixMode ( GLenum mode ) */
3184static void
3185android_glMatrixMode__I
3186  (JNIEnv *_env, jobject _this, jint mode) {
3187    glMatrixMode(
3188        (GLenum)mode
3189    );
3190}
3191
3192/* void glMultMatrixf ( const GLfloat *m ) */
3193static void
3194android_glMultMatrixf___3FI
3195  (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
3196    jint _exception = 0;
3197    const char * _exceptionType = NULL;
3198    const char * _exceptionMessage = NULL;
3199    GLfloat *m_base = (GLfloat *) 0;
3200    jint _remaining;
3201    GLfloat *m = (GLfloat *) 0;
3202
3203    if (!m_ref) {
3204        _exception = 1;
3205        _exceptionType = "java/lang/IllegalArgumentException";
3206        _exceptionMessage = "m == null";
3207        goto exit;
3208    }
3209    if (offset < 0) {
3210        _exception = 1;
3211        _exceptionType = "java/lang/IllegalArgumentException";
3212        _exceptionMessage = "offset < 0";
3213        goto exit;
3214    }
3215    _remaining = _env->GetArrayLength(m_ref) - offset;
3216    m_base = (GLfloat *)
3217        _env->GetFloatArrayElements(m_ref, (jboolean *)0);
3218    m = m_base + offset;
3219
3220    glMultMatrixf(
3221        (GLfloat *)m
3222    );
3223
3224exit:
3225    if (m_base) {
3226        _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
3227            JNI_ABORT);
3228    }
3229    if (_exception) {
3230        jniThrowException(_env, _exceptionType, _exceptionMessage);
3231    }
3232}
3233
3234/* void glMultMatrixf ( const GLfloat *m ) */
3235static void
3236android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3237  (JNIEnv *_env, jobject _this, jobject m_buf) {
3238    jint _exception = 0;
3239    const char * _exceptionType = NULL;
3240    const char * _exceptionMessage = NULL;
3241    jfloatArray _array = (jfloatArray) 0;
3242    jint _bufferOffset = (jint) 0;
3243    jint _remaining;
3244    GLfloat *m = (GLfloat *) 0;
3245
3246    if (!m_buf) {
3247        _exception = 1;
3248        _exceptionType = "java/lang/IllegalArgumentException";
3249        _exceptionMessage = "m == null";
3250        goto exit;
3251    }
3252    m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3253    if (m == NULL) {
3254        char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
3255        m = (GLfloat *) (_mBase + _bufferOffset);
3256    }
3257    glMultMatrixf(
3258        (GLfloat *)m
3259    );
3260
3261exit:
3262    if (_array) {
3263        _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
3264    }
3265    if (_exception) {
3266        jniThrowException(_env, _exceptionType, _exceptionMessage);
3267    }
3268}
3269
3270/* void glMultMatrixx ( const GLfixed *m ) */
3271static void
3272android_glMultMatrixx___3II
3273  (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
3274    jint _exception = 0;
3275    const char * _exceptionType = NULL;
3276    const char * _exceptionMessage = NULL;
3277    GLfixed *m_base = (GLfixed *) 0;
3278    jint _remaining;
3279    GLfixed *m = (GLfixed *) 0;
3280
3281    if (!m_ref) {
3282        _exception = 1;
3283        _exceptionType = "java/lang/IllegalArgumentException";
3284        _exceptionMessage = "m == null";
3285        goto exit;
3286    }
3287    if (offset < 0) {
3288        _exception = 1;
3289        _exceptionType = "java/lang/IllegalArgumentException";
3290        _exceptionMessage = "offset < 0";
3291        goto exit;
3292    }
3293    _remaining = _env->GetArrayLength(m_ref) - offset;
3294    m_base = (GLfixed *)
3295        _env->GetIntArrayElements(m_ref, (jboolean *)0);
3296    m = m_base + offset;
3297
3298    glMultMatrixx(
3299        (GLfixed *)m
3300    );
3301
3302exit:
3303    if (m_base) {
3304        _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
3305            JNI_ABORT);
3306    }
3307    if (_exception) {
3308        jniThrowException(_env, _exceptionType, _exceptionMessage);
3309    }
3310}
3311
3312/* void glMultMatrixx ( const GLfixed *m ) */
3313static void
3314android_glMultMatrixx__Ljava_nio_IntBuffer_2
3315  (JNIEnv *_env, jobject _this, jobject m_buf) {
3316    jint _exception = 0;
3317    const char * _exceptionType = NULL;
3318    const char * _exceptionMessage = NULL;
3319    jintArray _array = (jintArray) 0;
3320    jint _bufferOffset = (jint) 0;
3321    jint _remaining;
3322    GLfixed *m = (GLfixed *) 0;
3323
3324    if (!m_buf) {
3325        _exception = 1;
3326        _exceptionType = "java/lang/IllegalArgumentException";
3327        _exceptionMessage = "m == null";
3328        goto exit;
3329    }
3330    m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3331    if (m == NULL) {
3332        char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3333        m = (GLfixed *) (_mBase + _bufferOffset);
3334    }
3335    glMultMatrixx(
3336        (GLfixed *)m
3337    );
3338
3339exit:
3340    if (_array) {
3341        _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
3342    }
3343    if (_exception) {
3344        jniThrowException(_env, _exceptionType, _exceptionMessage);
3345    }
3346}
3347
3348/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3349static void
3350android_glMultiTexCoord4f__IFFFF
3351  (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3352    glMultiTexCoord4f(
3353        (GLenum)target,
3354        (GLfloat)s,
3355        (GLfloat)t,
3356        (GLfloat)r,
3357        (GLfloat)q
3358    );
3359}
3360
3361/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3362static void
3363android_glMultiTexCoord4x__IIIII
3364  (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3365    glMultiTexCoord4x(
3366        (GLenum)target,
3367        (GLfixed)s,
3368        (GLfixed)t,
3369        (GLfixed)r,
3370        (GLfixed)q
3371    );
3372}
3373
3374/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3375static void
3376android_glNormal3f__FFF
3377  (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3378    glNormal3f(
3379        (GLfloat)nx,
3380        (GLfloat)ny,
3381        (GLfloat)nz
3382    );
3383}
3384
3385/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3386static void
3387android_glNormal3x__III
3388  (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3389    glNormal3x(
3390        (GLfixed)nx,
3391        (GLfixed)ny,
3392        (GLfixed)nz
3393    );
3394}
3395
3396/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3397static void
3398android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3399  (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
3400    jint _exception = 0;
3401    const char * _exceptionType = NULL;
3402    const char * _exceptionMessage = NULL;
3403    jarray _array = (jarray) 0;
3404    jint _bufferOffset = (jint) 0;
3405    jint _remaining;
3406    GLvoid *pointer = (GLvoid *) 0;
3407
3408    if (pointer_buf) {
3409        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
3410        if ( ! pointer ) {
3411            return;
3412        }
3413    }
3414    glNormalPointerBounds(
3415        (GLenum)type,
3416        (GLsizei)stride,
3417        (GLvoid *)pointer,
3418        (GLsizei)remaining
3419    );
3420    if (_exception) {
3421        jniThrowException(_env, _exceptionType, _exceptionMessage);
3422    }
3423}
3424
3425/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3426static void
3427android_glOrthof__FFFFFF
3428  (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3429    glOrthof(
3430        (GLfloat)left,
3431        (GLfloat)right,
3432        (GLfloat)bottom,
3433        (GLfloat)top,
3434        (GLfloat)zNear,
3435        (GLfloat)zFar
3436    );
3437}
3438
3439/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3440static void
3441android_glOrthox__IIIIII
3442  (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3443    glOrthox(
3444        (GLfixed)left,
3445        (GLfixed)right,
3446        (GLfixed)bottom,
3447        (GLfixed)top,
3448        (GLfixed)zNear,
3449        (GLfixed)zFar
3450    );
3451}
3452
3453/* void glPixelStorei ( GLenum pname, GLint param ) */
3454static void
3455android_glPixelStorei__II
3456  (JNIEnv *_env, jobject _this, jint pname, jint param) {
3457    glPixelStorei(
3458        (GLenum)pname,
3459        (GLint)param
3460    );
3461}
3462
3463/* void glPointSize ( GLfloat size ) */
3464static void
3465android_glPointSize__F
3466  (JNIEnv *_env, jobject _this, jfloat size) {
3467    glPointSize(
3468        (GLfloat)size
3469    );
3470}
3471
3472/* void glPointSizex ( GLfixed size ) */
3473static void
3474android_glPointSizex__I
3475  (JNIEnv *_env, jobject _this, jint size) {
3476    glPointSizex(
3477        (GLfixed)size
3478    );
3479}
3480
3481/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3482static void
3483android_glPolygonOffset__FF
3484  (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3485    glPolygonOffset(
3486        (GLfloat)factor,
3487        (GLfloat)units
3488    );
3489}
3490
3491/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3492static void
3493android_glPolygonOffsetx__II
3494  (JNIEnv *_env, jobject _this, jint factor, jint units) {
3495    glPolygonOffsetx(
3496        (GLfixed)factor,
3497        (GLfixed)units
3498    );
3499}
3500
3501/* void glPopMatrix ( void ) */
3502static void
3503android_glPopMatrix__
3504  (JNIEnv *_env, jobject _this) {
3505    glPopMatrix();
3506}
3507
3508/* void glPushMatrix ( void ) */
3509static void
3510android_glPushMatrix__
3511  (JNIEnv *_env, jobject _this) {
3512    glPushMatrix();
3513}
3514
3515/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3516static void
3517android_glReadPixels__IIIIIILjava_nio_Buffer_2
3518  (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3519    jint _exception = 0;
3520    const char * _exceptionType = NULL;
3521    const char * _exceptionMessage = NULL;
3522    jarray _array = (jarray) 0;
3523    jint _bufferOffset = (jint) 0;
3524    jint _remaining;
3525    GLvoid *pixels = (GLvoid *) 0;
3526
3527    if (!pixels_buf) {
3528        _exception = 1;
3529        _exceptionType = "java/lang/IllegalArgumentException";
3530        _exceptionMessage = "pixels == null";
3531        goto exit;
3532    }
3533    pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3534    if (pixels == NULL) {
3535        char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3536        pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3537    }
3538    glReadPixels(
3539        (GLint)x,
3540        (GLint)y,
3541        (GLsizei)width,
3542        (GLsizei)height,
3543        (GLenum)format,
3544        (GLenum)type,
3545        (GLvoid *)pixels
3546    );
3547
3548exit:
3549    if (_array) {
3550        releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
3551    }
3552    if (_exception) {
3553        jniThrowException(_env, _exceptionType, _exceptionMessage);
3554    }
3555}
3556
3557/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3558static void
3559android_glRotatef__FFFF
3560  (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3561    glRotatef(
3562        (GLfloat)angle,
3563        (GLfloat)x,
3564        (GLfloat)y,
3565        (GLfloat)z
3566    );
3567}
3568
3569/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3570static void
3571android_glRotatex__IIII
3572  (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3573    glRotatex(
3574        (GLfixed)angle,
3575        (GLfixed)x,
3576        (GLfixed)y,
3577        (GLfixed)z
3578    );
3579}
3580
3581/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3582static void
3583android_glSampleCoverage__FZ
3584  (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3585    glSampleCoverage(
3586        (GLclampf)value,
3587        (GLboolean)invert
3588    );
3589}
3590
3591/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3592static void
3593android_glSampleCoveragex__IZ
3594  (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3595    glSampleCoveragex(
3596        (GLclampx)value,
3597        (GLboolean)invert
3598    );
3599}
3600
3601/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3602static void
3603android_glScalef__FFF
3604  (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3605    glScalef(
3606        (GLfloat)x,
3607        (GLfloat)y,
3608        (GLfloat)z
3609    );
3610}
3611
3612/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3613static void
3614android_glScalex__III
3615  (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3616    glScalex(
3617        (GLfixed)x,
3618        (GLfixed)y,
3619        (GLfixed)z
3620    );
3621}
3622
3623/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3624static void
3625android_glScissor__IIII
3626  (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3627    glScissor(
3628        (GLint)x,
3629        (GLint)y,
3630        (GLsizei)width,
3631        (GLsizei)height
3632    );
3633}
3634
3635/* void glShadeModel ( GLenum mode ) */
3636static void
3637android_glShadeModel__I
3638  (JNIEnv *_env, jobject _this, jint mode) {
3639    glShadeModel(
3640        (GLenum)mode
3641    );
3642}
3643
3644/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3645static void
3646android_glStencilFunc__III
3647  (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3648    glStencilFunc(
3649        (GLenum)func,
3650        (GLint)ref,
3651        (GLuint)mask
3652    );
3653}
3654
3655/* void glStencilMask ( GLuint mask ) */
3656static void
3657android_glStencilMask__I
3658  (JNIEnv *_env, jobject _this, jint mask) {
3659    glStencilMask(
3660        (GLuint)mask
3661    );
3662}
3663
3664/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3665static void
3666android_glStencilOp__III
3667  (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3668    glStencilOp(
3669        (GLenum)fail,
3670        (GLenum)zfail,
3671        (GLenum)zpass
3672    );
3673}
3674
3675/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3676static void
3677android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3678  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3679    jint _exception = 0;
3680    const char * _exceptionType = NULL;
3681    const char * _exceptionMessage = NULL;
3682    jarray _array = (jarray) 0;
3683    jint _bufferOffset = (jint) 0;
3684    jint _remaining;
3685    GLvoid *pointer = (GLvoid *) 0;
3686
3687    if (pointer_buf) {
3688        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
3689        if ( ! pointer ) {
3690            return;
3691        }
3692    }
3693    glTexCoordPointerBounds(
3694        (GLint)size,
3695        (GLenum)type,
3696        (GLsizei)stride,
3697        (GLvoid *)pointer,
3698        (GLsizei)remaining
3699    );
3700    if (_exception) {
3701        jniThrowException(_env, _exceptionType, _exceptionMessage);
3702    }
3703}
3704
3705/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3706static void
3707android_glTexEnvf__IIF
3708  (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3709    glTexEnvf(
3710        (GLenum)target,
3711        (GLenum)pname,
3712        (GLfloat)param
3713    );
3714}
3715
3716/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3717static void
3718android_glTexEnvfv__II_3FI
3719  (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
3720    jint _exception = 0;
3721    const char * _exceptionType = NULL;
3722    const char * _exceptionMessage = NULL;
3723    GLfloat *params_base = (GLfloat *) 0;
3724    jint _remaining;
3725    GLfloat *params = (GLfloat *) 0;
3726
3727    if (!params_ref) {
3728        _exception = 1;
3729        _exceptionType = "java/lang/IllegalArgumentException";
3730        _exceptionMessage = "params == null";
3731        goto exit;
3732    }
3733    if (offset < 0) {
3734        _exception = 1;
3735        _exceptionType = "java/lang/IllegalArgumentException";
3736        _exceptionMessage = "offset < 0";
3737        goto exit;
3738    }
3739    _remaining = _env->GetArrayLength(params_ref) - offset;
3740    int _needed;
3741    switch (pname) {
3742#if defined(GL_TEXTURE_ENV_MODE)
3743        case GL_TEXTURE_ENV_MODE:
3744#endif // defined(GL_TEXTURE_ENV_MODE)
3745#if defined(GL_COMBINE_RGB)
3746        case GL_COMBINE_RGB:
3747#endif // defined(GL_COMBINE_RGB)
3748#if defined(GL_COMBINE_ALPHA)
3749        case GL_COMBINE_ALPHA:
3750#endif // defined(GL_COMBINE_ALPHA)
3751            _needed = 1;
3752            break;
3753#if defined(GL_TEXTURE_ENV_COLOR)
3754        case GL_TEXTURE_ENV_COLOR:
3755#endif // defined(GL_TEXTURE_ENV_COLOR)
3756            _needed = 4;
3757            break;
3758        default:
3759            _needed = 1;
3760            break;
3761    }
3762    if (_remaining < _needed) {
3763        _exception = 1;
3764        _exceptionType = "java/lang/IllegalArgumentException";
3765        _exceptionMessage = "length - offset < needed";
3766        goto exit;
3767    }
3768    params_base = (GLfloat *)
3769        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
3770    params = params_base + offset;
3771
3772    glTexEnvfv(
3773        (GLenum)target,
3774        (GLenum)pname,
3775        (GLfloat *)params
3776    );
3777
3778exit:
3779    if (params_base) {
3780        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
3781            JNI_ABORT);
3782    }
3783    if (_exception) {
3784        jniThrowException(_env, _exceptionType, _exceptionMessage);
3785    }
3786}
3787
3788/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3789static void
3790android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3791  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3792    jint _exception = 0;
3793    const char * _exceptionType = NULL;
3794    const char * _exceptionMessage = NULL;
3795    jfloatArray _array = (jfloatArray) 0;
3796    jint _bufferOffset = (jint) 0;
3797    jint _remaining;
3798    GLfloat *params = (GLfloat *) 0;
3799
3800    if (!params_buf) {
3801        _exception = 1;
3802        _exceptionType = "java/lang/IllegalArgumentException";
3803        _exceptionMessage = "params == null";
3804        goto exit;
3805    }
3806    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3807    int _needed;
3808    switch (pname) {
3809#if defined(GL_TEXTURE_ENV_MODE)
3810        case GL_TEXTURE_ENV_MODE:
3811#endif // defined(GL_TEXTURE_ENV_MODE)
3812#if defined(GL_COMBINE_RGB)
3813        case GL_COMBINE_RGB:
3814#endif // defined(GL_COMBINE_RGB)
3815#if defined(GL_COMBINE_ALPHA)
3816        case GL_COMBINE_ALPHA:
3817#endif // defined(GL_COMBINE_ALPHA)
3818            _needed = 1;
3819            break;
3820#if defined(GL_TEXTURE_ENV_COLOR)
3821        case GL_TEXTURE_ENV_COLOR:
3822#endif // defined(GL_TEXTURE_ENV_COLOR)
3823            _needed = 4;
3824            break;
3825        default:
3826            _needed = 1;
3827            break;
3828    }
3829    if (_remaining < _needed) {
3830        _exception = 1;
3831        _exceptionType = "java/lang/IllegalArgumentException";
3832        _exceptionMessage = "remaining() < needed";
3833        goto exit;
3834    }
3835    if (params == NULL) {
3836        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
3837        params = (GLfloat *) (_paramsBase + _bufferOffset);
3838    }
3839    glTexEnvfv(
3840        (GLenum)target,
3841        (GLenum)pname,
3842        (GLfloat *)params
3843    );
3844
3845exit:
3846    if (_array) {
3847        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
3848    }
3849    if (_exception) {
3850        jniThrowException(_env, _exceptionType, _exceptionMessage);
3851    }
3852}
3853
3854/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3855static void
3856android_glTexEnvx__III
3857  (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3858    glTexEnvx(
3859        (GLenum)target,
3860        (GLenum)pname,
3861        (GLfixed)param
3862    );
3863}
3864
3865/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3866static void
3867android_glTexEnvxv__II_3II
3868  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
3869    jint _exception = 0;
3870    const char * _exceptionType = NULL;
3871    const char * _exceptionMessage = NULL;
3872    GLfixed *params_base = (GLfixed *) 0;
3873    jint _remaining;
3874    GLfixed *params = (GLfixed *) 0;
3875
3876    if (!params_ref) {
3877        _exception = 1;
3878        _exceptionType = "java/lang/IllegalArgumentException";
3879        _exceptionMessage = "params == null";
3880        goto exit;
3881    }
3882    if (offset < 0) {
3883        _exception = 1;
3884        _exceptionType = "java/lang/IllegalArgumentException";
3885        _exceptionMessage = "offset < 0";
3886        goto exit;
3887    }
3888    _remaining = _env->GetArrayLength(params_ref) - offset;
3889    int _needed;
3890    switch (pname) {
3891#if defined(GL_TEXTURE_ENV_MODE)
3892        case GL_TEXTURE_ENV_MODE:
3893#endif // defined(GL_TEXTURE_ENV_MODE)
3894#if defined(GL_COMBINE_RGB)
3895        case GL_COMBINE_RGB:
3896#endif // defined(GL_COMBINE_RGB)
3897#if defined(GL_COMBINE_ALPHA)
3898        case GL_COMBINE_ALPHA:
3899#endif // defined(GL_COMBINE_ALPHA)
3900            _needed = 1;
3901            break;
3902#if defined(GL_TEXTURE_ENV_COLOR)
3903        case GL_TEXTURE_ENV_COLOR:
3904#endif // defined(GL_TEXTURE_ENV_COLOR)
3905            _needed = 4;
3906            break;
3907        default:
3908            _needed = 1;
3909            break;
3910    }
3911    if (_remaining < _needed) {
3912        _exception = 1;
3913        _exceptionType = "java/lang/IllegalArgumentException";
3914        _exceptionMessage = "length - offset < needed";
3915        goto exit;
3916    }
3917    params_base = (GLfixed *)
3918        _env->GetIntArrayElements(params_ref, (jboolean *)0);
3919    params = params_base + offset;
3920
3921    glTexEnvxv(
3922        (GLenum)target,
3923        (GLenum)pname,
3924        (GLfixed *)params
3925    );
3926
3927exit:
3928    if (params_base) {
3929        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3930            JNI_ABORT);
3931    }
3932    if (_exception) {
3933        jniThrowException(_env, _exceptionType, _exceptionMessage);
3934    }
3935}
3936
3937/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3938static void
3939android_glTexEnvxv__IILjava_nio_IntBuffer_2
3940  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3941    jint _exception = 0;
3942    const char * _exceptionType = NULL;
3943    const char * _exceptionMessage = NULL;
3944    jintArray _array = (jintArray) 0;
3945    jint _bufferOffset = (jint) 0;
3946    jint _remaining;
3947    GLfixed *params = (GLfixed *) 0;
3948
3949    if (!params_buf) {
3950        _exception = 1;
3951        _exceptionType = "java/lang/IllegalArgumentException";
3952        _exceptionMessage = "params == null";
3953        goto exit;
3954    }
3955    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3956    int _needed;
3957    switch (pname) {
3958#if defined(GL_TEXTURE_ENV_MODE)
3959        case GL_TEXTURE_ENV_MODE:
3960#endif // defined(GL_TEXTURE_ENV_MODE)
3961#if defined(GL_COMBINE_RGB)
3962        case GL_COMBINE_RGB:
3963#endif // defined(GL_COMBINE_RGB)
3964#if defined(GL_COMBINE_ALPHA)
3965        case GL_COMBINE_ALPHA:
3966#endif // defined(GL_COMBINE_ALPHA)
3967            _needed = 1;
3968            break;
3969#if defined(GL_TEXTURE_ENV_COLOR)
3970        case GL_TEXTURE_ENV_COLOR:
3971#endif // defined(GL_TEXTURE_ENV_COLOR)
3972            _needed = 4;
3973            break;
3974        default:
3975            _needed = 1;
3976            break;
3977    }
3978    if (_remaining < _needed) {
3979        _exception = 1;
3980        _exceptionType = "java/lang/IllegalArgumentException";
3981        _exceptionMessage = "remaining() < needed";
3982        goto exit;
3983    }
3984    if (params == NULL) {
3985        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3986        params = (GLfixed *) (_paramsBase + _bufferOffset);
3987    }
3988    glTexEnvxv(
3989        (GLenum)target,
3990        (GLenum)pname,
3991        (GLfixed *)params
3992    );
3993
3994exit:
3995    if (_array) {
3996        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3997    }
3998    if (_exception) {
3999        jniThrowException(_env, _exceptionType, _exceptionMessage);
4000    }
4001}
4002
4003/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
4004static void
4005android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
4006  (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
4007    jint _exception = 0;
4008    const char * _exceptionType = NULL;
4009    const char * _exceptionMessage = NULL;
4010    jarray _array = (jarray) 0;
4011    jint _bufferOffset = (jint) 0;
4012    jint _remaining;
4013    GLvoid *pixels = (GLvoid *) 0;
4014
4015    if (pixels_buf) {
4016        pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4017    }
4018    if (pixels_buf && pixels == NULL) {
4019        char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4020        pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
4021    }
4022    glTexImage2D(
4023        (GLenum)target,
4024        (GLint)level,
4025        (GLint)internalformat,
4026        (GLsizei)width,
4027        (GLsizei)height,
4028        (GLint)border,
4029        (GLenum)format,
4030        (GLenum)type,
4031        (GLvoid *)pixels
4032    );
4033    if (_array) {
4034        releasePointer(_env, _array, pixels, JNI_FALSE);
4035    }
4036    if (_exception) {
4037        jniThrowException(_env, _exceptionType, _exceptionMessage);
4038    }
4039}
4040
4041/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
4042static void
4043android_glTexParameterf__IIF
4044  (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
4045    glTexParameterf(
4046        (GLenum)target,
4047        (GLenum)pname,
4048        (GLfloat)param
4049    );
4050}
4051
4052/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
4053static void
4054android_glTexParameterx__III
4055  (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
4056    glTexParameterx(
4057        (GLenum)target,
4058        (GLenum)pname,
4059        (GLfixed)param
4060    );
4061}
4062
4063/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
4064static void
4065android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
4066  (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
4067    jint _exception = 0;
4068    const char * _exceptionType = NULL;
4069    const char * _exceptionMessage = NULL;
4070    jarray _array = (jarray) 0;
4071    jint _bufferOffset = (jint) 0;
4072    jint _remaining;
4073    GLvoid *pixels = (GLvoid *) 0;
4074
4075    if (pixels_buf) {
4076        pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4077    }
4078    if (pixels_buf && pixels == NULL) {
4079        char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4080        pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
4081    }
4082    glTexSubImage2D(
4083        (GLenum)target,
4084        (GLint)level,
4085        (GLint)xoffset,
4086        (GLint)yoffset,
4087        (GLsizei)width,
4088        (GLsizei)height,
4089        (GLenum)format,
4090        (GLenum)type,
4091        (GLvoid *)pixels
4092    );
4093    if (_array) {
4094        releasePointer(_env, _array, pixels, JNI_FALSE);
4095    }
4096    if (_exception) {
4097        jniThrowException(_env, _exceptionType, _exceptionMessage);
4098    }
4099}
4100
4101/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
4102static void
4103android_glTranslatef__FFF
4104  (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
4105    glTranslatef(
4106        (GLfloat)x,
4107        (GLfloat)y,
4108        (GLfloat)z
4109    );
4110}
4111
4112/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
4113static void
4114android_glTranslatex__III
4115  (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
4116    glTranslatex(
4117        (GLfixed)x,
4118        (GLfixed)y,
4119        (GLfixed)z
4120    );
4121}
4122
4123/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
4124static void
4125android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
4126  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
4127    jint _exception = 0;
4128    const char * _exceptionType = NULL;
4129    const char * _exceptionMessage = NULL;
4130    jarray _array = (jarray) 0;
4131    jint _bufferOffset = (jint) 0;
4132    jint _remaining;
4133    GLvoid *pointer = (GLvoid *) 0;
4134
4135    if (pointer_buf) {
4136        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
4137        if ( ! pointer ) {
4138            return;
4139        }
4140    }
4141    glVertexPointerBounds(
4142        (GLint)size,
4143        (GLenum)type,
4144        (GLsizei)stride,
4145        (GLvoid *)pointer,
4146        (GLsizei)remaining
4147    );
4148    if (_exception) {
4149        jniThrowException(_env, _exceptionType, _exceptionMessage);
4150    }
4151}
4152
4153/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
4154static void
4155android_glViewport__IIII
4156  (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
4157    glViewport(
4158        (GLint)x,
4159        (GLint)y,
4160        (GLsizei)width,
4161        (GLsizei)height
4162    );
4163}
4164
4165/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4166static jint
4167android_glQueryMatrixxOES___3II_3II
4168  (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
4169    jint _exception = 0;
4170    const char * _exceptionType = NULL;
4171    const char * _exceptionMessage = NULL;
4172    GLbitfield _returnValue = -1;
4173    GLfixed *mantissa_base = (GLfixed *) 0;
4174    jint _mantissaRemaining;
4175    GLfixed *mantissa = (GLfixed *) 0;
4176    GLint *exponent_base = (GLint *) 0;
4177    jint _exponentRemaining;
4178    GLint *exponent = (GLint *) 0;
4179
4180    if (!mantissa_ref) {
4181        _exception = 1;
4182        _exceptionType = "java/lang/IllegalArgumentException";
4183        _exceptionMessage = "mantissa == null";
4184        goto exit;
4185    }
4186    if (mantissaOffset < 0) {
4187        _exception = 1;
4188        _exceptionType = "java/lang/IllegalArgumentException";
4189        _exceptionMessage = "mantissaOffset < 0";
4190        goto exit;
4191    }
4192    _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
4193    if (_mantissaRemaining < 16) {
4194        _exception = 1;
4195        _exceptionType = "java/lang/IllegalArgumentException";
4196        _exceptionMessage = "length - mantissaOffset < 16 < needed";
4197        goto exit;
4198    }
4199    mantissa_base = (GLfixed *)
4200        _env->GetIntArrayElements(mantissa_ref, (jboolean *)0);
4201    mantissa = mantissa_base + mantissaOffset;
4202
4203    if (!exponent_ref) {
4204        _exception = 1;
4205        _exceptionType = "java/lang/IllegalArgumentException";
4206        _exceptionMessage = "exponent == null";
4207        goto exit;
4208    }
4209    if (exponentOffset < 0) {
4210        _exception = 1;
4211        _exceptionType = "java/lang/IllegalArgumentException";
4212        _exceptionMessage = "exponentOffset < 0";
4213        goto exit;
4214    }
4215    _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
4216    if (_exponentRemaining < 16) {
4217        _exception = 1;
4218        _exceptionType = "java/lang/IllegalArgumentException";
4219        _exceptionMessage = "length - exponentOffset < 16 < needed";
4220        goto exit;
4221    }
4222    exponent_base = (GLint *)
4223        _env->GetIntArrayElements(exponent_ref, (jboolean *)0);
4224    exponent = exponent_base + exponentOffset;
4225
4226    _returnValue = glQueryMatrixxOES(
4227        (GLfixed *)mantissa,
4228        (GLint *)exponent
4229    );
4230
4231exit:
4232    if (exponent_base) {
4233        _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base,
4234            _exception ? JNI_ABORT: 0);
4235    }
4236    if (mantissa_base) {
4237        _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base,
4238            _exception ? JNI_ABORT: 0);
4239    }
4240    if (_exception) {
4241        jniThrowException(_env, _exceptionType, _exceptionMessage);
4242    }
4243    return (jint)_returnValue;
4244}
4245
4246/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4247static jint
4248android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4249  (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4250    jint _exception = 0;
4251    const char * _exceptionType = NULL;
4252    const char * _exceptionMessage = NULL;
4253    jintArray _mantissaArray = (jintArray) 0;
4254    jint _mantissaBufferOffset = (jint) 0;
4255    jintArray _exponentArray = (jintArray) 0;
4256    jint _exponentBufferOffset = (jint) 0;
4257    GLbitfield _returnValue = -1;
4258    jint _mantissaRemaining;
4259    GLfixed *mantissa = (GLfixed *) 0;
4260    jint _exponentRemaining;
4261    GLint *exponent = (GLint *) 0;
4262
4263    if (!mantissa_buf) {
4264        _exception = 1;
4265        _exceptionType = "java/lang/IllegalArgumentException";
4266        _exceptionMessage = "mantissa == null";
4267        goto exit;
4268    }
4269    mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
4270    if (_mantissaRemaining < 16) {
4271        _exception = 1;
4272        _exceptionType = "java/lang/IllegalArgumentException";
4273        _exceptionMessage = "remaining() < 16 < needed";
4274        goto exit;
4275    }
4276    if (!exponent_buf) {
4277        _exception = 1;
4278        _exceptionType = "java/lang/IllegalArgumentException";
4279        _exceptionMessage = "exponent == null";
4280        goto exit;
4281    }
4282    exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
4283    if (_exponentRemaining < 16) {
4284        _exception = 1;
4285        _exceptionType = "java/lang/IllegalArgumentException";
4286        _exceptionMessage = "remaining() < 16 < needed";
4287        goto exit;
4288    }
4289    if (mantissa == NULL) {
4290        char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0);
4291        mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4292    }
4293    if (exponent == NULL) {
4294        char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0);
4295        exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4296    }
4297    _returnValue = glQueryMatrixxOES(
4298        (GLfixed *)mantissa,
4299        (GLint *)exponent
4300    );
4301
4302exit:
4303    if (_exponentArray) {
4304        _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0);
4305    }
4306    if (_mantissaArray) {
4307        _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0);
4308    }
4309    if (_exception) {
4310        jniThrowException(_env, _exceptionType, _exceptionMessage);
4311    }
4312    return (jint)_returnValue;
4313}
4314
4315/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4316static void
4317android_glBindBuffer__II
4318  (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4319    glBindBuffer(
4320        (GLenum)target,
4321        (GLuint)buffer
4322    );
4323}
4324
4325/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4326static void
4327android_glBufferData__IILjava_nio_Buffer_2I
4328  (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
4329    jint _exception = 0;
4330    const char * _exceptionType = NULL;
4331    const char * _exceptionMessage = NULL;
4332    jarray _array = (jarray) 0;
4333    jint _bufferOffset = (jint) 0;
4334    jint _remaining;
4335    GLvoid *data = (GLvoid *) 0;
4336
4337    if (data_buf) {
4338        data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4339        if (_remaining < size) {
4340            _exception = 1;
4341            _exceptionType = "java/lang/IllegalArgumentException";
4342            _exceptionMessage = "remaining() < size < needed";
4343            goto exit;
4344        }
4345    }
4346    if (data_buf && data == NULL) {
4347        char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4348        data = (GLvoid *) (_dataBase + _bufferOffset);
4349    }
4350    glBufferData(
4351        (GLenum)target,
4352        (GLsizeiptr)size,
4353        (GLvoid *)data,
4354        (GLenum)usage
4355    );
4356
4357exit:
4358    if (_array) {
4359        releasePointer(_env, _array, data, JNI_FALSE);
4360    }
4361    if (_exception) {
4362        jniThrowException(_env, _exceptionType, _exceptionMessage);
4363    }
4364}
4365
4366/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4367static void
4368android_glBufferSubData__IIILjava_nio_Buffer_2
4369  (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
4370    jint _exception = 0;
4371    const char * _exceptionType = NULL;
4372    const char * _exceptionMessage = NULL;
4373    jarray _array = (jarray) 0;
4374    jint _bufferOffset = (jint) 0;
4375    jint _remaining;
4376    GLvoid *data = (GLvoid *) 0;
4377
4378    if (!data_buf) {
4379        _exception = 1;
4380        _exceptionType = "java/lang/IllegalArgumentException";
4381        _exceptionMessage = "data == null";
4382        goto exit;
4383    }
4384    data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4385    if (_remaining < size) {
4386        _exception = 1;
4387        _exceptionType = "java/lang/IllegalArgumentException";
4388        _exceptionMessage = "remaining() < size < needed";
4389        goto exit;
4390    }
4391    if (data == NULL) {
4392        char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4393        data = (GLvoid *) (_dataBase + _bufferOffset);
4394    }
4395    glBufferSubData(
4396        (GLenum)target,
4397        (GLintptr)offset,
4398        (GLsizeiptr)size,
4399        (GLvoid *)data
4400    );
4401
4402exit:
4403    if (_array) {
4404        releasePointer(_env, _array, data, JNI_FALSE);
4405    }
4406    if (_exception) {
4407        jniThrowException(_env, _exceptionType, _exceptionMessage);
4408    }
4409}
4410
4411/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4412static void
4413android_glClipPlanef__I_3FI
4414  (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
4415    jint _exception = 0;
4416    const char * _exceptionType = NULL;
4417    const char * _exceptionMessage = NULL;
4418    GLfloat *equation_base = (GLfloat *) 0;
4419    jint _remaining;
4420    GLfloat *equation = (GLfloat *) 0;
4421
4422    if (!equation_ref) {
4423        _exception = 1;
4424        _exceptionType = "java/lang/IllegalArgumentException";
4425        _exceptionMessage = "equation == null";
4426        goto exit;
4427    }
4428    if (offset < 0) {
4429        _exception = 1;
4430        _exceptionType = "java/lang/IllegalArgumentException";
4431        _exceptionMessage = "offset < 0";
4432        goto exit;
4433    }
4434    _remaining = _env->GetArrayLength(equation_ref) - offset;
4435    if (_remaining < 4) {
4436        _exception = 1;
4437        _exceptionType = "java/lang/IllegalArgumentException";
4438        _exceptionMessage = "length - offset < 4 < needed";
4439        goto exit;
4440    }
4441    equation_base = (GLfloat *)
4442        _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
4443    equation = equation_base + offset;
4444
4445    glClipPlanef(
4446        (GLenum)plane,
4447        (GLfloat *)equation
4448    );
4449
4450exit:
4451    if (equation_base) {
4452        _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
4453            JNI_ABORT);
4454    }
4455    if (_exception) {
4456        jniThrowException(_env, _exceptionType, _exceptionMessage);
4457    }
4458}
4459
4460/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4461static void
4462android_glClipPlanef__ILjava_nio_FloatBuffer_2
4463  (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
4464    jint _exception = 0;
4465    const char * _exceptionType = NULL;
4466    const char * _exceptionMessage = NULL;
4467    jfloatArray _array = (jfloatArray) 0;
4468    jint _bufferOffset = (jint) 0;
4469    jint _remaining;
4470    GLfloat *equation = (GLfloat *) 0;
4471
4472    if (!equation_buf) {
4473        _exception = 1;
4474        _exceptionType = "java/lang/IllegalArgumentException";
4475        _exceptionMessage = "equation == null";
4476        goto exit;
4477    }
4478    equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4479    if (_remaining < 4) {
4480        _exception = 1;
4481        _exceptionType = "java/lang/IllegalArgumentException";
4482        _exceptionMessage = "remaining() < 4 < needed";
4483        goto exit;
4484    }
4485    if (equation == NULL) {
4486        char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
4487        equation = (GLfloat *) (_equationBase + _bufferOffset);
4488    }
4489    glClipPlanef(
4490        (GLenum)plane,
4491        (GLfloat *)equation
4492    );
4493
4494exit:
4495    if (_array) {
4496        _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
4497    }
4498    if (_exception) {
4499        jniThrowException(_env, _exceptionType, _exceptionMessage);
4500    }
4501}
4502
4503/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4504static void
4505android_glClipPlanex__I_3II
4506  (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
4507    jint _exception = 0;
4508    const char * _exceptionType = NULL;
4509    const char * _exceptionMessage = NULL;
4510    GLfixed *equation_base = (GLfixed *) 0;
4511    jint _remaining;
4512    GLfixed *equation = (GLfixed *) 0;
4513
4514    if (!equation_ref) {
4515        _exception = 1;
4516        _exceptionType = "java/lang/IllegalArgumentException";
4517        _exceptionMessage = "equation == null";
4518        goto exit;
4519    }
4520    if (offset < 0) {
4521        _exception = 1;
4522        _exceptionType = "java/lang/IllegalArgumentException";
4523        _exceptionMessage = "offset < 0";
4524        goto exit;
4525    }
4526    _remaining = _env->GetArrayLength(equation_ref) - offset;
4527    if (_remaining < 4) {
4528        _exception = 1;
4529        _exceptionType = "java/lang/IllegalArgumentException";
4530        _exceptionMessage = "length - offset < 4 < needed";
4531        goto exit;
4532    }
4533    equation_base = (GLfixed *)
4534        _env->GetIntArrayElements(equation_ref, (jboolean *)0);
4535    equation = equation_base + offset;
4536
4537    glClipPlanex(
4538        (GLenum)plane,
4539        (GLfixed *)equation
4540    );
4541
4542exit:
4543    if (equation_base) {
4544        _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
4545            JNI_ABORT);
4546    }
4547    if (_exception) {
4548        jniThrowException(_env, _exceptionType, _exceptionMessage);
4549    }
4550}
4551
4552/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4553static void
4554android_glClipPlanex__ILjava_nio_IntBuffer_2
4555  (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
4556    jint _exception = 0;
4557    const char * _exceptionType = NULL;
4558    const char * _exceptionMessage = NULL;
4559    jintArray _array = (jintArray) 0;
4560    jint _bufferOffset = (jint) 0;
4561    jint _remaining;
4562    GLfixed *equation = (GLfixed *) 0;
4563
4564    if (!equation_buf) {
4565        _exception = 1;
4566        _exceptionType = "java/lang/IllegalArgumentException";
4567        _exceptionMessage = "equation == null";
4568        goto exit;
4569    }
4570    equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4571    if (_remaining < 4) {
4572        _exception = 1;
4573        _exceptionType = "java/lang/IllegalArgumentException";
4574        _exceptionMessage = "remaining() < 4 < needed";
4575        goto exit;
4576    }
4577    if (equation == NULL) {
4578        char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
4579        equation = (GLfixed *) (_equationBase + _bufferOffset);
4580    }
4581    glClipPlanex(
4582        (GLenum)plane,
4583        (GLfixed *)equation
4584    );
4585
4586exit:
4587    if (_array) {
4588        _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
4589    }
4590    if (_exception) {
4591        jniThrowException(_env, _exceptionType, _exceptionMessage);
4592    }
4593}
4594
4595/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4596static void
4597android_glColor4ub__BBBB
4598  (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4599    glColor4ub(
4600        (GLubyte)red,
4601        (GLubyte)green,
4602        (GLubyte)blue,
4603        (GLubyte)alpha
4604    );
4605}
4606
4607/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4608static void
4609android_glColorPointer__IIII
4610  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4611    glColorPointer(
4612        (GLint)size,
4613        (GLenum)type,
4614        (GLsizei)stride,
4615        reinterpret_cast<GLvoid *>(offset)
4616    );
4617}
4618
4619/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4620static void
4621android_glDeleteBuffers__I_3II
4622  (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4623    jint _exception = 0;
4624    const char * _exceptionType = NULL;
4625    const char * _exceptionMessage = NULL;
4626    GLuint *buffers_base = (GLuint *) 0;
4627    jint _remaining;
4628    GLuint *buffers = (GLuint *) 0;
4629
4630    if (!buffers_ref) {
4631        _exception = 1;
4632        _exceptionType = "java/lang/IllegalArgumentException";
4633        _exceptionMessage = "buffers == null";
4634        goto exit;
4635    }
4636    if (offset < 0) {
4637        _exception = 1;
4638        _exceptionType = "java/lang/IllegalArgumentException";
4639        _exceptionMessage = "offset < 0";
4640        goto exit;
4641    }
4642    _remaining = _env->GetArrayLength(buffers_ref) - offset;
4643    if (_remaining < n) {
4644        _exception = 1;
4645        _exceptionType = "java/lang/IllegalArgumentException";
4646        _exceptionMessage = "length - offset < n < needed";
4647        goto exit;
4648    }
4649    buffers_base = (GLuint *)
4650        _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
4651    buffers = buffers_base + offset;
4652
4653    glDeleteBuffers(
4654        (GLsizei)n,
4655        (GLuint *)buffers
4656    );
4657
4658exit:
4659    if (buffers_base) {
4660        _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
4661            JNI_ABORT);
4662    }
4663    if (_exception) {
4664        jniThrowException(_env, _exceptionType, _exceptionMessage);
4665    }
4666}
4667
4668/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4669static void
4670android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4671  (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4672    jint _exception = 0;
4673    const char * _exceptionType = NULL;
4674    const char * _exceptionMessage = NULL;
4675    jintArray _array = (jintArray) 0;
4676    jint _bufferOffset = (jint) 0;
4677    jint _remaining;
4678    GLuint *buffers = (GLuint *) 0;
4679
4680    if (!buffers_buf) {
4681        _exception = 1;
4682        _exceptionType = "java/lang/IllegalArgumentException";
4683        _exceptionMessage = "buffers == null";
4684        goto exit;
4685    }
4686    buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4687    if (_remaining < n) {
4688        _exception = 1;
4689        _exceptionType = "java/lang/IllegalArgumentException";
4690        _exceptionMessage = "remaining() < n < needed";
4691        goto exit;
4692    }
4693    if (buffers == NULL) {
4694        char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
4695        buffers = (GLuint *) (_buffersBase + _bufferOffset);
4696    }
4697    glDeleteBuffers(
4698        (GLsizei)n,
4699        (GLuint *)buffers
4700    );
4701
4702exit:
4703    if (_array) {
4704        _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
4705    }
4706    if (_exception) {
4707        jniThrowException(_env, _exceptionType, _exceptionMessage);
4708    }
4709}
4710
4711/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4712static void
4713android_glDrawElements__IIII
4714  (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
4715    jint _exception = 0;
4716    const char * _exceptionType = NULL;
4717    const char * _exceptionMessage = NULL;
4718    glDrawElements(
4719        (GLenum)mode,
4720        (GLsizei)count,
4721        (GLenum)type,
4722        reinterpret_cast<GLvoid *>(offset)
4723    );
4724    if (_exception) {
4725        jniThrowException(_env, _exceptionType, _exceptionMessage);
4726    }
4727}
4728
4729/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4730static void
4731android_glGenBuffers__I_3II
4732  (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4733    jint _exception = 0;
4734    const char * _exceptionType = NULL;
4735    const char * _exceptionMessage = NULL;
4736    GLuint *buffers_base = (GLuint *) 0;
4737    jint _remaining;
4738    GLuint *buffers = (GLuint *) 0;
4739
4740    if (!buffers_ref) {
4741        _exception = 1;
4742        _exceptionType = "java/lang/IllegalArgumentException";
4743        _exceptionMessage = "buffers == null";
4744        goto exit;
4745    }
4746    if (offset < 0) {
4747        _exception = 1;
4748        _exceptionType = "java/lang/IllegalArgumentException";
4749        _exceptionMessage = "offset < 0";
4750        goto exit;
4751    }
4752    _remaining = _env->GetArrayLength(buffers_ref) - offset;
4753    if (_remaining < n) {
4754        _exception = 1;
4755        _exceptionType = "java/lang/IllegalArgumentException";
4756        _exceptionMessage = "length - offset < n < needed";
4757        goto exit;
4758    }
4759    buffers_base = (GLuint *)
4760        _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
4761    buffers = buffers_base + offset;
4762
4763    glGenBuffers(
4764        (GLsizei)n,
4765        (GLuint *)buffers
4766    );
4767
4768exit:
4769    if (buffers_base) {
4770        _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
4771            _exception ? JNI_ABORT: 0);
4772    }
4773    if (_exception) {
4774        jniThrowException(_env, _exceptionType, _exceptionMessage);
4775    }
4776}
4777
4778/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4779static void
4780android_glGenBuffers__ILjava_nio_IntBuffer_2
4781  (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4782    jint _exception = 0;
4783    const char * _exceptionType = NULL;
4784    const char * _exceptionMessage = NULL;
4785    jintArray _array = (jintArray) 0;
4786    jint _bufferOffset = (jint) 0;
4787    jint _remaining;
4788    GLuint *buffers = (GLuint *) 0;
4789
4790    if (!buffers_buf) {
4791        _exception = 1;
4792        _exceptionType = "java/lang/IllegalArgumentException";
4793        _exceptionMessage = "buffers == null";
4794        goto exit;
4795    }
4796    buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4797    if (_remaining < n) {
4798        _exception = 1;
4799        _exceptionType = "java/lang/IllegalArgumentException";
4800        _exceptionMessage = "remaining() < n < needed";
4801        goto exit;
4802    }
4803    if (buffers == NULL) {
4804        char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
4805        buffers = (GLuint *) (_buffersBase + _bufferOffset);
4806    }
4807    glGenBuffers(
4808        (GLsizei)n,
4809        (GLuint *)buffers
4810    );
4811
4812exit:
4813    if (_array) {
4814        _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
4815    }
4816    if (_exception) {
4817        jniThrowException(_env, _exceptionType, _exceptionMessage);
4818    }
4819}
4820
4821/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4822static void
4823android_glGetBooleanv__I_3ZI
4824  (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4825    jint _exception = 0;
4826    const char * _exceptionType = NULL;
4827    const char * _exceptionMessage = NULL;
4828    GLboolean *params_base = (GLboolean *) 0;
4829    jint _remaining;
4830    GLboolean *params = (GLboolean *) 0;
4831
4832    if (!params_ref) {
4833        _exception = 1;
4834        _exceptionType = "java/lang/IllegalArgumentException";
4835        _exceptionMessage = "params == null";
4836        goto exit;
4837    }
4838    if (offset < 0) {
4839        _exception = 1;
4840        _exceptionType = "java/lang/IllegalArgumentException";
4841        _exceptionMessage = "offset < 0";
4842        goto exit;
4843    }
4844    _remaining = _env->GetArrayLength(params_ref) - offset;
4845    params_base = (GLboolean *)
4846        _env->GetBooleanArrayElements(params_ref, (jboolean *)0);
4847    params = params_base + offset;
4848
4849    glGetBooleanv(
4850        (GLenum)pname,
4851        (GLboolean *)params
4852    );
4853
4854exit:
4855    if (params_base) {
4856        _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base,
4857            _exception ? JNI_ABORT: 0);
4858    }
4859    if (_exception) {
4860        jniThrowException(_env, _exceptionType, _exceptionMessage);
4861    }
4862}
4863
4864/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4865static void
4866android_glGetBooleanv__ILjava_nio_IntBuffer_2
4867  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
4868    jint _exception = 0;
4869    const char * _exceptionType = NULL;
4870    const char * _exceptionMessage = NULL;
4871    jintArray _array = (jintArray) 0;
4872    jint _bufferOffset = (jint) 0;
4873    jint _remaining;
4874    GLboolean *params = (GLboolean *) 0;
4875
4876    if (!params_buf) {
4877        _exception = 1;
4878        _exceptionType = "java/lang/IllegalArgumentException";
4879        _exceptionMessage = "params == null";
4880        goto exit;
4881    }
4882    params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4883    if (params == NULL) {
4884        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
4885        params = (GLboolean *) (_paramsBase + _bufferOffset);
4886    }
4887    glGetBooleanv(
4888        (GLenum)pname,
4889        (GLboolean *)params
4890    );
4891
4892exit:
4893    if (_array) {
4894        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4895    }
4896    if (_exception) {
4897        jniThrowException(_env, _exceptionType, _exceptionMessage);
4898    }
4899}
4900
4901/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4902static void
4903android_glGetBufferParameteriv__II_3II
4904  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
4905    jniThrowException(_env, "java/lang/UnsupportedOperationException",
4906        "glGetBufferParameteriv");
4907}
4908
4909/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4910static void
4911android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4912  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
4913    jniThrowException(_env, "java/lang/UnsupportedOperationException",
4914        "glGetBufferParameteriv");
4915}
4916
4917/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4918static void
4919android_glGetClipPlanef__I_3FI
4920  (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4921    jint _exception = 0;
4922    const char * _exceptionType = NULL;
4923    const char * _exceptionMessage = NULL;
4924    GLfloat *eqn_base = (GLfloat *) 0;
4925    jint _remaining;
4926    GLfloat *eqn = (GLfloat *) 0;
4927
4928    if (!eqn_ref) {
4929        _exception = 1;
4930        _exceptionType = "java/lang/IllegalArgumentException";
4931        _exceptionMessage = "eqn == null";
4932        goto exit;
4933    }
4934    if (offset < 0) {
4935        _exception = 1;
4936        _exceptionType = "java/lang/IllegalArgumentException";
4937        _exceptionMessage = "offset < 0";
4938        goto exit;
4939    }
4940    _remaining = _env->GetArrayLength(eqn_ref) - offset;
4941    eqn_base = (GLfloat *)
4942        _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
4943    eqn = eqn_base + offset;
4944
4945    glGetClipPlanef(
4946        (GLenum)pname,
4947        (GLfloat *)eqn
4948    );
4949
4950exit:
4951    if (eqn_base) {
4952        _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
4953            _exception ? JNI_ABORT: 0);
4954    }
4955    if (_exception) {
4956        jniThrowException(_env, _exceptionType, _exceptionMessage);
4957    }
4958}
4959
4960/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4961static void
4962android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4963  (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
4964    jint _exception = 0;
4965    const char * _exceptionType = NULL;
4966    const char * _exceptionMessage = NULL;
4967    jfloatArray _array = (jfloatArray) 0;
4968    jint _bufferOffset = (jint) 0;
4969    jint _remaining;
4970    GLfloat *eqn = (GLfloat *) 0;
4971
4972    if (!eqn_buf) {
4973        _exception = 1;
4974        _exceptionType = "java/lang/IllegalArgumentException";
4975        _exceptionMessage = "eqn == null";
4976        goto exit;
4977    }
4978    eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
4979    if (eqn == NULL) {
4980        char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
4981        eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4982    }
4983    glGetClipPlanef(
4984        (GLenum)pname,
4985        (GLfloat *)eqn
4986    );
4987
4988exit:
4989    if (_array) {
4990        _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0);
4991    }
4992    if (_exception) {
4993        jniThrowException(_env, _exceptionType, _exceptionMessage);
4994    }
4995}
4996
4997/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4998static void
4999android_glGetClipPlanex__I_3II
5000  (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
5001    jint _exception = 0;
5002    const char * _exceptionType = NULL;
5003    const char * _exceptionMessage = NULL;
5004    GLfixed *eqn_base = (GLfixed *) 0;
5005    jint _remaining;
5006    GLfixed *eqn = (GLfixed *) 0;
5007
5008    if (!eqn_ref) {
5009        _exception = 1;
5010        _exceptionType = "java/lang/IllegalArgumentException";
5011        _exceptionMessage = "eqn == null";
5012        goto exit;
5013    }
5014    if (offset < 0) {
5015        _exception = 1;
5016        _exceptionType = "java/lang/IllegalArgumentException";
5017        _exceptionMessage = "offset < 0";
5018        goto exit;
5019    }
5020    _remaining = _env->GetArrayLength(eqn_ref) - offset;
5021    eqn_base = (GLfixed *)
5022        _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
5023    eqn = eqn_base + offset;
5024
5025    glGetClipPlanex(
5026        (GLenum)pname,
5027        (GLfixed *)eqn
5028    );
5029
5030exit:
5031    if (eqn_base) {
5032        _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
5033            _exception ? JNI_ABORT: 0);
5034    }
5035    if (_exception) {
5036        jniThrowException(_env, _exceptionType, _exceptionMessage);
5037    }
5038}
5039
5040/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
5041static void
5042android_glGetClipPlanex__ILjava_nio_IntBuffer_2
5043  (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
5044    jint _exception = 0;
5045    const char * _exceptionType = NULL;
5046    const char * _exceptionMessage = NULL;
5047    jintArray _array = (jintArray) 0;
5048    jint _bufferOffset = (jint) 0;
5049    jint _remaining;
5050    GLfixed *eqn = (GLfixed *) 0;
5051
5052    if (!eqn_buf) {
5053        _exception = 1;
5054        _exceptionType = "java/lang/IllegalArgumentException";
5055        _exceptionMessage = "eqn == null";
5056        goto exit;
5057    }
5058    eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5059    if (eqn == NULL) {
5060        char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
5061        eqn = (GLfixed *) (_eqnBase + _bufferOffset);
5062    }
5063    glGetClipPlanex(
5064        (GLenum)pname,
5065        (GLfixed *)eqn
5066    );
5067
5068exit:
5069    if (_array) {
5070        _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0);
5071    }
5072    if (_exception) {
5073        jniThrowException(_env, _exceptionType, _exceptionMessage);
5074    }
5075}
5076
5077/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5078static void
5079android_glGetFixedv__I_3II
5080  (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
5081    jint _exception = 0;
5082    const char * _exceptionType = NULL;
5083    const char * _exceptionMessage = NULL;
5084    GLfixed *params_base = (GLfixed *) 0;
5085    jint _remaining;
5086    GLfixed *params = (GLfixed *) 0;
5087
5088    if (!params_ref) {
5089        _exception = 1;
5090        _exceptionType = "java/lang/IllegalArgumentException";
5091        _exceptionMessage = "params == null";
5092        goto exit;
5093    }
5094    if (offset < 0) {
5095        _exception = 1;
5096        _exceptionType = "java/lang/IllegalArgumentException";
5097        _exceptionMessage = "offset < 0";
5098        goto exit;
5099    }
5100    _remaining = _env->GetArrayLength(params_ref) - offset;
5101    params_base = (GLfixed *)
5102        _env->GetIntArrayElements(params_ref, (jboolean *)0);
5103    params = params_base + offset;
5104
5105    glGetFixedv(
5106        (GLenum)pname,
5107        (GLfixed *)params
5108    );
5109
5110exit:
5111    if (params_base) {
5112        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
5113            _exception ? JNI_ABORT: 0);
5114    }
5115    if (_exception) {
5116        jniThrowException(_env, _exceptionType, _exceptionMessage);
5117    }
5118}
5119
5120/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5121static void
5122android_glGetFixedv__ILjava_nio_IntBuffer_2
5123  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
5124    jint _exception = 0;
5125    const char * _exceptionType = NULL;
5126    const char * _exceptionMessage = NULL;
5127    jintArray _array = (jintArray) 0;
5128    jint _bufferOffset = (jint) 0;
5129    jint _remaining;
5130    GLfixed *params = (GLfixed *) 0;
5131
5132    if (!params_buf) {
5133        _exception = 1;
5134        _exceptionType = "java/lang/IllegalArgumentException";
5135        _exceptionMessage = "params == null";
5136        goto exit;
5137    }
5138    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5139    if (params == NULL) {
5140        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
5141        params = (GLfixed *) (_paramsBase + _bufferOffset);
5142    }
5143    glGetFixedv(
5144        (GLenum)pname,
5145        (GLfixed *)params
5146    );
5147
5148exit:
5149    if (_array) {
5150        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5151    }
5152    if (_exception) {
5153        jniThrowException(_env, _exceptionType, _exceptionMessage);
5154    }
5155}
5156
5157/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5158static void
5159android_glGetFloatv__I_3FI
5160  (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
5161    jint _exception = 0;
5162    const char * _exceptionType = NULL;
5163    const char * _exceptionMessage = NULL;
5164    GLfloat *params_base = (GLfloat *) 0;
5165    jint _remaining;
5166    GLfloat *params = (GLfloat *) 0;
5167
5168    if (!params_ref) {
5169        _exception = 1;
5170        _exceptionType = "java/lang/IllegalArgumentException";
5171        _exceptionMessage = "params == null";
5172        goto exit;
5173    }
5174    if (offset < 0) {
5175        _exception = 1;
5176        _exceptionType = "java/lang/IllegalArgumentException";
5177        _exceptionMessage = "offset < 0";
5178        goto exit;
5179    }
5180    _remaining = _env->GetArrayLength(params_ref) - offset;
5181    params_base = (GLfloat *)
5182        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
5183    params = params_base + offset;
5184
5185    glGetFloatv(
5186        (GLenum)pname,
5187        (GLfloat *)params
5188    );
5189
5190exit:
5191    if (params_base) {
5192        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
5193            _exception ? JNI_ABORT: 0);
5194    }
5195    if (_exception) {
5196        jniThrowException(_env, _exceptionType, _exceptionMessage);
5197    }
5198}
5199
5200/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5201static void
5202android_glGetFloatv__ILjava_nio_FloatBuffer_2
5203  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
5204    jint _exception = 0;
5205    const char * _exceptionType = NULL;
5206    const char * _exceptionMessage = NULL;
5207    jfloatArray _array = (jfloatArray) 0;
5208    jint _bufferOffset = (jint) 0;
5209    jint _remaining;
5210    GLfloat *params = (GLfloat *) 0;
5211
5212    if (!params_buf) {
5213        _exception = 1;
5214        _exceptionType = "java/lang/IllegalArgumentException";
5215        _exceptionMessage = "params == null";
5216        goto exit;
5217    }
5218    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5219    if (params == NULL) {
5220        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
5221        params = (GLfloat *) (_paramsBase + _bufferOffset);
5222    }
5223    glGetFloatv(
5224        (GLenum)pname,
5225        (GLfloat *)params
5226    );
5227
5228exit:
5229    if (_array) {
5230        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5231    }
5232    if (_exception) {
5233        jniThrowException(_env, _exceptionType, _exceptionMessage);
5234    }
5235}
5236
5237/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5238static void
5239android_glGetLightfv__II_3FI
5240  (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
5241    jint _exception = 0;
5242    const char * _exceptionType = NULL;
5243    const char * _exceptionMessage = NULL;
5244    GLfloat *params_base = (GLfloat *) 0;
5245    jint _remaining;
5246    GLfloat *params = (GLfloat *) 0;
5247
5248    if (!params_ref) {
5249        _exception = 1;
5250        _exceptionType = "java/lang/IllegalArgumentException";
5251        _exceptionMessage = "params == null";
5252        goto exit;
5253    }
5254    if (offset < 0) {
5255        _exception = 1;
5256        _exceptionType = "java/lang/IllegalArgumentException";
5257        _exceptionMessage = "offset < 0";
5258        goto exit;
5259    }
5260    _remaining = _env->GetArrayLength(params_ref) - offset;
5261    int _needed;
5262    switch (pname) {
5263#if defined(GL_SPOT_EXPONENT)
5264        case GL_SPOT_EXPONENT:
5265#endif // defined(GL_SPOT_EXPONENT)
5266#if defined(GL_SPOT_CUTOFF)
5267        case GL_SPOT_CUTOFF:
5268#endif // defined(GL_SPOT_CUTOFF)
5269#if defined(GL_CONSTANT_ATTENUATION)
5270        case GL_CONSTANT_ATTENUATION:
5271#endif // defined(GL_CONSTANT_ATTENUATION)
5272#if defined(GL_LINEAR_ATTENUATION)
5273        case GL_LINEAR_ATTENUATION:
5274#endif // defined(GL_LINEAR_ATTENUATION)
5275#if defined(GL_QUADRATIC_ATTENUATION)
5276        case GL_QUADRATIC_ATTENUATION:
5277#endif // defined(GL_QUADRATIC_ATTENUATION)
5278            _needed = 1;
5279            break;
5280#if defined(GL_SPOT_DIRECTION)
5281        case GL_SPOT_DIRECTION:
5282#endif // defined(GL_SPOT_DIRECTION)
5283            _needed = 3;
5284            break;
5285#if defined(GL_AMBIENT)
5286        case GL_AMBIENT:
5287#endif // defined(GL_AMBIENT)
5288#if defined(GL_DIFFUSE)
5289        case GL_DIFFUSE:
5290#endif // defined(GL_DIFFUSE)
5291#if defined(GL_SPECULAR)
5292        case GL_SPECULAR:
5293#endif // defined(GL_SPECULAR)
5294#if defined(GL_EMISSION)
5295        case GL_EMISSION:
5296#endif // defined(GL_EMISSION)
5297            _needed = 4;
5298            break;
5299        default:
5300            _needed = 1;
5301            break;
5302    }
5303    if (_remaining < _needed) {
5304        _exception = 1;
5305        _exceptionType = "java/lang/IllegalArgumentException";
5306        _exceptionMessage = "length - offset < needed";
5307        goto exit;
5308    }
5309    params_base = (GLfloat *)
5310        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
5311    params = params_base + offset;
5312
5313    glGetLightfv(
5314        (GLenum)light,
5315        (GLenum)pname,
5316        (GLfloat *)params
5317    );
5318
5319exit:
5320    if (params_base) {
5321        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
5322            _exception ? JNI_ABORT: 0);
5323    }
5324    if (_exception) {
5325        jniThrowException(_env, _exceptionType, _exceptionMessage);
5326    }
5327}
5328
5329/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5330static void
5331android_glGetLightfv__IILjava_nio_FloatBuffer_2
5332  (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5333    jint _exception = 0;
5334    const char * _exceptionType = NULL;
5335    const char * _exceptionMessage = NULL;
5336    jfloatArray _array = (jfloatArray) 0;
5337    jint _bufferOffset = (jint) 0;
5338    jint _remaining;
5339    GLfloat *params = (GLfloat *) 0;
5340
5341    if (!params_buf) {
5342        _exception = 1;
5343        _exceptionType = "java/lang/IllegalArgumentException";
5344        _exceptionMessage = "params == null";
5345        goto exit;
5346    }
5347    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5348    int _needed;
5349    switch (pname) {
5350#if defined(GL_SPOT_EXPONENT)
5351        case GL_SPOT_EXPONENT:
5352#endif // defined(GL_SPOT_EXPONENT)
5353#if defined(GL_SPOT_CUTOFF)
5354        case GL_SPOT_CUTOFF:
5355#endif // defined(GL_SPOT_CUTOFF)
5356#if defined(GL_CONSTANT_ATTENUATION)
5357        case GL_CONSTANT_ATTENUATION:
5358#endif // defined(GL_CONSTANT_ATTENUATION)
5359#if defined(GL_LINEAR_ATTENUATION)
5360        case GL_LINEAR_ATTENUATION:
5361#endif // defined(GL_LINEAR_ATTENUATION)
5362#if defined(GL_QUADRATIC_ATTENUATION)
5363        case GL_QUADRATIC_ATTENUATION:
5364#endif // defined(GL_QUADRATIC_ATTENUATION)
5365            _needed = 1;
5366            break;
5367#if defined(GL_SPOT_DIRECTION)
5368        case GL_SPOT_DIRECTION:
5369#endif // defined(GL_SPOT_DIRECTION)
5370            _needed = 3;
5371            break;
5372#if defined(GL_AMBIENT)
5373        case GL_AMBIENT:
5374#endif // defined(GL_AMBIENT)
5375#if defined(GL_DIFFUSE)
5376        case GL_DIFFUSE:
5377#endif // defined(GL_DIFFUSE)
5378#if defined(GL_SPECULAR)
5379        case GL_SPECULAR:
5380#endif // defined(GL_SPECULAR)
5381#if defined(GL_EMISSION)
5382        case GL_EMISSION:
5383#endif // defined(GL_EMISSION)
5384            _needed = 4;
5385            break;
5386        default:
5387            _needed = 1;
5388            break;
5389    }
5390    if (_remaining < _needed) {
5391        _exception = 1;
5392        _exceptionType = "java/lang/IllegalArgumentException";
5393        _exceptionMessage = "remaining() < needed";
5394        goto exit;
5395    }
5396    if (params == NULL) {
5397        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
5398        params = (GLfloat *) (_paramsBase + _bufferOffset);
5399    }
5400    glGetLightfv(
5401        (GLenum)light,
5402        (GLenum)pname,
5403        (GLfloat *)params
5404    );
5405
5406exit:
5407    if (_array) {
5408        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5409    }
5410    if (_exception) {
5411        jniThrowException(_env, _exceptionType, _exceptionMessage);
5412    }
5413}
5414
5415/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5416static void
5417android_glGetLightxv__II_3II
5418  (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5419    jint _exception = 0;
5420    const char * _exceptionType = NULL;
5421    const char * _exceptionMessage = NULL;
5422    GLfixed *params_base = (GLfixed *) 0;
5423    jint _remaining;
5424    GLfixed *params = (GLfixed *) 0;
5425
5426    if (!params_ref) {
5427        _exception = 1;
5428        _exceptionType = "java/lang/IllegalArgumentException";
5429        _exceptionMessage = "params == null";
5430        goto exit;
5431    }
5432    if (offset < 0) {
5433        _exception = 1;
5434        _exceptionType = "java/lang/IllegalArgumentException";
5435        _exceptionMessage = "offset < 0";
5436        goto exit;
5437    }
5438    _remaining = _env->GetArrayLength(params_ref) - offset;
5439    int _needed;
5440    switch (pname) {
5441#if defined(GL_SPOT_EXPONENT)
5442        case GL_SPOT_EXPONENT:
5443#endif // defined(GL_SPOT_EXPONENT)
5444#if defined(GL_SPOT_CUTOFF)
5445        case GL_SPOT_CUTOFF:
5446#endif // defined(GL_SPOT_CUTOFF)
5447#if defined(GL_CONSTANT_ATTENUATION)
5448        case GL_CONSTANT_ATTENUATION:
5449#endif // defined(GL_CONSTANT_ATTENUATION)
5450#if defined(GL_LINEAR_ATTENUATION)
5451        case GL_LINEAR_ATTENUATION:
5452#endif // defined(GL_LINEAR_ATTENUATION)
5453#if defined(GL_QUADRATIC_ATTENUATION)
5454        case GL_QUADRATIC_ATTENUATION:
5455#endif // defined(GL_QUADRATIC_ATTENUATION)
5456            _needed = 1;
5457            break;
5458#if defined(GL_SPOT_DIRECTION)
5459        case GL_SPOT_DIRECTION:
5460#endif // defined(GL_SPOT_DIRECTION)
5461            _needed = 3;
5462            break;
5463#if defined(GL_AMBIENT)
5464        case GL_AMBIENT:
5465#endif // defined(GL_AMBIENT)
5466#if defined(GL_DIFFUSE)
5467        case GL_DIFFUSE:
5468#endif // defined(GL_DIFFUSE)
5469#if defined(GL_SPECULAR)
5470        case GL_SPECULAR:
5471#endif // defined(GL_SPECULAR)
5472#if defined(GL_EMISSION)
5473        case GL_EMISSION:
5474#endif // defined(GL_EMISSION)
5475            _needed = 4;
5476            break;
5477        default:
5478            _needed = 1;
5479            break;
5480    }
5481    if (_remaining < _needed) {
5482        _exception = 1;
5483        _exceptionType = "java/lang/IllegalArgumentException";
5484        _exceptionMessage = "length - offset < needed";
5485        goto exit;
5486    }
5487    params_base = (GLfixed *)
5488        _env->GetIntArrayElements(params_ref, (jboolean *)0);
5489    params = params_base + offset;
5490
5491    glGetLightxv(
5492        (GLenum)light,
5493        (GLenum)pname,
5494        (GLfixed *)params
5495    );
5496
5497exit:
5498    if (params_base) {
5499        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
5500            _exception ? JNI_ABORT: 0);
5501    }
5502    if (_exception) {
5503        jniThrowException(_env, _exceptionType, _exceptionMessage);
5504    }
5505}
5506
5507/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5508static void
5509android_glGetLightxv__IILjava_nio_IntBuffer_2
5510  (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5511    jint _exception = 0;
5512    const char * _exceptionType = NULL;
5513    const char * _exceptionMessage = NULL;
5514    jintArray _array = (jintArray) 0;
5515    jint _bufferOffset = (jint) 0;
5516    jint _remaining;
5517    GLfixed *params = (GLfixed *) 0;
5518
5519    if (!params_buf) {
5520        _exception = 1;
5521        _exceptionType = "java/lang/IllegalArgumentException";
5522        _exceptionMessage = "params == null";
5523        goto exit;
5524    }
5525    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5526    int _needed;
5527    switch (pname) {
5528#if defined(GL_SPOT_EXPONENT)
5529        case GL_SPOT_EXPONENT:
5530#endif // defined(GL_SPOT_EXPONENT)
5531#if defined(GL_SPOT_CUTOFF)
5532        case GL_SPOT_CUTOFF:
5533#endif // defined(GL_SPOT_CUTOFF)
5534#if defined(GL_CONSTANT_ATTENUATION)
5535        case GL_CONSTANT_ATTENUATION:
5536#endif // defined(GL_CONSTANT_ATTENUATION)
5537#if defined(GL_LINEAR_ATTENUATION)
5538        case GL_LINEAR_ATTENUATION:
5539#endif // defined(GL_LINEAR_ATTENUATION)
5540#if defined(GL_QUADRATIC_ATTENUATION)
5541        case GL_QUADRATIC_ATTENUATION:
5542#endif // defined(GL_QUADRATIC_ATTENUATION)
5543            _needed = 1;
5544            break;
5545#if defined(GL_SPOT_DIRECTION)
5546        case GL_SPOT_DIRECTION:
5547#endif // defined(GL_SPOT_DIRECTION)
5548            _needed = 3;
5549            break;
5550#if defined(GL_AMBIENT)
5551        case GL_AMBIENT:
5552#endif // defined(GL_AMBIENT)
5553#if defined(GL_DIFFUSE)
5554        case GL_DIFFUSE:
5555#endif // defined(GL_DIFFUSE)
5556#if defined(GL_SPECULAR)
5557        case GL_SPECULAR:
5558#endif // defined(GL_SPECULAR)
5559#if defined(GL_EMISSION)
5560        case GL_EMISSION:
5561#endif // defined(GL_EMISSION)
5562            _needed = 4;
5563            break;
5564        default:
5565            _needed = 1;
5566            break;
5567    }
5568    if (_remaining < _needed) {
5569        _exception = 1;
5570        _exceptionType = "java/lang/IllegalArgumentException";
5571        _exceptionMessage = "remaining() < needed";
5572        goto exit;
5573    }
5574    if (params == NULL) {
5575        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
5576        params = (GLfixed *) (_paramsBase + _bufferOffset);
5577    }
5578    glGetLightxv(
5579        (GLenum)light,
5580        (GLenum)pname,
5581        (GLfixed *)params
5582    );
5583
5584exit:
5585    if (_array) {
5586        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5587    }
5588    if (_exception) {
5589        jniThrowException(_env, _exceptionType, _exceptionMessage);
5590    }
5591}
5592
5593/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5594static void
5595android_glGetMaterialfv__II_3FI
5596  (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5597    jint _exception = 0;
5598    const char * _exceptionType = NULL;
5599    const char * _exceptionMessage = NULL;
5600    GLfloat *params_base = (GLfloat *) 0;
5601    jint _remaining;
5602    GLfloat *params = (GLfloat *) 0;
5603
5604    if (!params_ref) {
5605        _exception = 1;
5606        _exceptionType = "java/lang/IllegalArgumentException";
5607        _exceptionMessage = "params == null";
5608        goto exit;
5609    }
5610    if (offset < 0) {
5611        _exception = 1;
5612        _exceptionType = "java/lang/IllegalArgumentException";
5613        _exceptionMessage = "offset < 0";
5614        goto exit;
5615    }
5616    _remaining = _env->GetArrayLength(params_ref) - offset;
5617    int _needed;
5618    switch (pname) {
5619#if defined(GL_SHININESS)
5620        case GL_SHININESS:
5621#endif // defined(GL_SHININESS)
5622            _needed = 1;
5623            break;
5624#if defined(GL_AMBIENT)
5625        case GL_AMBIENT:
5626#endif // defined(GL_AMBIENT)
5627#if defined(GL_DIFFUSE)
5628        case GL_DIFFUSE:
5629#endif // defined(GL_DIFFUSE)
5630#if defined(GL_SPECULAR)
5631        case GL_SPECULAR:
5632#endif // defined(GL_SPECULAR)
5633#if defined(GL_EMISSION)
5634        case GL_EMISSION:
5635#endif // defined(GL_EMISSION)
5636#if defined(GL_AMBIENT_AND_DIFFUSE)
5637        case GL_AMBIENT_AND_DIFFUSE:
5638#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5639            _needed = 4;
5640            break;
5641        default:
5642            _needed = 1;
5643            break;
5644    }
5645    if (_remaining < _needed) {
5646        _exception = 1;
5647        _exceptionType = "java/lang/IllegalArgumentException";
5648        _exceptionMessage = "length - offset < needed";
5649        goto exit;
5650    }
5651    params_base = (GLfloat *)
5652        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
5653    params = params_base + offset;
5654
5655    glGetMaterialfv(
5656        (GLenum)face,
5657        (GLenum)pname,
5658        (GLfloat *)params
5659    );
5660
5661exit:
5662    if (params_base) {
5663        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
5664            _exception ? JNI_ABORT: 0);
5665    }
5666    if (_exception) {
5667        jniThrowException(_env, _exceptionType, _exceptionMessage);
5668    }
5669}
5670
5671/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5672static void
5673android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5674  (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5675    jint _exception = 0;
5676    const char * _exceptionType = NULL;
5677    const char * _exceptionMessage = NULL;
5678    jfloatArray _array = (jfloatArray) 0;
5679    jint _bufferOffset = (jint) 0;
5680    jint _remaining;
5681    GLfloat *params = (GLfloat *) 0;
5682
5683    if (!params_buf) {
5684        _exception = 1;
5685        _exceptionType = "java/lang/IllegalArgumentException";
5686        _exceptionMessage = "params == null";
5687        goto exit;
5688    }
5689    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5690    int _needed;
5691    switch (pname) {
5692#if defined(GL_SHININESS)
5693        case GL_SHININESS:
5694#endif // defined(GL_SHININESS)
5695            _needed = 1;
5696            break;
5697#if defined(GL_AMBIENT)
5698        case GL_AMBIENT:
5699#endif // defined(GL_AMBIENT)
5700#if defined(GL_DIFFUSE)
5701        case GL_DIFFUSE:
5702#endif // defined(GL_DIFFUSE)
5703#if defined(GL_SPECULAR)
5704        case GL_SPECULAR:
5705#endif // defined(GL_SPECULAR)
5706#if defined(GL_EMISSION)
5707        case GL_EMISSION:
5708#endif // defined(GL_EMISSION)
5709#if defined(GL_AMBIENT_AND_DIFFUSE)
5710        case GL_AMBIENT_AND_DIFFUSE:
5711#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5712            _needed = 4;
5713            break;
5714        default:
5715            _needed = 1;
5716            break;
5717    }
5718    if (_remaining < _needed) {
5719        _exception = 1;
5720        _exceptionType = "java/lang/IllegalArgumentException";
5721        _exceptionMessage = "remaining() < needed";
5722        goto exit;
5723    }
5724    if (params == NULL) {
5725        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
5726        params = (GLfloat *) (_paramsBase + _bufferOffset);
5727    }
5728    glGetMaterialfv(
5729        (GLenum)face,
5730        (GLenum)pname,
5731        (GLfloat *)params
5732    );
5733
5734exit:
5735    if (_array) {
5736        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5737    }
5738    if (_exception) {
5739        jniThrowException(_env, _exceptionType, _exceptionMessage);
5740    }
5741}
5742
5743/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5744static void
5745android_glGetMaterialxv__II_3II
5746  (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5747    jint _exception = 0;
5748    const char * _exceptionType = NULL;
5749    const char * _exceptionMessage = NULL;
5750    GLfixed *params_base = (GLfixed *) 0;
5751    jint _remaining;
5752    GLfixed *params = (GLfixed *) 0;
5753
5754    if (!params_ref) {
5755        _exception = 1;
5756        _exceptionType = "java/lang/IllegalArgumentException";
5757        _exceptionMessage = "params == null";
5758        goto exit;
5759    }
5760    if (offset < 0) {
5761        _exception = 1;
5762        _exceptionType = "java/lang/IllegalArgumentException";
5763        _exceptionMessage = "offset < 0";
5764        goto exit;
5765    }
5766    _remaining = _env->GetArrayLength(params_ref) - offset;
5767    int _needed;
5768    switch (pname) {
5769#if defined(GL_SHININESS)
5770        case GL_SHININESS:
5771#endif // defined(GL_SHININESS)
5772            _needed = 1;
5773            break;
5774#if defined(GL_AMBIENT)
5775        case GL_AMBIENT:
5776#endif // defined(GL_AMBIENT)
5777#if defined(GL_DIFFUSE)
5778        case GL_DIFFUSE:
5779#endif // defined(GL_DIFFUSE)
5780#if defined(GL_SPECULAR)
5781        case GL_SPECULAR:
5782#endif // defined(GL_SPECULAR)
5783#if defined(GL_EMISSION)
5784        case GL_EMISSION:
5785#endif // defined(GL_EMISSION)
5786#if defined(GL_AMBIENT_AND_DIFFUSE)
5787        case GL_AMBIENT_AND_DIFFUSE:
5788#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5789            _needed = 4;
5790            break;
5791        default:
5792            _needed = 1;
5793            break;
5794    }
5795    if (_remaining < _needed) {
5796        _exception = 1;
5797        _exceptionType = "java/lang/IllegalArgumentException";
5798        _exceptionMessage = "length - offset < needed";
5799        goto exit;
5800    }
5801    params_base = (GLfixed *)
5802        _env->GetIntArrayElements(params_ref, (jboolean *)0);
5803    params = params_base + offset;
5804
5805    glGetMaterialxv(
5806        (GLenum)face,
5807        (GLenum)pname,
5808        (GLfixed *)params
5809    );
5810
5811exit:
5812    if (params_base) {
5813        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
5814            _exception ? JNI_ABORT: 0);
5815    }
5816    if (_exception) {
5817        jniThrowException(_env, _exceptionType, _exceptionMessage);
5818    }
5819}
5820
5821/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5822static void
5823android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5824  (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5825    jint _exception = 0;
5826    const char * _exceptionType = NULL;
5827    const char * _exceptionMessage = NULL;
5828    jintArray _array = (jintArray) 0;
5829    jint _bufferOffset = (jint) 0;
5830    jint _remaining;
5831    GLfixed *params = (GLfixed *) 0;
5832
5833    if (!params_buf) {
5834        _exception = 1;
5835        _exceptionType = "java/lang/IllegalArgumentException";
5836        _exceptionMessage = "params == null";
5837        goto exit;
5838    }
5839    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5840    int _needed;
5841    switch (pname) {
5842#if defined(GL_SHININESS)
5843        case GL_SHININESS:
5844#endif // defined(GL_SHININESS)
5845            _needed = 1;
5846            break;
5847#if defined(GL_AMBIENT)
5848        case GL_AMBIENT:
5849#endif // defined(GL_AMBIENT)
5850#if defined(GL_DIFFUSE)
5851        case GL_DIFFUSE:
5852#endif // defined(GL_DIFFUSE)
5853#if defined(GL_SPECULAR)
5854        case GL_SPECULAR:
5855#endif // defined(GL_SPECULAR)
5856#if defined(GL_EMISSION)
5857        case GL_EMISSION:
5858#endif // defined(GL_EMISSION)
5859#if defined(GL_AMBIENT_AND_DIFFUSE)
5860        case GL_AMBIENT_AND_DIFFUSE:
5861#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5862            _needed = 4;
5863            break;
5864        default:
5865            _needed = 1;
5866            break;
5867    }
5868    if (_remaining < _needed) {
5869        _exception = 1;
5870        _exceptionType = "java/lang/IllegalArgumentException";
5871        _exceptionMessage = "remaining() < needed";
5872        goto exit;
5873    }
5874    if (params == NULL) {
5875        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
5876        params = (GLfixed *) (_paramsBase + _bufferOffset);
5877    }
5878    glGetMaterialxv(
5879        (GLenum)face,
5880        (GLenum)pname,
5881        (GLfixed *)params
5882    );
5883
5884exit:
5885    if (_array) {
5886        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5887    }
5888    if (_exception) {
5889        jniThrowException(_env, _exceptionType, _exceptionMessage);
5890    }
5891}
5892
5893/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5894static void
5895android_glGetTexEnviv__II_3II
5896  (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5897    jint _exception = 0;
5898    const char * _exceptionType = NULL;
5899    const char * _exceptionMessage = NULL;
5900    GLint *params_base = (GLint *) 0;
5901    jint _remaining;
5902    GLint *params = (GLint *) 0;
5903
5904    if (!params_ref) {
5905        _exception = 1;
5906        _exceptionType = "java/lang/IllegalArgumentException";
5907        _exceptionMessage = "params == null";
5908        goto exit;
5909    }
5910    if (offset < 0) {
5911        _exception = 1;
5912        _exceptionType = "java/lang/IllegalArgumentException";
5913        _exceptionMessage = "offset < 0";
5914        goto exit;
5915    }
5916    _remaining = _env->GetArrayLength(params_ref) - offset;
5917    int _needed;
5918    switch (pname) {
5919#if defined(GL_TEXTURE_ENV_MODE)
5920        case GL_TEXTURE_ENV_MODE:
5921#endif // defined(GL_TEXTURE_ENV_MODE)
5922#if defined(GL_COMBINE_RGB)
5923        case GL_COMBINE_RGB:
5924#endif // defined(GL_COMBINE_RGB)
5925#if defined(GL_COMBINE_ALPHA)
5926        case GL_COMBINE_ALPHA:
5927#endif // defined(GL_COMBINE_ALPHA)
5928            _needed = 1;
5929            break;
5930#if defined(GL_TEXTURE_ENV_COLOR)
5931        case GL_TEXTURE_ENV_COLOR:
5932#endif // defined(GL_TEXTURE_ENV_COLOR)
5933            _needed = 4;
5934            break;
5935        default:
5936            _needed = 1;
5937            break;
5938    }
5939    if (_remaining < _needed) {
5940        _exception = 1;
5941        _exceptionType = "java/lang/IllegalArgumentException";
5942        _exceptionMessage = "length - offset < needed";
5943        goto exit;
5944    }
5945    params_base = (GLint *)
5946        _env->GetIntArrayElements(params_ref, (jboolean *)0);
5947    params = params_base + offset;
5948
5949    glGetTexEnviv(
5950        (GLenum)env,
5951        (GLenum)pname,
5952        (GLint *)params
5953    );
5954
5955exit:
5956    if (params_base) {
5957        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
5958            _exception ? JNI_ABORT: 0);
5959    }
5960    if (_exception) {
5961        jniThrowException(_env, _exceptionType, _exceptionMessage);
5962    }
5963}
5964
5965/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5966static void
5967android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5968  (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5969    jint _exception = 0;
5970    const char * _exceptionType = NULL;
5971    const char * _exceptionMessage = NULL;
5972    jintArray _array = (jintArray) 0;
5973    jint _bufferOffset = (jint) 0;
5974    jint _remaining;
5975    GLint *params = (GLint *) 0;
5976
5977    if (!params_buf) {
5978        _exception = 1;
5979        _exceptionType = "java/lang/IllegalArgumentException";
5980        _exceptionMessage = "params == null";
5981        goto exit;
5982    }
5983    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
5984    int _needed;
5985    switch (pname) {
5986#if defined(GL_TEXTURE_ENV_MODE)
5987        case GL_TEXTURE_ENV_MODE:
5988#endif // defined(GL_TEXTURE_ENV_MODE)
5989#if defined(GL_COMBINE_RGB)
5990        case GL_COMBINE_RGB:
5991#endif // defined(GL_COMBINE_RGB)
5992#if defined(GL_COMBINE_ALPHA)
5993        case GL_COMBINE_ALPHA:
5994#endif // defined(GL_COMBINE_ALPHA)
5995            _needed = 1;
5996            break;
5997#if defined(GL_TEXTURE_ENV_COLOR)
5998        case GL_TEXTURE_ENV_COLOR:
5999#endif // defined(GL_TEXTURE_ENV_COLOR)
6000            _needed = 4;
6001            break;
6002        default:
6003            _needed = 1;
6004            break;
6005    }
6006    if (_remaining < _needed) {
6007        _exception = 1;
6008        _exceptionType = "java/lang/IllegalArgumentException";
6009        _exceptionMessage = "remaining() < needed";
6010        goto exit;
6011    }
6012    if (params == NULL) {
6013        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6014        params = (GLint *) (_paramsBase + _bufferOffset);
6015    }
6016    glGetTexEnviv(
6017        (GLenum)env,
6018        (GLenum)pname,
6019        (GLint *)params
6020    );
6021
6022exit:
6023    if (_array) {
6024        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
6025    }
6026    if (_exception) {
6027        jniThrowException(_env, _exceptionType, _exceptionMessage);
6028    }
6029}
6030
6031/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6032static void
6033android_glGetTexEnvxv__II_3II
6034  (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
6035    jint _exception = 0;
6036    const char * _exceptionType = NULL;
6037    const char * _exceptionMessage = NULL;
6038    GLfixed *params_base = (GLfixed *) 0;
6039    jint _remaining;
6040    GLfixed *params = (GLfixed *) 0;
6041
6042    if (!params_ref) {
6043        _exception = 1;
6044        _exceptionType = "java/lang/IllegalArgumentException";
6045        _exceptionMessage = "params == null";
6046        goto exit;
6047    }
6048    if (offset < 0) {
6049        _exception = 1;
6050        _exceptionType = "java/lang/IllegalArgumentException";
6051        _exceptionMessage = "offset < 0";
6052        goto exit;
6053    }
6054    _remaining = _env->GetArrayLength(params_ref) - offset;
6055    int _needed;
6056    switch (pname) {
6057#if defined(GL_TEXTURE_ENV_MODE)
6058        case GL_TEXTURE_ENV_MODE:
6059#endif // defined(GL_TEXTURE_ENV_MODE)
6060#if defined(GL_COMBINE_RGB)
6061        case GL_COMBINE_RGB:
6062#endif // defined(GL_COMBINE_RGB)
6063#if defined(GL_COMBINE_ALPHA)
6064        case GL_COMBINE_ALPHA:
6065#endif // defined(GL_COMBINE_ALPHA)
6066            _needed = 1;
6067            break;
6068#if defined(GL_TEXTURE_ENV_COLOR)
6069        case GL_TEXTURE_ENV_COLOR:
6070#endif // defined(GL_TEXTURE_ENV_COLOR)
6071            _needed = 4;
6072            break;
6073        default:
6074            _needed = 1;
6075            break;
6076    }
6077    if (_remaining < _needed) {
6078        _exception = 1;
6079        _exceptionType = "java/lang/IllegalArgumentException";
6080        _exceptionMessage = "length - offset < needed";
6081        goto exit;
6082    }
6083    params_base = (GLfixed *)
6084        _env->GetIntArrayElements(params_ref, (jboolean *)0);
6085    params = params_base + offset;
6086
6087    glGetTexEnvxv(
6088        (GLenum)env,
6089        (GLenum)pname,
6090        (GLfixed *)params
6091    );
6092
6093exit:
6094    if (params_base) {
6095        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
6096            _exception ? JNI_ABORT: 0);
6097    }
6098    if (_exception) {
6099        jniThrowException(_env, _exceptionType, _exceptionMessage);
6100    }
6101}
6102
6103/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6104static void
6105android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
6106  (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
6107    jint _exception = 0;
6108    const char * _exceptionType = NULL;
6109    const char * _exceptionMessage = NULL;
6110    jintArray _array = (jintArray) 0;
6111    jint _bufferOffset = (jint) 0;
6112    jint _remaining;
6113    GLfixed *params = (GLfixed *) 0;
6114
6115    if (!params_buf) {
6116        _exception = 1;
6117        _exceptionType = "java/lang/IllegalArgumentException";
6118        _exceptionMessage = "params == null";
6119        goto exit;
6120    }
6121    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6122    int _needed;
6123    switch (pname) {
6124#if defined(GL_TEXTURE_ENV_MODE)
6125        case GL_TEXTURE_ENV_MODE:
6126#endif // defined(GL_TEXTURE_ENV_MODE)
6127#if defined(GL_COMBINE_RGB)
6128        case GL_COMBINE_RGB:
6129#endif // defined(GL_COMBINE_RGB)
6130#if defined(GL_COMBINE_ALPHA)
6131        case GL_COMBINE_ALPHA:
6132#endif // defined(GL_COMBINE_ALPHA)
6133            _needed = 1;
6134            break;
6135#if defined(GL_TEXTURE_ENV_COLOR)
6136        case GL_TEXTURE_ENV_COLOR:
6137#endif // defined(GL_TEXTURE_ENV_COLOR)
6138            _needed = 4;
6139            break;
6140        default:
6141            _needed = 1;
6142            break;
6143    }
6144    if (_remaining < _needed) {
6145        _exception = 1;
6146        _exceptionType = "java/lang/IllegalArgumentException";
6147        _exceptionMessage = "remaining() < needed";
6148        goto exit;
6149    }
6150    if (params == NULL) {
6151        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6152        params = (GLfixed *) (_paramsBase + _bufferOffset);
6153    }
6154    glGetTexEnvxv(
6155        (GLenum)env,
6156        (GLenum)pname,
6157        (GLfixed *)params
6158    );
6159
6160exit:
6161    if (_array) {
6162        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
6163    }
6164    if (_exception) {
6165        jniThrowException(_env, _exceptionType, _exceptionMessage);
6166    }
6167}
6168
6169/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6170static void
6171android_glGetTexParameterfv__II_3FI
6172  (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
6173    jint _exception = 0;
6174    const char * _exceptionType = NULL;
6175    const char * _exceptionMessage = NULL;
6176    GLfloat *params_base = (GLfloat *) 0;
6177    jint _remaining;
6178    GLfloat *params = (GLfloat *) 0;
6179
6180    if (!params_ref) {
6181        _exception = 1;
6182        _exceptionType = "java/lang/IllegalArgumentException";
6183        _exceptionMessage = "params == null";
6184        goto exit;
6185    }
6186    if (offset < 0) {
6187        _exception = 1;
6188        _exceptionType = "java/lang/IllegalArgumentException";
6189        _exceptionMessage = "offset < 0";
6190        goto exit;
6191    }
6192    _remaining = _env->GetArrayLength(params_ref) - offset;
6193    if (_remaining < 1) {
6194        _exception = 1;
6195        _exceptionType = "java/lang/IllegalArgumentException";
6196        _exceptionMessage = "length - offset < 1 < needed";
6197        goto exit;
6198    }
6199    params_base = (GLfloat *)
6200        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
6201    params = params_base + offset;
6202
6203    glGetTexParameterfv(
6204        (GLenum)target,
6205        (GLenum)pname,
6206        (GLfloat *)params
6207    );
6208
6209exit:
6210    if (params_base) {
6211        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
6212            _exception ? JNI_ABORT: 0);
6213    }
6214    if (_exception) {
6215        jniThrowException(_env, _exceptionType, _exceptionMessage);
6216    }
6217}
6218
6219/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6220static void
6221android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
6222  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6223    jint _exception = 0;
6224    const char * _exceptionType = NULL;
6225    const char * _exceptionMessage = NULL;
6226    jfloatArray _array = (jfloatArray) 0;
6227    jint _bufferOffset = (jint) 0;
6228    jint _remaining;
6229    GLfloat *params = (GLfloat *) 0;
6230
6231    if (!params_buf) {
6232        _exception = 1;
6233        _exceptionType = "java/lang/IllegalArgumentException";
6234        _exceptionMessage = "params == null";
6235        goto exit;
6236    }
6237    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6238    if (_remaining < 1) {
6239        _exception = 1;
6240        _exceptionType = "java/lang/IllegalArgumentException";
6241        _exceptionMessage = "remaining() < 1 < needed";
6242        goto exit;
6243    }
6244    if (params == NULL) {
6245        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
6246        params = (GLfloat *) (_paramsBase + _bufferOffset);
6247    }
6248    glGetTexParameterfv(
6249        (GLenum)target,
6250        (GLenum)pname,
6251        (GLfloat *)params
6252    );
6253
6254exit:
6255    if (_array) {
6256        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
6257    }
6258    if (_exception) {
6259        jniThrowException(_env, _exceptionType, _exceptionMessage);
6260    }
6261}
6262
6263/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6264static void
6265android_glGetTexParameteriv__II_3II
6266  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6267    jint _exception = 0;
6268    const char * _exceptionType = NULL;
6269    const char * _exceptionMessage = NULL;
6270    GLint *params_base = (GLint *) 0;
6271    jint _remaining;
6272    GLint *params = (GLint *) 0;
6273
6274    if (!params_ref) {
6275        _exception = 1;
6276        _exceptionType = "java/lang/IllegalArgumentException";
6277        _exceptionMessage = "params == null";
6278        goto exit;
6279    }
6280    if (offset < 0) {
6281        _exception = 1;
6282        _exceptionType = "java/lang/IllegalArgumentException";
6283        _exceptionMessage = "offset < 0";
6284        goto exit;
6285    }
6286    _remaining = _env->GetArrayLength(params_ref) - offset;
6287    if (_remaining < 1) {
6288        _exception = 1;
6289        _exceptionType = "java/lang/IllegalArgumentException";
6290        _exceptionMessage = "length - offset < 1 < needed";
6291        goto exit;
6292    }
6293    params_base = (GLint *)
6294        _env->GetIntArrayElements(params_ref, (jboolean *)0);
6295    params = params_base + offset;
6296
6297    glGetTexParameteriv(
6298        (GLenum)target,
6299        (GLenum)pname,
6300        (GLint *)params
6301    );
6302
6303exit:
6304    if (params_base) {
6305        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
6306            _exception ? JNI_ABORT: 0);
6307    }
6308    if (_exception) {
6309        jniThrowException(_env, _exceptionType, _exceptionMessage);
6310    }
6311}
6312
6313/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6314static void
6315android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
6316  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6317    jint _exception = 0;
6318    const char * _exceptionType = NULL;
6319    const char * _exceptionMessage = NULL;
6320    jintArray _array = (jintArray) 0;
6321    jint _bufferOffset = (jint) 0;
6322    jint _remaining;
6323    GLint *params = (GLint *) 0;
6324
6325    if (!params_buf) {
6326        _exception = 1;
6327        _exceptionType = "java/lang/IllegalArgumentException";
6328        _exceptionMessage = "params == null";
6329        goto exit;
6330    }
6331    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6332    if (_remaining < 1) {
6333        _exception = 1;
6334        _exceptionType = "java/lang/IllegalArgumentException";
6335        _exceptionMessage = "remaining() < 1 < needed";
6336        goto exit;
6337    }
6338    if (params == NULL) {
6339        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6340        params = (GLint *) (_paramsBase + _bufferOffset);
6341    }
6342    glGetTexParameteriv(
6343        (GLenum)target,
6344        (GLenum)pname,
6345        (GLint *)params
6346    );
6347
6348exit:
6349    if (_array) {
6350        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
6351    }
6352    if (_exception) {
6353        jniThrowException(_env, _exceptionType, _exceptionMessage);
6354    }
6355}
6356
6357/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6358static void
6359android_glGetTexParameterxv__II_3II
6360  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6361    jint _exception = 0;
6362    const char * _exceptionType = NULL;
6363    const char * _exceptionMessage = NULL;
6364    GLfixed *params_base = (GLfixed *) 0;
6365    jint _remaining;
6366    GLfixed *params = (GLfixed *) 0;
6367
6368    if (!params_ref) {
6369        _exception = 1;
6370        _exceptionType = "java/lang/IllegalArgumentException";
6371        _exceptionMessage = "params == null";
6372        goto exit;
6373    }
6374    if (offset < 0) {
6375        _exception = 1;
6376        _exceptionType = "java/lang/IllegalArgumentException";
6377        _exceptionMessage = "offset < 0";
6378        goto exit;
6379    }
6380    _remaining = _env->GetArrayLength(params_ref) - offset;
6381    if (_remaining < 1) {
6382        _exception = 1;
6383        _exceptionType = "java/lang/IllegalArgumentException";
6384        _exceptionMessage = "length - offset < 1 < needed";
6385        goto exit;
6386    }
6387    params_base = (GLfixed *)
6388        _env->GetIntArrayElements(params_ref, (jboolean *)0);
6389    params = params_base + offset;
6390
6391    glGetTexParameterxv(
6392        (GLenum)target,
6393        (GLenum)pname,
6394        (GLfixed *)params
6395    );
6396
6397exit:
6398    if (params_base) {
6399        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
6400            _exception ? JNI_ABORT: 0);
6401    }
6402    if (_exception) {
6403        jniThrowException(_env, _exceptionType, _exceptionMessage);
6404    }
6405}
6406
6407/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6408static void
6409android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6410  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6411    jint _exception = 0;
6412    const char * _exceptionType = NULL;
6413    const char * _exceptionMessage = NULL;
6414    jintArray _array = (jintArray) 0;
6415    jint _bufferOffset = (jint) 0;
6416    jint _remaining;
6417    GLfixed *params = (GLfixed *) 0;
6418
6419    if (!params_buf) {
6420        _exception = 1;
6421        _exceptionType = "java/lang/IllegalArgumentException";
6422        _exceptionMessage = "params == null";
6423        goto exit;
6424    }
6425    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6426    if (_remaining < 1) {
6427        _exception = 1;
6428        _exceptionType = "java/lang/IllegalArgumentException";
6429        _exceptionMessage = "remaining() < 1 < needed";
6430        goto exit;
6431    }
6432    if (params == NULL) {
6433        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6434        params = (GLfixed *) (_paramsBase + _bufferOffset);
6435    }
6436    glGetTexParameterxv(
6437        (GLenum)target,
6438        (GLenum)pname,
6439        (GLfixed *)params
6440    );
6441
6442exit:
6443    if (_array) {
6444        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
6445    }
6446    if (_exception) {
6447        jniThrowException(_env, _exceptionType, _exceptionMessage);
6448    }
6449}
6450
6451/* GLboolean glIsBuffer ( GLuint buffer ) */
6452static jboolean
6453android_glIsBuffer__I
6454  (JNIEnv *_env, jobject _this, jint buffer) {
6455    GLboolean _returnValue;
6456    _returnValue = glIsBuffer(
6457        (GLuint)buffer
6458    );
6459    return (jboolean)_returnValue;
6460}
6461
6462/* GLboolean glIsEnabled ( GLenum cap ) */
6463static jboolean
6464android_glIsEnabled__I
6465  (JNIEnv *_env, jobject _this, jint cap) {
6466    GLboolean _returnValue;
6467    _returnValue = glIsEnabled(
6468        (GLenum)cap
6469    );
6470    return (jboolean)_returnValue;
6471}
6472
6473/* GLboolean glIsTexture ( GLuint texture ) */
6474static jboolean
6475android_glIsTexture__I
6476  (JNIEnv *_env, jobject _this, jint texture) {
6477    GLboolean _returnValue;
6478    _returnValue = glIsTexture(
6479        (GLuint)texture
6480    );
6481    return (jboolean)_returnValue;
6482}
6483
6484/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6485static void
6486android_glNormalPointer__III
6487  (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6488    glNormalPointer(
6489        (GLenum)type,
6490        (GLsizei)stride,
6491        reinterpret_cast<GLvoid *>(offset)
6492    );
6493}
6494
6495/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6496static void
6497android_glPointParameterf__IF
6498  (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6499    glPointParameterf(
6500        (GLenum)pname,
6501        (GLfloat)param
6502    );
6503}
6504
6505/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6506static void
6507android_glPointParameterfv__I_3FI
6508  (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
6509    jint _exception = 0;
6510    const char * _exceptionType = NULL;
6511    const char * _exceptionMessage = NULL;
6512    GLfloat *params_base = (GLfloat *) 0;
6513    jint _remaining;
6514    GLfloat *params = (GLfloat *) 0;
6515
6516    if (!params_ref) {
6517        _exception = 1;
6518        _exceptionType = "java/lang/IllegalArgumentException";
6519        _exceptionMessage = "params == null";
6520        goto exit;
6521    }
6522    if (offset < 0) {
6523        _exception = 1;
6524        _exceptionType = "java/lang/IllegalArgumentException";
6525        _exceptionMessage = "offset < 0";
6526        goto exit;
6527    }
6528    _remaining = _env->GetArrayLength(params_ref) - offset;
6529    if (_remaining < 1) {
6530        _exception = 1;
6531        _exceptionType = "java/lang/IllegalArgumentException";
6532        _exceptionMessage = "length - offset < 1 < needed";
6533        goto exit;
6534    }
6535    params_base = (GLfloat *)
6536        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
6537    params = params_base + offset;
6538
6539    glPointParameterfv(
6540        (GLenum)pname,
6541        (GLfloat *)params
6542    );
6543
6544exit:
6545    if (params_base) {
6546        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
6547            JNI_ABORT);
6548    }
6549    if (_exception) {
6550        jniThrowException(_env, _exceptionType, _exceptionMessage);
6551    }
6552}
6553
6554/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6555static void
6556android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6557  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
6558    jint _exception = 0;
6559    const char * _exceptionType = NULL;
6560    const char * _exceptionMessage = NULL;
6561    jfloatArray _array = (jfloatArray) 0;
6562    jint _bufferOffset = (jint) 0;
6563    jint _remaining;
6564    GLfloat *params = (GLfloat *) 0;
6565
6566    if (!params_buf) {
6567        _exception = 1;
6568        _exceptionType = "java/lang/IllegalArgumentException";
6569        _exceptionMessage = "params == null";
6570        goto exit;
6571    }
6572    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6573    if (_remaining < 1) {
6574        _exception = 1;
6575        _exceptionType = "java/lang/IllegalArgumentException";
6576        _exceptionMessage = "remaining() < 1 < needed";
6577        goto exit;
6578    }
6579    if (params == NULL) {
6580        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
6581        params = (GLfloat *) (_paramsBase + _bufferOffset);
6582    }
6583    glPointParameterfv(
6584        (GLenum)pname,
6585        (GLfloat *)params
6586    );
6587
6588exit:
6589    if (_array) {
6590        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
6591    }
6592    if (_exception) {
6593        jniThrowException(_env, _exceptionType, _exceptionMessage);
6594    }
6595}
6596
6597/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6598static void
6599android_glPointParameterx__II
6600  (JNIEnv *_env, jobject _this, jint pname, jint param) {
6601    glPointParameterx(
6602        (GLenum)pname,
6603        (GLfixed)param
6604    );
6605}
6606
6607/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6608static void
6609android_glPointParameterxv__I_3II
6610  (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
6611    jint _exception = 0;
6612    const char * _exceptionType = NULL;
6613    const char * _exceptionMessage = NULL;
6614    GLfixed *params_base = (GLfixed *) 0;
6615    jint _remaining;
6616    GLfixed *params = (GLfixed *) 0;
6617
6618    if (!params_ref) {
6619        _exception = 1;
6620        _exceptionType = "java/lang/IllegalArgumentException";
6621        _exceptionMessage = "params == null";
6622        goto exit;
6623    }
6624    if (offset < 0) {
6625        _exception = 1;
6626        _exceptionType = "java/lang/IllegalArgumentException";
6627        _exceptionMessage = "offset < 0";
6628        goto exit;
6629    }
6630    _remaining = _env->GetArrayLength(params_ref) - offset;
6631    if (_remaining < 1) {
6632        _exception = 1;
6633        _exceptionType = "java/lang/IllegalArgumentException";
6634        _exceptionMessage = "length - offset < 1 < needed";
6635        goto exit;
6636    }
6637    params_base = (GLfixed *)
6638        _env->GetIntArrayElements(params_ref, (jboolean *)0);
6639    params = params_base + offset;
6640
6641    glPointParameterxv(
6642        (GLenum)pname,
6643        (GLfixed *)params
6644    );
6645
6646exit:
6647    if (params_base) {
6648        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
6649            JNI_ABORT);
6650    }
6651    if (_exception) {
6652        jniThrowException(_env, _exceptionType, _exceptionMessage);
6653    }
6654}
6655
6656/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6657static void
6658android_glPointParameterxv__ILjava_nio_IntBuffer_2
6659  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
6660    jint _exception = 0;
6661    const char * _exceptionType = NULL;
6662    const char * _exceptionMessage = NULL;
6663    jintArray _array = (jintArray) 0;
6664    jint _bufferOffset = (jint) 0;
6665    jint _remaining;
6666    GLfixed *params = (GLfixed *) 0;
6667
6668    if (!params_buf) {
6669        _exception = 1;
6670        _exceptionType = "java/lang/IllegalArgumentException";
6671        _exceptionMessage = "params == null";
6672        goto exit;
6673    }
6674    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6675    if (_remaining < 1) {
6676        _exception = 1;
6677        _exceptionType = "java/lang/IllegalArgumentException";
6678        _exceptionMessage = "remaining() < 1 < needed";
6679        goto exit;
6680    }
6681    if (params == NULL) {
6682        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6683        params = (GLfixed *) (_paramsBase + _bufferOffset);
6684    }
6685    glPointParameterxv(
6686        (GLenum)pname,
6687        (GLfixed *)params
6688    );
6689
6690exit:
6691    if (_array) {
6692        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
6693    }
6694    if (_exception) {
6695        jniThrowException(_env, _exceptionType, _exceptionMessage);
6696    }
6697}
6698
6699/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6700static void
6701android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6702  (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
6703    jint _exception = 0;
6704    const char * _exceptionType = NULL;
6705    const char * _exceptionMessage = NULL;
6706    jarray _array = (jarray) 0;
6707    jint _bufferOffset = (jint) 0;
6708    jint _remaining;
6709    GLvoid *pointer = (GLvoid *) 0;
6710
6711    if (pointer_buf) {
6712        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6713        if ( ! pointer ) {
6714            return;
6715        }
6716    }
6717    glPointSizePointerOESBounds(
6718        (GLenum)type,
6719        (GLsizei)stride,
6720        (GLvoid *)pointer,
6721        (GLsizei)remaining
6722    );
6723    if (_exception) {
6724        jniThrowException(_env, _exceptionType, _exceptionMessage);
6725    }
6726}
6727
6728/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6729static void
6730android_glTexCoordPointer__IIII
6731  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6732    glTexCoordPointer(
6733        (GLint)size,
6734        (GLenum)type,
6735        (GLsizei)stride,
6736        reinterpret_cast<GLvoid *>(offset)
6737    );
6738}
6739
6740/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6741static void
6742android_glTexEnvi__III
6743  (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6744    glTexEnvi(
6745        (GLenum)target,
6746        (GLenum)pname,
6747        (GLint)param
6748    );
6749}
6750
6751/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6752static void
6753android_glTexEnviv__II_3II
6754  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6755    jint _exception = 0;
6756    const char * _exceptionType = NULL;
6757    const char * _exceptionMessage = NULL;
6758    GLint *params_base = (GLint *) 0;
6759    jint _remaining;
6760    GLint *params = (GLint *) 0;
6761
6762    if (!params_ref) {
6763        _exception = 1;
6764        _exceptionType = "java/lang/IllegalArgumentException";
6765        _exceptionMessage = "params == null";
6766        goto exit;
6767    }
6768    if (offset < 0) {
6769        _exception = 1;
6770        _exceptionType = "java/lang/IllegalArgumentException";
6771        _exceptionMessage = "offset < 0";
6772        goto exit;
6773    }
6774    _remaining = _env->GetArrayLength(params_ref) - offset;
6775    int _needed;
6776    switch (pname) {
6777#if defined(GL_TEXTURE_ENV_MODE)
6778        case GL_TEXTURE_ENV_MODE:
6779#endif // defined(GL_TEXTURE_ENV_MODE)
6780#if defined(GL_COMBINE_RGB)
6781        case GL_COMBINE_RGB:
6782#endif // defined(GL_COMBINE_RGB)
6783#if defined(GL_COMBINE_ALPHA)
6784        case GL_COMBINE_ALPHA:
6785#endif // defined(GL_COMBINE_ALPHA)
6786            _needed = 1;
6787            break;
6788#if defined(GL_TEXTURE_ENV_COLOR)
6789        case GL_TEXTURE_ENV_COLOR:
6790#endif // defined(GL_TEXTURE_ENV_COLOR)
6791            _needed = 4;
6792            break;
6793        default:
6794            _needed = 1;
6795            break;
6796    }
6797    if (_remaining < _needed) {
6798        _exception = 1;
6799        _exceptionType = "java/lang/IllegalArgumentException";
6800        _exceptionMessage = "length - offset < needed";
6801        goto exit;
6802    }
6803    params_base = (GLint *)
6804        _env->GetIntArrayElements(params_ref, (jboolean *)0);
6805    params = params_base + offset;
6806
6807    glTexEnviv(
6808        (GLenum)target,
6809        (GLenum)pname,
6810        (GLint *)params
6811    );
6812
6813exit:
6814    if (params_base) {
6815        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
6816            JNI_ABORT);
6817    }
6818    if (_exception) {
6819        jniThrowException(_env, _exceptionType, _exceptionMessage);
6820    }
6821}
6822
6823/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6824static void
6825android_glTexEnviv__IILjava_nio_IntBuffer_2
6826  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6827    jint _exception = 0;
6828    const char * _exceptionType = NULL;
6829    const char * _exceptionMessage = NULL;
6830    jintArray _array = (jintArray) 0;
6831    jint _bufferOffset = (jint) 0;
6832    jint _remaining;
6833    GLint *params = (GLint *) 0;
6834
6835    if (!params_buf) {
6836        _exception = 1;
6837        _exceptionType = "java/lang/IllegalArgumentException";
6838        _exceptionMessage = "params == null";
6839        goto exit;
6840    }
6841    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6842    int _needed;
6843    switch (pname) {
6844#if defined(GL_TEXTURE_ENV_MODE)
6845        case GL_TEXTURE_ENV_MODE:
6846#endif // defined(GL_TEXTURE_ENV_MODE)
6847#if defined(GL_COMBINE_RGB)
6848        case GL_COMBINE_RGB:
6849#endif // defined(GL_COMBINE_RGB)
6850#if defined(GL_COMBINE_ALPHA)
6851        case GL_COMBINE_ALPHA:
6852#endif // defined(GL_COMBINE_ALPHA)
6853            _needed = 1;
6854            break;
6855#if defined(GL_TEXTURE_ENV_COLOR)
6856        case GL_TEXTURE_ENV_COLOR:
6857#endif // defined(GL_TEXTURE_ENV_COLOR)
6858            _needed = 4;
6859            break;
6860        default:
6861            _needed = 1;
6862            break;
6863    }
6864    if (_remaining < _needed) {
6865        _exception = 1;
6866        _exceptionType = "java/lang/IllegalArgumentException";
6867        _exceptionMessage = "remaining() < needed";
6868        goto exit;
6869    }
6870    if (params == NULL) {
6871        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
6872        params = (GLint *) (_paramsBase + _bufferOffset);
6873    }
6874    glTexEnviv(
6875        (GLenum)target,
6876        (GLenum)pname,
6877        (GLint *)params
6878    );
6879
6880exit:
6881    if (_array) {
6882        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
6883    }
6884    if (_exception) {
6885        jniThrowException(_env, _exceptionType, _exceptionMessage);
6886    }
6887}
6888
6889/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6890static void
6891android_glTexParameterfv__II_3FI
6892  (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
6893    jint _exception = 0;
6894    const char * _exceptionType = NULL;
6895    const char * _exceptionMessage = NULL;
6896    GLfloat *params_base = (GLfloat *) 0;
6897    jint _remaining;
6898    GLfloat *params = (GLfloat *) 0;
6899
6900    if (!params_ref) {
6901        _exception = 1;
6902        _exceptionType = "java/lang/IllegalArgumentException";
6903        _exceptionMessage = "params == null";
6904        goto exit;
6905    }
6906    if (offset < 0) {
6907        _exception = 1;
6908        _exceptionType = "java/lang/IllegalArgumentException";
6909        _exceptionMessage = "offset < 0";
6910        goto exit;
6911    }
6912    _remaining = _env->GetArrayLength(params_ref) - offset;
6913    if (_remaining < 1) {
6914        _exception = 1;
6915        _exceptionType = "java/lang/IllegalArgumentException";
6916        _exceptionMessage = "length - offset < 1 < needed";
6917        goto exit;
6918    }
6919    params_base = (GLfloat *)
6920        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
6921    params = params_base + offset;
6922
6923    glTexParameterfv(
6924        (GLenum)target,
6925        (GLenum)pname,
6926        (GLfloat *)params
6927    );
6928
6929exit:
6930    if (params_base) {
6931        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
6932            JNI_ABORT);
6933    }
6934    if (_exception) {
6935        jniThrowException(_env, _exceptionType, _exceptionMessage);
6936    }
6937}
6938
6939/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6940static void
6941android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6942  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6943    jint _exception = 0;
6944    const char * _exceptionType = NULL;
6945    const char * _exceptionMessage = NULL;
6946    jfloatArray _array = (jfloatArray) 0;
6947    jint _bufferOffset = (jint) 0;
6948    jint _remaining;
6949    GLfloat *params = (GLfloat *) 0;
6950
6951    if (!params_buf) {
6952        _exception = 1;
6953        _exceptionType = "java/lang/IllegalArgumentException";
6954        _exceptionMessage = "params == null";
6955        goto exit;
6956    }
6957    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
6958    if (_remaining < 1) {
6959        _exception = 1;
6960        _exceptionType = "java/lang/IllegalArgumentException";
6961        _exceptionMessage = "remaining() < 1 < needed";
6962        goto exit;
6963    }
6964    if (params == NULL) {
6965        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
6966        params = (GLfloat *) (_paramsBase + _bufferOffset);
6967    }
6968    glTexParameterfv(
6969        (GLenum)target,
6970        (GLenum)pname,
6971        (GLfloat *)params
6972    );
6973
6974exit:
6975    if (_array) {
6976        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
6977    }
6978    if (_exception) {
6979        jniThrowException(_env, _exceptionType, _exceptionMessage);
6980    }
6981}
6982
6983/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6984static void
6985android_glTexParameteri__III
6986  (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6987    glTexParameteri(
6988        (GLenum)target,
6989        (GLenum)pname,
6990        (GLint)param
6991    );
6992}
6993
6994/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6995static void
6996android_glTexParameteriv__II_3II
6997  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6998    jint _exception = 0;
6999    const char * _exceptionType = NULL;
7000    const char * _exceptionMessage = NULL;
7001    GLint *params_base = (GLint *) 0;
7002    jint _remaining;
7003    GLint *params = (GLint *) 0;
7004
7005    if (!params_ref) {
7006        _exception = 1;
7007        _exceptionType = "java/lang/IllegalArgumentException";
7008        _exceptionMessage = "params == null";
7009        goto exit;
7010    }
7011    if (offset < 0) {
7012        _exception = 1;
7013        _exceptionType = "java/lang/IllegalArgumentException";
7014        _exceptionMessage = "offset < 0";
7015        goto exit;
7016    }
7017    _remaining = _env->GetArrayLength(params_ref) - offset;
7018    if (_remaining < 1) {
7019        _exception = 1;
7020        _exceptionType = "java/lang/IllegalArgumentException";
7021        _exceptionMessage = "length - offset < 1 < needed";
7022        goto exit;
7023    }
7024    params_base = (GLint *)
7025        _env->GetIntArrayElements(params_ref, (jboolean *)0);
7026    params = params_base + offset;
7027
7028    glTexParameteriv(
7029        (GLenum)target,
7030        (GLenum)pname,
7031        (GLint *)params
7032    );
7033
7034exit:
7035    if (params_base) {
7036        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
7037            JNI_ABORT);
7038    }
7039    if (_exception) {
7040        jniThrowException(_env, _exceptionType, _exceptionMessage);
7041    }
7042}
7043
7044/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
7045static void
7046android_glTexParameteriv__IILjava_nio_IntBuffer_2
7047  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
7048    jint _exception = 0;
7049    const char * _exceptionType = NULL;
7050    const char * _exceptionMessage = NULL;
7051    jintArray _array = (jintArray) 0;
7052    jint _bufferOffset = (jint) 0;
7053    jint _remaining;
7054    GLint *params = (GLint *) 0;
7055
7056    if (!params_buf) {
7057        _exception = 1;
7058        _exceptionType = "java/lang/IllegalArgumentException";
7059        _exceptionMessage = "params == null";
7060        goto exit;
7061    }
7062    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7063    if (_remaining < 1) {
7064        _exception = 1;
7065        _exceptionType = "java/lang/IllegalArgumentException";
7066        _exceptionMessage = "remaining() < 1 < needed";
7067        goto exit;
7068    }
7069    if (params == NULL) {
7070        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7071        params = (GLint *) (_paramsBase + _bufferOffset);
7072    }
7073    glTexParameteriv(
7074        (GLenum)target,
7075        (GLenum)pname,
7076        (GLint *)params
7077    );
7078
7079exit:
7080    if (_array) {
7081        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
7082    }
7083    if (_exception) {
7084        jniThrowException(_env, _exceptionType, _exceptionMessage);
7085    }
7086}
7087
7088/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7089static void
7090android_glTexParameterxv__II_3II
7091  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
7092    jint _exception = 0;
7093    const char * _exceptionType = NULL;
7094    const char * _exceptionMessage = NULL;
7095    GLfixed *params_base = (GLfixed *) 0;
7096    jint _remaining;
7097    GLfixed *params = (GLfixed *) 0;
7098
7099    if (!params_ref) {
7100        _exception = 1;
7101        _exceptionType = "java/lang/IllegalArgumentException";
7102        _exceptionMessage = "params == null";
7103        goto exit;
7104    }
7105    if (offset < 0) {
7106        _exception = 1;
7107        _exceptionType = "java/lang/IllegalArgumentException";
7108        _exceptionMessage = "offset < 0";
7109        goto exit;
7110    }
7111    _remaining = _env->GetArrayLength(params_ref) - offset;
7112    if (_remaining < 1) {
7113        _exception = 1;
7114        _exceptionType = "java/lang/IllegalArgumentException";
7115        _exceptionMessage = "length - offset < 1 < needed";
7116        goto exit;
7117    }
7118    params_base = (GLfixed *)
7119        _env->GetIntArrayElements(params_ref, (jboolean *)0);
7120    params = params_base + offset;
7121
7122    glTexParameterxv(
7123        (GLenum)target,
7124        (GLenum)pname,
7125        (GLfixed *)params
7126    );
7127
7128exit:
7129    if (params_base) {
7130        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
7131            JNI_ABORT);
7132    }
7133    if (_exception) {
7134        jniThrowException(_env, _exceptionType, _exceptionMessage);
7135    }
7136}
7137
7138/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7139static void
7140android_glTexParameterxv__IILjava_nio_IntBuffer_2
7141  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
7142    jint _exception = 0;
7143    const char * _exceptionType = NULL;
7144    const char * _exceptionMessage = NULL;
7145    jintArray _array = (jintArray) 0;
7146    jint _bufferOffset = (jint) 0;
7147    jint _remaining;
7148    GLfixed *params = (GLfixed *) 0;
7149
7150    if (!params_buf) {
7151        _exception = 1;
7152        _exceptionType = "java/lang/IllegalArgumentException";
7153        _exceptionMessage = "params == null";
7154        goto exit;
7155    }
7156    params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7157    if (_remaining < 1) {
7158        _exception = 1;
7159        _exceptionType = "java/lang/IllegalArgumentException";
7160        _exceptionMessage = "remaining() < 1 < needed";
7161        goto exit;
7162    }
7163    if (params == NULL) {
7164        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7165        params = (GLfixed *) (_paramsBase + _bufferOffset);
7166    }
7167    glTexParameterxv(
7168        (GLenum)target,
7169        (GLenum)pname,
7170        (GLfixed *)params
7171    );
7172
7173exit:
7174    if (_array) {
7175        _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
7176    }
7177    if (_exception) {
7178        jniThrowException(_env, _exceptionType, _exceptionMessage);
7179    }
7180}
7181
7182/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7183static void
7184android_glVertexPointer__IIII
7185  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7186    glVertexPointer(
7187        (GLint)size,
7188        (GLenum)type,
7189        (GLsizei)stride,
7190        reinterpret_cast<GLvoid *>(offset)
7191    );
7192}
7193
7194/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
7195static void
7196android_glCurrentPaletteMatrixOES__I
7197  (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
7198    glCurrentPaletteMatrixOES(
7199        (GLuint)matrixpaletteindex
7200    );
7201}
7202
7203/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
7204static void
7205android_glDrawTexfOES__FFFFF
7206  (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
7207    glDrawTexfOES(
7208        (GLfloat)x,
7209        (GLfloat)y,
7210        (GLfloat)z,
7211        (GLfloat)width,
7212        (GLfloat)height
7213    );
7214}
7215
7216/* void glDrawTexfvOES ( const GLfloat *coords ) */
7217static void
7218android_glDrawTexfvOES___3FI
7219  (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
7220    jint _exception = 0;
7221    const char * _exceptionType = NULL;
7222    const char * _exceptionMessage = NULL;
7223    GLfloat *coords_base = (GLfloat *) 0;
7224    jint _remaining;
7225    GLfloat *coords = (GLfloat *) 0;
7226
7227    if (!coords_ref) {
7228        _exception = 1;
7229        _exceptionType = "java/lang/IllegalArgumentException";
7230        _exceptionMessage = "coords == null";
7231        goto exit;
7232    }
7233    if (offset < 0) {
7234        _exception = 1;
7235        _exceptionType = "java/lang/IllegalArgumentException";
7236        _exceptionMessage = "offset < 0";
7237        goto exit;
7238    }
7239    _remaining = _env->GetArrayLength(coords_ref) - offset;
7240    if (_remaining < 5) {
7241        _exception = 1;
7242        _exceptionType = "java/lang/IllegalArgumentException";
7243        _exceptionMessage = "length - offset < 5 < needed";
7244        goto exit;
7245    }
7246    coords_base = (GLfloat *)
7247        _env->GetFloatArrayElements(coords_ref, (jboolean *)0);
7248    coords = coords_base + offset;
7249
7250    glDrawTexfvOES(
7251        (GLfloat *)coords
7252    );
7253
7254exit:
7255    if (coords_base) {
7256        _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base,
7257            JNI_ABORT);
7258    }
7259    if (_exception) {
7260        jniThrowException(_env, _exceptionType, _exceptionMessage);
7261    }
7262}
7263
7264/* void glDrawTexfvOES ( const GLfloat *coords ) */
7265static void
7266android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
7267  (JNIEnv *_env, jobject _this, jobject coords_buf) {
7268    jint _exception = 0;
7269    const char * _exceptionType = NULL;
7270    const char * _exceptionMessage = NULL;
7271    jfloatArray _array = (jfloatArray) 0;
7272    jint _bufferOffset = (jint) 0;
7273    jint _remaining;
7274    GLfloat *coords = (GLfloat *) 0;
7275
7276    if (!coords_buf) {
7277        _exception = 1;
7278        _exceptionType = "java/lang/IllegalArgumentException";
7279        _exceptionMessage = "coords == null";
7280        goto exit;
7281    }
7282    coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7283    if (_remaining < 5) {
7284        _exception = 1;
7285        _exceptionType = "java/lang/IllegalArgumentException";
7286        _exceptionMessage = "remaining() < 5 < needed";
7287        goto exit;
7288    }
7289    if (coords == NULL) {
7290        char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
7291        coords = (GLfloat *) (_coordsBase + _bufferOffset);
7292    }
7293    glDrawTexfvOES(
7294        (GLfloat *)coords
7295    );
7296
7297exit:
7298    if (_array) {
7299        _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT);
7300    }
7301    if (_exception) {
7302        jniThrowException(_env, _exceptionType, _exceptionMessage);
7303    }
7304}
7305
7306/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
7307static void
7308android_glDrawTexiOES__IIIII
7309  (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7310    glDrawTexiOES(
7311        (GLint)x,
7312        (GLint)y,
7313        (GLint)z,
7314        (GLint)width,
7315        (GLint)height
7316    );
7317}
7318
7319/* void glDrawTexivOES ( const GLint *coords ) */
7320static void
7321android_glDrawTexivOES___3II
7322  (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
7323    jint _exception = 0;
7324    const char * _exceptionType = NULL;
7325    const char * _exceptionMessage = NULL;
7326    GLint *coords_base = (GLint *) 0;
7327    jint _remaining;
7328    GLint *coords = (GLint *) 0;
7329
7330    if (!coords_ref) {
7331        _exception = 1;
7332        _exceptionType = "java/lang/IllegalArgumentException";
7333        _exceptionMessage = "coords == null";
7334        goto exit;
7335    }
7336    if (offset < 0) {
7337        _exception = 1;
7338        _exceptionType = "java/lang/IllegalArgumentException";
7339        _exceptionMessage = "offset < 0";
7340        goto exit;
7341    }
7342    _remaining = _env->GetArrayLength(coords_ref) - offset;
7343    if (_remaining < 5) {
7344        _exception = 1;
7345        _exceptionType = "java/lang/IllegalArgumentException";
7346        _exceptionMessage = "length - offset < 5 < needed";
7347        goto exit;
7348    }
7349    coords_base = (GLint *)
7350        _env->GetIntArrayElements(coords_ref, (jboolean *)0);
7351    coords = coords_base + offset;
7352
7353    glDrawTexivOES(
7354        (GLint *)coords
7355    );
7356
7357exit:
7358    if (coords_base) {
7359        _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
7360            JNI_ABORT);
7361    }
7362    if (_exception) {
7363        jniThrowException(_env, _exceptionType, _exceptionMessage);
7364    }
7365}
7366
7367/* void glDrawTexivOES ( const GLint *coords ) */
7368static void
7369android_glDrawTexivOES__Ljava_nio_IntBuffer_2
7370  (JNIEnv *_env, jobject _this, jobject coords_buf) {
7371    jint _exception = 0;
7372    const char * _exceptionType = NULL;
7373    const char * _exceptionMessage = NULL;
7374    jintArray _array = (jintArray) 0;
7375    jint _bufferOffset = (jint) 0;
7376    jint _remaining;
7377    GLint *coords = (GLint *) 0;
7378
7379    if (!coords_buf) {
7380        _exception = 1;
7381        _exceptionType = "java/lang/IllegalArgumentException";
7382        _exceptionMessage = "coords == null";
7383        goto exit;
7384    }
7385    coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7386    if (_remaining < 5) {
7387        _exception = 1;
7388        _exceptionType = "java/lang/IllegalArgumentException";
7389        _exceptionMessage = "remaining() < 5 < needed";
7390        goto exit;
7391    }
7392    if (coords == NULL) {
7393        char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7394        coords = (GLint *) (_coordsBase + _bufferOffset);
7395    }
7396    glDrawTexivOES(
7397        (GLint *)coords
7398    );
7399
7400exit:
7401    if (_array) {
7402        _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
7403    }
7404    if (_exception) {
7405        jniThrowException(_env, _exceptionType, _exceptionMessage);
7406    }
7407}
7408
7409/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
7410static void
7411android_glDrawTexsOES__SSSSS
7412  (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
7413    glDrawTexsOES(
7414        (GLshort)x,
7415        (GLshort)y,
7416        (GLshort)z,
7417        (GLshort)width,
7418        (GLshort)height
7419    );
7420}
7421
7422/* void glDrawTexsvOES ( const GLshort *coords ) */
7423static void
7424android_glDrawTexsvOES___3SI
7425  (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
7426    jint _exception = 0;
7427    const char * _exceptionType = NULL;
7428    const char * _exceptionMessage = NULL;
7429    GLshort *coords_base = (GLshort *) 0;
7430    jint _remaining;
7431    GLshort *coords = (GLshort *) 0;
7432
7433    if (!coords_ref) {
7434        _exception = 1;
7435        _exceptionType = "java/lang/IllegalArgumentException";
7436        _exceptionMessage = "coords == null";
7437        goto exit;
7438    }
7439    if (offset < 0) {
7440        _exception = 1;
7441        _exceptionType = "java/lang/IllegalArgumentException";
7442        _exceptionMessage = "offset < 0";
7443        goto exit;
7444    }
7445    _remaining = _env->GetArrayLength(coords_ref) - offset;
7446    if (_remaining < 5) {
7447        _exception = 1;
7448        _exceptionType = "java/lang/IllegalArgumentException";
7449        _exceptionMessage = "length - offset < 5 < needed";
7450        goto exit;
7451    }
7452    coords_base = (GLshort *)
7453        _env->GetShortArrayElements(coords_ref, (jboolean *)0);
7454    coords = coords_base + offset;
7455
7456    glDrawTexsvOES(
7457        (GLshort *)coords
7458    );
7459
7460exit:
7461    if (coords_base) {
7462        _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base,
7463            JNI_ABORT);
7464    }
7465    if (_exception) {
7466        jniThrowException(_env, _exceptionType, _exceptionMessage);
7467    }
7468}
7469
7470/* void glDrawTexsvOES ( const GLshort *coords ) */
7471static void
7472android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7473  (JNIEnv *_env, jobject _this, jobject coords_buf) {
7474    jint _exception = 0;
7475    const char * _exceptionType = NULL;
7476    const char * _exceptionMessage = NULL;
7477    jshortArray _array = (jshortArray) 0;
7478    jint _bufferOffset = (jint) 0;
7479    jint _remaining;
7480    GLshort *coords = (GLshort *) 0;
7481
7482    if (!coords_buf) {
7483        _exception = 1;
7484        _exceptionType = "java/lang/IllegalArgumentException";
7485        _exceptionMessage = "coords == null";
7486        goto exit;
7487    }
7488    coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7489    if (_remaining < 5) {
7490        _exception = 1;
7491        _exceptionType = "java/lang/IllegalArgumentException";
7492        _exceptionMessage = "remaining() < 5 < needed";
7493        goto exit;
7494    }
7495    if (coords == NULL) {
7496        char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0);
7497        coords = (GLshort *) (_coordsBase + _bufferOffset);
7498    }
7499    glDrawTexsvOES(
7500        (GLshort *)coords
7501    );
7502
7503exit:
7504    if (_array) {
7505        _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT);
7506    }
7507    if (_exception) {
7508        jniThrowException(_env, _exceptionType, _exceptionMessage);
7509    }
7510}
7511
7512/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7513static void
7514android_glDrawTexxOES__IIIII
7515  (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7516    glDrawTexxOES(
7517        (GLfixed)x,
7518        (GLfixed)y,
7519        (GLfixed)z,
7520        (GLfixed)width,
7521        (GLfixed)height
7522    );
7523}
7524
7525/* void glDrawTexxvOES ( const GLfixed *coords ) */
7526static void
7527android_glDrawTexxvOES___3II
7528  (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
7529    jint _exception = 0;
7530    const char * _exceptionType = NULL;
7531    const char * _exceptionMessage = NULL;
7532    GLfixed *coords_base = (GLfixed *) 0;
7533    jint _remaining;
7534    GLfixed *coords = (GLfixed *) 0;
7535
7536    if (!coords_ref) {
7537        _exception = 1;
7538        _exceptionType = "java/lang/IllegalArgumentException";
7539        _exceptionMessage = "coords == null";
7540        goto exit;
7541    }
7542    if (offset < 0) {
7543        _exception = 1;
7544        _exceptionType = "java/lang/IllegalArgumentException";
7545        _exceptionMessage = "offset < 0";
7546        goto exit;
7547    }
7548    _remaining = _env->GetArrayLength(coords_ref) - offset;
7549    if (_remaining < 5) {
7550        _exception = 1;
7551        _exceptionType = "java/lang/IllegalArgumentException";
7552        _exceptionMessage = "length - offset < 5 < needed";
7553        goto exit;
7554    }
7555    coords_base = (GLfixed *)
7556        _env->GetIntArrayElements(coords_ref, (jboolean *)0);
7557    coords = coords_base + offset;
7558
7559    glDrawTexxvOES(
7560        (GLfixed *)coords
7561    );
7562
7563exit:
7564    if (coords_base) {
7565        _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
7566            JNI_ABORT);
7567    }
7568    if (_exception) {
7569        jniThrowException(_env, _exceptionType, _exceptionMessage);
7570    }
7571}
7572
7573/* void glDrawTexxvOES ( const GLfixed *coords ) */
7574static void
7575android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7576  (JNIEnv *_env, jobject _this, jobject coords_buf) {
7577    jint _exception = 0;
7578    const char * _exceptionType = NULL;
7579    const char * _exceptionMessage = NULL;
7580    jintArray _array = (jintArray) 0;
7581    jint _bufferOffset = (jint) 0;
7582    jint _remaining;
7583    GLfixed *coords = (GLfixed *) 0;
7584
7585    if (!coords_buf) {
7586        _exception = 1;
7587        _exceptionType = "java/lang/IllegalArgumentException";
7588        _exceptionMessage = "coords == null";
7589        goto exit;
7590    }
7591    coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7592    if (_remaining < 5) {
7593        _exception = 1;
7594        _exceptionType = "java/lang/IllegalArgumentException";
7595        _exceptionMessage = "remaining() < 5 < needed";
7596        goto exit;
7597    }
7598    if (coords == NULL) {
7599        char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7600        coords = (GLfixed *) (_coordsBase + _bufferOffset);
7601    }
7602    glDrawTexxvOES(
7603        (GLfixed *)coords
7604    );
7605
7606exit:
7607    if (_array) {
7608        _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
7609    }
7610    if (_exception) {
7611        jniThrowException(_env, _exceptionType, _exceptionMessage);
7612    }
7613}
7614
7615/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7616static void
7617android_glLoadPaletteFromModelViewMatrixOES__
7618  (JNIEnv *_env, jobject _this) {
7619    glLoadPaletteFromModelViewMatrixOES();
7620}
7621
7622/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7623static void
7624android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7625  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7626    jint _exception = 0;
7627    const char * _exceptionType = NULL;
7628    const char * _exceptionMessage = NULL;
7629    jarray _array = (jarray) 0;
7630    jint _bufferOffset = (jint) 0;
7631    jint _remaining;
7632    GLvoid *pointer = (GLvoid *) 0;
7633
7634    if (pointer_buf) {
7635        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7636        if ( ! pointer ) {
7637            return;
7638        }
7639    }
7640    glMatrixIndexPointerOESBounds(
7641        (GLint)size,
7642        (GLenum)type,
7643        (GLsizei)stride,
7644        (GLvoid *)pointer,
7645        (GLsizei)remaining
7646    );
7647    if (_exception) {
7648        jniThrowException(_env, _exceptionType, _exceptionMessage);
7649    }
7650}
7651
7652/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7653static void
7654android_glMatrixIndexPointerOES__IIII
7655  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7656    glMatrixIndexPointerOES(
7657        (GLint)size,
7658        (GLenum)type,
7659        (GLsizei)stride,
7660        reinterpret_cast<GLvoid *>(offset)
7661    );
7662}
7663
7664/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7665static void
7666android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7667  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7668    jint _exception = 0;
7669    const char * _exceptionType = NULL;
7670    const char * _exceptionMessage = NULL;
7671    jarray _array = (jarray) 0;
7672    jint _bufferOffset = (jint) 0;
7673    jint _remaining;
7674    GLvoid *pointer = (GLvoid *) 0;
7675
7676    if (pointer_buf) {
7677        pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7678        if ( ! pointer ) {
7679            return;
7680        }
7681    }
7682    glWeightPointerOESBounds(
7683        (GLint)size,
7684        (GLenum)type,
7685        (GLsizei)stride,
7686        (GLvoid *)pointer,
7687        (GLsizei)remaining
7688    );
7689    if (_exception) {
7690        jniThrowException(_env, _exceptionType, _exceptionMessage);
7691    }
7692}
7693
7694/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7695static void
7696android_glWeightPointerOES__IIII
7697  (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7698    glWeightPointerOES(
7699        (GLint)size,
7700        (GLenum)type,
7701        (GLsizei)stride,
7702        reinterpret_cast<GLvoid *>(offset)
7703    );
7704}
7705
7706/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7707static void
7708android_glBindFramebufferOES__II
7709  (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
7710    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7711        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7712            "glBindFramebufferOES");
7713            return;
7714    }
7715    glBindFramebufferOES(
7716        (GLint)target,
7717        (GLint)framebuffer
7718    );
7719}
7720
7721/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7722static void
7723android_glBindRenderbufferOES__II
7724  (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
7725    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7726        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7727            "glBindRenderbufferOES");
7728            return;
7729    }
7730    glBindRenderbufferOES(
7731        (GLint)target,
7732        (GLint)renderbuffer
7733    );
7734}
7735
7736/* void glBlendEquation ( GLint mode ) */
7737static void
7738android_glBlendEquation__I
7739  (JNIEnv *_env, jobject _this, jint mode) {
7740    if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
7741        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7742            "glBlendEquation");
7743            return;
7744    }
7745    glBlendEquation(
7746        (GLint)mode
7747    );
7748}
7749
7750/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7751static void
7752android_glBlendEquationSeparate__II
7753  (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
7754    if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
7755        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7756            "glBlendEquationSeparate");
7757            return;
7758    }
7759    glBlendEquationSeparate(
7760        (GLint)modeRGB,
7761        (GLint)modeAlpha
7762    );
7763}
7764
7765/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7766static void
7767android_glBlendFuncSeparate__IIII
7768  (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
7769    if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
7770        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7771            "glBlendFuncSeparate");
7772            return;
7773    }
7774    glBlendFuncSeparate(
7775        (GLint)srcRGB,
7776        (GLint)dstRGB,
7777        (GLint)srcAlpha,
7778        (GLint)dstAlpha
7779    );
7780}
7781
7782/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7783static jint
7784android_glCheckFramebufferStatusOES__I
7785  (JNIEnv *_env, jobject _this, jint target) {
7786    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7787        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7788            "glCheckFramebufferStatusOES");
7789    return 0;
7790    }
7791    GLint _returnValue = 0;
7792    _returnValue = glCheckFramebufferStatusOES(
7793        (GLint)target
7794    );
7795    return (jint)_returnValue;
7796}
7797
7798/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
7799static void
7800android_glDeleteFramebuffersOES__I_3II
7801  (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
7802    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7803        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7804            "glDeleteFramebuffersOES");
7805            return;
7806    }
7807    jint _exception = 0;
7808    const char * _exceptionType = NULL;
7809    const char * _exceptionMessage = NULL;
7810    GLuint *framebuffers_base = (GLuint *) 0;
7811    jint _remaining;
7812    GLuint *framebuffers = (GLuint *) 0;
7813
7814    if (!framebuffers_ref) {
7815        _exception = 1;
7816        _exceptionType = "java/lang/IllegalArgumentException";
7817        _exceptionMessage = "framebuffers == null";
7818        goto exit;
7819    }
7820    if (offset < 0) {
7821        _exception = 1;
7822        _exceptionType = "java/lang/IllegalArgumentException";
7823        _exceptionMessage = "offset < 0";
7824        goto exit;
7825    }
7826    _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7827    if (_remaining < n) {
7828        _exception = 1;
7829        _exceptionType = "java/lang/IllegalArgumentException";
7830        _exceptionMessage = "length - offset < n < needed";
7831        goto exit;
7832    }
7833    framebuffers_base = (GLuint *)
7834        _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
7835    framebuffers = framebuffers_base + offset;
7836
7837    glDeleteFramebuffersOES(
7838        (GLint)n,
7839        (GLuint *)framebuffers
7840    );
7841
7842exit:
7843    if (framebuffers_base) {
7844        _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
7845            _exception ? JNI_ABORT: 0);
7846    }
7847    if (_exception) {
7848        jniThrowException(_env, _exceptionType, _exceptionMessage);
7849    }
7850}
7851
7852/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
7853static void
7854android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7855  (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
7856    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7857        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7858            "glDeleteFramebuffersOES");
7859            return;
7860    }
7861    jint _exception = 0;
7862    const char * _exceptionType = NULL;
7863    const char * _exceptionMessage = NULL;
7864    jintArray _array = (jintArray) 0;
7865    jint _bufferOffset = (jint) 0;
7866    jint _remaining;
7867    GLuint *framebuffers = (GLuint *) 0;
7868
7869    if (!framebuffers_buf) {
7870        _exception = 1;
7871        _exceptionType = "java/lang/IllegalArgumentException";
7872        _exceptionMessage = "framebuffers == null";
7873        goto exit;
7874    }
7875    framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7876    if (_remaining < n) {
7877        _exception = 1;
7878        _exceptionType = "java/lang/IllegalArgumentException";
7879        _exceptionMessage = "remaining() < n < needed";
7880        goto exit;
7881    }
7882    if (framebuffers == NULL) {
7883        char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7884        framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7885    }
7886    glDeleteFramebuffersOES(
7887        (GLint)n,
7888        (GLuint *)framebuffers
7889    );
7890
7891exit:
7892    if (_array) {
7893        _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
7894    }
7895    if (_exception) {
7896        jniThrowException(_env, _exceptionType, _exceptionMessage);
7897    }
7898}
7899
7900/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
7901static void
7902android_glDeleteRenderbuffersOES__I_3II
7903  (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
7904    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7905        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7906            "glDeleteRenderbuffersOES");
7907            return;
7908    }
7909    jint _exception = 0;
7910    const char * _exceptionType = NULL;
7911    const char * _exceptionMessage = NULL;
7912    GLuint *renderbuffers_base = (GLuint *) 0;
7913    jint _remaining;
7914    GLuint *renderbuffers = (GLuint *) 0;
7915
7916    if (!renderbuffers_ref) {
7917        _exception = 1;
7918        _exceptionType = "java/lang/IllegalArgumentException";
7919        _exceptionMessage = "renderbuffers == null";
7920        goto exit;
7921    }
7922    if (offset < 0) {
7923        _exception = 1;
7924        _exceptionType = "java/lang/IllegalArgumentException";
7925        _exceptionMessage = "offset < 0";
7926        goto exit;
7927    }
7928    _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7929    if (_remaining < n) {
7930        _exception = 1;
7931        _exceptionType = "java/lang/IllegalArgumentException";
7932        _exceptionMessage = "length - offset < n < needed";
7933        goto exit;
7934    }
7935    renderbuffers_base = (GLuint *)
7936        _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
7937    renderbuffers = renderbuffers_base + offset;
7938
7939    glDeleteRenderbuffersOES(
7940        (GLint)n,
7941        (GLuint *)renderbuffers
7942    );
7943
7944exit:
7945    if (renderbuffers_base) {
7946        _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
7947            _exception ? JNI_ABORT: 0);
7948    }
7949    if (_exception) {
7950        jniThrowException(_env, _exceptionType, _exceptionMessage);
7951    }
7952}
7953
7954/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
7955static void
7956android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7957  (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
7958    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
7959        jniThrowException(_env, "java/lang/UnsupportedOperationException",
7960            "glDeleteRenderbuffersOES");
7961            return;
7962    }
7963    jint _exception = 0;
7964    const char * _exceptionType = NULL;
7965    const char * _exceptionMessage = NULL;
7966    jintArray _array = (jintArray) 0;
7967    jint _bufferOffset = (jint) 0;
7968    jint _remaining;
7969    GLuint *renderbuffers = (GLuint *) 0;
7970
7971    if (!renderbuffers_buf) {
7972        _exception = 1;
7973        _exceptionType = "java/lang/IllegalArgumentException";
7974        _exceptionMessage = "renderbuffers == null";
7975        goto exit;
7976    }
7977    renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
7978    if (_remaining < n) {
7979        _exception = 1;
7980        _exceptionType = "java/lang/IllegalArgumentException";
7981        _exceptionMessage = "remaining() < n < needed";
7982        goto exit;
7983    }
7984    if (renderbuffers == NULL) {
7985        char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
7986        renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7987    }
7988    glDeleteRenderbuffersOES(
7989        (GLint)n,
7990        (GLuint *)renderbuffers
7991    );
7992
7993exit:
7994    if (_array) {
7995        _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
7996    }
7997    if (_exception) {
7998        jniThrowException(_env, _exceptionType, _exceptionMessage);
7999    }
8000}
8001
8002/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
8003static void
8004android_glFramebufferRenderbufferOES__IIII
8005  (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
8006    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8007        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8008            "glFramebufferRenderbufferOES");
8009            return;
8010    }
8011    glFramebufferRenderbufferOES(
8012        (GLint)target,
8013        (GLint)attachment,
8014        (GLint)renderbuffertarget,
8015        (GLint)renderbuffer
8016    );
8017}
8018
8019/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
8020static void
8021android_glFramebufferTexture2DOES__IIIII
8022  (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
8023    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8024        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8025            "glFramebufferTexture2DOES");
8026            return;
8027    }
8028    glFramebufferTexture2DOES(
8029        (GLint)target,
8030        (GLint)attachment,
8031        (GLint)textarget,
8032        (GLint)texture,
8033        (GLint)level
8034    );
8035}
8036
8037/* void glGenerateMipmapOES ( GLint target ) */
8038static void
8039android_glGenerateMipmapOES__I
8040  (JNIEnv *_env, jobject _this, jint target) {
8041    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8042        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8043            "glGenerateMipmapOES");
8044            return;
8045    }
8046    glGenerateMipmapOES(
8047        (GLint)target
8048    );
8049}
8050
8051/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
8052static void
8053android_glGenFramebuffersOES__I_3II
8054  (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
8055    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8056        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8057            "glGenFramebuffersOES");
8058            return;
8059    }
8060    jint _exception = 0;
8061    const char * _exceptionType = NULL;
8062    const char * _exceptionMessage = NULL;
8063    GLuint *framebuffers_base = (GLuint *) 0;
8064    jint _remaining;
8065    GLuint *framebuffers = (GLuint *) 0;
8066
8067    if (!framebuffers_ref) {
8068        _exception = 1;
8069        _exceptionType = "java/lang/IllegalArgumentException";
8070        _exceptionMessage = "framebuffers == null";
8071        goto exit;
8072    }
8073    if (offset < 0) {
8074        _exception = 1;
8075        _exceptionType = "java/lang/IllegalArgumentException";
8076        _exceptionMessage = "offset < 0";
8077        goto exit;
8078    }
8079    _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
8080    if (_remaining < n) {
8081        _exception = 1;
8082        _exceptionType = "java/lang/IllegalArgumentException";
8083        _exceptionMessage = "length - offset < n < needed";
8084        goto exit;
8085    }
8086    framebuffers_base = (GLuint *)
8087        _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
8088    framebuffers = framebuffers_base + offset;
8089
8090    glGenFramebuffersOES(
8091        (GLint)n,
8092        (GLuint *)framebuffers
8093    );
8094
8095exit:
8096    if (framebuffers_base) {
8097        _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
8098            _exception ? JNI_ABORT: 0);
8099    }
8100    if (_exception) {
8101        jniThrowException(_env, _exceptionType, _exceptionMessage);
8102    }
8103}
8104
8105/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
8106static void
8107android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
8108  (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
8109    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8110        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8111            "glGenFramebuffersOES");
8112            return;
8113    }
8114    jint _exception = 0;
8115    const char * _exceptionType = NULL;
8116    const char * _exceptionMessage = NULL;
8117    jintArray _array = (jintArray) 0;
8118    jint _bufferOffset = (jint) 0;
8119    jint _remaining;
8120    GLuint *framebuffers = (GLuint *) 0;
8121
8122    if (!framebuffers_buf) {
8123        _exception = 1;
8124        _exceptionType = "java/lang/IllegalArgumentException";
8125        _exceptionMessage = "framebuffers == null";
8126        goto exit;
8127    }
8128    framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8129    if (_remaining < n) {
8130        _exception = 1;
8131        _exceptionType = "java/lang/IllegalArgumentException";
8132        _exceptionMessage = "remaining() < n < needed";
8133        goto exit;
8134    }
8135    if (framebuffers == NULL) {
8136        char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8137        framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
8138    }
8139    glGenFramebuffersOES(
8140        (GLint)n,
8141        (GLuint *)framebuffers
8142    );
8143
8144exit:
8145    if (_array) {
8146        _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
8147    }
8148    if (_exception) {
8149        jniThrowException(_env, _exceptionType, _exceptionMessage);
8150    }
8151}
8152
8153/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
8154static void
8155android_glGenRenderbuffersOES__I_3II
8156  (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
8157    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8158        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8159            "glGenRenderbuffersOES");
8160            return;
8161    }
8162    jint _exception = 0;
8163    const char * _exceptionType = NULL;
8164    const char * _exceptionMessage = NULL;
8165    GLuint *renderbuffers_base = (GLuint *) 0;
8166    jint _remaining;
8167    GLuint *renderbuffers = (GLuint *) 0;
8168
8169    if (!renderbuffers_ref) {
8170        _exception = 1;
8171        _exceptionType = "java/lang/IllegalArgumentException";
8172        _exceptionMessage = "renderbuffers == null";
8173        goto exit;
8174    }
8175    if (offset < 0) {
8176        _exception = 1;
8177        _exceptionType = "java/lang/IllegalArgumentException";
8178        _exceptionMessage = "offset < 0";
8179        goto exit;
8180    }
8181    _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
8182    if (_remaining < n) {
8183        _exception = 1;
8184        _exceptionType = "java/lang/IllegalArgumentException";
8185        _exceptionMessage = "length - offset < n < needed";
8186        goto exit;
8187    }
8188    renderbuffers_base = (GLuint *)
8189        _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
8190    renderbuffers = renderbuffers_base + offset;
8191
8192    glGenRenderbuffersOES(
8193        (GLint)n,
8194        (GLuint *)renderbuffers
8195    );
8196
8197exit:
8198    if (renderbuffers_base) {
8199        _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
8200            _exception ? JNI_ABORT: 0);
8201    }
8202    if (_exception) {
8203        jniThrowException(_env, _exceptionType, _exceptionMessage);
8204    }
8205}
8206
8207/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
8208static void
8209android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
8210  (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
8211    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8212        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8213            "glGenRenderbuffersOES");
8214            return;
8215    }
8216    jint _exception = 0;
8217    const char * _exceptionType = NULL;
8218    const char * _exceptionMessage = NULL;
8219    jintArray _array = (jintArray) 0;
8220    jint _bufferOffset = (jint) 0;
8221    jint _remaining;
8222    GLuint *renderbuffers = (GLuint *) 0;
8223
8224    if (!renderbuffers_buf) {
8225        _exception = 1;
8226        _exceptionType = "java/lang/IllegalArgumentException";
8227        _exceptionMessage = "renderbuffers == null";
8228        goto exit;
8229    }
8230    renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8231    if (_remaining < n) {
8232        _exception = 1;
8233        _exceptionType = "java/lang/IllegalArgumentException";
8234        _exceptionMessage = "remaining() < n < needed";
8235        goto exit;
8236    }
8237    if (renderbuffers == NULL) {
8238        char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8239        renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
8240    }
8241    glGenRenderbuffersOES(
8242        (GLint)n,
8243        (GLuint *)renderbuffers
8244    );
8245
8246exit:
8247    if (_array) {
8248        _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
8249    }
8250    if (_exception) {
8251        jniThrowException(_env, _exceptionType, _exceptionMessage);
8252    }
8253}
8254
8255/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8256static void
8257android_glGetFramebufferAttachmentParameterivOES__III_3II
8258  (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
8259    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8260        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8261            "glGetFramebufferAttachmentParameterivOES");
8262            return;
8263    }
8264    jint _exception = 0;
8265    const char * _exceptionType = NULL;
8266    const char * _exceptionMessage = NULL;
8267    GLint *params_base = (GLint *) 0;
8268    jint _remaining;
8269    GLint *params = (GLint *) 0;
8270
8271    if (!params_ref) {
8272        _exception = 1;
8273        _exceptionType = "java/lang/IllegalArgumentException";
8274        _exceptionMessage = "params == null";
8275        goto exit;
8276    }
8277    if (offset < 0) {
8278        _exception = 1;
8279        _exceptionType = "java/lang/IllegalArgumentException";
8280        _exceptionMessage = "offset < 0";
8281        goto exit;
8282    }
8283    _remaining = _env->GetArrayLength(params_ref) - offset;
8284    params_base = (GLint *)
8285        _env->GetIntArrayElements(params_ref, (jboolean *)0);
8286    params = params_base + offset;
8287
8288    glGetFramebufferAttachmentParameterivOES(
8289        (GLint)target,
8290        (GLint)attachment,
8291        (GLint)pname,
8292        (GLint *)params
8293    );
8294
8295exit:
8296    if (params_base) {
8297        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
8298            _exception ? JNI_ABORT: 0);
8299    }
8300    if (_exception) {
8301        jniThrowException(_env, _exceptionType, _exceptionMessage);
8302    }
8303}
8304
8305/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8306static void
8307android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
8308  (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
8309    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8310        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8311            "glGetFramebufferAttachmentParameterivOES");
8312            return;
8313    }
8314    jint _exception = 0;
8315    const char * _exceptionType = NULL;
8316    const char * _exceptionMessage = NULL;
8317    jintArray _array = (jintArray) 0;
8318    jint _bufferOffset = (jint) 0;
8319    jint _remaining;
8320    GLint *params = (GLint *) 0;
8321
8322    if (!params_buf) {
8323        _exception = 1;
8324        _exceptionType = "java/lang/IllegalArgumentException";
8325        _exceptionMessage = "params == null";
8326        goto exit;
8327    }
8328    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8329    if (params == NULL) {
8330        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8331        params = (GLint *) (_paramsBase + _bufferOffset);
8332    }
8333    glGetFramebufferAttachmentParameterivOES(
8334        (GLint)target,
8335        (GLint)attachment,
8336        (GLint)pname,
8337        (GLint *)params
8338    );
8339
8340exit:
8341    if (_array) {
8342        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8343    }
8344    if (_exception) {
8345        jniThrowException(_env, _exceptionType, _exceptionMessage);
8346    }
8347}
8348
8349/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8350static void
8351android_glGetRenderbufferParameterivOES__II_3II
8352  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
8353    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8354        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8355            "glGetRenderbufferParameterivOES");
8356            return;
8357    }
8358    jint _exception = 0;
8359    const char * _exceptionType = NULL;
8360    const char * _exceptionMessage = NULL;
8361    GLint *params_base = (GLint *) 0;
8362    jint _remaining;
8363    GLint *params = (GLint *) 0;
8364
8365    if (!params_ref) {
8366        _exception = 1;
8367        _exceptionType = "java/lang/IllegalArgumentException";
8368        _exceptionMessage = "params == null";
8369        goto exit;
8370    }
8371    if (offset < 0) {
8372        _exception = 1;
8373        _exceptionType = "java/lang/IllegalArgumentException";
8374        _exceptionMessage = "offset < 0";
8375        goto exit;
8376    }
8377    _remaining = _env->GetArrayLength(params_ref) - offset;
8378    params_base = (GLint *)
8379        _env->GetIntArrayElements(params_ref, (jboolean *)0);
8380    params = params_base + offset;
8381
8382    glGetRenderbufferParameterivOES(
8383        (GLint)target,
8384        (GLint)pname,
8385        (GLint *)params
8386    );
8387
8388exit:
8389    if (params_base) {
8390        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
8391            _exception ? JNI_ABORT: 0);
8392    }
8393    if (_exception) {
8394        jniThrowException(_env, _exceptionType, _exceptionMessage);
8395    }
8396}
8397
8398/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8399static void
8400android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
8401  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
8402    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8403        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8404            "glGetRenderbufferParameterivOES");
8405            return;
8406    }
8407    jint _exception = 0;
8408    const char * _exceptionType = NULL;
8409    const char * _exceptionMessage = NULL;
8410    jintArray _array = (jintArray) 0;
8411    jint _bufferOffset = (jint) 0;
8412    jint _remaining;
8413    GLint *params = (GLint *) 0;
8414
8415    if (!params_buf) {
8416        _exception = 1;
8417        _exceptionType = "java/lang/IllegalArgumentException";
8418        _exceptionMessage = "params == null";
8419        goto exit;
8420    }
8421    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8422    if (params == NULL) {
8423        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8424        params = (GLint *) (_paramsBase + _bufferOffset);
8425    }
8426    glGetRenderbufferParameterivOES(
8427        (GLint)target,
8428        (GLint)pname,
8429        (GLint *)params
8430    );
8431
8432exit:
8433    if (_array) {
8434        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8435    }
8436    if (_exception) {
8437        jniThrowException(_env, _exceptionType, _exceptionMessage);
8438    }
8439}
8440
8441/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8442static void
8443android_glGetTexGenfv__II_3FI
8444  (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
8445    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8446        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8447            "glGetTexGenfv");
8448            return;
8449    }
8450    jint _exception = 0;
8451    const char * _exceptionType = NULL;
8452    const char * _exceptionMessage = NULL;
8453    GLfloat *params_base = (GLfloat *) 0;
8454    jint _remaining;
8455    GLfloat *params = (GLfloat *) 0;
8456
8457    if (!params_ref) {
8458        _exception = 1;
8459        _exceptionType = "java/lang/IllegalArgumentException";
8460        _exceptionMessage = "params == null";
8461        goto exit;
8462    }
8463    if (offset < 0) {
8464        _exception = 1;
8465        _exceptionType = "java/lang/IllegalArgumentException";
8466        _exceptionMessage = "offset < 0";
8467        goto exit;
8468    }
8469    _remaining = _env->GetArrayLength(params_ref) - offset;
8470    params_base = (GLfloat *)
8471        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
8472    params = params_base + offset;
8473
8474    glGetTexGenfv(
8475        (GLint)coord,
8476        (GLint)pname,
8477        (GLfloat *)params
8478    );
8479
8480exit:
8481    if (params_base) {
8482        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
8483            _exception ? JNI_ABORT: 0);
8484    }
8485    if (_exception) {
8486        jniThrowException(_env, _exceptionType, _exceptionMessage);
8487    }
8488}
8489
8490/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8491static void
8492android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
8493  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
8494    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8495        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8496            "glGetTexGenfv");
8497            return;
8498    }
8499    jint _exception = 0;
8500    const char * _exceptionType = NULL;
8501    const char * _exceptionMessage = NULL;
8502    jfloatArray _array = (jfloatArray) 0;
8503    jint _bufferOffset = (jint) 0;
8504    jint _remaining;
8505    GLfloat *params = (GLfloat *) 0;
8506
8507    if (!params_buf) {
8508        _exception = 1;
8509        _exceptionType = "java/lang/IllegalArgumentException";
8510        _exceptionMessage = "params == null";
8511        goto exit;
8512    }
8513    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8514    if (params == NULL) {
8515        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
8516        params = (GLfloat *) (_paramsBase + _bufferOffset);
8517    }
8518    glGetTexGenfv(
8519        (GLint)coord,
8520        (GLint)pname,
8521        (GLfloat *)params
8522    );
8523
8524exit:
8525    if (_array) {
8526        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8527    }
8528    if (_exception) {
8529        jniThrowException(_env, _exceptionType, _exceptionMessage);
8530    }
8531}
8532
8533/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8534static void
8535android_glGetTexGeniv__II_3II
8536  (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
8537    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8538        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8539            "glGetTexGeniv");
8540            return;
8541    }
8542    jint _exception = 0;
8543    const char * _exceptionType = NULL;
8544    const char * _exceptionMessage = NULL;
8545    GLint *params_base = (GLint *) 0;
8546    jint _remaining;
8547    GLint *params = (GLint *) 0;
8548
8549    if (!params_ref) {
8550        _exception = 1;
8551        _exceptionType = "java/lang/IllegalArgumentException";
8552        _exceptionMessage = "params == null";
8553        goto exit;
8554    }
8555    if (offset < 0) {
8556        _exception = 1;
8557        _exceptionType = "java/lang/IllegalArgumentException";
8558        _exceptionMessage = "offset < 0";
8559        goto exit;
8560    }
8561    _remaining = _env->GetArrayLength(params_ref) - offset;
8562    params_base = (GLint *)
8563        _env->GetIntArrayElements(params_ref, (jboolean *)0);
8564    params = params_base + offset;
8565
8566    glGetTexGeniv(
8567        (GLint)coord,
8568        (GLint)pname,
8569        (GLint *)params
8570    );
8571
8572exit:
8573    if (params_base) {
8574        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
8575            _exception ? JNI_ABORT: 0);
8576    }
8577    if (_exception) {
8578        jniThrowException(_env, _exceptionType, _exceptionMessage);
8579    }
8580}
8581
8582/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8583static void
8584android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8585  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
8586    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8587        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8588            "glGetTexGeniv");
8589            return;
8590    }
8591    jint _exception = 0;
8592    const char * _exceptionType = NULL;
8593    const char * _exceptionMessage = NULL;
8594    jintArray _array = (jintArray) 0;
8595    jint _bufferOffset = (jint) 0;
8596    jint _remaining;
8597    GLint *params = (GLint *) 0;
8598
8599    if (!params_buf) {
8600        _exception = 1;
8601        _exceptionType = "java/lang/IllegalArgumentException";
8602        _exceptionMessage = "params == null";
8603        goto exit;
8604    }
8605    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8606    if (params == NULL) {
8607        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8608        params = (GLint *) (_paramsBase + _bufferOffset);
8609    }
8610    glGetTexGeniv(
8611        (GLint)coord,
8612        (GLint)pname,
8613        (GLint *)params
8614    );
8615
8616exit:
8617    if (_array) {
8618        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8619    }
8620    if (_exception) {
8621        jniThrowException(_env, _exceptionType, _exceptionMessage);
8622    }
8623}
8624
8625/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8626static void
8627android_glGetTexGenxv__II_3II
8628  (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
8629    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8630        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8631            "glGetTexGenxv");
8632            return;
8633    }
8634    jint _exception = 0;
8635    const char * _exceptionType = NULL;
8636    const char * _exceptionMessage = NULL;
8637    GLint *params_base = (GLint *) 0;
8638    jint _remaining;
8639    GLint *params = (GLint *) 0;
8640
8641    if (!params_ref) {
8642        _exception = 1;
8643        _exceptionType = "java/lang/IllegalArgumentException";
8644        _exceptionMessage = "params == null";
8645        goto exit;
8646    }
8647    if (offset < 0) {
8648        _exception = 1;
8649        _exceptionType = "java/lang/IllegalArgumentException";
8650        _exceptionMessage = "offset < 0";
8651        goto exit;
8652    }
8653    _remaining = _env->GetArrayLength(params_ref) - offset;
8654    params_base = (GLint *)
8655        _env->GetIntArrayElements(params_ref, (jboolean *)0);
8656    params = params_base + offset;
8657
8658    glGetTexGenxv(
8659        (GLint)coord,
8660        (GLint)pname,
8661        (GLint *)params
8662    );
8663
8664exit:
8665    if (params_base) {
8666        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
8667            _exception ? JNI_ABORT: 0);
8668    }
8669    if (_exception) {
8670        jniThrowException(_env, _exceptionType, _exceptionMessage);
8671    }
8672}
8673
8674/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8675static void
8676android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8677  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
8678    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8679        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8680            "glGetTexGenxv");
8681            return;
8682    }
8683    jint _exception = 0;
8684    const char * _exceptionType = NULL;
8685    const char * _exceptionMessage = NULL;
8686    jintArray _array = (jintArray) 0;
8687    jint _bufferOffset = (jint) 0;
8688    jint _remaining;
8689    GLint *params = (GLint *) 0;
8690
8691    if (!params_buf) {
8692        _exception = 1;
8693        _exceptionType = "java/lang/IllegalArgumentException";
8694        _exceptionMessage = "params == null";
8695        goto exit;
8696    }
8697    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8698    if (params == NULL) {
8699        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8700        params = (GLint *) (_paramsBase + _bufferOffset);
8701    }
8702    glGetTexGenxv(
8703        (GLint)coord,
8704        (GLint)pname,
8705        (GLint *)params
8706    );
8707
8708exit:
8709    if (_array) {
8710        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8711    }
8712    if (_exception) {
8713        jniThrowException(_env, _exceptionType, _exceptionMessage);
8714    }
8715}
8716
8717/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8718static jboolean
8719android_glIsFramebufferOES__I
8720  (JNIEnv *_env, jobject _this, jint framebuffer) {
8721    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8722        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8723            "glIsFramebufferOES");
8724    return JNI_FALSE;
8725    }
8726    GLboolean _returnValue = JNI_FALSE;
8727    _returnValue = glIsFramebufferOES(
8728        (GLint)framebuffer
8729    );
8730    return (jboolean)_returnValue;
8731}
8732
8733/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8734static jboolean
8735android_glIsRenderbufferOES__I
8736  (JNIEnv *_env, jobject _this, jint renderbuffer) {
8737    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8738        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8739            "glIsRenderbufferOES");
8740    return JNI_FALSE;
8741    }
8742    GLboolean _returnValue = JNI_FALSE;
8743    _returnValue = glIsRenderbufferOES(
8744        (GLint)renderbuffer
8745    );
8746    return (jboolean)_returnValue;
8747}
8748
8749/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8750static void
8751android_glRenderbufferStorageOES__IIII
8752  (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
8753    if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
8754        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8755            "glRenderbufferStorageOES");
8756            return;
8757    }
8758    glRenderbufferStorageOES(
8759        (GLint)target,
8760        (GLint)internalformat,
8761        (GLint)width,
8762        (GLint)height
8763    );
8764}
8765
8766/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8767static void
8768android_glTexGenf__IIF
8769  (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
8770    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8771        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8772            "glTexGenf");
8773            return;
8774    }
8775    glTexGenf(
8776        (GLint)coord,
8777        (GLint)pname,
8778        (GLfloat)param
8779    );
8780}
8781
8782/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8783static void
8784android_glTexGenfv__II_3FI
8785  (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
8786    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8787        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8788            "glTexGenfv");
8789            return;
8790    }
8791    jint _exception = 0;
8792    const char * _exceptionType = NULL;
8793    const char * _exceptionMessage = NULL;
8794    GLfloat *params_base = (GLfloat *) 0;
8795    jint _remaining;
8796    GLfloat *params = (GLfloat *) 0;
8797
8798    if (!params_ref) {
8799        _exception = 1;
8800        _exceptionType = "java/lang/IllegalArgumentException";
8801        _exceptionMessage = "params == null";
8802        goto exit;
8803    }
8804    if (offset < 0) {
8805        _exception = 1;
8806        _exceptionType = "java/lang/IllegalArgumentException";
8807        _exceptionMessage = "offset < 0";
8808        goto exit;
8809    }
8810    _remaining = _env->GetArrayLength(params_ref) - offset;
8811    params_base = (GLfloat *)
8812        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
8813    params = params_base + offset;
8814
8815    glTexGenfv(
8816        (GLint)coord,
8817        (GLint)pname,
8818        (GLfloat *)params
8819    );
8820
8821exit:
8822    if (params_base) {
8823        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
8824            _exception ? JNI_ABORT: 0);
8825    }
8826    if (_exception) {
8827        jniThrowException(_env, _exceptionType, _exceptionMessage);
8828    }
8829}
8830
8831/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8832static void
8833android_glTexGenfv__IILjava_nio_FloatBuffer_2
8834  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
8835    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8836        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8837            "glTexGenfv");
8838            return;
8839    }
8840    jint _exception = 0;
8841    const char * _exceptionType = NULL;
8842    const char * _exceptionMessage = NULL;
8843    jfloatArray _array = (jfloatArray) 0;
8844    jint _bufferOffset = (jint) 0;
8845    jint _remaining;
8846    GLfloat *params = (GLfloat *) 0;
8847
8848    if (!params_buf) {
8849        _exception = 1;
8850        _exceptionType = "java/lang/IllegalArgumentException";
8851        _exceptionMessage = "params == null";
8852        goto exit;
8853    }
8854    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8855    if (params == NULL) {
8856        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
8857        params = (GLfloat *) (_paramsBase + _bufferOffset);
8858    }
8859    glTexGenfv(
8860        (GLint)coord,
8861        (GLint)pname,
8862        (GLfloat *)params
8863    );
8864
8865exit:
8866    if (_array) {
8867        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8868    }
8869    if (_exception) {
8870        jniThrowException(_env, _exceptionType, _exceptionMessage);
8871    }
8872}
8873
8874/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8875static void
8876android_glTexGeni__III
8877  (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
8878    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8879        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8880            "glTexGeni");
8881            return;
8882    }
8883    glTexGeni(
8884        (GLint)coord,
8885        (GLint)pname,
8886        (GLint)param
8887    );
8888}
8889
8890/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8891static void
8892android_glTexGeniv__II_3II
8893  (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
8894    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8895        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8896            "glTexGeniv");
8897            return;
8898    }
8899    jint _exception = 0;
8900    const char * _exceptionType = NULL;
8901    const char * _exceptionMessage = NULL;
8902    GLint *params_base = (GLint *) 0;
8903    jint _remaining;
8904    GLint *params = (GLint *) 0;
8905
8906    if (!params_ref) {
8907        _exception = 1;
8908        _exceptionType = "java/lang/IllegalArgumentException";
8909        _exceptionMessage = "params == null";
8910        goto exit;
8911    }
8912    if (offset < 0) {
8913        _exception = 1;
8914        _exceptionType = "java/lang/IllegalArgumentException";
8915        _exceptionMessage = "offset < 0";
8916        goto exit;
8917    }
8918    _remaining = _env->GetArrayLength(params_ref) - offset;
8919    params_base = (GLint *)
8920        _env->GetIntArrayElements(params_ref, (jboolean *)0);
8921    params = params_base + offset;
8922
8923    glTexGeniv(
8924        (GLint)coord,
8925        (GLint)pname,
8926        (GLint *)params
8927    );
8928
8929exit:
8930    if (params_base) {
8931        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
8932            _exception ? JNI_ABORT: 0);
8933    }
8934    if (_exception) {
8935        jniThrowException(_env, _exceptionType, _exceptionMessage);
8936    }
8937}
8938
8939/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8940static void
8941android_glTexGeniv__IILjava_nio_IntBuffer_2
8942  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
8943    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8944        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8945            "glTexGeniv");
8946            return;
8947    }
8948    jint _exception = 0;
8949    const char * _exceptionType = NULL;
8950    const char * _exceptionMessage = NULL;
8951    jintArray _array = (jintArray) 0;
8952    jint _bufferOffset = (jint) 0;
8953    jint _remaining;
8954    GLint *params = (GLint *) 0;
8955
8956    if (!params_buf) {
8957        _exception = 1;
8958        _exceptionType = "java/lang/IllegalArgumentException";
8959        _exceptionMessage = "params == null";
8960        goto exit;
8961    }
8962    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
8963    if (params == NULL) {
8964        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
8965        params = (GLint *) (_paramsBase + _bufferOffset);
8966    }
8967    glTexGeniv(
8968        (GLint)coord,
8969        (GLint)pname,
8970        (GLint *)params
8971    );
8972
8973exit:
8974    if (_array) {
8975        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8976    }
8977    if (_exception) {
8978        jniThrowException(_env, _exceptionType, _exceptionMessage);
8979    }
8980}
8981
8982/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8983static void
8984android_glTexGenx__III
8985  (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
8986    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
8987        jniThrowException(_env, "java/lang/UnsupportedOperationException",
8988            "glTexGenx");
8989            return;
8990    }
8991    glTexGenx(
8992        (GLint)coord,
8993        (GLint)pname,
8994        (GLint)param
8995    );
8996}
8997
8998/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8999static void
9000android_glTexGenxv__II_3II
9001  (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
9002    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
9003        jniThrowException(_env, "java/lang/UnsupportedOperationException",
9004            "glTexGenxv");
9005            return;
9006    }
9007    jint _exception = 0;
9008    const char * _exceptionType = NULL;
9009    const char * _exceptionMessage = NULL;
9010    GLint *params_base = (GLint *) 0;
9011    jint _remaining;
9012    GLint *params = (GLint *) 0;
9013
9014    if (!params_ref) {
9015        _exception = 1;
9016        _exceptionType = "java/lang/IllegalArgumentException";
9017        _exceptionMessage = "params == null";
9018        goto exit;
9019    }
9020    if (offset < 0) {
9021        _exception = 1;
9022        _exceptionType = "java/lang/IllegalArgumentException";
9023        _exceptionMessage = "offset < 0";
9024        goto exit;
9025    }
9026    _remaining = _env->GetArrayLength(params_ref) - offset;
9027    params_base = (GLint *)
9028        _env->GetIntArrayElements(params_ref, (jboolean *)0);
9029    params = params_base + offset;
9030
9031    glTexGenxv(
9032        (GLint)coord,
9033        (GLint)pname,
9034        (GLint *)params
9035    );
9036
9037exit:
9038    if (params_base) {
9039        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
9040            _exception ? JNI_ABORT: 0);
9041    }
9042    if (_exception) {
9043        jniThrowException(_env, _exceptionType, _exceptionMessage);
9044    }
9045}
9046
9047/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
9048static void
9049android_glTexGenxv__IILjava_nio_IntBuffer_2
9050  (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
9051    if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
9052        jniThrowException(_env, "java/lang/UnsupportedOperationException",
9053            "glTexGenxv");
9054            return;
9055    }
9056    jint _exception = 0;
9057    const char * _exceptionType = NULL;
9058    const char * _exceptionMessage = NULL;
9059    jintArray _array = (jintArray) 0;
9060    jint _bufferOffset = (jint) 0;
9061    jint _remaining;
9062    GLint *params = (GLint *) 0;
9063
9064    if (!params_buf) {
9065        _exception = 1;
9066        _exceptionType = "java/lang/IllegalArgumentException";
9067        _exceptionMessage = "params == null";
9068        goto exit;
9069    }
9070    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
9071    if (params == NULL) {
9072        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
9073        params = (GLint *) (_paramsBase + _bufferOffset);
9074    }
9075    glTexGenxv(
9076        (GLint)coord,
9077        (GLint)pname,
9078        (GLint *)params
9079    );
9080
9081exit:
9082    if (_array) {
9083        _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
9084    }
9085    if (_exception) {
9086        jniThrowException(_env, _exceptionType, _exceptionMessage);
9087    }
9088}
9089
9090static const char *classPathName = "com/google/android/gles_jni/GLImpl";
9091
9092static const JNINativeMethod methods[] = {
9093{"_nativeClassInit", "()V", (void*)nativeClassInit },
9094{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
9095{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
9096{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
9097{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
9098{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
9099{"glClear", "(I)V", (void *) android_glClear__I },
9100{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
9101{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
9102{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
9103{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
9104{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
9105{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
9106{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
9107{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
9108{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
9109{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
9110{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
9111{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9112{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
9113{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
9114{"glCullFace", "(I)V", (void *) android_glCullFace__I },
9115{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
9116{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
9117{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
9118{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
9119{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
9120{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
9121{"glDisable", "(I)V", (void *) android_glDisable__I },
9122{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
9123{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
9124{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
9125{"glEnable", "(I)V", (void *) android_glEnable__I },
9126{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
9127{"glFinish", "()V", (void *) android_glFinish__ },
9128{"glFlush", "()V", (void *) android_glFlush__ },
9129{"glFogf", "(IF)V", (void *) android_glFogf__IF },
9130{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
9131{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
9132{"glFogx", "(II)V", (void *) android_glFogx__II },
9133{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
9134{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
9135{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
9136{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
9137{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
9138{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
9139{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
9140{"glGetError", "()I", (void *) android_glGetError__ },
9141{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
9142{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
9143{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
9144{"glHint", "(II)V", (void *) android_glHint__II },
9145{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
9146{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
9147{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
9148{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
9149{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
9150{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
9151{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
9152{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
9153{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
9154{"glLightx", "(III)V", (void *) android_glLightx__III },
9155{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
9156{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
9157{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
9158{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
9159{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
9160{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
9161{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
9162{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
9163{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
9164{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
9165{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
9166{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
9167{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
9168{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
9169{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
9170{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
9171{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
9172{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
9173{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
9174{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
9175{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
9176{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
9177{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
9178{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
9179{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
9180{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
9181{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
9182{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
9183{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
9184{"glPointSize", "(F)V", (void *) android_glPointSize__F },
9185{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
9186{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
9187{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
9188{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
9189{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
9190{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
9191{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
9192{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
9193{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
9194{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
9195{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
9196{"glScalex", "(III)V", (void *) android_glScalex__III },
9197{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
9198{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
9199{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
9200{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
9201{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
9202{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
9203{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
9204{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
9205{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
9206{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
9207{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
9208{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
9209{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
9210{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
9211{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
9212{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9213{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
9214{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
9215{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
9216{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
9217{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
9218{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
9219{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
9220{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
9221{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
9222{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
9223{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
9224{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
9225{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
9226{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
9227{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
9228{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
9229{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
9230{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
9231{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
9232{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
9233{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
9234{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
9235{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
9236{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
9237{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
9238{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
9239{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
9240{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
9241{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
9242{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
9243{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
9244{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
9245{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
9246{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
9247{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
9248{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
9249{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
9250{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
9251{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
9252{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
9253{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
9254{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
9255{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
9256{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
9257{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
9258{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
9259{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
9260{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
9261{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
9262{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
9263{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
9264{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
9265{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
9266{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
9267{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
9268{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
9269{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
9270{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
9271{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
9272{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
9273{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
9274{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
9275{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
9276{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
9277{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
9278{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
9279{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
9280{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
9281{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
9282{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
9283{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
9284{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
9285{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
9286{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
9287{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
9288{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
9289{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
9290{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
9291{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
9292{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
9293{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
9294{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
9295{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
9296{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
9297{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
9298{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
9299{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
9300{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
9301{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
9302{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
9303{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
9304{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
9305{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
9306{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
9307{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
9308{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
9309{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
9310{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
9311{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
9312{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
9313{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9314{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
9315{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
9316{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
9317{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
9318{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
9319{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
9320{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9321{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
9322{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
9323{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
9324{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
9325{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
9326{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
9327{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
9328{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
9329{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
9330{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
9331{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
9332{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
9333{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
9334{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
9335{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
9336{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
9337{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
9338{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
9339{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
9340{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
9341{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
9342{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
9343};
9344
9345int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
9346{
9347    int err;
9348    err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
9349    return err;
9350}
9351