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