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