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