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