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