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