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