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