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