blob: 1d12b0a862beec1b4712ff4326d448c8aa53e2a4 [file] [log] [blame]
Jesse Halld830e742013-03-29 11:02:35 -07001/*
2**
3** Copyright 2013, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18// This source file is automatically generated
19
Andreas Gampebfe63332014-11-12 14:12:45 -080020#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22#pragma GCC diagnostic ignored "-Wunused-function"
23
Jesse Halld830e742013-03-29 11:02:35 -070024#include <GLES3/gl3.h>
25#include <GLES3/gl3ext.h>
26
Jesse Hall9626f822014-05-19 20:57:49 -070027#include <jni.h>
28#include <JNIHelp.h>
Jesse Halld830e742013-03-29 11:02:35 -070029#include <android_runtime/AndroidRuntime.h>
30#include <utils/misc.h>
31#include <assert.h>
32
33static int initialized = 0;
34
35static jclass nioAccessClass;
36static jclass bufferClass;
37static jmethodID getBasePointerID;
38static jmethodID getBaseArrayID;
39static jmethodID getBaseArrayOffsetID;
40static jfieldID positionID;
41static jfieldID limitID;
42static jfieldID elementSizeShiftID;
43
44
45/* special calls implemented in Android's GLES wrapper used to more
46 * efficiently bound-check passed arrays */
47extern "C" {
48#ifdef GL_VERSION_ES_CM_1_1
49GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
63#endif
64#ifdef GL_ES_VERSION_2_0
65static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
66 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
67 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
68}
69#endif
70#ifdef GL_ES_VERSION_3_0
71static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
72 GLsizei stride, const GLvoid *pointer, GLsizei count) {
73 glVertexAttribIPointer(indx, size, type, stride, pointer);
74}
75#endif
76}
77
78/* Cache method IDs each time the class is loaded. */
79
80static void
81nativeClassInit(JNIEnv *_env, jclass glImplClass)
82{
83 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
84 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
85
86 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
87 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
88
89 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
90 "getBasePointer", "(Ljava/nio/Buffer;)J");
91 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
93 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
94 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
95
96 positionID = _env->GetFieldID(bufferClass, "position", "I");
97 limitID = _env->GetFieldID(bufferClass, "limit", "I");
98 elementSizeShiftID =
99 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
100}
101
102static void *
103getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
104{
105 jint position;
106 jint limit;
107 jint elementSizeShift;
108 jlong pointer;
109
110 position = _env->GetIntField(buffer, positionID);
111 limit = _env->GetIntField(buffer, limitID);
112 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
113 *remaining = (limit - position) << elementSizeShift;
114 pointer = _env->CallStaticLongMethod(nioAccessClass,
115 getBasePointerID, buffer);
116 if (pointer != 0L) {
117 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000118 return reinterpret_cast<void*>(pointer);
Jesse Halld830e742013-03-29 11:02:35 -0700119 }
120
121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
122 getBaseArrayID, buffer);
123 *offset = _env->CallStaticIntMethod(nioAccessClass,
124 getBaseArrayOffsetID, buffer);
125
126 return NULL;
127}
128
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700129class ByteArrayGetter {
130public:
131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
132 return _env->GetByteArrayElements(array, is_copy);
133 }
134};
135class BooleanArrayGetter {
136public:
137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
138 return _env->GetBooleanArrayElements(array, is_copy);
139 }
140};
141class CharArrayGetter {
142public:
143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
144 return _env->GetCharArrayElements(array, is_copy);
145 }
146};
147class ShortArrayGetter {
148public:
149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
150 return _env->GetShortArrayElements(array, is_copy);
151 }
152};
153class IntArrayGetter {
154public:
155 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
156 return _env->GetIntArrayElements(array, is_copy);
157 }
158};
159class LongArrayGetter {
160public:
161 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
162 return _env->GetLongArrayElements(array, is_copy);
163 }
164};
165class FloatArrayGetter {
166public:
167 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
168 return _env->GetFloatArrayElements(array, is_copy);
169 }
170};
171class DoubleArrayGetter {
172public:
173 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
174 return _env->GetDoubleArrayElements(array, is_copy);
175 }
176};
177
178template<typename JTYPEARRAY, typename ARRAYGETTER>
179static void*
180getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
181 return ARRAYGETTER::Get(_env, array, is_copy);
182}
183
184class ByteArrayReleaser {
185public:
186 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
187 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
188 }
189};
190class BooleanArrayReleaser {
191public:
192 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
193 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
194 }
195};
196class CharArrayReleaser {
197public:
198 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
199 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
200 }
201};
202class ShortArrayReleaser {
203public:
204 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
205 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
206 }
207};
208class IntArrayReleaser {
209public:
210 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
211 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
212 }
213};
214class LongArrayReleaser {
215public:
216 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
217 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
218 }
219};
220class FloatArrayReleaser {
221public:
222 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
223 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
224 }
225};
226class DoubleArrayReleaser {
227public:
228 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
229 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
230 }
231};
232
233template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
234static void
235releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
236 ARRAYRELEASER::Release(_env, array, data, commit);
237}
238
Jesse Halld830e742013-03-29 11:02:35 -0700239static void
240releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
241{
242 _env->ReleasePrimitiveArrayCritical(array, data,
243 commit ? 0 : JNI_ABORT);
244}
245
246static void *
247getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
248 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
249 if (buf) {
250 jint position = _env->GetIntField(buffer, positionID);
251 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
252 buf += position << elementSizeShift;
253 } else {
254 jniThrowException(_env, "java/lang/IllegalArgumentException",
255 "Must use a native order direct Buffer");
256 }
257 return (void*) buf;
258}
259
260// --------------------------------------------------------------------------
261
262/*
263 * returns the number of values glGet returns for a given pname.
264 *
265 * The code below is written such that pnames requiring only one values
266 * are the default (and are not explicitely tested for). This makes the
267 * checking code much shorter/readable/efficient.
268 *
269 * This means that unknown pnames (e.g.: extensions) will default to 1. If
270 * that unknown pname needs more than 1 value, then the validation check
271 * is incomplete and the app may crash if it passed the wrong number params.
272 */
273static int getNeededCount(GLint pname) {
274 int needed = 1;
Romain Guydc43a6c2017-02-17 19:54:25 -0800275#ifdef GL_ES_VERSION_3_0
276 // GLES 3.x pnames
277 switch (pname) {
278 case GL_MAX_VIEWPORT_DIMS:
279 needed = 2;
280 break;
281
282 case GL_PROGRAM_BINARY_FORMATS:
283 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
284 break;
285 }
286#endif
287
Jesse Halld830e742013-03-29 11:02:35 -0700288#ifdef GL_ES_VERSION_2_0
289 // GLES 2.x pnames
290 switch (pname) {
291 case GL_ALIASED_LINE_WIDTH_RANGE:
292 case GL_ALIASED_POINT_SIZE_RANGE:
293 needed = 2;
294 break;
295
296 case GL_BLEND_COLOR:
297 case GL_COLOR_CLEAR_VALUE:
298 case GL_COLOR_WRITEMASK:
299 case GL_SCISSOR_BOX:
300 case GL_VIEWPORT:
301 needed = 4;
302 break;
303
304 case GL_COMPRESSED_TEXTURE_FORMATS:
305 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
306 break;
307
308 case GL_SHADER_BINARY_FORMATS:
309 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
310 break;
311 }
312#endif
313
314#ifdef GL_VERSION_ES_CM_1_1
315 // GLES 1.x pnames
316 switch (pname) {
317 case GL_ALIASED_LINE_WIDTH_RANGE:
318 case GL_ALIASED_POINT_SIZE_RANGE:
319 case GL_DEPTH_RANGE:
320 case GL_SMOOTH_LINE_WIDTH_RANGE:
321 case GL_SMOOTH_POINT_SIZE_RANGE:
322 needed = 2;
323 break;
324
325 case GL_CURRENT_NORMAL:
326 case GL_POINT_DISTANCE_ATTENUATION:
327 needed = 3;
328 break;
329
330 case GL_COLOR_CLEAR_VALUE:
331 case GL_COLOR_WRITEMASK:
332 case GL_CURRENT_COLOR:
333 case GL_CURRENT_TEXTURE_COORDS:
334 case GL_FOG_COLOR:
335 case GL_LIGHT_MODEL_AMBIENT:
336 case GL_SCISSOR_BOX:
337 case GL_VIEWPORT:
338 needed = 4;
339 break;
340
341 case GL_MODELVIEW_MATRIX:
342 case GL_PROJECTION_MATRIX:
343 case GL_TEXTURE_MATRIX:
344 needed = 16;
345 break;
346
347 case GL_COMPRESSED_TEXTURE_FORMATS:
348 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
349 break;
350 }
351#endif
352 return needed;
353}
354
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700355template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
356 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700357static void
358get
359 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
360 jint _exception = 0;
361 const char * _exceptionType;
362 const char * _exceptionMessage;
363 CTYPE *params_base = (CTYPE *) 0;
364 jint _remaining;
365 CTYPE *params = (CTYPE *) 0;
366 int _needed = 0;
367
368 if (!params_ref) {
369 _exception = 1;
370 _exceptionType = "java/lang/IllegalArgumentException";
371 _exceptionMessage = "params == null";
372 goto exit;
373 }
374 if (offset < 0) {
375 _exception = 1;
376 _exceptionType = "java/lang/IllegalArgumentException";
377 _exceptionMessage = "offset < 0";
378 goto exit;
379 }
380 _remaining = _env->GetArrayLength(params_ref) - offset;
381 _needed = getNeededCount(pname);
382 // if we didn't find this pname, we just assume the user passed
383 // an array of the right size -- this might happen with extensions
384 // or if we forget an enum here.
385 if (_remaining < _needed) {
386 _exception = 1;
387 _exceptionType = "java/lang/IllegalArgumentException";
388 _exceptionMessage = "length - offset < needed";
389 goto exit;
390 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700391 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
392 _env, params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700393 params = params_base + offset;
394
395 GET(
396 (GLenum)pname,
397 (CTYPE *)params
398 );
399
400exit:
401 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700402 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
403 _env, params_ref, params_base, !_exception);
Jesse Halld830e742013-03-29 11:02:35 -0700404 }
405 if (_exception) {
406 jniThrowException(_env, _exceptionType, _exceptionMessage);
407 }
408}
409
410
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700411template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
412 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700413static void
414getarray
415 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
416 jint _exception = 0;
417 const char * _exceptionType;
418 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700419 JTYPEARRAY _array = (JTYPEARRAY) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700420 jint _bufferOffset = (jint) 0;
421 jint _remaining;
422 CTYPE *params = (CTYPE *) 0;
423 int _needed = 0;
424
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700425 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700426 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Jesse Halld830e742013-03-29 11:02:35 -0700427 _needed = getNeededCount(pname);
428 // if we didn't find this pname, we just assume the user passed
429 // an array of the right size -- this might happen with extensions
430 // or if we forget an enum here.
431 if (_needed>0 && _remaining < _needed) {
432 _exception = 1;
433 _exceptionType = "java/lang/IllegalArgumentException";
434 _exceptionMessage = "remaining() < needed";
435 goto exit;
436 }
437 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700438 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
439 _env, _array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700440 params = (CTYPE *) (_paramsBase + _bufferOffset);
441 }
442 GET(
443 (GLenum)pname,
444 (CTYPE *)params
445 );
446
447exit:
448 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700449 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
450 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -0700451 }
452 if (_exception) {
453 jniThrowException(_env, _exceptionType, _exceptionMessage);
454 }
455}
456
457// --------------------------------------------------------------------------
458/* void glReadBuffer ( GLenum mode ) */
459static void
460android_glReadBuffer__I
461 (JNIEnv *_env, jobject _this, jint mode) {
462 glReadBuffer(
463 (GLenum)mode
464 );
465}
466
467/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
468static void
469android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
470 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800471 jint _exception = 0;
472 const char * _exceptionType = NULL;
473 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700474 jarray _array = (jarray) 0;
475 jint _bufferOffset = (jint) 0;
476 jint _remaining;
477 GLvoid *indices = (GLvoid *) 0;
478
Romain Guy84cac202016-12-05 12:26:02 -0800479 if (!indices_buf) {
480 _exception = 1;
481 _exceptionType = "java/lang/IllegalArgumentException";
482 _exceptionMessage = "indices == null";
483 goto exit;
484 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700485 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700486 if (indices == NULL) {
487 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
488 indices = (GLvoid *) (_indicesBase + _bufferOffset);
489 }
490 glDrawRangeElements(
491 (GLenum)mode,
492 (GLuint)start,
493 (GLuint)end,
494 (GLsizei)count,
495 (GLenum)type,
496 (GLvoid *)indices
497 );
Romain Guy84cac202016-12-05 12:26:02 -0800498
499exit:
Jesse Halld830e742013-03-29 11:02:35 -0700500 if (_array) {
501 releasePointer(_env, _array, indices, JNI_FALSE);
502 }
Romain Guy84cac202016-12-05 12:26:02 -0800503 if (_exception) {
504 jniThrowException(_env, _exceptionType, _exceptionMessage);
505 }
Jesse Halld830e742013-03-29 11:02:35 -0700506}
507
508/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
509static void
510android_glDrawRangeElements__IIIIII
511 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
512 glDrawRangeElements(
513 (GLenum)mode,
514 (GLuint)start,
515 (GLuint)end,
516 (GLsizei)count,
517 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000518 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700519 );
520}
521
522/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
523static void
524android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
525 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800526 jint _exception = 0;
527 const char * _exceptionType = NULL;
528 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700529 jarray _array = (jarray) 0;
530 jint _bufferOffset = (jint) 0;
531 jint _remaining;
532 GLvoid *pixels = (GLvoid *) 0;
533
Pablo Ceballos6aff9062015-10-01 18:35:39 -0700534 if (pixels_buf) {
535 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
536 }
537 if (pixels_buf && pixels == NULL) {
Jesse Halld830e742013-03-29 11:02:35 -0700538 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
539 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
540 }
541 glTexImage3D(
542 (GLenum)target,
543 (GLint)level,
544 (GLint)internalformat,
545 (GLsizei)width,
546 (GLsizei)height,
547 (GLsizei)depth,
548 (GLint)border,
549 (GLenum)format,
550 (GLenum)type,
551 (GLvoid *)pixels
552 );
553 if (_array) {
554 releasePointer(_env, _array, pixels, JNI_FALSE);
555 }
Romain Guy84cac202016-12-05 12:26:02 -0800556 if (_exception) {
557 jniThrowException(_env, _exceptionType, _exceptionMessage);
558 }
Jesse Halld830e742013-03-29 11:02:35 -0700559}
560
561/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
562static void
563android_glTexImage3D__IIIIIIIIII
564 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
565 glTexImage3D(
566 (GLenum)target,
567 (GLint)level,
568 (GLint)internalformat,
569 (GLsizei)width,
570 (GLsizei)height,
571 (GLsizei)depth,
572 (GLint)border,
573 (GLenum)format,
574 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000575 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700576 );
577}
578
579/* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) */
580static void
581android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
582 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800583 jint _exception = 0;
584 const char * _exceptionType = NULL;
585 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700586 jarray _array = (jarray) 0;
587 jint _bufferOffset = (jint) 0;
588 jint _remaining;
589 GLvoid *pixels = (GLvoid *) 0;
590
Romain Guy84cac202016-12-05 12:26:02 -0800591 if (!pixels_buf) {
592 _exception = 1;
593 _exceptionType = "java/lang/IllegalArgumentException";
594 _exceptionMessage = "pixels == null";
595 goto exit;
596 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700597 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700598 if (pixels == NULL) {
599 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
600 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
601 }
602 glTexSubImage3D(
603 (GLenum)target,
604 (GLint)level,
605 (GLint)xoffset,
606 (GLint)yoffset,
607 (GLint)zoffset,
608 (GLsizei)width,
609 (GLsizei)height,
610 (GLsizei)depth,
611 (GLenum)format,
612 (GLenum)type,
613 (GLvoid *)pixels
614 );
Romain Guy84cac202016-12-05 12:26:02 -0800615
616exit:
Jesse Halld830e742013-03-29 11:02:35 -0700617 if (_array) {
618 releasePointer(_env, _array, pixels, JNI_FALSE);
619 }
Romain Guy84cac202016-12-05 12:26:02 -0800620 if (_exception) {
621 jniThrowException(_env, _exceptionType, _exceptionMessage);
622 }
Jesse Halld830e742013-03-29 11:02:35 -0700623}
624
625/* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
626static void
627android_glTexSubImage3D__IIIIIIIIIII
628 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint offset) {
629 glTexSubImage3D(
630 (GLenum)target,
631 (GLint)level,
632 (GLint)xoffset,
633 (GLint)yoffset,
634 (GLint)zoffset,
635 (GLsizei)width,
636 (GLsizei)height,
637 (GLsizei)depth,
638 (GLenum)format,
639 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000640 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700641 );
642}
643
644/* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
645static void
646android_glCopyTexSubImage3D__IIIIIIIII
647 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
648 glCopyTexSubImage3D(
649 (GLenum)target,
650 (GLint)level,
651 (GLint)xoffset,
652 (GLint)yoffset,
653 (GLint)zoffset,
654 (GLint)x,
655 (GLint)y,
656 (GLsizei)width,
657 (GLsizei)height
658 );
659}
660
661/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
662static void
663android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
664 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800665 jint _exception = 0;
666 const char * _exceptionType = NULL;
667 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700668 jarray _array = (jarray) 0;
669 jint _bufferOffset = (jint) 0;
670 jint _remaining;
671 GLvoid *data = (GLvoid *) 0;
672
Romain Guy84cac202016-12-05 12:26:02 -0800673 if (!data_buf) {
674 _exception = 1;
675 _exceptionType = "java/lang/IllegalArgumentException";
676 _exceptionMessage = "data == null";
677 goto exit;
678 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700679 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700680 if (data == NULL) {
681 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
682 data = (GLvoid *) (_dataBase + _bufferOffset);
683 }
684 glCompressedTexImage3D(
685 (GLenum)target,
686 (GLint)level,
687 (GLenum)internalformat,
688 (GLsizei)width,
689 (GLsizei)height,
690 (GLsizei)depth,
691 (GLint)border,
692 (GLsizei)imageSize,
693 (GLvoid *)data
694 );
Romain Guy84cac202016-12-05 12:26:02 -0800695
696exit:
Jesse Halld830e742013-03-29 11:02:35 -0700697 if (_array) {
698 releasePointer(_env, _array, data, JNI_FALSE);
699 }
Romain Guy84cac202016-12-05 12:26:02 -0800700 if (_exception) {
701 jniThrowException(_env, _exceptionType, _exceptionMessage);
702 }
Jesse Halld830e742013-03-29 11:02:35 -0700703}
704
705/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
706static void
707android_glCompressedTexImage3D__IIIIIIIII
708 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
709 glCompressedTexImage3D(
710 (GLenum)target,
711 (GLint)level,
712 (GLenum)internalformat,
713 (GLsizei)width,
714 (GLsizei)height,
715 (GLsizei)depth,
716 (GLint)border,
717 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000718 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700719 );
720}
721
722/* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) */
723static void
724android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
725 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800726 jint _exception = 0;
727 const char * _exceptionType = NULL;
728 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700729 jarray _array = (jarray) 0;
730 jint _bufferOffset = (jint) 0;
731 jint _remaining;
732 GLvoid *data = (GLvoid *) 0;
733
Romain Guy84cac202016-12-05 12:26:02 -0800734 if (!data_buf) {
735 _exception = 1;
736 _exceptionType = "java/lang/IllegalArgumentException";
737 _exceptionMessage = "data == null";
738 goto exit;
739 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700740 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700741 if (data == NULL) {
742 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
743 data = (GLvoid *) (_dataBase + _bufferOffset);
744 }
745 glCompressedTexSubImage3D(
746 (GLenum)target,
747 (GLint)level,
748 (GLint)xoffset,
749 (GLint)yoffset,
750 (GLint)zoffset,
751 (GLsizei)width,
752 (GLsizei)height,
753 (GLsizei)depth,
754 (GLenum)format,
755 (GLsizei)imageSize,
756 (GLvoid *)data
757 );
Romain Guy84cac202016-12-05 12:26:02 -0800758
759exit:
Jesse Halld830e742013-03-29 11:02:35 -0700760 if (_array) {
761 releasePointer(_env, _array, data, JNI_FALSE);
762 }
Romain Guy84cac202016-12-05 12:26:02 -0800763 if (_exception) {
764 jniThrowException(_env, _exceptionType, _exceptionMessage);
765 }
Jesse Halld830e742013-03-29 11:02:35 -0700766}
767
768/* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
769static void
770android_glCompressedTexSubImage3D__IIIIIIIIIII
771 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jint offset) {
772 glCompressedTexSubImage3D(
773 (GLenum)target,
774 (GLint)level,
775 (GLint)xoffset,
776 (GLint)yoffset,
777 (GLint)zoffset,
778 (GLsizei)width,
779 (GLsizei)height,
780 (GLsizei)depth,
781 (GLenum)format,
782 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000783 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700784 );
785}
786
787/* void glGenQueries ( GLsizei n, GLuint *ids ) */
788static void
789android_glGenQueries__I_3II
790 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
791 jint _exception = 0;
792 const char * _exceptionType = NULL;
793 const char * _exceptionMessage = NULL;
794 GLuint *ids_base = (GLuint *) 0;
795 jint _remaining;
796 GLuint *ids = (GLuint *) 0;
797
798 if (!ids_ref) {
799 _exception = 1;
800 _exceptionType = "java/lang/IllegalArgumentException";
801 _exceptionMessage = "ids == null";
802 goto exit;
803 }
804 if (offset < 0) {
805 _exception = 1;
806 _exceptionType = "java/lang/IllegalArgumentException";
807 _exceptionMessage = "offset < 0";
808 goto exit;
809 }
810 _remaining = _env->GetArrayLength(ids_ref) - offset;
811 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700812 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700813 ids = ids_base + offset;
814
815 glGenQueries(
816 (GLsizei)n,
817 (GLuint *)ids
818 );
819
820exit:
821 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700822 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700823 _exception ? JNI_ABORT: 0);
824 }
825 if (_exception) {
826 jniThrowException(_env, _exceptionType, _exceptionMessage);
827 }
828}
829
830/* void glGenQueries ( GLsizei n, GLuint *ids ) */
831static void
832android_glGenQueries__ILjava_nio_IntBuffer_2
833 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800834 jint _exception = 0;
835 const char * _exceptionType = NULL;
836 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700837 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700838 jint _bufferOffset = (jint) 0;
839 jint _remaining;
840 GLuint *ids = (GLuint *) 0;
841
Romain Guy84cac202016-12-05 12:26:02 -0800842 if (!ids_buf) {
843 _exception = 1;
844 _exceptionType = "java/lang/IllegalArgumentException";
845 _exceptionMessage = "ids == null";
846 goto exit;
847 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700848 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700849 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700850 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700851 ids = (GLuint *) (_idsBase + _bufferOffset);
852 }
853 glGenQueries(
854 (GLsizei)n,
855 (GLuint *)ids
856 );
Romain Guy84cac202016-12-05 12:26:02 -0800857
858exit:
Jesse Halld830e742013-03-29 11:02:35 -0700859 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -0800860 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
861 }
862 if (_exception) {
863 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -0700864 }
865}
866
867/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
868static void
869android_glDeleteQueries__I_3II
870 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
871 jint _exception = 0;
872 const char * _exceptionType = NULL;
873 const char * _exceptionMessage = NULL;
874 GLuint *ids_base = (GLuint *) 0;
875 jint _remaining;
876 GLuint *ids = (GLuint *) 0;
877
878 if (!ids_ref) {
879 _exception = 1;
880 _exceptionType = "java/lang/IllegalArgumentException";
881 _exceptionMessage = "ids == null";
882 goto exit;
883 }
884 if (offset < 0) {
885 _exception = 1;
886 _exceptionType = "java/lang/IllegalArgumentException";
887 _exceptionMessage = "offset < 0";
888 goto exit;
889 }
890 _remaining = _env->GetArrayLength(ids_ref) - offset;
891 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700892 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700893 ids = ids_base + offset;
894
895 glDeleteQueries(
896 (GLsizei)n,
897 (GLuint *)ids
898 );
899
900exit:
901 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700902 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700903 JNI_ABORT);
904 }
905 if (_exception) {
906 jniThrowException(_env, _exceptionType, _exceptionMessage);
907 }
908}
909
910/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
911static void
912android_glDeleteQueries__ILjava_nio_IntBuffer_2
913 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800914 jint _exception = 0;
915 const char * _exceptionType = NULL;
916 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700917 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700918 jint _bufferOffset = (jint) 0;
919 jint _remaining;
920 GLuint *ids = (GLuint *) 0;
921
Romain Guy84cac202016-12-05 12:26:02 -0800922 if (!ids_buf) {
923 _exception = 1;
924 _exceptionType = "java/lang/IllegalArgumentException";
925 _exceptionMessage = "ids == null";
926 goto exit;
927 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700928 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700929 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700930 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700931 ids = (GLuint *) (_idsBase + _bufferOffset);
932 }
933 glDeleteQueries(
934 (GLsizei)n,
935 (GLuint *)ids
936 );
Romain Guy84cac202016-12-05 12:26:02 -0800937
938exit:
Jesse Halld830e742013-03-29 11:02:35 -0700939 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700940 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -0700941 }
Romain Guy84cac202016-12-05 12:26:02 -0800942 if (_exception) {
943 jniThrowException(_env, _exceptionType, _exceptionMessage);
944 }
Jesse Halld830e742013-03-29 11:02:35 -0700945}
946
947/* GLboolean glIsQuery ( GLuint id ) */
948static jboolean
949android_glIsQuery__I
950 (JNIEnv *_env, jobject _this, jint id) {
951 GLboolean _returnValue;
952 _returnValue = glIsQuery(
953 (GLuint)id
954 );
955 return (jboolean)_returnValue;
956}
957
958/* void glBeginQuery ( GLenum target, GLuint id ) */
959static void
960android_glBeginQuery__II
961 (JNIEnv *_env, jobject _this, jint target, jint id) {
962 glBeginQuery(
963 (GLenum)target,
964 (GLuint)id
965 );
966}
967
968/* void glEndQuery ( GLenum target ) */
969static void
970android_glEndQuery__I
971 (JNIEnv *_env, jobject _this, jint target) {
972 glEndQuery(
973 (GLenum)target
974 );
975}
976
977/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
978static void
979android_glGetQueryiv__II_3II
980 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
981 jint _exception = 0;
982 const char * _exceptionType = NULL;
983 const char * _exceptionMessage = NULL;
984 GLint *params_base = (GLint *) 0;
985 jint _remaining;
986 GLint *params = (GLint *) 0;
987
988 if (!params_ref) {
989 _exception = 1;
990 _exceptionType = "java/lang/IllegalArgumentException";
991 _exceptionMessage = "params == null";
992 goto exit;
993 }
994 if (offset < 0) {
995 _exception = 1;
996 _exceptionType = "java/lang/IllegalArgumentException";
997 _exceptionMessage = "offset < 0";
998 goto exit;
999 }
1000 _remaining = _env->GetArrayLength(params_ref) - offset;
1001 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001002 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001003 params = params_base + offset;
1004
1005 glGetQueryiv(
1006 (GLenum)target,
1007 (GLenum)pname,
1008 (GLint *)params
1009 );
1010
1011exit:
1012 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001013 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07001014 _exception ? JNI_ABORT: 0);
1015 }
1016 if (_exception) {
1017 jniThrowException(_env, _exceptionType, _exceptionMessage);
1018 }
1019}
1020
1021/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
1022static void
1023android_glGetQueryiv__IILjava_nio_IntBuffer_2
1024 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001025 jint _exception = 0;
1026 const char * _exceptionType = NULL;
1027 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001028 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001029 jint _bufferOffset = (jint) 0;
1030 jint _remaining;
1031 GLint *params = (GLint *) 0;
1032
Romain Guy84cac202016-12-05 12:26:02 -08001033 if (!params_buf) {
1034 _exception = 1;
1035 _exceptionType = "java/lang/IllegalArgumentException";
1036 _exceptionMessage = "params == null";
1037 goto exit;
1038 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001039 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001040 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001041 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001042 params = (GLint *) (_paramsBase + _bufferOffset);
1043 }
1044 glGetQueryiv(
1045 (GLenum)target,
1046 (GLenum)pname,
1047 (GLint *)params
1048 );
Romain Guy84cac202016-12-05 12:26:02 -08001049
1050exit:
Jesse Halld830e742013-03-29 11:02:35 -07001051 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001052 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1053 }
1054 if (_exception) {
1055 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001056 }
1057}
1058
1059/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1060static void
1061android_glGetQueryObjectuiv__II_3II
1062 (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
1063 jint _exception = 0;
1064 const char * _exceptionType = NULL;
1065 const char * _exceptionMessage = NULL;
1066 GLuint *params_base = (GLuint *) 0;
1067 jint _remaining;
1068 GLuint *params = (GLuint *) 0;
1069
1070 if (!params_ref) {
1071 _exception = 1;
1072 _exceptionType = "java/lang/IllegalArgumentException";
1073 _exceptionMessage = "params == null";
1074 goto exit;
1075 }
1076 if (offset < 0) {
1077 _exception = 1;
1078 _exceptionType = "java/lang/IllegalArgumentException";
1079 _exceptionMessage = "offset < 0";
1080 goto exit;
1081 }
1082 _remaining = _env->GetArrayLength(params_ref) - offset;
1083 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001084 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001085 params = params_base + offset;
1086
1087 glGetQueryObjectuiv(
1088 (GLuint)id,
1089 (GLenum)pname,
1090 (GLuint *)params
1091 );
1092
1093exit:
1094 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001095 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07001096 _exception ? JNI_ABORT: 0);
1097 }
1098 if (_exception) {
1099 jniThrowException(_env, _exceptionType, _exceptionMessage);
1100 }
1101}
1102
1103/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1104static void
1105android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
1106 (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001107 jint _exception = 0;
1108 const char * _exceptionType = NULL;
1109 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001110 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001111 jint _bufferOffset = (jint) 0;
1112 jint _remaining;
1113 GLuint *params = (GLuint *) 0;
1114
Romain Guy84cac202016-12-05 12:26:02 -08001115 if (!params_buf) {
1116 _exception = 1;
1117 _exceptionType = "java/lang/IllegalArgumentException";
1118 _exceptionMessage = "params == null";
1119 goto exit;
1120 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001121 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001122 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001123 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001124 params = (GLuint *) (_paramsBase + _bufferOffset);
1125 }
1126 glGetQueryObjectuiv(
1127 (GLuint)id,
1128 (GLenum)pname,
1129 (GLuint *)params
1130 );
Romain Guy84cac202016-12-05 12:26:02 -08001131
1132exit:
Jesse Halld830e742013-03-29 11:02:35 -07001133 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001134 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1135 }
1136 if (_exception) {
1137 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001138 }
1139}
1140
1141/* GLboolean glUnmapBuffer ( GLenum target ) */
1142static jboolean
1143android_glUnmapBuffer__I
1144 (JNIEnv *_env, jobject _this, jint target) {
1145 GLboolean _returnValue;
1146 _returnValue = glUnmapBuffer(
1147 (GLenum)target
1148 );
1149 return (jboolean)_returnValue;
1150}
1151
1152/* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
1153static jobject
1154android_glGetBufferPointerv__II
1155 (JNIEnv *_env, jobject _this, jint target, jint pname) {
1156 GLint64 _mapLength;
1157 GLvoid* _p;
1158 glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
1159 glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
1160 return _env->NewDirectByteBuffer(_p, _mapLength);
1161}
1162
1163/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1164static void
1165android_glDrawBuffers__I_3II
1166 (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
1167 jint _exception = 0;
1168 const char * _exceptionType = NULL;
1169 const char * _exceptionMessage = NULL;
1170 GLenum *bufs_base = (GLenum *) 0;
1171 jint _remaining;
1172 GLenum *bufs = (GLenum *) 0;
1173
1174 if (!bufs_ref) {
1175 _exception = 1;
1176 _exceptionType = "java/lang/IllegalArgumentException";
1177 _exceptionMessage = "bufs == null";
1178 goto exit;
1179 }
1180 if (offset < 0) {
1181 _exception = 1;
1182 _exceptionType = "java/lang/IllegalArgumentException";
1183 _exceptionMessage = "offset < 0";
1184 goto exit;
1185 }
1186 _remaining = _env->GetArrayLength(bufs_ref) - offset;
1187 bufs_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001188 _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001189 bufs = bufs_base + offset;
1190
1191 glDrawBuffers(
1192 (GLsizei)n,
1193 (GLenum *)bufs
1194 );
1195
1196exit:
1197 if (bufs_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001198 _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
Jesse Halld830e742013-03-29 11:02:35 -07001199 JNI_ABORT);
1200 }
1201 if (_exception) {
1202 jniThrowException(_env, _exceptionType, _exceptionMessage);
1203 }
1204}
1205
1206/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1207static void
1208android_glDrawBuffers__ILjava_nio_IntBuffer_2
1209 (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001210 jint _exception = 0;
1211 const char * _exceptionType = NULL;
1212 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001213 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001214 jint _bufferOffset = (jint) 0;
1215 jint _remaining;
1216 GLenum *bufs = (GLenum *) 0;
1217
Romain Guy84cac202016-12-05 12:26:02 -08001218 if (!bufs_buf) {
1219 _exception = 1;
1220 _exceptionType = "java/lang/IllegalArgumentException";
1221 _exceptionMessage = "bufs == null";
1222 goto exit;
1223 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001224 bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001225 if (bufs == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001226 char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001227 bufs = (GLenum *) (_bufsBase + _bufferOffset);
1228 }
1229 glDrawBuffers(
1230 (GLsizei)n,
1231 (GLenum *)bufs
1232 );
Romain Guy84cac202016-12-05 12:26:02 -08001233
1234exit:
Jesse Halld830e742013-03-29 11:02:35 -07001235 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001236 _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001237 }
Romain Guy84cac202016-12-05 12:26:02 -08001238 if (_exception) {
1239 jniThrowException(_env, _exceptionType, _exceptionMessage);
1240 }
Jesse Halld830e742013-03-29 11:02:35 -07001241}
1242
1243/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1244static void
1245android_glUniformMatrix2x3fv__IIZ_3FI
1246 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1247 jint _exception = 0;
1248 const char * _exceptionType = NULL;
1249 const char * _exceptionMessage = NULL;
1250 GLfloat *value_base = (GLfloat *) 0;
1251 jint _remaining;
1252 GLfloat *value = (GLfloat *) 0;
1253
1254 if (!value_ref) {
1255 _exception = 1;
1256 _exceptionType = "java/lang/IllegalArgumentException";
1257 _exceptionMessage = "value == null";
1258 goto exit;
1259 }
1260 if (offset < 0) {
1261 _exception = 1;
1262 _exceptionType = "java/lang/IllegalArgumentException";
1263 _exceptionMessage = "offset < 0";
1264 goto exit;
1265 }
1266 _remaining = _env->GetArrayLength(value_ref) - offset;
1267 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001268 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001269 value = value_base + offset;
1270
1271 glUniformMatrix2x3fv(
1272 (GLint)location,
1273 (GLsizei)count,
1274 (GLboolean)transpose,
1275 (GLfloat *)value
1276 );
1277
1278exit:
1279 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001280 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001281 JNI_ABORT);
1282 }
1283 if (_exception) {
1284 jniThrowException(_env, _exceptionType, _exceptionMessage);
1285 }
1286}
1287
1288/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1289static void
1290android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
1291 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001292 jint _exception = 0;
1293 const char * _exceptionType = NULL;
1294 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001295 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001296 jint _bufferOffset = (jint) 0;
1297 jint _remaining;
1298 GLfloat *value = (GLfloat *) 0;
1299
Romain Guy84cac202016-12-05 12:26:02 -08001300 if (!value_buf) {
1301 _exception = 1;
1302 _exceptionType = "java/lang/IllegalArgumentException";
1303 _exceptionMessage = "value == null";
1304 goto exit;
1305 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001306 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001307 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001308 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001309 value = (GLfloat *) (_valueBase + _bufferOffset);
1310 }
1311 glUniformMatrix2x3fv(
1312 (GLint)location,
1313 (GLsizei)count,
1314 (GLboolean)transpose,
1315 (GLfloat *)value
1316 );
Romain Guy84cac202016-12-05 12:26:02 -08001317
1318exit:
Jesse Halld830e742013-03-29 11:02:35 -07001319 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001320 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001321 }
Romain Guy84cac202016-12-05 12:26:02 -08001322 if (_exception) {
1323 jniThrowException(_env, _exceptionType, _exceptionMessage);
1324 }
Jesse Halld830e742013-03-29 11:02:35 -07001325}
1326
1327/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1328static void
1329android_glUniformMatrix3x2fv__IIZ_3FI
1330 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1331 jint _exception = 0;
1332 const char * _exceptionType = NULL;
1333 const char * _exceptionMessage = NULL;
1334 GLfloat *value_base = (GLfloat *) 0;
1335 jint _remaining;
1336 GLfloat *value = (GLfloat *) 0;
1337
1338 if (!value_ref) {
1339 _exception = 1;
1340 _exceptionType = "java/lang/IllegalArgumentException";
1341 _exceptionMessage = "value == null";
1342 goto exit;
1343 }
1344 if (offset < 0) {
1345 _exception = 1;
1346 _exceptionType = "java/lang/IllegalArgumentException";
1347 _exceptionMessage = "offset < 0";
1348 goto exit;
1349 }
1350 _remaining = _env->GetArrayLength(value_ref) - offset;
1351 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001352 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001353 value = value_base + offset;
1354
1355 glUniformMatrix3x2fv(
1356 (GLint)location,
1357 (GLsizei)count,
1358 (GLboolean)transpose,
1359 (GLfloat *)value
1360 );
1361
1362exit:
1363 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001364 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001365 JNI_ABORT);
1366 }
1367 if (_exception) {
1368 jniThrowException(_env, _exceptionType, _exceptionMessage);
1369 }
1370}
1371
1372/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1373static void
1374android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
1375 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001376 jint _exception = 0;
1377 const char * _exceptionType = NULL;
1378 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001379 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001380 jint _bufferOffset = (jint) 0;
1381 jint _remaining;
1382 GLfloat *value = (GLfloat *) 0;
1383
Romain Guy84cac202016-12-05 12:26:02 -08001384 if (!value_buf) {
1385 _exception = 1;
1386 _exceptionType = "java/lang/IllegalArgumentException";
1387 _exceptionMessage = "value == null";
1388 goto exit;
1389 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001390 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001391 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001392 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001393 value = (GLfloat *) (_valueBase + _bufferOffset);
1394 }
1395 glUniformMatrix3x2fv(
1396 (GLint)location,
1397 (GLsizei)count,
1398 (GLboolean)transpose,
1399 (GLfloat *)value
1400 );
Romain Guy84cac202016-12-05 12:26:02 -08001401
1402exit:
Jesse Halld830e742013-03-29 11:02:35 -07001403 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001404 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001405 }
Romain Guy84cac202016-12-05 12:26:02 -08001406 if (_exception) {
1407 jniThrowException(_env, _exceptionType, _exceptionMessage);
1408 }
Jesse Halld830e742013-03-29 11:02:35 -07001409}
1410
1411/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1412static void
1413android_glUniformMatrix2x4fv__IIZ_3FI
1414 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1415 jint _exception = 0;
1416 const char * _exceptionType = NULL;
1417 const char * _exceptionMessage = NULL;
1418 GLfloat *value_base = (GLfloat *) 0;
1419 jint _remaining;
1420 GLfloat *value = (GLfloat *) 0;
1421
1422 if (!value_ref) {
1423 _exception = 1;
1424 _exceptionType = "java/lang/IllegalArgumentException";
1425 _exceptionMessage = "value == null";
1426 goto exit;
1427 }
1428 if (offset < 0) {
1429 _exception = 1;
1430 _exceptionType = "java/lang/IllegalArgumentException";
1431 _exceptionMessage = "offset < 0";
1432 goto exit;
1433 }
1434 _remaining = _env->GetArrayLength(value_ref) - offset;
1435 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001436 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001437 value = value_base + offset;
1438
1439 glUniformMatrix2x4fv(
1440 (GLint)location,
1441 (GLsizei)count,
1442 (GLboolean)transpose,
1443 (GLfloat *)value
1444 );
1445
1446exit:
1447 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001448 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001449 JNI_ABORT);
1450 }
1451 if (_exception) {
1452 jniThrowException(_env, _exceptionType, _exceptionMessage);
1453 }
1454}
1455
1456/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1457static void
1458android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
1459 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001460 jint _exception = 0;
1461 const char * _exceptionType = NULL;
1462 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001463 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001464 jint _bufferOffset = (jint) 0;
1465 jint _remaining;
1466 GLfloat *value = (GLfloat *) 0;
1467
Romain Guy84cac202016-12-05 12:26:02 -08001468 if (!value_buf) {
1469 _exception = 1;
1470 _exceptionType = "java/lang/IllegalArgumentException";
1471 _exceptionMessage = "value == null";
1472 goto exit;
1473 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001474 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001475 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001476 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001477 value = (GLfloat *) (_valueBase + _bufferOffset);
1478 }
1479 glUniformMatrix2x4fv(
1480 (GLint)location,
1481 (GLsizei)count,
1482 (GLboolean)transpose,
1483 (GLfloat *)value
1484 );
Romain Guy84cac202016-12-05 12:26:02 -08001485
1486exit:
Jesse Halld830e742013-03-29 11:02:35 -07001487 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001488 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001489 }
Romain Guy84cac202016-12-05 12:26:02 -08001490 if (_exception) {
1491 jniThrowException(_env, _exceptionType, _exceptionMessage);
1492 }
Jesse Halld830e742013-03-29 11:02:35 -07001493}
1494
1495/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1496static void
1497android_glUniformMatrix4x2fv__IIZ_3FI
1498 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1499 jint _exception = 0;
1500 const char * _exceptionType = NULL;
1501 const char * _exceptionMessage = NULL;
1502 GLfloat *value_base = (GLfloat *) 0;
1503 jint _remaining;
1504 GLfloat *value = (GLfloat *) 0;
1505
1506 if (!value_ref) {
1507 _exception = 1;
1508 _exceptionType = "java/lang/IllegalArgumentException";
1509 _exceptionMessage = "value == null";
1510 goto exit;
1511 }
1512 if (offset < 0) {
1513 _exception = 1;
1514 _exceptionType = "java/lang/IllegalArgumentException";
1515 _exceptionMessage = "offset < 0";
1516 goto exit;
1517 }
1518 _remaining = _env->GetArrayLength(value_ref) - offset;
1519 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001520 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001521 value = value_base + offset;
1522
1523 glUniformMatrix4x2fv(
1524 (GLint)location,
1525 (GLsizei)count,
1526 (GLboolean)transpose,
1527 (GLfloat *)value
1528 );
1529
1530exit:
1531 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001532 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001533 JNI_ABORT);
1534 }
1535 if (_exception) {
1536 jniThrowException(_env, _exceptionType, _exceptionMessage);
1537 }
1538}
1539
1540/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1541static void
1542android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
1543 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001544 jint _exception = 0;
1545 const char * _exceptionType = NULL;
1546 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001547 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001548 jint _bufferOffset = (jint) 0;
1549 jint _remaining;
1550 GLfloat *value = (GLfloat *) 0;
1551
Romain Guy84cac202016-12-05 12:26:02 -08001552 if (!value_buf) {
1553 _exception = 1;
1554 _exceptionType = "java/lang/IllegalArgumentException";
1555 _exceptionMessage = "value == null";
1556 goto exit;
1557 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001558 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001559 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001560 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001561 value = (GLfloat *) (_valueBase + _bufferOffset);
1562 }
1563 glUniformMatrix4x2fv(
1564 (GLint)location,
1565 (GLsizei)count,
1566 (GLboolean)transpose,
1567 (GLfloat *)value
1568 );
Romain Guy84cac202016-12-05 12:26:02 -08001569
1570exit:
Jesse Halld830e742013-03-29 11:02:35 -07001571 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001572 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001573 }
Romain Guy84cac202016-12-05 12:26:02 -08001574 if (_exception) {
1575 jniThrowException(_env, _exceptionType, _exceptionMessage);
1576 }
Jesse Halld830e742013-03-29 11:02:35 -07001577}
1578
1579/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1580static void
1581android_glUniformMatrix3x4fv__IIZ_3FI
1582 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1583 jint _exception = 0;
1584 const char * _exceptionType = NULL;
1585 const char * _exceptionMessage = NULL;
1586 GLfloat *value_base = (GLfloat *) 0;
1587 jint _remaining;
1588 GLfloat *value = (GLfloat *) 0;
1589
1590 if (!value_ref) {
1591 _exception = 1;
1592 _exceptionType = "java/lang/IllegalArgumentException";
1593 _exceptionMessage = "value == null";
1594 goto exit;
1595 }
1596 if (offset < 0) {
1597 _exception = 1;
1598 _exceptionType = "java/lang/IllegalArgumentException";
1599 _exceptionMessage = "offset < 0";
1600 goto exit;
1601 }
1602 _remaining = _env->GetArrayLength(value_ref) - offset;
1603 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001604 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001605 value = value_base + offset;
1606
1607 glUniformMatrix3x4fv(
1608 (GLint)location,
1609 (GLsizei)count,
1610 (GLboolean)transpose,
1611 (GLfloat *)value
1612 );
1613
1614exit:
1615 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001616 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001617 JNI_ABORT);
1618 }
1619 if (_exception) {
1620 jniThrowException(_env, _exceptionType, _exceptionMessage);
1621 }
1622}
1623
1624/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1625static void
1626android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
1627 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001628 jint _exception = 0;
1629 const char * _exceptionType = NULL;
1630 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001631 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001632 jint _bufferOffset = (jint) 0;
1633 jint _remaining;
1634 GLfloat *value = (GLfloat *) 0;
1635
Romain Guy84cac202016-12-05 12:26:02 -08001636 if (!value_buf) {
1637 _exception = 1;
1638 _exceptionType = "java/lang/IllegalArgumentException";
1639 _exceptionMessage = "value == null";
1640 goto exit;
1641 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001642 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001643 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001644 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001645 value = (GLfloat *) (_valueBase + _bufferOffset);
1646 }
1647 glUniformMatrix3x4fv(
1648 (GLint)location,
1649 (GLsizei)count,
1650 (GLboolean)transpose,
1651 (GLfloat *)value
1652 );
Romain Guy84cac202016-12-05 12:26:02 -08001653
1654exit:
Jesse Halld830e742013-03-29 11:02:35 -07001655 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001656 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001657 }
Romain Guy84cac202016-12-05 12:26:02 -08001658 if (_exception) {
1659 jniThrowException(_env, _exceptionType, _exceptionMessage);
1660 }
Jesse Halld830e742013-03-29 11:02:35 -07001661}
1662
1663/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1664static void
1665android_glUniformMatrix4x3fv__IIZ_3FI
1666 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1667 jint _exception = 0;
1668 const char * _exceptionType = NULL;
1669 const char * _exceptionMessage = NULL;
1670 GLfloat *value_base = (GLfloat *) 0;
1671 jint _remaining;
1672 GLfloat *value = (GLfloat *) 0;
1673
1674 if (!value_ref) {
1675 _exception = 1;
1676 _exceptionType = "java/lang/IllegalArgumentException";
1677 _exceptionMessage = "value == null";
1678 goto exit;
1679 }
1680 if (offset < 0) {
1681 _exception = 1;
1682 _exceptionType = "java/lang/IllegalArgumentException";
1683 _exceptionMessage = "offset < 0";
1684 goto exit;
1685 }
1686 _remaining = _env->GetArrayLength(value_ref) - offset;
1687 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001688 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001689 value = value_base + offset;
1690
1691 glUniformMatrix4x3fv(
1692 (GLint)location,
1693 (GLsizei)count,
1694 (GLboolean)transpose,
1695 (GLfloat *)value
1696 );
1697
1698exit:
1699 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001700 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001701 JNI_ABORT);
1702 }
1703 if (_exception) {
1704 jniThrowException(_env, _exceptionType, _exceptionMessage);
1705 }
1706}
1707
1708/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1709static void
1710android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
1711 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001712 jint _exception = 0;
1713 const char * _exceptionType = NULL;
1714 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001715 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001716 jint _bufferOffset = (jint) 0;
1717 jint _remaining;
1718 GLfloat *value = (GLfloat *) 0;
1719
Romain Guy84cac202016-12-05 12:26:02 -08001720 if (!value_buf) {
1721 _exception = 1;
1722 _exceptionType = "java/lang/IllegalArgumentException";
1723 _exceptionMessage = "value == null";
1724 goto exit;
1725 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001726 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001727 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001728 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001729 value = (GLfloat *) (_valueBase + _bufferOffset);
1730 }
1731 glUniformMatrix4x3fv(
1732 (GLint)location,
1733 (GLsizei)count,
1734 (GLboolean)transpose,
1735 (GLfloat *)value
1736 );
Romain Guy84cac202016-12-05 12:26:02 -08001737
1738exit:
Jesse Halld830e742013-03-29 11:02:35 -07001739 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001740 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001741 }
Romain Guy84cac202016-12-05 12:26:02 -08001742 if (_exception) {
1743 jniThrowException(_env, _exceptionType, _exceptionMessage);
1744 }
Jesse Halld830e742013-03-29 11:02:35 -07001745}
1746
1747/* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
1748static void
1749android_glBlitFramebuffer__IIIIIIIIII
1750 (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
1751 glBlitFramebuffer(
1752 (GLint)srcX0,
1753 (GLint)srcY0,
1754 (GLint)srcX1,
1755 (GLint)srcY1,
1756 (GLint)dstX0,
1757 (GLint)dstY0,
1758 (GLint)dstX1,
1759 (GLint)dstY1,
1760 (GLbitfield)mask,
1761 (GLenum)filter
1762 );
1763}
1764
1765/* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
1766static void
1767android_glRenderbufferStorageMultisample__IIIII
1768 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
1769 glRenderbufferStorageMultisample(
1770 (GLenum)target,
1771 (GLsizei)samples,
1772 (GLenum)internalformat,
1773 (GLsizei)width,
1774 (GLsizei)height
1775 );
1776}
1777
1778/* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
1779static void
1780android_glFramebufferTextureLayer__IIIII
1781 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
1782 glFramebufferTextureLayer(
1783 (GLenum)target,
1784 (GLenum)attachment,
1785 (GLuint)texture,
1786 (GLint)level,
1787 (GLint)layer
1788 );
1789}
1790
1791/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
1792static jobject
1793android_glMapBufferRange__IIII
1794 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
1795 GLvoid* _p = glMapBufferRange((GLenum)target,
1796 (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
1797 jobject _buf = (jobject)0;
1798 if (_p) {
1799 _buf = _env->NewDirectByteBuffer(_p, length);
1800 }
1801 return _buf;
1802}
1803
1804/* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
1805static void
1806android_glFlushMappedBufferRange__III
1807 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
1808 glFlushMappedBufferRange(
1809 (GLenum)target,
1810 (GLintptr)offset,
1811 (GLsizeiptr)length
1812 );
1813}
1814
1815/* void glBindVertexArray ( GLuint array ) */
1816static void
1817android_glBindVertexArray__I
1818 (JNIEnv *_env, jobject _this, jint array) {
1819 glBindVertexArray(
1820 (GLuint)array
1821 );
1822}
1823
1824/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1825static void
1826android_glDeleteVertexArrays__I_3II
1827 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1828 jint _exception = 0;
1829 const char * _exceptionType = NULL;
1830 const char * _exceptionMessage = NULL;
1831 GLuint *arrays_base = (GLuint *) 0;
1832 jint _remaining;
1833 GLuint *arrays = (GLuint *) 0;
1834
1835 if (!arrays_ref) {
1836 _exception = 1;
1837 _exceptionType = "java/lang/IllegalArgumentException";
1838 _exceptionMessage = "arrays == null";
1839 goto exit;
1840 }
1841 if (offset < 0) {
1842 _exception = 1;
1843 _exceptionType = "java/lang/IllegalArgumentException";
1844 _exceptionMessage = "offset < 0";
1845 goto exit;
1846 }
1847 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1848 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001849 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001850 arrays = arrays_base + offset;
1851
1852 glDeleteVertexArrays(
1853 (GLsizei)n,
1854 (GLuint *)arrays
1855 );
1856
1857exit:
1858 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001859 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001860 JNI_ABORT);
1861 }
1862 if (_exception) {
1863 jniThrowException(_env, _exceptionType, _exceptionMessage);
1864 }
1865}
1866
1867/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1868static void
1869android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
1870 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001871 jint _exception = 0;
1872 const char * _exceptionType = NULL;
1873 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001874 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001875 jint _bufferOffset = (jint) 0;
1876 jint _remaining;
1877 GLuint *arrays = (GLuint *) 0;
1878
Romain Guy84cac202016-12-05 12:26:02 -08001879 if (!arrays_buf) {
1880 _exception = 1;
1881 _exceptionType = "java/lang/IllegalArgumentException";
1882 _exceptionMessage = "arrays == null";
1883 goto exit;
1884 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001885 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001886 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001887 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001888 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1889 }
1890 glDeleteVertexArrays(
1891 (GLsizei)n,
1892 (GLuint *)arrays
1893 );
Romain Guy84cac202016-12-05 12:26:02 -08001894
1895exit:
Jesse Halld830e742013-03-29 11:02:35 -07001896 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001897 _env->ReleaseIntArrayElements(_array, (jint*)arrays, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001898 }
Romain Guy84cac202016-12-05 12:26:02 -08001899 if (_exception) {
1900 jniThrowException(_env, _exceptionType, _exceptionMessage);
1901 }
Jesse Halld830e742013-03-29 11:02:35 -07001902}
1903
1904/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1905static void
1906android_glGenVertexArrays__I_3II
1907 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1908 jint _exception = 0;
1909 const char * _exceptionType = NULL;
1910 const char * _exceptionMessage = NULL;
1911 GLuint *arrays_base = (GLuint *) 0;
1912 jint _remaining;
1913 GLuint *arrays = (GLuint *) 0;
1914
1915 if (!arrays_ref) {
1916 _exception = 1;
1917 _exceptionType = "java/lang/IllegalArgumentException";
1918 _exceptionMessage = "arrays == null";
1919 goto exit;
1920 }
1921 if (offset < 0) {
1922 _exception = 1;
1923 _exceptionType = "java/lang/IllegalArgumentException";
1924 _exceptionMessage = "offset < 0";
1925 goto exit;
1926 }
1927 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1928 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001929 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001930 arrays = arrays_base + offset;
1931
1932 glGenVertexArrays(
1933 (GLsizei)n,
1934 (GLuint *)arrays
1935 );
1936
1937exit:
1938 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001939 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001940 _exception ? JNI_ABORT: 0);
1941 }
1942 if (_exception) {
1943 jniThrowException(_env, _exceptionType, _exceptionMessage);
1944 }
1945}
1946
1947/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1948static void
1949android_glGenVertexArrays__ILjava_nio_IntBuffer_2
1950 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001951 jint _exception = 0;
1952 const char * _exceptionType = NULL;
1953 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001954 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001955 jint _bufferOffset = (jint) 0;
1956 jint _remaining;
1957 GLuint *arrays = (GLuint *) 0;
1958
Romain Guy84cac202016-12-05 12:26:02 -08001959 if (!arrays_buf) {
1960 _exception = 1;
1961 _exceptionType = "java/lang/IllegalArgumentException";
1962 _exceptionMessage = "arrays == null";
1963 goto exit;
1964 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001965 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001966 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001967 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001968 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1969 }
1970 glGenVertexArrays(
1971 (GLsizei)n,
1972 (GLuint *)arrays
1973 );
Romain Guy84cac202016-12-05 12:26:02 -08001974
1975exit:
Jesse Halld830e742013-03-29 11:02:35 -07001976 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001977 _env->ReleaseIntArrayElements(_array, (jint*)arrays, _exception ? JNI_ABORT : 0);
1978 }
1979 if (_exception) {
1980 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001981 }
1982}
1983
1984/* GLboolean glIsVertexArray ( GLuint array ) */
1985static jboolean
1986android_glIsVertexArray__I
1987 (JNIEnv *_env, jobject _this, jint array) {
1988 GLboolean _returnValue;
1989 _returnValue = glIsVertexArray(
1990 (GLuint)array
1991 );
1992 return (jboolean)_returnValue;
1993}
1994
1995/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
1996static void
1997android_glGetIntegeri_v__II_3II
1998 (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
1999 jint _exception = 0;
2000 const char * _exceptionType = NULL;
2001 const char * _exceptionMessage = NULL;
2002 GLint *data_base = (GLint *) 0;
2003 jint _remaining;
2004 GLint *data = (GLint *) 0;
2005
2006 if (!data_ref) {
2007 _exception = 1;
2008 _exceptionType = "java/lang/IllegalArgumentException";
2009 _exceptionMessage = "data == null";
2010 goto exit;
2011 }
2012 if (offset < 0) {
2013 _exception = 1;
2014 _exceptionType = "java/lang/IllegalArgumentException";
2015 _exceptionMessage = "offset < 0";
2016 goto exit;
2017 }
2018 _remaining = _env->GetArrayLength(data_ref) - offset;
2019 data_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002020 _env->GetIntArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002021 data = data_base + offset;
2022
2023 glGetIntegeri_v(
2024 (GLenum)target,
2025 (GLuint)index,
2026 (GLint *)data
2027 );
2028
2029exit:
2030 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002031 _env->ReleaseIntArrayElements(data_ref, (jint*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07002032 _exception ? JNI_ABORT: 0);
2033 }
2034 if (_exception) {
2035 jniThrowException(_env, _exceptionType, _exceptionMessage);
2036 }
2037}
2038
2039/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
2040static void
2041android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
2042 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002043 jint _exception = 0;
2044 const char * _exceptionType = NULL;
2045 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002046 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002047 jint _bufferOffset = (jint) 0;
2048 jint _remaining;
2049 GLint *data = (GLint *) 0;
2050
Romain Guy84cac202016-12-05 12:26:02 -08002051 if (!data_buf) {
2052 _exception = 1;
2053 _exceptionType = "java/lang/IllegalArgumentException";
2054 _exceptionMessage = "data == null";
2055 goto exit;
2056 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002057 data = (GLint *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002058 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002059 char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002060 data = (GLint *) (_dataBase + _bufferOffset);
2061 }
2062 glGetIntegeri_v(
2063 (GLenum)target,
2064 (GLuint)index,
2065 (GLint *)data
2066 );
Romain Guy84cac202016-12-05 12:26:02 -08002067
2068exit:
Jesse Halld830e742013-03-29 11:02:35 -07002069 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002070 _env->ReleaseIntArrayElements(_array, (jint*)data, _exception ? JNI_ABORT : 0);
2071 }
2072 if (_exception) {
2073 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002074 }
2075}
2076
2077/* void glBeginTransformFeedback ( GLenum primitiveMode ) */
2078static void
2079android_glBeginTransformFeedback__I
2080 (JNIEnv *_env, jobject _this, jint primitiveMode) {
2081 glBeginTransformFeedback(
2082 (GLenum)primitiveMode
2083 );
2084}
2085
2086/* void glEndTransformFeedback ( void ) */
2087static void
2088android_glEndTransformFeedback__
2089 (JNIEnv *_env, jobject _this) {
2090 glEndTransformFeedback();
2091}
2092
2093/* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
2094static void
2095android_glBindBufferRange__IIIII
2096 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
2097 glBindBufferRange(
2098 (GLenum)target,
2099 (GLuint)index,
2100 (GLuint)buffer,
2101 (GLintptr)offset,
2102 (GLsizeiptr)size
2103 );
2104}
2105
2106/* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
2107static void
2108android_glBindBufferBase__III
2109 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
2110 glBindBufferBase(
2111 (GLenum)target,
2112 (GLuint)index,
2113 (GLuint)buffer
2114 );
2115}
2116
2117/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
2118static
2119void
2120android_glTransformFeedbackVaryings
2121 (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
2122 jint _exception = 0;
2123 const char* _exceptionType = NULL;
2124 const char* _exceptionMessage = NULL;
2125 jint _count = 0, _i;
2126 const char** _varyings = NULL;
2127 const char* _varying = NULL;
2128
2129 if (!varyings_ref) {
2130 _exception = 1;
2131 _exceptionType = "java/lang/IllegalArgumentException";
2132 _exceptionMessage = "varyings == null";
2133 goto exit;
2134 }
2135
2136 _count = _env->GetArrayLength(varyings_ref);
2137 _varyings = (const char**)calloc(_count, sizeof(const char*));
2138 for (_i = 0; _i < _count; _i++) {
2139 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2140 if (!_varying) {
2141 _exception = 1;
2142 _exceptionType = "java/lang/IllegalArgumentException";
2143 _exceptionMessage = "null varyings element";
2144 goto exit;
2145 }
2146 _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
2147 }
2148
2149 glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
2150
2151exit:
2152 for (_i = _count - 1; _i >= 0; _i--) {
2153 if (_varyings[_i]) {
2154 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2155 if (_varying) {
2156 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
2157 }
2158 }
2159 }
2160 free(_varyings);
2161 if (_exception) {
2162 jniThrowException(_env, _exceptionType, _exceptionMessage);
2163 }
2164}
2165
2166/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2167static void
2168android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
2169 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) {
2170 jint _exception = 0;
2171 const char * _exceptionType;
2172 const char * _exceptionMessage;
2173 GLsizei *length_base = (GLsizei *) 0;
2174 jint _lengthRemaining;
2175 GLsizei *length = (GLsizei *) 0;
2176 GLint *size_base = (GLint *) 0;
2177 jint _sizeRemaining;
2178 GLint *size = (GLint *) 0;
2179 GLenum *type_base = (GLenum *) 0;
2180 jint _typeRemaining;
2181 GLenum *type = (GLenum *) 0;
2182 char *name_base = (char *) 0;
2183 jint _nameRemaining;
2184 char *name = (char *) 0;
2185
Pablo Ceballos6aff9062015-10-01 18:35:39 -07002186 if (length_ref) {
2187 if (lengthOffset < 0) {
2188 _exception = 1;
2189 _exceptionType = "java/lang/IllegalArgumentException";
2190 _exceptionMessage = "lengthOffset < 0";
2191 goto exit;
2192 }
2193 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
2194 length_base = (GLsizei *)
2195 _env->GetIntArrayElements(length_ref, (jboolean *)0);
2196 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07002197 }
Jesse Halld830e742013-03-29 11:02:35 -07002198
2199 if (!size_ref) {
2200 _exception = 1;
2201 _exceptionType = "java/lang/IllegalArgumentException";
2202 _exceptionMessage = "size == null";
2203 goto exit;
2204 }
2205 if (sizeOffset < 0) {
2206 _exception = 1;
2207 _exceptionType = "java/lang/IllegalArgumentException";
2208 _exceptionMessage = "sizeOffset < 0";
2209 goto exit;
2210 }
2211 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2212 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002213 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002214 size = size_base + sizeOffset;
2215
2216 if (!type_ref) {
2217 _exception = 1;
2218 _exceptionType = "java/lang/IllegalArgumentException";
2219 _exceptionMessage = "type == null";
2220 goto exit;
2221 }
2222 if (typeOffset < 0) {
2223 _exception = 1;
2224 _exceptionType = "java/lang/IllegalArgumentException";
2225 _exceptionMessage = "typeOffset < 0";
2226 goto exit;
2227 }
2228 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2229 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002230 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002231 type = type_base + typeOffset;
2232
2233 if (!name_ref) {
2234 _exception = 1;
2235 _exceptionType = "java/lang/IllegalArgumentException";
2236 _exceptionMessage = "name == null";
2237 goto exit;
2238 }
2239 if (nameOffset < 0) {
2240 _exception = 1;
2241 _exceptionType = "java/lang/IllegalArgumentException";
2242 _exceptionMessage = "nameOffset < 0";
2243 goto exit;
2244 }
2245 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
2246 name_base = (char *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002247 _env->GetByteArrayElements(name_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002248 name = name_base + nameOffset;
2249
2250 glGetTransformFeedbackVarying(
2251 (GLuint)program,
2252 (GLuint)index,
2253 (GLsizei)bufsize,
2254 (GLsizei *)length,
2255 (GLint *)size,
2256 (GLenum *)type,
2257 (char *)name
2258 );
2259
2260exit:
2261 if (name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002262 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base,
Jesse Halld830e742013-03-29 11:02:35 -07002263 _exception ? JNI_ABORT: 0);
2264 }
2265 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002266 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002267 _exception ? JNI_ABORT: 0);
2268 }
2269 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002270 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002271 _exception ? JNI_ABORT: 0);
2272 }
2273 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002274 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07002275 _exception ? JNI_ABORT: 0);
2276 }
2277 if (_exception) {
2278 jniThrowException(_env, _exceptionType, _exceptionMessage);
2279 }
2280}
2281
2282/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2283static void
2284android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
2285 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002286 jniThrowException(_env, "java/lang/UnsupportedOperationException", "deprecated");
2287}
2288
2289/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2290static void
2291android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
2292 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jobject name_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002293 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002294 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002295 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002296 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002297 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002298 jint _typeBufferOffset = (jint) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002299 jbyteArray _nameArray = (jbyteArray)0;
2300 jint _nameBufferOffset = (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07002301 jint _lengthRemaining;
2302 GLsizei *length = (GLsizei *) 0;
2303 jint _sizeRemaining;
2304 GLint *size = (GLint *) 0;
2305 jint _typeRemaining;
2306 GLenum *type = (GLenum *) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002307 jint _nameRemaining;
2308 GLchar* name = (GLchar*)0;
2309
Jesse Halld830e742013-03-29 11:02:35 -07002310
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002311 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
2312 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2313 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002314 name = (GLchar*)getPointer(_env, name_buf, (jarray*)&_nameArray, &_nameRemaining, &_nameBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002315 if (length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002316 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002317 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
2318 }
2319 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002320 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002321 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2322 }
2323 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002324 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002325 type = (GLenum *) (_typeBase + _typeBufferOffset);
2326 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002327 if (name == NULL) {
2328 char* _nameBase = (char *)_env->GetByteArrayElements(_nameArray, (jboolean*)0);
2329 name = (GLchar *) (_nameBase + _nameBufferOffset);
2330 }
Jesse Halld830e742013-03-29 11:02:35 -07002331 glGetTransformFeedbackVarying(
2332 (GLuint)program,
2333 (GLuint)index,
2334 (GLsizei)bufsize,
2335 (GLsizei *)length,
2336 (GLint *)size,
2337 (GLenum *)type,
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002338 (GLchar*)name
Jesse Halld830e742013-03-29 11:02:35 -07002339 );
2340 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002341 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002342 }
2343 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002344 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002345 }
2346 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002347 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002348 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002349 if (_nameArray) {
2350 releaseArrayPointer<jbyteArray, jbyte*, ByteArrayReleaser>(_env, _nameArray, (jbyte*)name, JNI_TRUE);
2351 }
Jesse Halld830e742013-03-29 11:02:35 -07002352}
2353
2354/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2355static jstring
2356android_glGetTransformFeedbackVarying1
2357 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
2358 jint _exception = 0;
2359 const char * _exceptionType;
2360 const char * _exceptionMessage;
2361 GLint *size_base = (GLint *) 0;
2362 jint _sizeRemaining;
2363 GLint *size = (GLint *) 0;
2364 GLenum *type_base = (GLenum *) 0;
2365 jint _typeRemaining;
2366 GLenum *type = (GLenum *) 0;
2367
2368 jstring result = 0;
2369
2370 GLint len = 0;
2371 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2372 if (!len) {
2373 return _env->NewStringUTF("");
2374 }
2375 char* buf = (char*) malloc(len);
2376
2377 if (buf == NULL) {
2378 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2379 return NULL;
2380 }
2381 if (!size_ref) {
2382 _exception = 1;
2383 _exceptionType = "java/lang/IllegalArgumentException";
2384 _exceptionMessage = "size == null";
2385 goto exit;
2386 }
2387 if (sizeOffset < 0) {
2388 _exception = 1;
2389 _exceptionType = "java/lang/IllegalArgumentException";
2390 _exceptionMessage = "sizeOffset < 0";
2391 goto exit;
2392 }
2393 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2394 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002395 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002396 size = size_base + sizeOffset;
2397
2398 if (!type_ref) {
2399 _exception = 1;
2400 _exceptionType = "java/lang/IllegalArgumentException";
2401 _exceptionMessage = "type == null";
2402 goto exit;
2403 }
2404 if (typeOffset < 0) {
2405 _exception = 1;
2406 _exceptionType = "java/lang/IllegalArgumentException";
2407 _exceptionMessage = "typeOffset < 0";
2408 goto exit;
2409 }
2410 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2411 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002412 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002413 type = type_base + typeOffset;
2414
2415 glGetTransformFeedbackVarying(
2416 (GLuint)program,
2417 (GLuint)index,
2418 (GLsizei)len,
2419 NULL,
2420 (GLint *)size,
2421 (GLenum *)type,
2422 (char *)buf
2423 );
2424exit:
2425 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002426 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002427 _exception ? JNI_ABORT: 0);
2428 }
2429 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002430 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002431 _exception ? JNI_ABORT: 0);
2432 }
2433 if (_exception != 1) {
2434 result = _env->NewStringUTF(buf);
2435 }
2436 if (buf) {
2437 free(buf);
2438 }
2439 if (_exception) {
2440 jniThrowException(_env, _exceptionType, _exceptionMessage);
2441 }
2442 if (result == 0) {
2443 result = _env->NewStringUTF("");
2444 }
2445
2446 return result;
2447}
2448
2449/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2450static jstring
2451android_glGetTransformFeedbackVarying2
2452 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002453 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002454 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002455 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002456 jint _typeBufferOffset = (jint) 0;
2457 jint _lengthRemaining;
2458 GLsizei *length = (GLsizei *) 0;
2459 jint _sizeRemaining;
2460 GLint *size = (GLint *) 0;
2461 jint _typeRemaining;
2462 GLenum *type = (GLenum *) 0;
2463
2464 jstring result = 0;
2465
2466 GLint len = 0;
2467 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2468 if (!len) {
2469 return _env->NewStringUTF("");
2470 }
2471 char* buf = (char*) malloc(len);
2472
2473 if (buf == NULL) {
2474 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2475 return NULL;
2476 }
2477
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002478 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2479 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002480 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002481 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002482 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2483 }
2484 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002485 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002486 type = (GLenum *) (_typeBase + _typeBufferOffset);
2487 }
2488 glGetTransformFeedbackVarying(
2489 (GLuint)program,
2490 (GLuint)index,
2491 (GLsizei)len,
2492 NULL,
2493 (GLint *)size,
2494 (GLenum *)type,
2495 (char *)buf
2496 );
2497
2498 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002499 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002500 }
2501 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002502 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002503 }
2504 result = _env->NewStringUTF(buf);
2505 if (buf) {
2506 free(buf);
2507 }
2508 return result;
2509}
2510/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2511static void
2512android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
2513 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08002514 jint _exception = 0;
2515 const char * _exceptionType = NULL;
2516 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07002517 jarray _array = (jarray) 0;
2518 jint _bufferOffset = (jint) 0;
2519 jint _remaining;
2520 GLvoid *pointer = (GLvoid *) 0;
2521
2522 if (pointer_buf) {
2523 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2524 if ( ! pointer ) {
2525 return;
2526 }
2527 }
2528 glVertexAttribIPointerBounds(
2529 (GLuint)index,
2530 (GLint)size,
2531 (GLenum)type,
2532 (GLsizei)stride,
2533 (GLvoid *)pointer,
2534 (GLsizei)remaining
2535 );
Romain Guy84cac202016-12-05 12:26:02 -08002536 if (_exception) {
2537 jniThrowException(_env, _exceptionType, _exceptionMessage);
2538 }
Jesse Halld830e742013-03-29 11:02:35 -07002539}
2540
2541/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
2542static void
2543android_glVertexAttribIPointer__IIIII
2544 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
2545 glVertexAttribIPointer(
2546 (GLuint)index,
2547 (GLint)size,
2548 (GLenum)type,
2549 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00002550 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -07002551 );
2552}
2553
2554/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2555static void
2556android_glGetVertexAttribIiv__II_3II
2557 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2558 jint _exception = 0;
2559 const char * _exceptionType = NULL;
2560 const char * _exceptionMessage = NULL;
2561 GLint *params_base = (GLint *) 0;
2562 jint _remaining;
2563 GLint *params = (GLint *) 0;
2564
2565 if (!params_ref) {
2566 _exception = 1;
2567 _exceptionType = "java/lang/IllegalArgumentException";
2568 _exceptionMessage = "params == null";
2569 goto exit;
2570 }
2571 if (offset < 0) {
2572 _exception = 1;
2573 _exceptionType = "java/lang/IllegalArgumentException";
2574 _exceptionMessage = "offset < 0";
2575 goto exit;
2576 }
2577 _remaining = _env->GetArrayLength(params_ref) - offset;
2578 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002579 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002580 params = params_base + offset;
2581
2582 glGetVertexAttribIiv(
2583 (GLuint)index,
2584 (GLenum)pname,
2585 (GLint *)params
2586 );
2587
2588exit:
2589 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002590 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002591 _exception ? JNI_ABORT: 0);
2592 }
2593 if (_exception) {
2594 jniThrowException(_env, _exceptionType, _exceptionMessage);
2595 }
2596}
2597
2598/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2599static void
2600android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
2601 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002602 jint _exception = 0;
2603 const char * _exceptionType = NULL;
2604 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002605 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002606 jint _bufferOffset = (jint) 0;
2607 jint _remaining;
2608 GLint *params = (GLint *) 0;
2609
Romain Guy84cac202016-12-05 12:26:02 -08002610 if (!params_buf) {
2611 _exception = 1;
2612 _exceptionType = "java/lang/IllegalArgumentException";
2613 _exceptionMessage = "params == null";
2614 goto exit;
2615 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002616 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002617 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002618 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002619 params = (GLint *) (_paramsBase + _bufferOffset);
2620 }
2621 glGetVertexAttribIiv(
2622 (GLuint)index,
2623 (GLenum)pname,
2624 (GLint *)params
2625 );
Romain Guy84cac202016-12-05 12:26:02 -08002626
2627exit:
Jesse Halld830e742013-03-29 11:02:35 -07002628 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002629 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2630 }
2631 if (_exception) {
2632 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002633 }
2634}
2635
2636/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2637static void
2638android_glGetVertexAttribIuiv__II_3II
2639 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2640 jint _exception = 0;
2641 const char * _exceptionType = NULL;
2642 const char * _exceptionMessage = NULL;
2643 GLuint *params_base = (GLuint *) 0;
2644 jint _remaining;
2645 GLuint *params = (GLuint *) 0;
2646
2647 if (!params_ref) {
2648 _exception = 1;
2649 _exceptionType = "java/lang/IllegalArgumentException";
2650 _exceptionMessage = "params == null";
2651 goto exit;
2652 }
2653 if (offset < 0) {
2654 _exception = 1;
2655 _exceptionType = "java/lang/IllegalArgumentException";
2656 _exceptionMessage = "offset < 0";
2657 goto exit;
2658 }
2659 _remaining = _env->GetArrayLength(params_ref) - offset;
2660 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002661 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002662 params = params_base + offset;
2663
2664 glGetVertexAttribIuiv(
2665 (GLuint)index,
2666 (GLenum)pname,
2667 (GLuint *)params
2668 );
2669
2670exit:
2671 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002672 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002673 _exception ? JNI_ABORT: 0);
2674 }
2675 if (_exception) {
2676 jniThrowException(_env, _exceptionType, _exceptionMessage);
2677 }
2678}
2679
2680/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2681static void
2682android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
2683 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002684 jint _exception = 0;
2685 const char * _exceptionType = NULL;
2686 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002687 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002688 jint _bufferOffset = (jint) 0;
2689 jint _remaining;
2690 GLuint *params = (GLuint *) 0;
2691
Romain Guy84cac202016-12-05 12:26:02 -08002692 if (!params_buf) {
2693 _exception = 1;
2694 _exceptionType = "java/lang/IllegalArgumentException";
2695 _exceptionMessage = "params == null";
2696 goto exit;
2697 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002698 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002699 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002700 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002701 params = (GLuint *) (_paramsBase + _bufferOffset);
2702 }
2703 glGetVertexAttribIuiv(
2704 (GLuint)index,
2705 (GLenum)pname,
2706 (GLuint *)params
2707 );
Romain Guy84cac202016-12-05 12:26:02 -08002708
2709exit:
Jesse Halld830e742013-03-29 11:02:35 -07002710 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002711 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2712 }
2713 if (_exception) {
2714 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002715 }
2716}
2717
2718/* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
2719static void
2720android_glVertexAttribI4i__IIIII
2721 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2722 glVertexAttribI4i(
2723 (GLuint)index,
2724 (GLint)x,
2725 (GLint)y,
2726 (GLint)z,
2727 (GLint)w
2728 );
2729}
2730
2731/* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
2732static void
2733android_glVertexAttribI4ui__IIIII
2734 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2735 glVertexAttribI4ui(
2736 (GLuint)index,
2737 (GLuint)x,
2738 (GLuint)y,
2739 (GLuint)z,
2740 (GLuint)w
2741 );
2742}
2743
2744/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2745static void
2746android_glVertexAttribI4iv__I_3II
2747 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2748 jint _exception = 0;
2749 const char * _exceptionType = NULL;
2750 const char * _exceptionMessage = NULL;
2751 GLint *v_base = (GLint *) 0;
2752 jint _remaining;
2753 GLint *v = (GLint *) 0;
2754
2755 if (!v_ref) {
2756 _exception = 1;
2757 _exceptionType = "java/lang/IllegalArgumentException";
2758 _exceptionMessage = "v == null";
2759 goto exit;
2760 }
2761 if (offset < 0) {
2762 _exception = 1;
2763 _exceptionType = "java/lang/IllegalArgumentException";
2764 _exceptionMessage = "offset < 0";
2765 goto exit;
2766 }
2767 _remaining = _env->GetArrayLength(v_ref) - offset;
2768 v_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002769 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002770 v = v_base + offset;
2771
2772 glVertexAttribI4iv(
2773 (GLuint)index,
2774 (GLint *)v
2775 );
2776
2777exit:
2778 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002779 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002780 JNI_ABORT);
2781 }
2782 if (_exception) {
2783 jniThrowException(_env, _exceptionType, _exceptionMessage);
2784 }
2785}
2786
2787/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2788static void
2789android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
2790 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002791 jint _exception = 0;
2792 const char * _exceptionType = NULL;
2793 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002794 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002795 jint _bufferOffset = (jint) 0;
2796 jint _remaining;
2797 GLint *v = (GLint *) 0;
2798
Romain Guy84cac202016-12-05 12:26:02 -08002799 if (!v_buf) {
2800 _exception = 1;
2801 _exceptionType = "java/lang/IllegalArgumentException";
2802 _exceptionMessage = "v == null";
2803 goto exit;
2804 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002805 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002806 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002807 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002808 v = (GLint *) (_vBase + _bufferOffset);
2809 }
2810 glVertexAttribI4iv(
2811 (GLuint)index,
2812 (GLint *)v
2813 );
Romain Guy84cac202016-12-05 12:26:02 -08002814
2815exit:
Jesse Halld830e742013-03-29 11:02:35 -07002816 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002817 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002818 }
Romain Guy84cac202016-12-05 12:26:02 -08002819 if (_exception) {
2820 jniThrowException(_env, _exceptionType, _exceptionMessage);
2821 }
Jesse Halld830e742013-03-29 11:02:35 -07002822}
2823
2824/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2825static void
2826android_glVertexAttribI4uiv__I_3II
2827 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2828 jint _exception = 0;
2829 const char * _exceptionType = NULL;
2830 const char * _exceptionMessage = NULL;
2831 GLuint *v_base = (GLuint *) 0;
2832 jint _remaining;
2833 GLuint *v = (GLuint *) 0;
2834
2835 if (!v_ref) {
2836 _exception = 1;
2837 _exceptionType = "java/lang/IllegalArgumentException";
2838 _exceptionMessage = "v == null";
2839 goto exit;
2840 }
2841 if (offset < 0) {
2842 _exception = 1;
2843 _exceptionType = "java/lang/IllegalArgumentException";
2844 _exceptionMessage = "offset < 0";
2845 goto exit;
2846 }
2847 _remaining = _env->GetArrayLength(v_ref) - offset;
2848 v_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002849 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002850 v = v_base + offset;
2851
2852 glVertexAttribI4uiv(
2853 (GLuint)index,
2854 (GLuint *)v
2855 );
2856
2857exit:
2858 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002859 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002860 JNI_ABORT);
2861 }
2862 if (_exception) {
2863 jniThrowException(_env, _exceptionType, _exceptionMessage);
2864 }
2865}
2866
2867/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2868static void
2869android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
2870 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002871 jint _exception = 0;
2872 const char * _exceptionType = NULL;
2873 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002874 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002875 jint _bufferOffset = (jint) 0;
2876 jint _remaining;
2877 GLuint *v = (GLuint *) 0;
2878
Romain Guy84cac202016-12-05 12:26:02 -08002879 if (!v_buf) {
2880 _exception = 1;
2881 _exceptionType = "java/lang/IllegalArgumentException";
2882 _exceptionMessage = "v == null";
2883 goto exit;
2884 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002885 v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002886 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002887 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002888 v = (GLuint *) (_vBase + _bufferOffset);
2889 }
2890 glVertexAttribI4uiv(
2891 (GLuint)index,
2892 (GLuint *)v
2893 );
Romain Guy84cac202016-12-05 12:26:02 -08002894
2895exit:
Jesse Halld830e742013-03-29 11:02:35 -07002896 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002897 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002898 }
Romain Guy84cac202016-12-05 12:26:02 -08002899 if (_exception) {
2900 jniThrowException(_env, _exceptionType, _exceptionMessage);
2901 }
Jesse Halld830e742013-03-29 11:02:35 -07002902}
2903
2904/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2905static void
2906android_glGetUniformuiv__II_3II
2907 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
2908 jint _exception = 0;
2909 const char * _exceptionType = NULL;
2910 const char * _exceptionMessage = NULL;
2911 GLuint *params_base = (GLuint *) 0;
2912 jint _remaining;
2913 GLuint *params = (GLuint *) 0;
2914
2915 if (!params_ref) {
2916 _exception = 1;
2917 _exceptionType = "java/lang/IllegalArgumentException";
2918 _exceptionMessage = "params == null";
2919 goto exit;
2920 }
2921 if (offset < 0) {
2922 _exception = 1;
2923 _exceptionType = "java/lang/IllegalArgumentException";
2924 _exceptionMessage = "offset < 0";
2925 goto exit;
2926 }
2927 _remaining = _env->GetArrayLength(params_ref) - offset;
2928 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002929 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002930 params = params_base + offset;
2931
2932 glGetUniformuiv(
2933 (GLuint)program,
2934 (GLint)location,
2935 (GLuint *)params
2936 );
2937
2938exit:
2939 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002940 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002941 _exception ? JNI_ABORT: 0);
2942 }
2943 if (_exception) {
2944 jniThrowException(_env, _exceptionType, _exceptionMessage);
2945 }
2946}
2947
2948/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2949static void
2950android_glGetUniformuiv__IILjava_nio_IntBuffer_2
2951 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002952 jint _exception = 0;
2953 const char * _exceptionType = NULL;
2954 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002955 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002956 jint _bufferOffset = (jint) 0;
2957 jint _remaining;
2958 GLuint *params = (GLuint *) 0;
2959
Romain Guy84cac202016-12-05 12:26:02 -08002960 if (!params_buf) {
2961 _exception = 1;
2962 _exceptionType = "java/lang/IllegalArgumentException";
2963 _exceptionMessage = "params == null";
2964 goto exit;
2965 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002966 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002967 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002968 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002969 params = (GLuint *) (_paramsBase + _bufferOffset);
2970 }
2971 glGetUniformuiv(
2972 (GLuint)program,
2973 (GLint)location,
2974 (GLuint *)params
2975 );
Romain Guy84cac202016-12-05 12:26:02 -08002976
2977exit:
Jesse Halld830e742013-03-29 11:02:35 -07002978 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002979 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2980 }
2981 if (_exception) {
2982 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002983 }
2984}
2985
2986/* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
2987static jint
2988android_glGetFragDataLocation__ILjava_lang_String_2
2989 (JNIEnv *_env, jobject _this, jint program, jstring name) {
2990 jint _exception = 0;
2991 const char * _exceptionType = NULL;
2992 const char * _exceptionMessage = NULL;
2993 GLint _returnValue = 0;
2994 const char* _nativename = 0;
2995
2996 if (!name) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07002997 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07002998 _exceptionType = "java/lang/IllegalArgumentException";
2999 _exceptionMessage = "name == null";
3000 goto exit;
3001 }
3002 _nativename = _env->GetStringUTFChars(name, 0);
3003
3004 _returnValue = glGetFragDataLocation(
3005 (GLuint)program,
3006 (GLchar *)_nativename
3007 );
3008
3009exit:
3010 if (_nativename) {
3011 _env->ReleaseStringUTFChars(name, _nativename);
3012 }
3013
3014 if (_exception) {
3015 jniThrowException(_env, _exceptionType, _exceptionMessage);
3016 }
3017 return (jint)_returnValue;
3018}
3019
3020/* void glUniform1ui ( GLint location, GLuint v0 ) */
3021static void
3022android_glUniform1ui__II
3023 (JNIEnv *_env, jobject _this, jint location, jint v0) {
3024 glUniform1ui(
3025 (GLint)location,
3026 (GLuint)v0
3027 );
3028}
3029
3030/* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
3031static void
3032android_glUniform2ui__III
3033 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
3034 glUniform2ui(
3035 (GLint)location,
3036 (GLuint)v0,
3037 (GLuint)v1
3038 );
3039}
3040
3041/* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
3042static void
3043android_glUniform3ui__IIII
3044 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
3045 glUniform3ui(
3046 (GLint)location,
3047 (GLuint)v0,
3048 (GLuint)v1,
3049 (GLuint)v2
3050 );
3051}
3052
3053/* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
3054static void
3055android_glUniform4ui__IIIII
3056 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
3057 glUniform4ui(
3058 (GLint)location,
3059 (GLuint)v0,
3060 (GLuint)v1,
3061 (GLuint)v2,
3062 (GLuint)v3
3063 );
3064}
3065
3066/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3067static void
3068android_glUniform1uiv__II_3II
3069 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3070 jint _exception = 0;
3071 const char * _exceptionType = NULL;
3072 const char * _exceptionMessage = NULL;
3073 GLuint *value_base = (GLuint *) 0;
3074 jint _remaining;
3075 GLuint *value = (GLuint *) 0;
3076
3077 if (!value_ref) {
3078 _exception = 1;
3079 _exceptionType = "java/lang/IllegalArgumentException";
3080 _exceptionMessage = "value == null";
3081 goto exit;
3082 }
3083 if (offset < 0) {
3084 _exception = 1;
3085 _exceptionType = "java/lang/IllegalArgumentException";
3086 _exceptionMessage = "offset < 0";
3087 goto exit;
3088 }
3089 _remaining = _env->GetArrayLength(value_ref) - offset;
3090 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003091 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003092 value = value_base + offset;
3093
3094 glUniform1uiv(
3095 (GLint)location,
3096 (GLsizei)count,
3097 (GLuint *)value
3098 );
3099
3100exit:
3101 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003102 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003103 JNI_ABORT);
3104 }
3105 if (_exception) {
3106 jniThrowException(_env, _exceptionType, _exceptionMessage);
3107 }
3108}
3109
3110/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3111static void
3112android_glUniform1uiv__IILjava_nio_IntBuffer_2
3113 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003114 jint _exception = 0;
3115 const char * _exceptionType = NULL;
3116 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003117 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003118 jint _bufferOffset = (jint) 0;
3119 jint _remaining;
3120 GLuint *value = (GLuint *) 0;
3121
Romain Guy84cac202016-12-05 12:26:02 -08003122 if (!value_buf) {
3123 _exception = 1;
3124 _exceptionType = "java/lang/IllegalArgumentException";
3125 _exceptionMessage = "value == null";
3126 goto exit;
3127 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003128 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003129 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003130 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003131 value = (GLuint *) (_valueBase + _bufferOffset);
3132 }
3133 glUniform1uiv(
3134 (GLint)location,
3135 (GLsizei)count,
3136 (GLuint *)value
3137 );
Romain Guy84cac202016-12-05 12:26:02 -08003138
3139exit:
Jesse Halld830e742013-03-29 11:02:35 -07003140 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003141 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003142 }
Romain Guy84cac202016-12-05 12:26:02 -08003143 if (_exception) {
3144 jniThrowException(_env, _exceptionType, _exceptionMessage);
3145 }
Jesse Halld830e742013-03-29 11:02:35 -07003146}
3147
3148/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3149static void
3150android_glUniform2uiv__II_3II
3151 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3152 jint _exception = 0;
3153 const char * _exceptionType = NULL;
3154 const char * _exceptionMessage = NULL;
3155 GLuint *value_base = (GLuint *) 0;
3156 jint _remaining;
3157 GLuint *value = (GLuint *) 0;
3158
3159 if (!value_ref) {
3160 _exception = 1;
3161 _exceptionType = "java/lang/IllegalArgumentException";
3162 _exceptionMessage = "value == null";
3163 goto exit;
3164 }
3165 if (offset < 0) {
3166 _exception = 1;
3167 _exceptionType = "java/lang/IllegalArgumentException";
3168 _exceptionMessage = "offset < 0";
3169 goto exit;
3170 }
3171 _remaining = _env->GetArrayLength(value_ref) - offset;
3172 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003173 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003174 value = value_base + offset;
3175
3176 glUniform2uiv(
3177 (GLint)location,
3178 (GLsizei)count,
3179 (GLuint *)value
3180 );
3181
3182exit:
3183 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003184 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003185 JNI_ABORT);
3186 }
3187 if (_exception) {
3188 jniThrowException(_env, _exceptionType, _exceptionMessage);
3189 }
3190}
3191
3192/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3193static void
3194android_glUniform2uiv__IILjava_nio_IntBuffer_2
3195 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003196 jint _exception = 0;
3197 const char * _exceptionType = NULL;
3198 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003199 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003200 jint _bufferOffset = (jint) 0;
3201 jint _remaining;
3202 GLuint *value = (GLuint *) 0;
3203
Romain Guy84cac202016-12-05 12:26:02 -08003204 if (!value_buf) {
3205 _exception = 1;
3206 _exceptionType = "java/lang/IllegalArgumentException";
3207 _exceptionMessage = "value == null";
3208 goto exit;
3209 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003210 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003211 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003212 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003213 value = (GLuint *) (_valueBase + _bufferOffset);
3214 }
3215 glUniform2uiv(
3216 (GLint)location,
3217 (GLsizei)count,
3218 (GLuint *)value
3219 );
Romain Guy84cac202016-12-05 12:26:02 -08003220
3221exit:
Jesse Halld830e742013-03-29 11:02:35 -07003222 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003223 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003224 }
Romain Guy84cac202016-12-05 12:26:02 -08003225 if (_exception) {
3226 jniThrowException(_env, _exceptionType, _exceptionMessage);
3227 }
Jesse Halld830e742013-03-29 11:02:35 -07003228}
3229
3230/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3231static void
3232android_glUniform3uiv__II_3II
3233 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3234 jint _exception = 0;
3235 const char * _exceptionType = NULL;
3236 const char * _exceptionMessage = NULL;
3237 GLuint *value_base = (GLuint *) 0;
3238 jint _remaining;
3239 GLuint *value = (GLuint *) 0;
3240
3241 if (!value_ref) {
3242 _exception = 1;
3243 _exceptionType = "java/lang/IllegalArgumentException";
3244 _exceptionMessage = "value == null";
3245 goto exit;
3246 }
3247 if (offset < 0) {
3248 _exception = 1;
3249 _exceptionType = "java/lang/IllegalArgumentException";
3250 _exceptionMessage = "offset < 0";
3251 goto exit;
3252 }
3253 _remaining = _env->GetArrayLength(value_ref) - offset;
3254 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003255 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003256 value = value_base + offset;
3257
3258 glUniform3uiv(
3259 (GLint)location,
3260 (GLsizei)count,
3261 (GLuint *)value
3262 );
3263
3264exit:
3265 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003266 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003267 JNI_ABORT);
3268 }
3269 if (_exception) {
3270 jniThrowException(_env, _exceptionType, _exceptionMessage);
3271 }
3272}
3273
3274/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3275static void
3276android_glUniform3uiv__IILjava_nio_IntBuffer_2
3277 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003278 jint _exception = 0;
3279 const char * _exceptionType = NULL;
3280 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003281 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003282 jint _bufferOffset = (jint) 0;
3283 jint _remaining;
3284 GLuint *value = (GLuint *) 0;
3285
Romain Guy84cac202016-12-05 12:26:02 -08003286 if (!value_buf) {
3287 _exception = 1;
3288 _exceptionType = "java/lang/IllegalArgumentException";
3289 _exceptionMessage = "value == null";
3290 goto exit;
3291 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003292 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003293 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003294 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003295 value = (GLuint *) (_valueBase + _bufferOffset);
3296 }
3297 glUniform3uiv(
3298 (GLint)location,
3299 (GLsizei)count,
3300 (GLuint *)value
3301 );
Romain Guy84cac202016-12-05 12:26:02 -08003302
3303exit:
Jesse Halld830e742013-03-29 11:02:35 -07003304 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003305 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003306 }
Romain Guy84cac202016-12-05 12:26:02 -08003307 if (_exception) {
3308 jniThrowException(_env, _exceptionType, _exceptionMessage);
3309 }
Jesse Halld830e742013-03-29 11:02:35 -07003310}
3311
3312/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3313static void
3314android_glUniform4uiv__II_3II
3315 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3316 jint _exception = 0;
3317 const char * _exceptionType = NULL;
3318 const char * _exceptionMessage = NULL;
3319 GLuint *value_base = (GLuint *) 0;
3320 jint _remaining;
3321 GLuint *value = (GLuint *) 0;
3322
3323 if (!value_ref) {
3324 _exception = 1;
3325 _exceptionType = "java/lang/IllegalArgumentException";
3326 _exceptionMessage = "value == null";
3327 goto exit;
3328 }
3329 if (offset < 0) {
3330 _exception = 1;
3331 _exceptionType = "java/lang/IllegalArgumentException";
3332 _exceptionMessage = "offset < 0";
3333 goto exit;
3334 }
3335 _remaining = _env->GetArrayLength(value_ref) - offset;
3336 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003337 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003338 value = value_base + offset;
3339
3340 glUniform4uiv(
3341 (GLint)location,
3342 (GLsizei)count,
3343 (GLuint *)value
3344 );
3345
3346exit:
3347 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003348 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003349 JNI_ABORT);
3350 }
3351 if (_exception) {
3352 jniThrowException(_env, _exceptionType, _exceptionMessage);
3353 }
3354}
3355
3356/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3357static void
3358android_glUniform4uiv__IILjava_nio_IntBuffer_2
3359 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003360 jint _exception = 0;
3361 const char * _exceptionType = NULL;
3362 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003363 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003364 jint _bufferOffset = (jint) 0;
3365 jint _remaining;
3366 GLuint *value = (GLuint *) 0;
3367
Romain Guy84cac202016-12-05 12:26:02 -08003368 if (!value_buf) {
3369 _exception = 1;
3370 _exceptionType = "java/lang/IllegalArgumentException";
3371 _exceptionMessage = "value == null";
3372 goto exit;
3373 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003374 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003375 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003376 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003377 value = (GLuint *) (_valueBase + _bufferOffset);
3378 }
3379 glUniform4uiv(
3380 (GLint)location,
3381 (GLsizei)count,
3382 (GLuint *)value
3383 );
Romain Guy84cac202016-12-05 12:26:02 -08003384
3385exit:
Jesse Halld830e742013-03-29 11:02:35 -07003386 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003387 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003388 }
Romain Guy84cac202016-12-05 12:26:02 -08003389 if (_exception) {
3390 jniThrowException(_env, _exceptionType, _exceptionMessage);
3391 }
Jesse Halld830e742013-03-29 11:02:35 -07003392}
3393
3394/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3395static void
3396android_glClearBufferiv__II_3II
3397 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3398 jint _exception = 0;
3399 const char * _exceptionType = NULL;
3400 const char * _exceptionMessage = NULL;
3401 GLint *value_base = (GLint *) 0;
3402 jint _remaining;
3403 GLint *value = (GLint *) 0;
3404
3405 if (!value_ref) {
3406 _exception = 1;
3407 _exceptionType = "java/lang/IllegalArgumentException";
3408 _exceptionMessage = "value == null";
3409 goto exit;
3410 }
3411 if (offset < 0) {
3412 _exception = 1;
3413 _exceptionType = "java/lang/IllegalArgumentException";
3414 _exceptionMessage = "offset < 0";
3415 goto exit;
3416 }
3417 _remaining = _env->GetArrayLength(value_ref) - offset;
3418 value_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003419 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003420 value = value_base + offset;
3421
3422 glClearBufferiv(
3423 (GLenum)buffer,
3424 (GLint)drawbuffer,
3425 (GLint *)value
3426 );
3427
3428exit:
3429 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003430 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003431 JNI_ABORT);
3432 }
3433 if (_exception) {
3434 jniThrowException(_env, _exceptionType, _exceptionMessage);
3435 }
3436}
3437
3438/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3439static void
3440android_glClearBufferiv__IILjava_nio_IntBuffer_2
3441 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003442 jint _exception = 0;
3443 const char * _exceptionType = NULL;
3444 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003445 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003446 jint _bufferOffset = (jint) 0;
3447 jint _remaining;
3448 GLint *value = (GLint *) 0;
3449
Romain Guy84cac202016-12-05 12:26:02 -08003450 if (!value_buf) {
3451 _exception = 1;
3452 _exceptionType = "java/lang/IllegalArgumentException";
3453 _exceptionMessage = "value == null";
3454 goto exit;
3455 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003456 value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003457 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003458 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003459 value = (GLint *) (_valueBase + _bufferOffset);
3460 }
3461 glClearBufferiv(
3462 (GLenum)buffer,
3463 (GLint)drawbuffer,
3464 (GLint *)value
3465 );
Romain Guy84cac202016-12-05 12:26:02 -08003466
3467exit:
Jesse Halld830e742013-03-29 11:02:35 -07003468 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003469 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003470 }
Romain Guy84cac202016-12-05 12:26:02 -08003471 if (_exception) {
3472 jniThrowException(_env, _exceptionType, _exceptionMessage);
3473 }
Jesse Halld830e742013-03-29 11:02:35 -07003474}
3475
3476/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3477static void
3478android_glClearBufferuiv__II_3II
3479 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3480 jint _exception = 0;
3481 const char * _exceptionType = NULL;
3482 const char * _exceptionMessage = NULL;
3483 GLuint *value_base = (GLuint *) 0;
3484 jint _remaining;
3485 GLuint *value = (GLuint *) 0;
3486
3487 if (!value_ref) {
3488 _exception = 1;
3489 _exceptionType = "java/lang/IllegalArgumentException";
3490 _exceptionMessage = "value == null";
3491 goto exit;
3492 }
3493 if (offset < 0) {
3494 _exception = 1;
3495 _exceptionType = "java/lang/IllegalArgumentException";
3496 _exceptionMessage = "offset < 0";
3497 goto exit;
3498 }
3499 _remaining = _env->GetArrayLength(value_ref) - offset;
3500 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003501 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003502 value = value_base + offset;
3503
3504 glClearBufferuiv(
3505 (GLenum)buffer,
3506 (GLint)drawbuffer,
3507 (GLuint *)value
3508 );
3509
3510exit:
3511 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003512 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003513 JNI_ABORT);
3514 }
3515 if (_exception) {
3516 jniThrowException(_env, _exceptionType, _exceptionMessage);
3517 }
3518}
3519
3520/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3521static void
3522android_glClearBufferuiv__IILjava_nio_IntBuffer_2
3523 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003524 jint _exception = 0;
3525 const char * _exceptionType = NULL;
3526 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003527 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003528 jint _bufferOffset = (jint) 0;
3529 jint _remaining;
3530 GLuint *value = (GLuint *) 0;
3531
Romain Guy84cac202016-12-05 12:26:02 -08003532 if (!value_buf) {
3533 _exception = 1;
3534 _exceptionType = "java/lang/IllegalArgumentException";
3535 _exceptionMessage = "value == null";
3536 goto exit;
3537 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003538 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003539 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003540 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003541 value = (GLuint *) (_valueBase + _bufferOffset);
3542 }
3543 glClearBufferuiv(
3544 (GLenum)buffer,
3545 (GLint)drawbuffer,
3546 (GLuint *)value
3547 );
Romain Guy84cac202016-12-05 12:26:02 -08003548
3549exit:
Jesse Halld830e742013-03-29 11:02:35 -07003550 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003551 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003552 }
Romain Guy84cac202016-12-05 12:26:02 -08003553 if (_exception) {
3554 jniThrowException(_env, _exceptionType, _exceptionMessage);
3555 }
Jesse Halld830e742013-03-29 11:02:35 -07003556}
3557
3558/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3559static void
3560android_glClearBufferfv__II_3FI
3561 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
3562 jint _exception = 0;
3563 const char * _exceptionType = NULL;
3564 const char * _exceptionMessage = NULL;
3565 GLfloat *value_base = (GLfloat *) 0;
3566 jint _remaining;
3567 GLfloat *value = (GLfloat *) 0;
3568
3569 if (!value_ref) {
3570 _exception = 1;
3571 _exceptionType = "java/lang/IllegalArgumentException";
3572 _exceptionMessage = "value == null";
3573 goto exit;
3574 }
3575 if (offset < 0) {
3576 _exception = 1;
3577 _exceptionType = "java/lang/IllegalArgumentException";
3578 _exceptionMessage = "offset < 0";
3579 goto exit;
3580 }
3581 _remaining = _env->GetArrayLength(value_ref) - offset;
3582 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003583 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003584 value = value_base + offset;
3585
3586 glClearBufferfv(
3587 (GLenum)buffer,
3588 (GLint)drawbuffer,
3589 (GLfloat *)value
3590 );
3591
3592exit:
3593 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003594 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003595 JNI_ABORT);
3596 }
3597 if (_exception) {
3598 jniThrowException(_env, _exceptionType, _exceptionMessage);
3599 }
3600}
3601
3602/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3603static void
3604android_glClearBufferfv__IILjava_nio_FloatBuffer_2
3605 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003606 jint _exception = 0;
3607 const char * _exceptionType = NULL;
3608 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003609 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003610 jint _bufferOffset = (jint) 0;
3611 jint _remaining;
3612 GLfloat *value = (GLfloat *) 0;
3613
Romain Guy84cac202016-12-05 12:26:02 -08003614 if (!value_buf) {
3615 _exception = 1;
3616 _exceptionType = "java/lang/IllegalArgumentException";
3617 _exceptionMessage = "value == null";
3618 goto exit;
3619 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003620 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003621 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003622 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003623 value = (GLfloat *) (_valueBase + _bufferOffset);
3624 }
3625 glClearBufferfv(
3626 (GLenum)buffer,
3627 (GLint)drawbuffer,
3628 (GLfloat *)value
3629 );
Romain Guy84cac202016-12-05 12:26:02 -08003630
3631exit:
Jesse Halld830e742013-03-29 11:02:35 -07003632 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003633 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003634 }
Romain Guy84cac202016-12-05 12:26:02 -08003635 if (_exception) {
3636 jniThrowException(_env, _exceptionType, _exceptionMessage);
3637 }
Jesse Halld830e742013-03-29 11:02:35 -07003638}
3639
3640/* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
3641static void
3642android_glClearBufferfi__IIFI
3643 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
3644 glClearBufferfi(
3645 (GLenum)buffer,
3646 (GLint)drawbuffer,
3647 (GLfloat)depth,
3648 (GLint)stencil
3649 );
3650}
3651
3652/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
3653static jstring
3654android_glGetStringi__II
3655 (JNIEnv *_env, jobject _this, jint name, jint index) {
3656 const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
3657 return _env->NewStringUTF((const char*)_chars);
3658}
3659
3660/* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
3661static void
3662android_glCopyBufferSubData__IIIII
3663 (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
3664 glCopyBufferSubData(
3665 (GLenum)readTarget,
3666 (GLenum)writeTarget,
3667 (GLintptr)readOffset,
3668 (GLintptr)writeOffset,
3669 (GLsizeiptr)size
3670 );
3671}
3672
3673/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3674static
3675void
3676android_glGetUniformIndices_array
3677 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
3678 jint _exception = 0;
3679 const char* _exceptionType = NULL;
3680 const char* _exceptionMessage = NULL;
3681 jint _count = 0;
3682 jint _i;
3683 const char** _names = NULL;
3684 GLuint* _indices_base = NULL;
3685 GLuint* _indices = NULL;
3686
3687 if (!uniformNames_ref) {
3688 _exception = 1;
3689 _exceptionType = "java/lang/IllegalArgumentException";
3690 _exceptionMessage = "uniformNames == null";
3691 goto exit;
3692 }
3693 _count = _env->GetArrayLength(uniformNames_ref);
3694 _names = (const char**)calloc(_count, sizeof(const char*));
3695 for (_i = 0; _i < _count; _i++) {
3696 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3697 if (!_name) {
3698 _exception = 1;
3699 _exceptionType = "java/lang/IllegalArgumentException";
3700 _exceptionMessage = "null uniformNames element";
3701 goto exit;
3702 }
3703 _names[_i] = _env->GetStringUTFChars(_name, 0);
3704 }
3705
3706 if (!uniformIndices_ref) {
3707 _exception = 1;
3708 _exceptionType = "java/lang/IllegalArgumentException";
3709 _exceptionMessage = "uniformIndices == null";
3710 goto exit;
3711 }
3712 if (uniformIndicesOffset < 0) {
3713 _exception = 1;
3714 _exceptionType = "java/lang/IllegalArgumentException";
3715 _exceptionMessage = "uniformIndicesOffset < 0";
3716 goto exit;
3717 }
3718 if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
3719 _exception = 1;
3720 _exceptionType = "java/lang/IllegalArgumentException";
3721 _exceptionMessage = "not enough space in uniformIndices";
3722 goto exit;
3723 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003724 _indices_base = (GLuint*)_env->GetIntArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003725 uniformIndices_ref, 0);
3726 _indices = _indices_base + uniformIndicesOffset;
3727
3728 glGetUniformIndices(program, _count, _names, _indices);
3729
3730exit:
3731 if (_indices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003732 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
3733 _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003734 }
3735 for (_i = _count - 1; _i >= 0; _i--) {
3736 if (_names[_i]) {
3737 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3738 if (_name) {
3739 _env->ReleaseStringUTFChars(_name, _names[_i]);
3740 }
3741 }
3742 }
3743 free(_names);
3744 if (_exception) {
3745 jniThrowException(_env, _exceptionType, _exceptionMessage);
3746 }
3747}
3748
3749/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3750static
3751void
3752android_glGetUniformIndices_buffer
3753 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
3754 jint _exception = 0;
3755 const char* _exceptionType = NULL;
3756 const char* _exceptionMessage = NULL;
3757 jint _count = 0;
3758 jint _i;
3759 const char** _names = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003760 jintArray _uniformIndicesArray = (jintArray)0;
Jesse Halld830e742013-03-29 11:02:35 -07003761 jint _uniformIndicesRemaining;
3762 jint _uniformIndicesOffset = 0;
3763 GLuint* _indices = NULL;
3764 char* _indicesBase = NULL;
3765
3766 if (!uniformNames_ref) {
3767 _exception = 1;
3768 _exceptionType = "java/lang/IllegalArgumentException";
3769 _exceptionMessage = "uniformNames == null";
3770 goto exit;
3771 }
3772 if (!uniformIndices_buf) {
3773 _exception = 1;
3774 _exceptionType = "java/lang/IllegalArgumentException";
3775 _exceptionMessage = "uniformIndices == null";
3776 goto exit;
3777 }
3778
3779 _count = _env->GetArrayLength(uniformNames_ref);
3780 _names = (const char**)calloc(_count, sizeof(const char*));
3781 for (_i = 0; _i < _count; _i++) {
3782 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3783 if (!_name) {
3784 _exception = 1;
3785 _exceptionType = "java/lang/IllegalArgumentException";
3786 _exceptionMessage = "null uniformNames element";
3787 goto exit;
3788 }
3789 _names[_i] = _env->GetStringUTFChars(_name, 0);
3790 }
3791
3792 _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003793 (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
Jesse Halld830e742013-03-29 11:02:35 -07003794 &_uniformIndicesOffset);
3795 if (!_indices) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003796 _indicesBase = (char*)_env->GetIntArrayElements(
3797 _uniformIndicesArray, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003798 _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
3799 }
3800 if (_uniformIndicesRemaining < _count) {
3801 _exception = 1;
3802 _exceptionType = "java/lang/IllegalArgumentException";
3803 _exceptionMessage = "not enough space in uniformIndices";
3804 goto exit;
3805 }
3806
3807 glGetUniformIndices(program, _count, _names, _indices);
3808
3809exit:
3810 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003811 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
3812 _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07003813 }
3814 for (_i = _count - 1; _i >= 0; _i--) {
3815 if (_names[_i]) {
3816 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3817 if (_name) {
3818 _env->ReleaseStringUTFChars(_name, _names[_i]);
3819 }
3820 }
3821 }
3822 free(_names);
3823 if (_exception) {
3824 jniThrowException(_env, _exceptionType, _exceptionMessage);
3825 }
3826}
Jesse Halld830e742013-03-29 11:02:35 -07003827/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3828static void
3829android_glGetActiveUniformsiv__II_3III_3II
3830 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
3831 jint _exception = 0;
3832 const char * _exceptionType = NULL;
3833 const char * _exceptionMessage = NULL;
3834 GLuint *uniformIndices_base = (GLuint *) 0;
3835 jint _uniformIndicesRemaining;
3836 GLuint *uniformIndices = (GLuint *) 0;
3837 GLint *params_base = (GLint *) 0;
3838 jint _paramsRemaining;
3839 GLint *params = (GLint *) 0;
3840
3841 if (!uniformIndices_ref) {
3842 _exception = 1;
3843 _exceptionType = "java/lang/IllegalArgumentException";
3844 _exceptionMessage = "uniformIndices == null";
3845 goto exit;
3846 }
3847 if (uniformIndicesOffset < 0) {
3848 _exception = 1;
3849 _exceptionType = "java/lang/IllegalArgumentException";
3850 _exceptionMessage = "uniformIndicesOffset < 0";
3851 goto exit;
3852 }
3853 _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
3854 uniformIndices_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003855 _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003856 uniformIndices = uniformIndices_base + uniformIndicesOffset;
3857
3858 if (!params_ref) {
3859 _exception = 1;
3860 _exceptionType = "java/lang/IllegalArgumentException";
3861 _exceptionMessage = "params == null";
3862 goto exit;
3863 }
3864 if (paramsOffset < 0) {
3865 _exception = 1;
3866 _exceptionType = "java/lang/IllegalArgumentException";
3867 _exceptionMessage = "paramsOffset < 0";
3868 goto exit;
3869 }
3870 _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
3871 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003872 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003873 params = params_base + paramsOffset;
3874
3875 glGetActiveUniformsiv(
3876 (GLuint)program,
3877 (GLsizei)uniformCount,
3878 (GLuint *)uniformIndices,
3879 (GLenum)pname,
3880 (GLint *)params
3881 );
3882
3883exit:
3884 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003885 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003886 _exception ? JNI_ABORT: 0);
3887 }
3888 if (uniformIndices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003889 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
Jesse Halld830e742013-03-29 11:02:35 -07003890 JNI_ABORT);
3891 }
3892 if (_exception) {
3893 jniThrowException(_env, _exceptionType, _exceptionMessage);
3894 }
3895}
3896
3897/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3898static void
3899android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
3900 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003901 jint _exception = 0;
3902 const char * _exceptionType = NULL;
3903 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003904 jintArray _uniformIndicesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003905 jint _uniformIndicesBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003906 jintArray _paramsArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003907 jint _paramsBufferOffset = (jint) 0;
3908 jint _uniformIndicesRemaining;
3909 GLuint *uniformIndices = (GLuint *) 0;
3910 jint _paramsRemaining;
3911 GLint *params = (GLint *) 0;
3912
Romain Guy84cac202016-12-05 12:26:02 -08003913 if (!uniformIndices_buf) {
3914 _exception = 1;
3915 _exceptionType = "java/lang/IllegalArgumentException";
3916 _exceptionMessage = "uniformIndices == null";
3917 goto exit;
3918 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003919 uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08003920 if (!params_buf) {
3921 _exception = 1;
3922 _exceptionType = "java/lang/IllegalArgumentException";
3923 _exceptionMessage = "params == null";
3924 goto exit;
3925 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003926 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003927 if (uniformIndices == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003928 char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003929 uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
3930 }
3931 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003932 char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003933 params = (GLint *) (_paramsBase + _paramsBufferOffset);
3934 }
3935 glGetActiveUniformsiv(
3936 (GLuint)program,
3937 (GLsizei)uniformCount,
3938 (GLuint *)uniformIndices,
3939 (GLenum)pname,
3940 (GLint *)params
3941 );
Romain Guy84cac202016-12-05 12:26:02 -08003942
3943exit:
Jesse Halld830e742013-03-29 11:02:35 -07003944 if (_paramsArray) {
Romain Guy84cac202016-12-05 12:26:02 -08003945 _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003946 }
3947 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003948 _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003949 }
Romain Guy84cac202016-12-05 12:26:02 -08003950 if (_exception) {
3951 jniThrowException(_env, _exceptionType, _exceptionMessage);
3952 }
Jesse Halld830e742013-03-29 11:02:35 -07003953}
3954
3955/* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
3956static jint
3957android_glGetUniformBlockIndex__ILjava_lang_String_2
3958 (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
3959 jint _exception = 0;
3960 const char * _exceptionType = NULL;
3961 const char * _exceptionMessage = NULL;
3962 GLuint _returnValue = 0;
3963 const char* _nativeuniformBlockName = 0;
3964
3965 if (!uniformBlockName) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07003966 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07003967 _exceptionType = "java/lang/IllegalArgumentException";
3968 _exceptionMessage = "uniformBlockName == null";
3969 goto exit;
3970 }
3971 _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
3972
3973 _returnValue = glGetUniformBlockIndex(
3974 (GLuint)program,
3975 (GLchar *)_nativeuniformBlockName
3976 );
3977
3978exit:
3979 if (_nativeuniformBlockName) {
3980 _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
3981 }
3982
3983 if (_exception) {
3984 jniThrowException(_env, _exceptionType, _exceptionMessage);
3985 }
3986 return (jint)_returnValue;
3987}
3988
3989/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3990static void
3991android_glGetActiveUniformBlockiv__III_3II
3992 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
3993 jint _exception = 0;
3994 const char * _exceptionType = NULL;
3995 const char * _exceptionMessage = NULL;
3996 GLint *params_base = (GLint *) 0;
3997 jint _remaining;
3998 GLint *params = (GLint *) 0;
3999
4000 if (!params_ref) {
4001 _exception = 1;
4002 _exceptionType = "java/lang/IllegalArgumentException";
4003 _exceptionMessage = "params == null";
4004 goto exit;
4005 }
4006 if (offset < 0) {
4007 _exception = 1;
4008 _exceptionType = "java/lang/IllegalArgumentException";
4009 _exceptionMessage = "offset < 0";
4010 goto exit;
4011 }
4012 _remaining = _env->GetArrayLength(params_ref) - offset;
4013 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004014 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004015 params = params_base + offset;
4016
4017 glGetActiveUniformBlockiv(
4018 (GLuint)program,
4019 (GLuint)uniformBlockIndex,
4020 (GLenum)pname,
4021 (GLint *)params
4022 );
4023
4024exit:
4025 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004026 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004027 _exception ? JNI_ABORT: 0);
4028 }
4029 if (_exception) {
4030 jniThrowException(_env, _exceptionType, _exceptionMessage);
4031 }
4032}
4033
4034/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
4035static void
4036android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
4037 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004038 jint _exception = 0;
4039 const char * _exceptionType = NULL;
4040 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004041 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004042 jint _bufferOffset = (jint) 0;
4043 jint _remaining;
4044 GLint *params = (GLint *) 0;
4045
Romain Guy84cac202016-12-05 12:26:02 -08004046 if (!params_buf) {
4047 _exception = 1;
4048 _exceptionType = "java/lang/IllegalArgumentException";
4049 _exceptionMessage = "params == null";
4050 goto exit;
4051 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004052 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004053 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004054 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004055 params = (GLint *) (_paramsBase + _bufferOffset);
4056 }
4057 glGetActiveUniformBlockiv(
4058 (GLuint)program,
4059 (GLuint)uniformBlockIndex,
4060 (GLenum)pname,
4061 (GLint *)params
4062 );
Romain Guy84cac202016-12-05 12:26:02 -08004063
4064exit:
Jesse Halld830e742013-03-29 11:02:35 -07004065 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004066 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4067 }
4068 if (_exception) {
4069 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004070 }
4071}
4072
4073/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4074static void
4075android_glGetActiveUniformBlockName_III_3II_3BI
4076 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
4077 jint _exception = 0;
4078 const char* _exceptionType;
4079 const char* _exceptionMessage;
4080 GLsizei* _length_base = (GLsizei*)0;
4081 jint _lengthRemaining;
4082 GLsizei* _length = (GLsizei*)0;
4083 GLchar* _name_base = (GLchar*)0;
4084 jint _nameRemaining;
4085 GLchar* _name = (GLchar*)0;
4086
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004087 if (length_ref) {
4088 if (lengthOffset < 0) {
4089 _exception = 1;
4090 _exceptionType = "java/lang/IllegalArgumentException";
4091 _exceptionMessage = "lengthOffset < 0";
4092 goto exit;
4093 }
4094 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4095 _length_base = (GLsizei*)_env->GetIntArrayElements(
4096 length_ref, (jboolean*)0);
4097 _length = _length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004098 }
Jesse Halld830e742013-03-29 11:02:35 -07004099
4100 if (!name_ref) {
4101 _exception = 1;
4102 _exceptionType = "java/lang/IllegalArgumentException";
4103 _exceptionMessage = "uniformBlockName == null";
4104 goto exit;
4105 }
4106 if (nameOffset < 0) {
4107 _exception = 1;
4108 _exceptionType = "java/lang/IllegalArgumentException";
4109 _exceptionMessage = "uniformBlockNameOffset < 0";
4110 goto exit;
4111 }
4112 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004113 _name_base = (GLchar*)_env->GetByteArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07004114 name_ref, (jboolean*)0);
4115 _name = _name_base + nameOffset;
4116
4117 glGetActiveUniformBlockName(
4118 (GLuint)program,
4119 (GLuint)uniformBlockIndex,
4120 (GLsizei)bufSize,
4121 (GLsizei*)_length,
4122 (GLchar*)_name
4123 );
4124
4125exit:
4126 if (_name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004127 _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
Jesse Halld830e742013-03-29 11:02:35 -07004128 _exception ? JNI_ABORT: 0);
4129 }
4130 if (_length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004131 _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004132 _exception ? JNI_ABORT: 0);
4133 }
4134 if (_exception) {
4135 jniThrowException(_env, _exceptionType, _exceptionMessage);
4136 }
4137}
4138
4139/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4140static void
4141android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
4142 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
4143 jint _exception = 0;
4144 const char* _exceptionType;
4145 const char* _exceptionMessage;
4146 jarray _lengthArray = (jarray)0;
4147 jint _lengthBufferOffset = (jint)0;
4148 GLsizei* _length = (GLsizei*)0;
4149 jint _lengthRemaining;
4150 jarray _nameArray = (jarray)0;
4151 jint _nameBufferOffset = (jint)0;
4152 GLchar* _name = (GLchar*)0;
4153 jint _nameRemaining;
4154
4155 _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4156 if (_length == NULL) {
4157 GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
4158 _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
4159 }
4160
4161 _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
4162 if (_name == NULL) {
4163 GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
4164 _name = (GLchar*)(_nameBase + _nameBufferOffset);
4165 }
4166
4167 glGetActiveUniformBlockName(
4168 (GLuint)program,
4169 (GLuint)uniformBlockIndex,
4170 (GLsizei)_nameRemaining,
4171 _length, _name
4172 );
4173 if (_nameArray) {
4174 releasePointer(_env, _nameArray, _name, JNI_TRUE);
4175 }
4176 if (_lengthArray) {
4177 releasePointer(_env, _lengthArray, _length, JNI_TRUE);
4178 }
4179}
4180
4181/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4182static jstring
4183android_glGetActiveUniformBlockName_II
4184 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
4185 GLint len = 0;
4186 glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
4187 GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
4188 GLchar* name = (GLchar*)malloc(len);
4189 glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
4190 len, NULL, name);
4191 jstring result = _env->NewStringUTF(name);
4192 free(name);
4193 return result;
4194}
Jesse Halld830e742013-03-29 11:02:35 -07004195/* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
4196static void
4197android_glUniformBlockBinding__III
4198 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
4199 glUniformBlockBinding(
4200 (GLuint)program,
4201 (GLuint)uniformBlockIndex,
4202 (GLuint)uniformBlockBinding
4203 );
4204}
4205
4206/* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
4207static void
4208android_glDrawArraysInstanced__IIII
4209 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
4210 glDrawArraysInstanced(
4211 (GLenum)mode,
4212 (GLint)first,
4213 (GLsizei)count,
4214 (GLsizei)instanceCount
4215 );
4216}
4217
4218/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4219static void
4220android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
4221 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
4222 jarray _array = (jarray) 0;
4223 jint _bufferOffset = (jint) 0;
4224 jint _remaining;
4225 GLvoid *indices = (GLvoid *) 0;
4226
4227 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
4228 if (indices == NULL) {
4229 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4230 indices = (GLvoid *) (_indicesBase + _bufferOffset);
4231 }
4232 glDrawElementsInstanced(
4233 (GLenum)mode,
4234 (GLsizei)count,
4235 (GLenum)type,
4236 (GLvoid *)indices,
4237 (GLsizei)instanceCount
4238 );
4239 if (_array) {
4240 releasePointer(_env, _array, indices, JNI_FALSE);
4241 }
4242}
4243
4244/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4245static void
4246android_glDrawElementsInstanced__IIIII
4247 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
4248 glDrawElementsInstanced(
4249 (GLenum)mode,
4250 (GLsizei)count,
4251 (GLenum)type,
Dan Albert10caf032015-02-23 10:41:10 -08004252 (GLvoid *)static_cast<uintptr_t>(indicesOffset),
Jesse Halld830e742013-03-29 11:02:35 -07004253 (GLsizei)instanceCount
4254 );
4255}
Jesse Halld830e742013-03-29 11:02:35 -07004256/* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
4257static jlong
4258android_glFenceSync__II
4259 (JNIEnv *_env, jobject _this, jint condition, jint flags) {
4260 GLsync _returnValue;
4261 _returnValue = glFenceSync(
4262 (GLenum)condition,
4263 (GLbitfield)flags
4264 );
4265 return (jlong)_returnValue;
4266}
4267
4268/* GLboolean glIsSync ( GLsync sync ) */
4269static jboolean
4270android_glIsSync__J
4271 (JNIEnv *_env, jobject _this, jlong sync) {
4272 GLboolean _returnValue;
4273 _returnValue = glIsSync(
4274 (GLsync)sync
4275 );
4276 return (jboolean)_returnValue;
4277}
4278
4279/* void glDeleteSync ( GLsync sync ) */
4280static void
4281android_glDeleteSync__J
4282 (JNIEnv *_env, jobject _this, jlong sync) {
4283 glDeleteSync(
4284 (GLsync)sync
4285 );
4286}
4287
4288/* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4289static jint
4290android_glClientWaitSync__JIJ
4291 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4292 GLenum _returnValue;
4293 _returnValue = glClientWaitSync(
4294 (GLsync)sync,
4295 (GLbitfield)flags,
4296 (GLuint64)timeout
4297 );
4298 return (jint)_returnValue;
4299}
4300
4301/* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4302static void
4303android_glWaitSync__JIJ
4304 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4305 glWaitSync(
4306 (GLsync)sync,
4307 (GLbitfield)flags,
4308 (GLuint64)timeout
4309 );
4310}
4311
4312/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4313static void
4314android_glGetInteger64v__I_3JI
4315 (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
4316 jint _exception = 0;
4317 const char * _exceptionType = NULL;
4318 const char * _exceptionMessage = NULL;
4319 GLint64 *params_base = (GLint64 *) 0;
4320 jint _remaining;
4321 GLint64 *params = (GLint64 *) 0;
4322
4323 if (!params_ref) {
4324 _exception = 1;
4325 _exceptionType = "java/lang/IllegalArgumentException";
4326 _exceptionMessage = "params == null";
4327 goto exit;
4328 }
4329 if (offset < 0) {
4330 _exception = 1;
4331 _exceptionType = "java/lang/IllegalArgumentException";
4332 _exceptionMessage = "offset < 0";
4333 goto exit;
4334 }
4335 _remaining = _env->GetArrayLength(params_ref) - offset;
4336 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004337 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004338 params = params_base + offset;
4339
4340 glGetInteger64v(
4341 (GLenum)pname,
4342 (GLint64 *)params
4343 );
4344
4345exit:
4346 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004347 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004348 _exception ? JNI_ABORT: 0);
4349 }
4350 if (_exception) {
4351 jniThrowException(_env, _exceptionType, _exceptionMessage);
4352 }
4353}
4354
4355/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4356static void
4357android_glGetInteger64v__ILjava_nio_LongBuffer_2
4358 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004359 jint _exception = 0;
4360 const char * _exceptionType = NULL;
4361 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004362 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004363 jint _bufferOffset = (jint) 0;
4364 jint _remaining;
4365 GLint64 *params = (GLint64 *) 0;
4366
Romain Guy84cac202016-12-05 12:26:02 -08004367 if (!params_buf) {
4368 _exception = 1;
4369 _exceptionType = "java/lang/IllegalArgumentException";
4370 _exceptionMessage = "params == null";
4371 goto exit;
4372 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004373 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004374 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004375 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004376 params = (GLint64 *) (_paramsBase + _bufferOffset);
4377 }
4378 glGetInteger64v(
4379 (GLenum)pname,
4380 (GLint64 *)params
4381 );
Romain Guy84cac202016-12-05 12:26:02 -08004382
4383exit:
Jesse Halld830e742013-03-29 11:02:35 -07004384 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004385 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4386 }
4387 if (_exception) {
4388 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004389 }
4390}
4391
4392/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4393static void
4394android_glGetSynciv__JII_3II_3II
4395 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
4396 jint _exception = 0;
4397 const char * _exceptionType = NULL;
4398 const char * _exceptionMessage = NULL;
4399 GLsizei *length_base = (GLsizei *) 0;
4400 jint _lengthRemaining;
4401 GLsizei *length = (GLsizei *) 0;
4402 GLint *values_base = (GLint *) 0;
4403 jint _valuesRemaining;
4404 GLint *values = (GLint *) 0;
4405
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004406 if (length_ref) {
4407 if (lengthOffset < 0) {
4408 _exception = 1;
4409 _exceptionType = "java/lang/IllegalArgumentException";
4410 _exceptionMessage = "lengthOffset < 0";
4411 goto exit;
4412 }
4413 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4414 length_base = (GLsizei *)
4415 _env->GetIntArrayElements(length_ref, (jboolean *)0);
4416 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004417 }
Jesse Halld830e742013-03-29 11:02:35 -07004418
4419 if (!values_ref) {
4420 _exception = 1;
4421 _exceptionType = "java/lang/IllegalArgumentException";
4422 _exceptionMessage = "values == null";
4423 goto exit;
4424 }
4425 if (valuesOffset < 0) {
4426 _exception = 1;
4427 _exceptionType = "java/lang/IllegalArgumentException";
4428 _exceptionMessage = "valuesOffset < 0";
4429 goto exit;
4430 }
4431 _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
4432 values_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004433 _env->GetIntArrayElements(values_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004434 values = values_base + valuesOffset;
4435
4436 glGetSynciv(
4437 (GLsync)sync,
4438 (GLenum)pname,
4439 (GLsizei)bufSize,
4440 (GLsizei *)length,
4441 (GLint *)values
4442 );
4443
4444exit:
4445 if (values_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004446 _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
Jesse Halld830e742013-03-29 11:02:35 -07004447 _exception ? JNI_ABORT: 0);
4448 }
4449 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004450 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004451 _exception ? JNI_ABORT: 0);
4452 }
4453 if (_exception) {
4454 jniThrowException(_env, _exceptionType, _exceptionMessage);
4455 }
4456}
4457
4458/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4459static void
4460android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4461 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004462 jint _exception = 0;
4463 const char * _exceptionType = NULL;
4464 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004465 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004466 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004467 jintArray _valuesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004468 jint _valuesBufferOffset = (jint) 0;
4469 jint _lengthRemaining;
4470 GLsizei *length = (GLsizei *) 0;
4471 jint _valuesRemaining;
4472 GLint *values = (GLint *) 0;
4473
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004474 if (length_buf) {
4475 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4476 }
Romain Guy84cac202016-12-05 12:26:02 -08004477 if (!values_buf) {
4478 _exception = 1;
4479 _exceptionType = "java/lang/IllegalArgumentException";
4480 _exceptionMessage = "values == null";
4481 goto exit;
4482 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004483 values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004484 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004485 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004486 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
4487 }
4488 if (values == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004489 char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004490 values = (GLint *) (_valuesBase + _valuesBufferOffset);
4491 }
4492 glGetSynciv(
4493 (GLsync)sync,
4494 (GLenum)pname,
4495 (GLsizei)bufSize,
4496 (GLsizei *)length,
4497 (GLint *)values
4498 );
Romain Guy84cac202016-12-05 12:26:02 -08004499
4500exit:
Jesse Halld830e742013-03-29 11:02:35 -07004501 if (_valuesArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004502 _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07004503 }
4504 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004505 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
4506 }
4507 if (_exception) {
4508 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004509 }
4510}
4511
4512/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4513static void
4514android_glGetInteger64i_v__II_3JI
4515 (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
4516 jint _exception = 0;
4517 const char * _exceptionType = NULL;
4518 const char * _exceptionMessage = NULL;
4519 GLint64 *data_base = (GLint64 *) 0;
4520 jint _remaining;
4521 GLint64 *data = (GLint64 *) 0;
4522
4523 if (!data_ref) {
4524 _exception = 1;
4525 _exceptionType = "java/lang/IllegalArgumentException";
4526 _exceptionMessage = "data == null";
4527 goto exit;
4528 }
4529 if (offset < 0) {
4530 _exception = 1;
4531 _exceptionType = "java/lang/IllegalArgumentException";
4532 _exceptionMessage = "offset < 0";
4533 goto exit;
4534 }
4535 _remaining = _env->GetArrayLength(data_ref) - offset;
4536 data_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004537 _env->GetLongArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004538 data = data_base + offset;
4539
4540 glGetInteger64i_v(
4541 (GLenum)target,
4542 (GLuint)index,
4543 (GLint64 *)data
4544 );
4545
4546exit:
4547 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004548 _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07004549 _exception ? JNI_ABORT: 0);
4550 }
4551 if (_exception) {
4552 jniThrowException(_env, _exceptionType, _exceptionMessage);
4553 }
4554}
4555
4556/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4557static void
4558android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
4559 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004560 jint _exception = 0;
4561 const char * _exceptionType = NULL;
4562 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004563 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004564 jint _bufferOffset = (jint) 0;
4565 jint _remaining;
4566 GLint64 *data = (GLint64 *) 0;
4567
Romain Guy84cac202016-12-05 12:26:02 -08004568 if (!data_buf) {
4569 _exception = 1;
4570 _exceptionType = "java/lang/IllegalArgumentException";
4571 _exceptionMessage = "data == null";
4572 goto exit;
4573 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004574 data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004575 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004576 char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004577 data = (GLint64 *) (_dataBase + _bufferOffset);
4578 }
4579 glGetInteger64i_v(
4580 (GLenum)target,
4581 (GLuint)index,
4582 (GLint64 *)data
4583 );
Romain Guy84cac202016-12-05 12:26:02 -08004584
4585exit:
Jesse Halld830e742013-03-29 11:02:35 -07004586 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004587 _env->ReleaseLongArrayElements(_array, (jlong*)data, _exception ? JNI_ABORT : 0);
4588 }
4589 if (_exception) {
4590 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004591 }
4592}
4593
4594/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4595static void
4596android_glGetBufferParameteri64v__II_3JI
4597 (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
4598 jint _exception = 0;
4599 const char * _exceptionType = NULL;
4600 const char * _exceptionMessage = NULL;
4601 GLint64 *params_base = (GLint64 *) 0;
4602 jint _remaining;
4603 GLint64 *params = (GLint64 *) 0;
4604
4605 if (!params_ref) {
4606 _exception = 1;
4607 _exceptionType = "java/lang/IllegalArgumentException";
4608 _exceptionMessage = "params == null";
4609 goto exit;
4610 }
4611 if (offset < 0) {
4612 _exception = 1;
4613 _exceptionType = "java/lang/IllegalArgumentException";
4614 _exceptionMessage = "offset < 0";
4615 goto exit;
4616 }
4617 _remaining = _env->GetArrayLength(params_ref) - offset;
4618 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004619 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004620 params = params_base + offset;
4621
4622 glGetBufferParameteri64v(
4623 (GLenum)target,
4624 (GLenum)pname,
4625 (GLint64 *)params
4626 );
4627
4628exit:
4629 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004630 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004631 _exception ? JNI_ABORT: 0);
4632 }
4633 if (_exception) {
4634 jniThrowException(_env, _exceptionType, _exceptionMessage);
4635 }
4636}
4637
4638/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4639static void
4640android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
4641 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004642 jint _exception = 0;
4643 const char * _exceptionType = NULL;
4644 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004645 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004646 jint _bufferOffset = (jint) 0;
4647 jint _remaining;
4648 GLint64 *params = (GLint64 *) 0;
4649
Romain Guy84cac202016-12-05 12:26:02 -08004650 if (!params_buf) {
4651 _exception = 1;
4652 _exceptionType = "java/lang/IllegalArgumentException";
4653 _exceptionMessage = "params == null";
4654 goto exit;
4655 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004656 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004657 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004658 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004659 params = (GLint64 *) (_paramsBase + _bufferOffset);
4660 }
4661 glGetBufferParameteri64v(
4662 (GLenum)target,
4663 (GLenum)pname,
4664 (GLint64 *)params
4665 );
Romain Guy84cac202016-12-05 12:26:02 -08004666
4667exit:
Jesse Halld830e742013-03-29 11:02:35 -07004668 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004669 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4670 }
4671 if (_exception) {
4672 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004673 }
4674}
4675
4676/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4677static void
4678android_glGenSamplers__I_3II
4679 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4680 jint _exception = 0;
4681 const char * _exceptionType = NULL;
4682 const char * _exceptionMessage = NULL;
4683 GLuint *samplers_base = (GLuint *) 0;
4684 jint _remaining;
4685 GLuint *samplers = (GLuint *) 0;
4686
4687 if (!samplers_ref) {
4688 _exception = 1;
4689 _exceptionType = "java/lang/IllegalArgumentException";
4690 _exceptionMessage = "samplers == null";
4691 goto exit;
4692 }
4693 if (offset < 0) {
4694 _exception = 1;
4695 _exceptionType = "java/lang/IllegalArgumentException";
4696 _exceptionMessage = "offset < 0";
4697 goto exit;
4698 }
4699 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4700 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004701 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004702 samplers = samplers_base + offset;
4703
4704 glGenSamplers(
4705 (GLsizei)count,
4706 (GLuint *)samplers
4707 );
4708
4709exit:
4710 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004711 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004712 _exception ? JNI_ABORT: 0);
4713 }
4714 if (_exception) {
4715 jniThrowException(_env, _exceptionType, _exceptionMessage);
4716 }
4717}
4718
4719/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4720static void
4721android_glGenSamplers__ILjava_nio_IntBuffer_2
4722 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004723 jint _exception = 0;
4724 const char * _exceptionType = NULL;
4725 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004726 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004727 jint _bufferOffset = (jint) 0;
4728 jint _remaining;
4729 GLuint *samplers = (GLuint *) 0;
4730
Romain Guy84cac202016-12-05 12:26:02 -08004731 if (!samplers_buf) {
4732 _exception = 1;
4733 _exceptionType = "java/lang/IllegalArgumentException";
4734 _exceptionMessage = "samplers == null";
4735 goto exit;
4736 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004737 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004738 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004739 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004740 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4741 }
4742 glGenSamplers(
4743 (GLsizei)count,
4744 (GLuint *)samplers
4745 );
Romain Guy84cac202016-12-05 12:26:02 -08004746
4747exit:
Jesse Halld830e742013-03-29 11:02:35 -07004748 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004749 _env->ReleaseIntArrayElements(_array, (jint*)samplers, _exception ? JNI_ABORT : 0);
4750 }
4751 if (_exception) {
4752 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004753 }
4754}
4755
4756/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4757static void
4758android_glDeleteSamplers__I_3II
4759 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4760 jint _exception = 0;
4761 const char * _exceptionType = NULL;
4762 const char * _exceptionMessage = NULL;
4763 GLuint *samplers_base = (GLuint *) 0;
4764 jint _remaining;
4765 GLuint *samplers = (GLuint *) 0;
4766
4767 if (!samplers_ref) {
4768 _exception = 1;
4769 _exceptionType = "java/lang/IllegalArgumentException";
4770 _exceptionMessage = "samplers == null";
4771 goto exit;
4772 }
4773 if (offset < 0) {
4774 _exception = 1;
4775 _exceptionType = "java/lang/IllegalArgumentException";
4776 _exceptionMessage = "offset < 0";
4777 goto exit;
4778 }
4779 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4780 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004781 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004782 samplers = samplers_base + offset;
4783
4784 glDeleteSamplers(
4785 (GLsizei)count,
4786 (GLuint *)samplers
4787 );
4788
4789exit:
4790 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004791 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004792 JNI_ABORT);
4793 }
4794 if (_exception) {
4795 jniThrowException(_env, _exceptionType, _exceptionMessage);
4796 }
4797}
4798
4799/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4800static void
4801android_glDeleteSamplers__ILjava_nio_IntBuffer_2
4802 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004803 jint _exception = 0;
4804 const char * _exceptionType = NULL;
4805 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004806 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004807 jint _bufferOffset = (jint) 0;
4808 jint _remaining;
4809 GLuint *samplers = (GLuint *) 0;
4810
Romain Guy84cac202016-12-05 12:26:02 -08004811 if (!samplers_buf) {
4812 _exception = 1;
4813 _exceptionType = "java/lang/IllegalArgumentException";
4814 _exceptionMessage = "samplers == null";
4815 goto exit;
4816 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004817 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004818 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004819 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004820 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4821 }
4822 glDeleteSamplers(
4823 (GLsizei)count,
4824 (GLuint *)samplers
4825 );
Romain Guy84cac202016-12-05 12:26:02 -08004826
4827exit:
Jesse Halld830e742013-03-29 11:02:35 -07004828 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004829 _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004830 }
Romain Guy84cac202016-12-05 12:26:02 -08004831 if (_exception) {
4832 jniThrowException(_env, _exceptionType, _exceptionMessage);
4833 }
Jesse Halld830e742013-03-29 11:02:35 -07004834}
4835
4836/* GLboolean glIsSampler ( GLuint sampler ) */
4837static jboolean
4838android_glIsSampler__I
4839 (JNIEnv *_env, jobject _this, jint sampler) {
4840 GLboolean _returnValue;
4841 _returnValue = glIsSampler(
4842 (GLuint)sampler
4843 );
4844 return (jboolean)_returnValue;
4845}
4846
4847/* void glBindSampler ( GLuint unit, GLuint sampler ) */
4848static void
4849android_glBindSampler__II
4850 (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
4851 glBindSampler(
4852 (GLuint)unit,
4853 (GLuint)sampler
4854 );
4855}
4856
4857/* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
4858static void
4859android_glSamplerParameteri__III
4860 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
4861 glSamplerParameteri(
4862 (GLuint)sampler,
4863 (GLenum)pname,
4864 (GLint)param
4865 );
4866}
4867
4868/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4869static void
4870android_glSamplerParameteriv__II_3II
4871 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
4872 jint _exception = 0;
4873 const char * _exceptionType = NULL;
4874 const char * _exceptionMessage = NULL;
4875 GLint *param_base = (GLint *) 0;
4876 jint _remaining;
4877 GLint *param = (GLint *) 0;
4878
4879 if (!param_ref) {
4880 _exception = 1;
4881 _exceptionType = "java/lang/IllegalArgumentException";
4882 _exceptionMessage = "param == null";
4883 goto exit;
4884 }
4885 if (offset < 0) {
4886 _exception = 1;
4887 _exceptionType = "java/lang/IllegalArgumentException";
4888 _exceptionMessage = "offset < 0";
4889 goto exit;
4890 }
4891 _remaining = _env->GetArrayLength(param_ref) - offset;
4892 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004893 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004894 param = param_base + offset;
4895
4896 glSamplerParameteriv(
4897 (GLuint)sampler,
4898 (GLenum)pname,
4899 (GLint *)param
4900 );
4901
4902exit:
4903 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004904 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004905 JNI_ABORT);
4906 }
4907 if (_exception) {
4908 jniThrowException(_env, _exceptionType, _exceptionMessage);
4909 }
4910}
4911
4912/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4913static void
4914android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
4915 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004916 jint _exception = 0;
4917 const char * _exceptionType = NULL;
4918 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004919 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004920 jint _bufferOffset = (jint) 0;
4921 jint _remaining;
4922 GLint *param = (GLint *) 0;
4923
Romain Guy84cac202016-12-05 12:26:02 -08004924 if (!param_buf) {
4925 _exception = 1;
4926 _exceptionType = "java/lang/IllegalArgumentException";
4927 _exceptionMessage = "param == null";
4928 goto exit;
4929 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004930 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004931 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004932 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004933 param = (GLint *) (_paramBase + _bufferOffset);
4934 }
4935 glSamplerParameteriv(
4936 (GLuint)sampler,
4937 (GLenum)pname,
4938 (GLint *)param
4939 );
Romain Guy84cac202016-12-05 12:26:02 -08004940
4941exit:
Jesse Halld830e742013-03-29 11:02:35 -07004942 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004943 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004944 }
Romain Guy84cac202016-12-05 12:26:02 -08004945 if (_exception) {
4946 jniThrowException(_env, _exceptionType, _exceptionMessage);
4947 }
Jesse Halld830e742013-03-29 11:02:35 -07004948}
4949
4950/* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
4951static void
4952android_glSamplerParameterf__IIF
4953 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
4954 glSamplerParameterf(
4955 (GLuint)sampler,
4956 (GLenum)pname,
4957 (GLfloat)param
4958 );
4959}
4960
4961/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4962static void
4963android_glSamplerParameterfv__II_3FI
4964 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
4965 jint _exception = 0;
4966 const char * _exceptionType = NULL;
4967 const char * _exceptionMessage = NULL;
4968 GLfloat *param_base = (GLfloat *) 0;
4969 jint _remaining;
4970 GLfloat *param = (GLfloat *) 0;
4971
4972 if (!param_ref) {
4973 _exception = 1;
4974 _exceptionType = "java/lang/IllegalArgumentException";
4975 _exceptionMessage = "param == null";
4976 goto exit;
4977 }
4978 if (offset < 0) {
4979 _exception = 1;
4980 _exceptionType = "java/lang/IllegalArgumentException";
4981 _exceptionMessage = "offset < 0";
4982 goto exit;
4983 }
4984 _remaining = _env->GetArrayLength(param_ref) - offset;
4985 param_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004986 _env->GetFloatArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004987 param = param_base + offset;
4988
4989 glSamplerParameterfv(
4990 (GLuint)sampler,
4991 (GLenum)pname,
4992 (GLfloat *)param
4993 );
4994
4995exit:
4996 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004997 _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004998 JNI_ABORT);
4999 }
5000 if (_exception) {
5001 jniThrowException(_env, _exceptionType, _exceptionMessage);
5002 }
5003}
5004
5005/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
5006static void
5007android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
5008 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005009 jint _exception = 0;
5010 const char * _exceptionType = NULL;
5011 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005012 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005013 jint _bufferOffset = (jint) 0;
5014 jint _remaining;
5015 GLfloat *param = (GLfloat *) 0;
5016
Romain Guy84cac202016-12-05 12:26:02 -08005017 if (!param_buf) {
5018 _exception = 1;
5019 _exceptionType = "java/lang/IllegalArgumentException";
5020 _exceptionMessage = "param == null";
5021 goto exit;
5022 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005023 param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005024 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005025 char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005026 param = (GLfloat *) (_paramBase + _bufferOffset);
5027 }
5028 glSamplerParameterfv(
5029 (GLuint)sampler,
5030 (GLenum)pname,
5031 (GLfloat *)param
5032 );
Romain Guy84cac202016-12-05 12:26:02 -08005033
5034exit:
Jesse Halld830e742013-03-29 11:02:35 -07005035 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005036 _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005037 }
Romain Guy84cac202016-12-05 12:26:02 -08005038 if (_exception) {
5039 jniThrowException(_env, _exceptionType, _exceptionMessage);
5040 }
Jesse Halld830e742013-03-29 11:02:35 -07005041}
5042
5043/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5044static void
5045android_glGetSamplerParameteriv__II_3II
5046 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
5047 jint _exception = 0;
5048 const char * _exceptionType = NULL;
5049 const char * _exceptionMessage = NULL;
5050 GLint *params_base = (GLint *) 0;
5051 jint _remaining;
5052 GLint *params = (GLint *) 0;
5053
5054 if (!params_ref) {
5055 _exception = 1;
5056 _exceptionType = "java/lang/IllegalArgumentException";
5057 _exceptionMessage = "params == null";
5058 goto exit;
5059 }
5060 if (offset < 0) {
5061 _exception = 1;
5062 _exceptionType = "java/lang/IllegalArgumentException";
5063 _exceptionMessage = "offset < 0";
5064 goto exit;
5065 }
5066 _remaining = _env->GetArrayLength(params_ref) - offset;
5067 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005068 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005069 params = params_base + offset;
5070
5071 glGetSamplerParameteriv(
5072 (GLuint)sampler,
5073 (GLenum)pname,
5074 (GLint *)params
5075 );
5076
5077exit:
5078 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005079 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005080 _exception ? JNI_ABORT: 0);
5081 }
5082 if (_exception) {
5083 jniThrowException(_env, _exceptionType, _exceptionMessage);
5084 }
5085}
5086
5087/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5088static void
5089android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
5090 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005091 jint _exception = 0;
5092 const char * _exceptionType = NULL;
5093 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005094 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005095 jint _bufferOffset = (jint) 0;
5096 jint _remaining;
5097 GLint *params = (GLint *) 0;
5098
Romain Guy84cac202016-12-05 12:26:02 -08005099 if (!params_buf) {
5100 _exception = 1;
5101 _exceptionType = "java/lang/IllegalArgumentException";
5102 _exceptionMessage = "params == null";
5103 goto exit;
5104 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005105 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005106 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005107 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005108 params = (GLint *) (_paramsBase + _bufferOffset);
5109 }
5110 glGetSamplerParameteriv(
5111 (GLuint)sampler,
5112 (GLenum)pname,
5113 (GLint *)params
5114 );
Romain Guy84cac202016-12-05 12:26:02 -08005115
5116exit:
Jesse Halld830e742013-03-29 11:02:35 -07005117 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005118 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5119 }
5120 if (_exception) {
5121 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005122 }
5123}
5124
5125/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5126static void
5127android_glGetSamplerParameterfv__II_3FI
5128 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
5129 jint _exception = 0;
5130 const char * _exceptionType = NULL;
5131 const char * _exceptionMessage = NULL;
5132 GLfloat *params_base = (GLfloat *) 0;
5133 jint _remaining;
5134 GLfloat *params = (GLfloat *) 0;
5135
5136 if (!params_ref) {
5137 _exception = 1;
5138 _exceptionType = "java/lang/IllegalArgumentException";
5139 _exceptionMessage = "params == null";
5140 goto exit;
5141 }
5142 if (offset < 0) {
5143 _exception = 1;
5144 _exceptionType = "java/lang/IllegalArgumentException";
5145 _exceptionMessage = "offset < 0";
5146 goto exit;
5147 }
5148 _remaining = _env->GetArrayLength(params_ref) - offset;
5149 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005150 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005151 params = params_base + offset;
5152
5153 glGetSamplerParameterfv(
5154 (GLuint)sampler,
5155 (GLenum)pname,
5156 (GLfloat *)params
5157 );
5158
5159exit:
5160 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005161 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005162 _exception ? JNI_ABORT: 0);
5163 }
5164 if (_exception) {
5165 jniThrowException(_env, _exceptionType, _exceptionMessage);
5166 }
5167}
5168
5169/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5170static void
5171android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
5172 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005173 jint _exception = 0;
5174 const char * _exceptionType = NULL;
5175 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005176 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005177 jint _bufferOffset = (jint) 0;
5178 jint _remaining;
5179 GLfloat *params = (GLfloat *) 0;
5180
Romain Guy84cac202016-12-05 12:26:02 -08005181 if (!params_buf) {
5182 _exception = 1;
5183 _exceptionType = "java/lang/IllegalArgumentException";
5184 _exceptionMessage = "params == null";
5185 goto exit;
5186 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005187 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005188 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005189 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005190 params = (GLfloat *) (_paramsBase + _bufferOffset);
5191 }
5192 glGetSamplerParameterfv(
5193 (GLuint)sampler,
5194 (GLenum)pname,
5195 (GLfloat *)params
5196 );
Romain Guy84cac202016-12-05 12:26:02 -08005197
5198exit:
Jesse Halld830e742013-03-29 11:02:35 -07005199 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005200 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5201 }
5202 if (_exception) {
5203 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005204 }
5205}
5206
5207/* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
5208static void
5209android_glVertexAttribDivisor__II
5210 (JNIEnv *_env, jobject _this, jint index, jint divisor) {
5211 glVertexAttribDivisor(
5212 (GLuint)index,
5213 (GLuint)divisor
5214 );
5215}
5216
5217/* void glBindTransformFeedback ( GLenum target, GLuint id ) */
5218static void
5219android_glBindTransformFeedback__II
5220 (JNIEnv *_env, jobject _this, jint target, jint id) {
5221 glBindTransformFeedback(
5222 (GLenum)target,
5223 (GLuint)id
5224 );
5225}
5226
5227/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5228static void
5229android_glDeleteTransformFeedbacks__I_3II
5230 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5231 jint _exception = 0;
5232 const char * _exceptionType = NULL;
5233 const char * _exceptionMessage = NULL;
5234 GLuint *ids_base = (GLuint *) 0;
5235 jint _remaining;
5236 GLuint *ids = (GLuint *) 0;
5237
5238 if (!ids_ref) {
5239 _exception = 1;
5240 _exceptionType = "java/lang/IllegalArgumentException";
5241 _exceptionMessage = "ids == null";
5242 goto exit;
5243 }
5244 if (offset < 0) {
5245 _exception = 1;
5246 _exceptionType = "java/lang/IllegalArgumentException";
5247 _exceptionMessage = "offset < 0";
5248 goto exit;
5249 }
5250 _remaining = _env->GetArrayLength(ids_ref) - offset;
5251 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005252 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005253 ids = ids_base + offset;
5254
5255 glDeleteTransformFeedbacks(
5256 (GLsizei)n,
5257 (GLuint *)ids
5258 );
5259
5260exit:
5261 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005262 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005263 JNI_ABORT);
5264 }
5265 if (_exception) {
5266 jniThrowException(_env, _exceptionType, _exceptionMessage);
5267 }
5268}
5269
5270/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5271static void
5272android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
5273 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005274 jint _exception = 0;
5275 const char * _exceptionType = NULL;
5276 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005277 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005278 jint _bufferOffset = (jint) 0;
5279 jint _remaining;
5280 GLuint *ids = (GLuint *) 0;
5281
Romain Guy84cac202016-12-05 12:26:02 -08005282 if (!ids_buf) {
5283 _exception = 1;
5284 _exceptionType = "java/lang/IllegalArgumentException";
5285 _exceptionMessage = "ids == null";
5286 goto exit;
5287 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005288 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005289 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005290 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005291 ids = (GLuint *) (_idsBase + _bufferOffset);
5292 }
5293 glDeleteTransformFeedbacks(
5294 (GLsizei)n,
5295 (GLuint *)ids
5296 );
Romain Guy84cac202016-12-05 12:26:02 -08005297
5298exit:
Jesse Halld830e742013-03-29 11:02:35 -07005299 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005300 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005301 }
Romain Guy84cac202016-12-05 12:26:02 -08005302 if (_exception) {
5303 jniThrowException(_env, _exceptionType, _exceptionMessage);
5304 }
Jesse Halld830e742013-03-29 11:02:35 -07005305}
5306
5307/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5308static void
5309android_glGenTransformFeedbacks__I_3II
5310 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5311 jint _exception = 0;
5312 const char * _exceptionType = NULL;
5313 const char * _exceptionMessage = NULL;
5314 GLuint *ids_base = (GLuint *) 0;
5315 jint _remaining;
5316 GLuint *ids = (GLuint *) 0;
5317
5318 if (!ids_ref) {
5319 _exception = 1;
5320 _exceptionType = "java/lang/IllegalArgumentException";
5321 _exceptionMessage = "ids == null";
5322 goto exit;
5323 }
5324 if (offset < 0) {
5325 _exception = 1;
5326 _exceptionType = "java/lang/IllegalArgumentException";
5327 _exceptionMessage = "offset < 0";
5328 goto exit;
5329 }
5330 _remaining = _env->GetArrayLength(ids_ref) - offset;
5331 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005332 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005333 ids = ids_base + offset;
5334
5335 glGenTransformFeedbacks(
5336 (GLsizei)n,
5337 (GLuint *)ids
5338 );
5339
5340exit:
5341 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005342 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005343 _exception ? JNI_ABORT: 0);
5344 }
5345 if (_exception) {
5346 jniThrowException(_env, _exceptionType, _exceptionMessage);
5347 }
5348}
5349
5350/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5351static void
5352android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
5353 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005354 jint _exception = 0;
5355 const char * _exceptionType = NULL;
5356 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005357 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005358 jint _bufferOffset = (jint) 0;
5359 jint _remaining;
5360 GLuint *ids = (GLuint *) 0;
5361
Romain Guy84cac202016-12-05 12:26:02 -08005362 if (!ids_buf) {
5363 _exception = 1;
5364 _exceptionType = "java/lang/IllegalArgumentException";
5365 _exceptionMessage = "ids == null";
5366 goto exit;
5367 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005368 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005369 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005370 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005371 ids = (GLuint *) (_idsBase + _bufferOffset);
5372 }
5373 glGenTransformFeedbacks(
5374 (GLsizei)n,
5375 (GLuint *)ids
5376 );
Romain Guy84cac202016-12-05 12:26:02 -08005377
5378exit:
Jesse Halld830e742013-03-29 11:02:35 -07005379 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005380 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
5381 }
5382 if (_exception) {
5383 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005384 }
5385}
5386
5387/* GLboolean glIsTransformFeedback ( GLuint id ) */
5388static jboolean
5389android_glIsTransformFeedback__I
5390 (JNIEnv *_env, jobject _this, jint id) {
5391 GLboolean _returnValue;
5392 _returnValue = glIsTransformFeedback(
5393 (GLuint)id
5394 );
5395 return (jboolean)_returnValue;
5396}
5397
5398/* void glPauseTransformFeedback ( void ) */
5399static void
5400android_glPauseTransformFeedback__
5401 (JNIEnv *_env, jobject _this) {
5402 glPauseTransformFeedback();
5403}
5404
5405/* void glResumeTransformFeedback ( void ) */
5406static void
5407android_glResumeTransformFeedback__
5408 (JNIEnv *_env, jobject _this) {
5409 glResumeTransformFeedback();
5410}
5411
5412/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5413static void
5414android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
5415 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
5416 jint _exception = 0;
5417 const char * _exceptionType = NULL;
5418 const char * _exceptionMessage = NULL;
5419 jarray _array = (jarray) 0;
5420 jint _bufferOffset = (jint) 0;
5421 GLsizei *length_base = (GLsizei *) 0;
5422 jint _lengthRemaining;
5423 GLsizei *length = (GLsizei *) 0;
5424 GLenum *binaryFormat_base = (GLenum *) 0;
5425 jint _binaryFormatRemaining;
5426 GLenum *binaryFormat = (GLenum *) 0;
5427 jint _binaryRemaining;
5428 GLvoid *binary = (GLvoid *) 0;
5429
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005430 if (length_ref) {
5431 if (lengthOffset < 0) {
5432 _exception = 1;
5433 _exceptionType = "java/lang/IllegalArgumentException";
5434 _exceptionMessage = "lengthOffset < 0";
5435 goto exit;
5436 }
5437 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
5438 length_base = (GLsizei *)
5439 _env->GetIntArrayElements(length_ref, (jboolean *)0);
5440 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07005441 }
Jesse Halld830e742013-03-29 11:02:35 -07005442
5443 if (!binaryFormat_ref) {
5444 _exception = 1;
5445 _exceptionType = "java/lang/IllegalArgumentException";
5446 _exceptionMessage = "binaryFormat == null";
5447 goto exit;
5448 }
5449 if (binaryFormatOffset < 0) {
5450 _exception = 1;
5451 _exceptionType = "java/lang/IllegalArgumentException";
5452 _exceptionMessage = "binaryFormatOffset < 0";
5453 goto exit;
5454 }
5455 _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
5456 binaryFormat_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005457 _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005458 binaryFormat = binaryFormat_base + binaryFormatOffset;
5459
Romain Guy84cac202016-12-05 12:26:02 -08005460 if (!binary_buf) {
5461 _exception = 1;
5462 _exceptionType = "java/lang/IllegalArgumentException";
5463 _exceptionMessage = "binary == null";
5464 goto exit;
5465 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005466 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005467 if (binary == NULL) {
5468 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5469 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5470 }
5471 glGetProgramBinary(
5472 (GLuint)program,
5473 (GLsizei)bufSize,
5474 (GLsizei *)length,
5475 (GLenum *)binaryFormat,
5476 (GLvoid *)binary
5477 );
5478
5479exit:
5480 if (_array) {
5481 releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
5482 }
5483 if (binaryFormat_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005484 _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
Jesse Halld830e742013-03-29 11:02:35 -07005485 _exception ? JNI_ABORT: 0);
5486 }
5487 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005488 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07005489 _exception ? JNI_ABORT: 0);
5490 }
5491 if (_exception) {
5492 jniThrowException(_env, _exceptionType, _exceptionMessage);
5493 }
5494}
5495
5496/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5497static void
5498android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
5499 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005500 jint _exception = 0;
5501 const char * _exceptionType = NULL;
5502 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005503 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005504 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005505 jintArray _binaryFormatArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005506 jint _binaryFormatBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005507 jintArray _binaryArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005508 jint _binaryBufferOffset = (jint) 0;
5509 jint _lengthRemaining;
5510 GLsizei *length = (GLsizei *) 0;
5511 jint _binaryFormatRemaining;
5512 GLenum *binaryFormat = (GLenum *) 0;
5513 jint _binaryRemaining;
5514 GLvoid *binary = (GLvoid *) 0;
5515
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005516 if (length_buf) {
5517 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
5518 }
Romain Guy84cac202016-12-05 12:26:02 -08005519 if (!binaryFormat_buf) {
5520 _exception = 1;
5521 _exceptionType = "java/lang/IllegalArgumentException";
5522 _exceptionMessage = "binaryFormat == null";
5523 goto exit;
5524 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005525 binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08005526 if (!binary_buf) {
5527 _exception = 1;
5528 _exceptionType = "java/lang/IllegalArgumentException";
5529 _exceptionMessage = "binary == null";
5530 goto exit;
5531 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005532 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005533 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005534 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005535 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
5536 }
5537 if (binaryFormat == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005538 char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005539 binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
5540 }
5541 if (binary == NULL) {
5542 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
5543 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
5544 }
5545 glGetProgramBinary(
5546 (GLuint)program,
5547 (GLsizei)bufSize,
5548 (GLsizei *)length,
5549 (GLenum *)binaryFormat,
5550 (GLvoid *)binary
5551 );
Romain Guy84cac202016-12-05 12:26:02 -08005552
5553exit:
Jesse Halld830e742013-03-29 11:02:35 -07005554 if (_binaryArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005555 releasePointer(_env, _binaryArray, binary, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07005556 }
5557 if (_binaryFormatArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005558 _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07005559 }
5560 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005561 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
5562 }
5563 if (_exception) {
5564 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005565 }
5566}
5567
5568/* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
5569static void
5570android_glProgramBinary__IILjava_nio_Buffer_2I
5571 (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
Romain Guy84cac202016-12-05 12:26:02 -08005572 jint _exception = 0;
5573 const char * _exceptionType = NULL;
5574 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07005575 jarray _array = (jarray) 0;
5576 jint _bufferOffset = (jint) 0;
5577 jint _remaining;
5578 GLvoid *binary = (GLvoid *) 0;
5579
Romain Guy84cac202016-12-05 12:26:02 -08005580 if (!binary_buf) {
5581 _exception = 1;
5582 _exceptionType = "java/lang/IllegalArgumentException";
5583 _exceptionMessage = "binary == null";
5584 goto exit;
5585 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005586 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005587 if (binary == NULL) {
5588 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5589 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5590 }
5591 glProgramBinary(
5592 (GLuint)program,
5593 (GLenum)binaryFormat,
5594 (GLvoid *)binary,
5595 (GLsizei)length
5596 );
Romain Guy84cac202016-12-05 12:26:02 -08005597
5598exit:
Jesse Halld830e742013-03-29 11:02:35 -07005599 if (_array) {
5600 releasePointer(_env, _array, binary, JNI_FALSE);
5601 }
Romain Guy84cac202016-12-05 12:26:02 -08005602 if (_exception) {
5603 jniThrowException(_env, _exceptionType, _exceptionMessage);
5604 }
Jesse Halld830e742013-03-29 11:02:35 -07005605}
5606
5607/* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
5608static void
5609android_glProgramParameteri__III
5610 (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
5611 glProgramParameteri(
5612 (GLuint)program,
5613 (GLenum)pname,
5614 (GLint)value
5615 );
5616}
5617
5618/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5619static void
5620android_glInvalidateFramebuffer__II_3II
5621 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
5622 jint _exception = 0;
5623 const char * _exceptionType = NULL;
5624 const char * _exceptionMessage = NULL;
5625 GLenum *attachments_base = (GLenum *) 0;
5626 jint _remaining;
5627 GLenum *attachments = (GLenum *) 0;
5628
5629 if (!attachments_ref) {
5630 _exception = 1;
5631 _exceptionType = "java/lang/IllegalArgumentException";
5632 _exceptionMessage = "attachments == null";
5633 goto exit;
5634 }
5635 if (offset < 0) {
5636 _exception = 1;
5637 _exceptionType = "java/lang/IllegalArgumentException";
5638 _exceptionMessage = "offset < 0";
5639 goto exit;
5640 }
5641 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5642 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005643 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005644 attachments = attachments_base + offset;
5645
5646 glInvalidateFramebuffer(
5647 (GLenum)target,
5648 (GLsizei)numAttachments,
5649 (GLenum *)attachments
5650 );
5651
5652exit:
5653 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005654 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005655 JNI_ABORT);
5656 }
5657 if (_exception) {
5658 jniThrowException(_env, _exceptionType, _exceptionMessage);
5659 }
5660}
5661
5662/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5663static void
5664android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
5665 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005666 jint _exception = 0;
5667 const char * _exceptionType = NULL;
5668 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005669 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005670 jint _bufferOffset = (jint) 0;
5671 jint _remaining;
5672 GLenum *attachments = (GLenum *) 0;
5673
Romain Guy84cac202016-12-05 12:26:02 -08005674 if (!attachments_buf) {
5675 _exception = 1;
5676 _exceptionType = "java/lang/IllegalArgumentException";
5677 _exceptionMessage = "attachments == null";
5678 goto exit;
5679 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005680 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005681 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005682 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005683 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5684 }
5685 glInvalidateFramebuffer(
5686 (GLenum)target,
5687 (GLsizei)numAttachments,
5688 (GLenum *)attachments
5689 );
Romain Guy84cac202016-12-05 12:26:02 -08005690
5691exit:
Jesse Halld830e742013-03-29 11:02:35 -07005692 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005693 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005694 }
Romain Guy84cac202016-12-05 12:26:02 -08005695 if (_exception) {
5696 jniThrowException(_env, _exceptionType, _exceptionMessage);
5697 }
Jesse Halld830e742013-03-29 11:02:35 -07005698}
5699
5700/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5701static void
5702android_glInvalidateSubFramebuffer__II_3IIIIII
5703 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
5704 jint _exception = 0;
5705 const char * _exceptionType = NULL;
5706 const char * _exceptionMessage = NULL;
5707 GLenum *attachments_base = (GLenum *) 0;
5708 jint _remaining;
5709 GLenum *attachments = (GLenum *) 0;
5710
5711 if (!attachments_ref) {
5712 _exception = 1;
5713 _exceptionType = "java/lang/IllegalArgumentException";
5714 _exceptionMessage = "attachments == null";
5715 goto exit;
5716 }
5717 if (offset < 0) {
5718 _exception = 1;
5719 _exceptionType = "java/lang/IllegalArgumentException";
5720 _exceptionMessage = "offset < 0";
5721 goto exit;
5722 }
5723 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5724 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005725 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005726 attachments = attachments_base + offset;
5727
5728 glInvalidateSubFramebuffer(
5729 (GLenum)target,
5730 (GLsizei)numAttachments,
5731 (GLenum *)attachments,
5732 (GLint)x,
5733 (GLint)y,
5734 (GLsizei)width,
5735 (GLsizei)height
5736 );
5737
5738exit:
5739 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005740 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005741 JNI_ABORT);
5742 }
5743 if (_exception) {
5744 jniThrowException(_env, _exceptionType, _exceptionMessage);
5745 }
5746}
5747
5748/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5749static void
5750android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
5751 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf, jint x, jint y, jint width, jint height) {
Romain Guy84cac202016-12-05 12:26:02 -08005752 jint _exception = 0;
5753 const char * _exceptionType = NULL;
5754 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005755 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005756 jint _bufferOffset = (jint) 0;
5757 jint _remaining;
5758 GLenum *attachments = (GLenum *) 0;
5759
Romain Guy84cac202016-12-05 12:26:02 -08005760 if (!attachments_buf) {
5761 _exception = 1;
5762 _exceptionType = "java/lang/IllegalArgumentException";
5763 _exceptionMessage = "attachments == null";
5764 goto exit;
5765 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005766 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005767 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005768 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005769 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5770 }
5771 glInvalidateSubFramebuffer(
5772 (GLenum)target,
5773 (GLsizei)numAttachments,
5774 (GLenum *)attachments,
5775 (GLint)x,
5776 (GLint)y,
5777 (GLsizei)width,
5778 (GLsizei)height
5779 );
Romain Guy84cac202016-12-05 12:26:02 -08005780
5781exit:
Jesse Halld830e742013-03-29 11:02:35 -07005782 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005783 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005784 }
Romain Guy84cac202016-12-05 12:26:02 -08005785 if (_exception) {
5786 jniThrowException(_env, _exceptionType, _exceptionMessage);
5787 }
Jesse Halld830e742013-03-29 11:02:35 -07005788}
5789
5790/* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
5791static void
5792android_glTexStorage2D__IIIII
5793 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
5794 glTexStorage2D(
5795 (GLenum)target,
5796 (GLsizei)levels,
5797 (GLenum)internalformat,
5798 (GLsizei)width,
5799 (GLsizei)height
5800 );
5801}
5802
5803/* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
5804static void
5805android_glTexStorage3D__IIIIII
5806 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
5807 glTexStorage3D(
5808 (GLenum)target,
5809 (GLsizei)levels,
5810 (GLenum)internalformat,
5811 (GLsizei)width,
5812 (GLsizei)height,
5813 (GLsizei)depth
5814 );
5815}
5816
5817/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5818static void
5819android_glGetInternalformativ__IIII_3II
5820 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
5821 jint _exception = 0;
5822 const char * _exceptionType = NULL;
5823 const char * _exceptionMessage = NULL;
5824 GLint *params_base = (GLint *) 0;
5825 jint _remaining;
5826 GLint *params = (GLint *) 0;
5827
5828 if (!params_ref) {
5829 _exception = 1;
5830 _exceptionType = "java/lang/IllegalArgumentException";
5831 _exceptionMessage = "params == null";
5832 goto exit;
5833 }
5834 if (offset < 0) {
5835 _exception = 1;
5836 _exceptionType = "java/lang/IllegalArgumentException";
5837 _exceptionMessage = "offset < 0";
5838 goto exit;
5839 }
5840 _remaining = _env->GetArrayLength(params_ref) - offset;
5841 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005842 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005843 params = params_base + offset;
5844
5845 glGetInternalformativ(
5846 (GLenum)target,
5847 (GLenum)internalformat,
5848 (GLenum)pname,
5849 (GLsizei)bufSize,
5850 (GLint *)params
5851 );
5852
5853exit:
5854 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005855 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005856 _exception ? JNI_ABORT: 0);
5857 }
5858 if (_exception) {
5859 jniThrowException(_env, _exceptionType, _exceptionMessage);
5860 }
5861}
5862
5863/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5864static void
5865android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
5866 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005867 jint _exception = 0;
5868 const char * _exceptionType = NULL;
5869 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005870 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005871 jint _bufferOffset = (jint) 0;
5872 jint _remaining;
5873 GLint *params = (GLint *) 0;
5874
Romain Guy84cac202016-12-05 12:26:02 -08005875 if (!params_buf) {
5876 _exception = 1;
5877 _exceptionType = "java/lang/IllegalArgumentException";
5878 _exceptionMessage = "params == null";
5879 goto exit;
5880 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005881 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005882 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005883 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005884 params = (GLint *) (_paramsBase + _bufferOffset);
5885 }
5886 glGetInternalformativ(
5887 (GLenum)target,
5888 (GLenum)internalformat,
5889 (GLenum)pname,
5890 (GLsizei)bufSize,
5891 (GLint *)params
5892 );
Romain Guy84cac202016-12-05 12:26:02 -08005893
5894exit:
Jesse Halld830e742013-03-29 11:02:35 -07005895 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005896 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5897 }
5898 if (_exception) {
5899 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005900 }
5901}
5902
Pablo Ceballos68981ff2016-02-22 11:50:31 -08005903/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
5904static void
5905android_glReadPixels__IIIIIII
5906 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
5907 glReadPixels(
5908 (GLint)x,
5909 (GLint)y,
5910 (GLsizei)width,
5911 (GLsizei)height,
5912 (GLenum)format,
5913 (GLenum)type,
5914 reinterpret_cast<GLvoid *>(offset)
5915 );
5916}
5917
Jesse Halld830e742013-03-29 11:02:35 -07005918static const char *classPathName = "android/opengl/GLES30";
5919
Daniel Micay76f6a862015-09-19 17:31:01 -04005920static const JNINativeMethod methods[] = {
Jesse Halld830e742013-03-29 11:02:35 -07005921{"_nativeClassInit", "()V", (void*)nativeClassInit },
5922{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
5923{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
5924{"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
5925{"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
5926{"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
5927{"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5928{"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
5929{"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
5930{"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
5931{"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
5932{"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5933{"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
5934{"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
5935{"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
5936{"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
5937{"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
5938{"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
5939{"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
5940{"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
5941{"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
5942{"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
5943{"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
5944{"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
5945{"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
5946{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
5947{"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
5948{"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
5949{"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
5950{"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
5951{"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
5952{"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
5953{"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
5954{"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
5955{"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
5956{"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
5957{"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
5958{"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
5959{"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
5960{"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
5961{"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
5962{"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
5963{"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
5964{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
5965{"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
5966{"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
5967{"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
5968{"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
5969{"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
5970{"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
5971{"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
5972{"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
5973{"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
5974{"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
5975{"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
5976{"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
5977{"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
5978{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
5979{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
5980{"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08005981{"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
Jesse Halld830e742013-03-29 11:02:35 -07005982{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
5983{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
5984{"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
5985{"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
5986{"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
5987{"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
5988{"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
5989{"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
5990{"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
5991{"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
5992{"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
5993{"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
5994{"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
5995{"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
5996{"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
5997{"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
5998{"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
5999{"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
6000{"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
6001{"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
6002{"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
6003{"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
6004{"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
6005{"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
6006{"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
6007{"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
6008{"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
6009{"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
6010{"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
6011{"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
6012{"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
6013{"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
6014{"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
6015{"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
6016{"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
6017{"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
6018{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
6019{"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
6020{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
Jesse Halld877efe2013-04-29 15:59:35 -07006021{"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
Jesse Halld830e742013-03-29 11:02:35 -07006022{"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
6023{"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
6024{"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
6025{"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
6026{"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
6027{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
6028{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
6029{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
6030{"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
6031{"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
6032{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
6033{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
6034{"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
6035{"glIsSync", "(J)Z", (void *) android_glIsSync__J },
6036{"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
6037{"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
6038{"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
6039{"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
6040{"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
6041{"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
6042{"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
6043{"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
6044{"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
6045{"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
6046{"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
6047{"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
6048{"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
6049{"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
6050{"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
6051{"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
6052{"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
6053{"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
6054{"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
6055{"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6056{"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
6057{"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
6058{"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6059{"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
6060{"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6061{"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
6062{"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6063{"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
6064{"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
6065{"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
6066{"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6067{"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
6068{"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6069{"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
6070{"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
6071{"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
6072{"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
6073{"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
6074{"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
6075{"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
6076{"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
6077{"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
6078{"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
6079{"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
6080{"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
6081{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
6082{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
6083{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
Pablo Ceballos68981ff2016-02-22 11:50:31 -08006084{"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
Jesse Halld830e742013-03-29 11:02:35 -07006085};
6086
6087int register_android_opengl_jni_GLES30(JNIEnv *_env)
6088{
6089 int err;
6090 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
6091 return err;
6092}