blob: 992239865db7ef8e6434ec944e43436cb6bc9de2 [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"
Andreas Gampebfe63332014-11-12 14:12:45 -080021#pragma GCC diagnostic ignored "-Wunused-function"
22
Jesse Halld830e742013-03-29 11:02:35 -070023#include <GLES3/gl3.h>
24#include <GLES3/gl3ext.h>
25
Jesse Hall9626f822014-05-19 20:57:49 -070026#include <jni.h>
Steven Moreland2279b252017-07-19 09:50:45 -070027#include <nativehelper/JNIHelp.h>
Jesse Halld830e742013-03-29 11:02:35 -070028#include <android_runtime/AndroidRuntime.h>
29#include <utils/misc.h>
30#include <assert.h>
31
Jesse Halld830e742013-03-29 11:02:35 -070032static jclass nioAccessClass;
33static jclass bufferClass;
34static jmethodID getBasePointerID;
35static jmethodID getBaseArrayID;
36static jmethodID getBaseArrayOffsetID;
37static jfieldID positionID;
38static jfieldID limitID;
39static jfieldID elementSizeShiftID;
40
41
42/* special calls implemented in Android's GLES wrapper used to more
43 * efficiently bound-check passed arrays */
44extern "C" {
45#ifdef GL_VERSION_ES_CM_1_1
46GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
47 const GLvoid *ptr, GLsizei count);
48GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
49 const GLvoid *pointer, GLsizei count);
50GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
51 GLsizei stride, const GLvoid *pointer, GLsizei count);
52GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
53 GLsizei stride, const GLvoid *pointer, GLsizei count);
54GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
55 GLsizei stride, const GLvoid *pointer, GLsizei count);
56GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
57 GLsizei stride, const GLvoid *pointer, GLsizei count);
58GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
59 GLsizei stride, const GLvoid *pointer, GLsizei count);
60#endif
61#ifdef GL_ES_VERSION_2_0
62static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
63 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
64 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
65}
66#endif
67#ifdef GL_ES_VERSION_3_0
68static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
69 GLsizei stride, const GLvoid *pointer, GLsizei count) {
70 glVertexAttribIPointer(indx, size, type, stride, pointer);
71}
72#endif
73}
74
75/* Cache method IDs each time the class is loaded. */
76
77static void
78nativeClassInit(JNIEnv *_env, jclass glImplClass)
79{
80 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
81 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
82
83 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
84 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
85
86 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
87 "getBasePointer", "(Ljava/nio/Buffer;)J");
88 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
89 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
90 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
91 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
92
93 positionID = _env->GetFieldID(bufferClass, "position", "I");
94 limitID = _env->GetFieldID(bufferClass, "limit", "I");
95 elementSizeShiftID =
96 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
97}
98
99static void *
100getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
101{
102 jint position;
103 jint limit;
104 jint elementSizeShift;
105 jlong pointer;
106
107 position = _env->GetIntField(buffer, positionID);
108 limit = _env->GetIntField(buffer, limitID);
109 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
110 *remaining = (limit - position) << elementSizeShift;
111 pointer = _env->CallStaticLongMethod(nioAccessClass,
112 getBasePointerID, buffer);
113 if (pointer != 0L) {
114 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000115 return reinterpret_cast<void*>(pointer);
Jesse Halld830e742013-03-29 11:02:35 -0700116 }
117
118 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
119 getBaseArrayID, buffer);
120 *offset = _env->CallStaticIntMethod(nioAccessClass,
121 getBaseArrayOffsetID, buffer);
122
123 return NULL;
124}
125
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700126class ByteArrayGetter {
127public:
128 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
129 return _env->GetByteArrayElements(array, is_copy);
130 }
131};
132class BooleanArrayGetter {
133public:
134 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
135 return _env->GetBooleanArrayElements(array, is_copy);
136 }
137};
138class CharArrayGetter {
139public:
140 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
141 return _env->GetCharArrayElements(array, is_copy);
142 }
143};
144class ShortArrayGetter {
145public:
146 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
147 return _env->GetShortArrayElements(array, is_copy);
148 }
149};
150class IntArrayGetter {
151public:
152 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
153 return _env->GetIntArrayElements(array, is_copy);
154 }
155};
156class LongArrayGetter {
157public:
158 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
159 return _env->GetLongArrayElements(array, is_copy);
160 }
161};
162class FloatArrayGetter {
163public:
164 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
165 return _env->GetFloatArrayElements(array, is_copy);
166 }
167};
168class DoubleArrayGetter {
169public:
170 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
171 return _env->GetDoubleArrayElements(array, is_copy);
172 }
173};
174
175template<typename JTYPEARRAY, typename ARRAYGETTER>
176static void*
177getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
178 return ARRAYGETTER::Get(_env, array, is_copy);
179}
180
181class ByteArrayReleaser {
182public:
183 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
184 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
185 }
186};
187class BooleanArrayReleaser {
188public:
189 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
190 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
191 }
192};
193class CharArrayReleaser {
194public:
195 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
196 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
197 }
198};
199class ShortArrayReleaser {
200public:
201 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
202 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
203 }
204};
205class IntArrayReleaser {
206public:
207 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
208 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
209 }
210};
211class LongArrayReleaser {
212public:
213 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
214 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
215 }
216};
217class FloatArrayReleaser {
218public:
219 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
220 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
221 }
222};
223class DoubleArrayReleaser {
224public:
225 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
226 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
227 }
228};
229
230template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
231static void
232releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
233 ARRAYRELEASER::Release(_env, array, data, commit);
234}
235
Jesse Halld830e742013-03-29 11:02:35 -0700236static void
237releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
238{
239 _env->ReleasePrimitiveArrayCritical(array, data,
240 commit ? 0 : JNI_ABORT);
241}
242
243static void *
244getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
245 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
246 if (buf) {
247 jint position = _env->GetIntField(buffer, positionID);
248 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
249 buf += position << elementSizeShift;
250 } else {
251 jniThrowException(_env, "java/lang/IllegalArgumentException",
252 "Must use a native order direct Buffer");
253 }
254 return (void*) buf;
255}
256
257// --------------------------------------------------------------------------
258
259/*
260 * returns the number of values glGet returns for a given pname.
261 *
262 * The code below is written such that pnames requiring only one values
263 * are the default (and are not explicitely tested for). This makes the
264 * checking code much shorter/readable/efficient.
265 *
266 * This means that unknown pnames (e.g.: extensions) will default to 1. If
267 * that unknown pname needs more than 1 value, then the validation check
268 * is incomplete and the app may crash if it passed the wrong number params.
269 */
270static int getNeededCount(GLint pname) {
271 int needed = 1;
Romain Guydc43a6c2017-02-17 19:54:25 -0800272#ifdef GL_ES_VERSION_3_0
273 // GLES 3.x pnames
274 switch (pname) {
275 case GL_MAX_VIEWPORT_DIMS:
276 needed = 2;
277 break;
278
279 case GL_PROGRAM_BINARY_FORMATS:
280 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
281 break;
282 }
283#endif
284
Jesse Halld830e742013-03-29 11:02:35 -0700285#ifdef GL_ES_VERSION_2_0
286 // GLES 2.x pnames
287 switch (pname) {
288 case GL_ALIASED_LINE_WIDTH_RANGE:
289 case GL_ALIASED_POINT_SIZE_RANGE:
290 needed = 2;
291 break;
292
293 case GL_BLEND_COLOR:
294 case GL_COLOR_CLEAR_VALUE:
295 case GL_COLOR_WRITEMASK:
296 case GL_SCISSOR_BOX:
297 case GL_VIEWPORT:
298 needed = 4;
299 break;
300
301 case GL_COMPRESSED_TEXTURE_FORMATS:
302 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
303 break;
304
305 case GL_SHADER_BINARY_FORMATS:
306 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
307 break;
308 }
309#endif
310
311#ifdef GL_VERSION_ES_CM_1_1
312 // GLES 1.x pnames
313 switch (pname) {
314 case GL_ALIASED_LINE_WIDTH_RANGE:
315 case GL_ALIASED_POINT_SIZE_RANGE:
316 case GL_DEPTH_RANGE:
317 case GL_SMOOTH_LINE_WIDTH_RANGE:
318 case GL_SMOOTH_POINT_SIZE_RANGE:
319 needed = 2;
320 break;
321
322 case GL_CURRENT_NORMAL:
323 case GL_POINT_DISTANCE_ATTENUATION:
324 needed = 3;
325 break;
326
327 case GL_COLOR_CLEAR_VALUE:
328 case GL_COLOR_WRITEMASK:
329 case GL_CURRENT_COLOR:
330 case GL_CURRENT_TEXTURE_COORDS:
331 case GL_FOG_COLOR:
332 case GL_LIGHT_MODEL_AMBIENT:
333 case GL_SCISSOR_BOX:
334 case GL_VIEWPORT:
335 needed = 4;
336 break;
337
338 case GL_MODELVIEW_MATRIX:
339 case GL_PROJECTION_MATRIX:
340 case GL_TEXTURE_MATRIX:
341 needed = 16;
342 break;
343
344 case GL_COMPRESSED_TEXTURE_FORMATS:
345 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
346 break;
347 }
348#endif
349 return needed;
350}
351
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700352template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
353 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700354static void
355get
356 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
357 jint _exception = 0;
358 const char * _exceptionType;
359 const char * _exceptionMessage;
360 CTYPE *params_base = (CTYPE *) 0;
361 jint _remaining;
362 CTYPE *params = (CTYPE *) 0;
363 int _needed = 0;
364
365 if (!params_ref) {
366 _exception = 1;
367 _exceptionType = "java/lang/IllegalArgumentException";
368 _exceptionMessage = "params == null";
369 goto exit;
370 }
371 if (offset < 0) {
372 _exception = 1;
373 _exceptionType = "java/lang/IllegalArgumentException";
374 _exceptionMessage = "offset < 0";
375 goto exit;
376 }
377 _remaining = _env->GetArrayLength(params_ref) - offset;
378 _needed = getNeededCount(pname);
379 // if we didn't find this pname, we just assume the user passed
380 // an array of the right size -- this might happen with extensions
381 // or if we forget an enum here.
382 if (_remaining < _needed) {
383 _exception = 1;
384 _exceptionType = "java/lang/IllegalArgumentException";
385 _exceptionMessage = "length - offset < needed";
386 goto exit;
387 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700388 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
389 _env, params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700390 params = params_base + offset;
391
392 GET(
393 (GLenum)pname,
394 (CTYPE *)params
395 );
396
397exit:
398 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700399 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
400 _env, params_ref, params_base, !_exception);
Jesse Halld830e742013-03-29 11:02:35 -0700401 }
402 if (_exception) {
403 jniThrowException(_env, _exceptionType, _exceptionMessage);
404 }
405}
406
407
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700408template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
409 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700410static void
411getarray
412 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
413 jint _exception = 0;
414 const char * _exceptionType;
415 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700416 JTYPEARRAY _array = (JTYPEARRAY) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700417 jint _bufferOffset = (jint) 0;
418 jint _remaining;
419 CTYPE *params = (CTYPE *) 0;
420 int _needed = 0;
421
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700422 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700423 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Jesse Halld830e742013-03-29 11:02:35 -0700424 _needed = getNeededCount(pname);
425 // if we didn't find this pname, we just assume the user passed
426 // an array of the right size -- this might happen with extensions
427 // or if we forget an enum here.
428 if (_needed>0 && _remaining < _needed) {
429 _exception = 1;
430 _exceptionType = "java/lang/IllegalArgumentException";
431 _exceptionMessage = "remaining() < needed";
432 goto exit;
433 }
434 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700435 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
436 _env, _array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700437 params = (CTYPE *) (_paramsBase + _bufferOffset);
438 }
439 GET(
440 (GLenum)pname,
441 (CTYPE *)params
442 );
443
444exit:
445 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700446 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
447 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -0700448 }
449 if (_exception) {
450 jniThrowException(_env, _exceptionType, _exceptionMessage);
451 }
452}
453
454// --------------------------------------------------------------------------
455/* void glReadBuffer ( GLenum mode ) */
456static void
457android_glReadBuffer__I
458 (JNIEnv *_env, jobject _this, jint mode) {
459 glReadBuffer(
460 (GLenum)mode
461 );
462}
463
464/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
465static void
466android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
467 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800468 jint _exception = 0;
469 const char * _exceptionType = NULL;
470 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700471 jarray _array = (jarray) 0;
472 jint _bufferOffset = (jint) 0;
473 jint _remaining;
474 GLvoid *indices = (GLvoid *) 0;
475
Romain Guy84cac202016-12-05 12:26:02 -0800476 if (!indices_buf) {
477 _exception = 1;
478 _exceptionType = "java/lang/IllegalArgumentException";
479 _exceptionMessage = "indices == null";
480 goto exit;
481 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700482 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700483 if (indices == NULL) {
484 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
485 indices = (GLvoid *) (_indicesBase + _bufferOffset);
486 }
487 glDrawRangeElements(
488 (GLenum)mode,
489 (GLuint)start,
490 (GLuint)end,
491 (GLsizei)count,
492 (GLenum)type,
493 (GLvoid *)indices
494 );
Romain Guy84cac202016-12-05 12:26:02 -0800495
496exit:
Jesse Halld830e742013-03-29 11:02:35 -0700497 if (_array) {
498 releasePointer(_env, _array, indices, JNI_FALSE);
499 }
Romain Guy84cac202016-12-05 12:26:02 -0800500 if (_exception) {
501 jniThrowException(_env, _exceptionType, _exceptionMessage);
502 }
Jesse Halld830e742013-03-29 11:02:35 -0700503}
504
505/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
506static void
507android_glDrawRangeElements__IIIIII
508 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
509 glDrawRangeElements(
510 (GLenum)mode,
511 (GLuint)start,
512 (GLuint)end,
513 (GLsizei)count,
514 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000515 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700516 );
517}
518
519/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
520static void
521android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
522 (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 -0800523 jint _exception = 0;
524 const char * _exceptionType = NULL;
525 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700526 jarray _array = (jarray) 0;
527 jint _bufferOffset = (jint) 0;
528 jint _remaining;
529 GLvoid *pixels = (GLvoid *) 0;
530
Pablo Ceballos6aff9062015-10-01 18:35:39 -0700531 if (pixels_buf) {
532 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
533 }
534 if (pixels_buf && pixels == NULL) {
Jesse Halld830e742013-03-29 11:02:35 -0700535 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
536 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
537 }
538 glTexImage3D(
539 (GLenum)target,
540 (GLint)level,
541 (GLint)internalformat,
542 (GLsizei)width,
543 (GLsizei)height,
544 (GLsizei)depth,
545 (GLint)border,
546 (GLenum)format,
547 (GLenum)type,
548 (GLvoid *)pixels
549 );
550 if (_array) {
551 releasePointer(_env, _array, pixels, JNI_FALSE);
552 }
Romain Guy84cac202016-12-05 12:26:02 -0800553 if (_exception) {
554 jniThrowException(_env, _exceptionType, _exceptionMessage);
555 }
Jesse Halld830e742013-03-29 11:02:35 -0700556}
557
558/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
559static void
560android_glTexImage3D__IIIIIIIIII
561 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
562 glTexImage3D(
563 (GLenum)target,
564 (GLint)level,
565 (GLint)internalformat,
566 (GLsizei)width,
567 (GLsizei)height,
568 (GLsizei)depth,
569 (GLint)border,
570 (GLenum)format,
571 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000572 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700573 );
574}
575
576/* 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 ) */
577static void
578android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
579 (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 -0800580 jint _exception = 0;
581 const char * _exceptionType = NULL;
582 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700583 jarray _array = (jarray) 0;
584 jint _bufferOffset = (jint) 0;
585 jint _remaining;
586 GLvoid *pixels = (GLvoid *) 0;
587
Romain Guy84cac202016-12-05 12:26:02 -0800588 if (!pixels_buf) {
589 _exception = 1;
590 _exceptionType = "java/lang/IllegalArgumentException";
591 _exceptionMessage = "pixels == null";
592 goto exit;
593 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700594 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700595 if (pixels == NULL) {
596 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
597 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
598 }
599 glTexSubImage3D(
600 (GLenum)target,
601 (GLint)level,
602 (GLint)xoffset,
603 (GLint)yoffset,
604 (GLint)zoffset,
605 (GLsizei)width,
606 (GLsizei)height,
607 (GLsizei)depth,
608 (GLenum)format,
609 (GLenum)type,
610 (GLvoid *)pixels
611 );
Romain Guy84cac202016-12-05 12:26:02 -0800612
613exit:
Jesse Halld830e742013-03-29 11:02:35 -0700614 if (_array) {
615 releasePointer(_env, _array, pixels, JNI_FALSE);
616 }
Romain Guy84cac202016-12-05 12:26:02 -0800617 if (_exception) {
618 jniThrowException(_env, _exceptionType, _exceptionMessage);
619 }
Jesse Halld830e742013-03-29 11:02:35 -0700620}
621
622/* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
623static void
624android_glTexSubImage3D__IIIIIIIIIII
625 (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) {
626 glTexSubImage3D(
627 (GLenum)target,
628 (GLint)level,
629 (GLint)xoffset,
630 (GLint)yoffset,
631 (GLint)zoffset,
632 (GLsizei)width,
633 (GLsizei)height,
634 (GLsizei)depth,
635 (GLenum)format,
636 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000637 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700638 );
639}
640
641/* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
642static void
643android_glCopyTexSubImage3D__IIIIIIIII
644 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
645 glCopyTexSubImage3D(
646 (GLenum)target,
647 (GLint)level,
648 (GLint)xoffset,
649 (GLint)yoffset,
650 (GLint)zoffset,
651 (GLint)x,
652 (GLint)y,
653 (GLsizei)width,
654 (GLsizei)height
655 );
656}
657
658/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
659static void
660android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
661 (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 -0800662 jint _exception = 0;
663 const char * _exceptionType = NULL;
664 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700665 jarray _array = (jarray) 0;
666 jint _bufferOffset = (jint) 0;
667 jint _remaining;
668 GLvoid *data = (GLvoid *) 0;
669
Romain Guy84cac202016-12-05 12:26:02 -0800670 if (!data_buf) {
671 _exception = 1;
672 _exceptionType = "java/lang/IllegalArgumentException";
673 _exceptionMessage = "data == null";
674 goto exit;
675 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700676 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700677 if (data == NULL) {
678 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
679 data = (GLvoid *) (_dataBase + _bufferOffset);
680 }
681 glCompressedTexImage3D(
682 (GLenum)target,
683 (GLint)level,
684 (GLenum)internalformat,
685 (GLsizei)width,
686 (GLsizei)height,
687 (GLsizei)depth,
688 (GLint)border,
689 (GLsizei)imageSize,
690 (GLvoid *)data
691 );
Romain Guy84cac202016-12-05 12:26:02 -0800692
693exit:
Jesse Halld830e742013-03-29 11:02:35 -0700694 if (_array) {
695 releasePointer(_env, _array, data, JNI_FALSE);
696 }
Romain Guy84cac202016-12-05 12:26:02 -0800697 if (_exception) {
698 jniThrowException(_env, _exceptionType, _exceptionMessage);
699 }
Jesse Halld830e742013-03-29 11:02:35 -0700700}
701
702/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
703static void
704android_glCompressedTexImage3D__IIIIIIIII
705 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
706 glCompressedTexImage3D(
707 (GLenum)target,
708 (GLint)level,
709 (GLenum)internalformat,
710 (GLsizei)width,
711 (GLsizei)height,
712 (GLsizei)depth,
713 (GLint)border,
714 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000715 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700716 );
717}
718
719/* 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 ) */
720static void
721android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
722 (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 -0800723 jint _exception = 0;
724 const char * _exceptionType = NULL;
725 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700726 jarray _array = (jarray) 0;
727 jint _bufferOffset = (jint) 0;
728 jint _remaining;
729 GLvoid *data = (GLvoid *) 0;
730
Romain Guy84cac202016-12-05 12:26:02 -0800731 if (!data_buf) {
732 _exception = 1;
733 _exceptionType = "java/lang/IllegalArgumentException";
734 _exceptionMessage = "data == null";
735 goto exit;
736 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700737 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700738 if (data == NULL) {
739 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
740 data = (GLvoid *) (_dataBase + _bufferOffset);
741 }
742 glCompressedTexSubImage3D(
743 (GLenum)target,
744 (GLint)level,
745 (GLint)xoffset,
746 (GLint)yoffset,
747 (GLint)zoffset,
748 (GLsizei)width,
749 (GLsizei)height,
750 (GLsizei)depth,
751 (GLenum)format,
752 (GLsizei)imageSize,
753 (GLvoid *)data
754 );
Romain Guy84cac202016-12-05 12:26:02 -0800755
756exit:
Jesse Halld830e742013-03-29 11:02:35 -0700757 if (_array) {
758 releasePointer(_env, _array, data, JNI_FALSE);
759 }
Romain Guy84cac202016-12-05 12:26:02 -0800760 if (_exception) {
761 jniThrowException(_env, _exceptionType, _exceptionMessage);
762 }
Jesse Halld830e742013-03-29 11:02:35 -0700763}
764
765/* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
766static void
767android_glCompressedTexSubImage3D__IIIIIIIIIII
768 (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) {
769 glCompressedTexSubImage3D(
770 (GLenum)target,
771 (GLint)level,
772 (GLint)xoffset,
773 (GLint)yoffset,
774 (GLint)zoffset,
775 (GLsizei)width,
776 (GLsizei)height,
777 (GLsizei)depth,
778 (GLenum)format,
779 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000780 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700781 );
782}
783
784/* void glGenQueries ( GLsizei n, GLuint *ids ) */
785static void
786android_glGenQueries__I_3II
787 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
788 jint _exception = 0;
789 const char * _exceptionType = NULL;
790 const char * _exceptionMessage = NULL;
791 GLuint *ids_base = (GLuint *) 0;
792 jint _remaining;
793 GLuint *ids = (GLuint *) 0;
794
795 if (!ids_ref) {
796 _exception = 1;
797 _exceptionType = "java/lang/IllegalArgumentException";
798 _exceptionMessage = "ids == null";
799 goto exit;
800 }
801 if (offset < 0) {
802 _exception = 1;
803 _exceptionType = "java/lang/IllegalArgumentException";
804 _exceptionMessage = "offset < 0";
805 goto exit;
806 }
807 _remaining = _env->GetArrayLength(ids_ref) - offset;
808 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700809 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700810 ids = ids_base + offset;
811
812 glGenQueries(
813 (GLsizei)n,
814 (GLuint *)ids
815 );
816
817exit:
818 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700819 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700820 _exception ? JNI_ABORT: 0);
821 }
822 if (_exception) {
823 jniThrowException(_env, _exceptionType, _exceptionMessage);
824 }
825}
826
827/* void glGenQueries ( GLsizei n, GLuint *ids ) */
828static void
829android_glGenQueries__ILjava_nio_IntBuffer_2
830 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800831 jint _exception = 0;
832 const char * _exceptionType = NULL;
833 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700834 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700835 jint _bufferOffset = (jint) 0;
836 jint _remaining;
837 GLuint *ids = (GLuint *) 0;
838
Romain Guy84cac202016-12-05 12:26:02 -0800839 if (!ids_buf) {
840 _exception = 1;
841 _exceptionType = "java/lang/IllegalArgumentException";
842 _exceptionMessage = "ids == null";
843 goto exit;
844 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700845 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700846 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700847 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700848 ids = (GLuint *) (_idsBase + _bufferOffset);
849 }
850 glGenQueries(
851 (GLsizei)n,
852 (GLuint *)ids
853 );
Romain Guy84cac202016-12-05 12:26:02 -0800854
855exit:
Jesse Halld830e742013-03-29 11:02:35 -0700856 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -0800857 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
858 }
859 if (_exception) {
860 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -0700861 }
862}
863
864/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
865static void
866android_glDeleteQueries__I_3II
867 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
868 jint _exception = 0;
869 const char * _exceptionType = NULL;
870 const char * _exceptionMessage = NULL;
871 GLuint *ids_base = (GLuint *) 0;
872 jint _remaining;
873 GLuint *ids = (GLuint *) 0;
874
875 if (!ids_ref) {
876 _exception = 1;
877 _exceptionType = "java/lang/IllegalArgumentException";
878 _exceptionMessage = "ids == null";
879 goto exit;
880 }
881 if (offset < 0) {
882 _exception = 1;
883 _exceptionType = "java/lang/IllegalArgumentException";
884 _exceptionMessage = "offset < 0";
885 goto exit;
886 }
887 _remaining = _env->GetArrayLength(ids_ref) - offset;
888 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700889 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700890 ids = ids_base + offset;
891
892 glDeleteQueries(
893 (GLsizei)n,
894 (GLuint *)ids
895 );
896
897exit:
898 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700899 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700900 JNI_ABORT);
901 }
902 if (_exception) {
903 jniThrowException(_env, _exceptionType, _exceptionMessage);
904 }
905}
906
907/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
908static void
909android_glDeleteQueries__ILjava_nio_IntBuffer_2
910 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800911 jint _exception = 0;
912 const char * _exceptionType = NULL;
913 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700914 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700915 jint _bufferOffset = (jint) 0;
916 jint _remaining;
917 GLuint *ids = (GLuint *) 0;
918
Romain Guy84cac202016-12-05 12:26:02 -0800919 if (!ids_buf) {
920 _exception = 1;
921 _exceptionType = "java/lang/IllegalArgumentException";
922 _exceptionMessage = "ids == null";
923 goto exit;
924 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700925 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700926 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700927 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700928 ids = (GLuint *) (_idsBase + _bufferOffset);
929 }
930 glDeleteQueries(
931 (GLsizei)n,
932 (GLuint *)ids
933 );
Romain Guy84cac202016-12-05 12:26:02 -0800934
935exit:
Jesse Halld830e742013-03-29 11:02:35 -0700936 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700937 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -0700938 }
Romain Guy84cac202016-12-05 12:26:02 -0800939 if (_exception) {
940 jniThrowException(_env, _exceptionType, _exceptionMessage);
941 }
Jesse Halld830e742013-03-29 11:02:35 -0700942}
943
944/* GLboolean glIsQuery ( GLuint id ) */
945static jboolean
946android_glIsQuery__I
947 (JNIEnv *_env, jobject _this, jint id) {
948 GLboolean _returnValue;
949 _returnValue = glIsQuery(
950 (GLuint)id
951 );
952 return (jboolean)_returnValue;
953}
954
955/* void glBeginQuery ( GLenum target, GLuint id ) */
956static void
957android_glBeginQuery__II
958 (JNIEnv *_env, jobject _this, jint target, jint id) {
959 glBeginQuery(
960 (GLenum)target,
961 (GLuint)id
962 );
963}
964
965/* void glEndQuery ( GLenum target ) */
966static void
967android_glEndQuery__I
968 (JNIEnv *_env, jobject _this, jint target) {
969 glEndQuery(
970 (GLenum)target
971 );
972}
973
974/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
975static void
976android_glGetQueryiv__II_3II
977 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
978 jint _exception = 0;
979 const char * _exceptionType = NULL;
980 const char * _exceptionMessage = NULL;
981 GLint *params_base = (GLint *) 0;
982 jint _remaining;
983 GLint *params = (GLint *) 0;
984
985 if (!params_ref) {
986 _exception = 1;
987 _exceptionType = "java/lang/IllegalArgumentException";
988 _exceptionMessage = "params == null";
989 goto exit;
990 }
991 if (offset < 0) {
992 _exception = 1;
993 _exceptionType = "java/lang/IllegalArgumentException";
994 _exceptionMessage = "offset < 0";
995 goto exit;
996 }
997 _remaining = _env->GetArrayLength(params_ref) - offset;
998 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700999 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001000 params = params_base + offset;
1001
1002 glGetQueryiv(
1003 (GLenum)target,
1004 (GLenum)pname,
1005 (GLint *)params
1006 );
1007
1008exit:
1009 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001010 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07001011 _exception ? JNI_ABORT: 0);
1012 }
1013 if (_exception) {
1014 jniThrowException(_env, _exceptionType, _exceptionMessage);
1015 }
1016}
1017
1018/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
1019static void
1020android_glGetQueryiv__IILjava_nio_IntBuffer_2
1021 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001022 jint _exception = 0;
1023 const char * _exceptionType = NULL;
1024 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001025 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001026 jint _bufferOffset = (jint) 0;
1027 jint _remaining;
1028 GLint *params = (GLint *) 0;
1029
Romain Guy84cac202016-12-05 12:26:02 -08001030 if (!params_buf) {
1031 _exception = 1;
1032 _exceptionType = "java/lang/IllegalArgumentException";
1033 _exceptionMessage = "params == null";
1034 goto exit;
1035 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001036 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001037 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001038 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001039 params = (GLint *) (_paramsBase + _bufferOffset);
1040 }
1041 glGetQueryiv(
1042 (GLenum)target,
1043 (GLenum)pname,
1044 (GLint *)params
1045 );
Romain Guy84cac202016-12-05 12:26:02 -08001046
1047exit:
Jesse Halld830e742013-03-29 11:02:35 -07001048 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001049 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1050 }
1051 if (_exception) {
1052 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001053 }
1054}
1055
1056/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1057static void
1058android_glGetQueryObjectuiv__II_3II
1059 (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
1060 jint _exception = 0;
1061 const char * _exceptionType = NULL;
1062 const char * _exceptionMessage = NULL;
1063 GLuint *params_base = (GLuint *) 0;
1064 jint _remaining;
1065 GLuint *params = (GLuint *) 0;
1066
1067 if (!params_ref) {
1068 _exception = 1;
1069 _exceptionType = "java/lang/IllegalArgumentException";
1070 _exceptionMessage = "params == null";
1071 goto exit;
1072 }
1073 if (offset < 0) {
1074 _exception = 1;
1075 _exceptionType = "java/lang/IllegalArgumentException";
1076 _exceptionMessage = "offset < 0";
1077 goto exit;
1078 }
1079 _remaining = _env->GetArrayLength(params_ref) - offset;
1080 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001081 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001082 params = params_base + offset;
1083
1084 glGetQueryObjectuiv(
1085 (GLuint)id,
1086 (GLenum)pname,
1087 (GLuint *)params
1088 );
1089
1090exit:
1091 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001092 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07001093 _exception ? JNI_ABORT: 0);
1094 }
1095 if (_exception) {
1096 jniThrowException(_env, _exceptionType, _exceptionMessage);
1097 }
1098}
1099
1100/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1101static void
1102android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
1103 (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001104 jint _exception = 0;
1105 const char * _exceptionType = NULL;
1106 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001107 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001108 jint _bufferOffset = (jint) 0;
1109 jint _remaining;
1110 GLuint *params = (GLuint *) 0;
1111
Romain Guy84cac202016-12-05 12:26:02 -08001112 if (!params_buf) {
1113 _exception = 1;
1114 _exceptionType = "java/lang/IllegalArgumentException";
1115 _exceptionMessage = "params == null";
1116 goto exit;
1117 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001118 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001119 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001120 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001121 params = (GLuint *) (_paramsBase + _bufferOffset);
1122 }
1123 glGetQueryObjectuiv(
1124 (GLuint)id,
1125 (GLenum)pname,
1126 (GLuint *)params
1127 );
Romain Guy84cac202016-12-05 12:26:02 -08001128
1129exit:
Jesse Halld830e742013-03-29 11:02:35 -07001130 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001131 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1132 }
1133 if (_exception) {
1134 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001135 }
1136}
1137
1138/* GLboolean glUnmapBuffer ( GLenum target ) */
1139static jboolean
1140android_glUnmapBuffer__I
1141 (JNIEnv *_env, jobject _this, jint target) {
1142 GLboolean _returnValue;
1143 _returnValue = glUnmapBuffer(
1144 (GLenum)target
1145 );
1146 return (jboolean)_returnValue;
1147}
1148
1149/* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
1150static jobject
1151android_glGetBufferPointerv__II
1152 (JNIEnv *_env, jobject _this, jint target, jint pname) {
1153 GLint64 _mapLength;
1154 GLvoid* _p;
1155 glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
1156 glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
1157 return _env->NewDirectByteBuffer(_p, _mapLength);
1158}
1159
1160/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1161static void
1162android_glDrawBuffers__I_3II
1163 (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
1164 jint _exception = 0;
1165 const char * _exceptionType = NULL;
1166 const char * _exceptionMessage = NULL;
1167 GLenum *bufs_base = (GLenum *) 0;
1168 jint _remaining;
1169 GLenum *bufs = (GLenum *) 0;
1170
1171 if (!bufs_ref) {
1172 _exception = 1;
1173 _exceptionType = "java/lang/IllegalArgumentException";
1174 _exceptionMessage = "bufs == null";
1175 goto exit;
1176 }
1177 if (offset < 0) {
1178 _exception = 1;
1179 _exceptionType = "java/lang/IllegalArgumentException";
1180 _exceptionMessage = "offset < 0";
1181 goto exit;
1182 }
1183 _remaining = _env->GetArrayLength(bufs_ref) - offset;
1184 bufs_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001185 _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001186 bufs = bufs_base + offset;
1187
1188 glDrawBuffers(
1189 (GLsizei)n,
1190 (GLenum *)bufs
1191 );
1192
1193exit:
1194 if (bufs_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001195 _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
Jesse Halld830e742013-03-29 11:02:35 -07001196 JNI_ABORT);
1197 }
1198 if (_exception) {
1199 jniThrowException(_env, _exceptionType, _exceptionMessage);
1200 }
1201}
1202
1203/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1204static void
1205android_glDrawBuffers__ILjava_nio_IntBuffer_2
1206 (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001207 jint _exception = 0;
1208 const char * _exceptionType = NULL;
1209 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001210 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001211 jint _bufferOffset = (jint) 0;
1212 jint _remaining;
1213 GLenum *bufs = (GLenum *) 0;
1214
Romain Guy84cac202016-12-05 12:26:02 -08001215 if (!bufs_buf) {
1216 _exception = 1;
1217 _exceptionType = "java/lang/IllegalArgumentException";
1218 _exceptionMessage = "bufs == null";
1219 goto exit;
1220 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001221 bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001222 if (bufs == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001223 char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001224 bufs = (GLenum *) (_bufsBase + _bufferOffset);
1225 }
1226 glDrawBuffers(
1227 (GLsizei)n,
1228 (GLenum *)bufs
1229 );
Romain Guy84cac202016-12-05 12:26:02 -08001230
1231exit:
Jesse Halld830e742013-03-29 11:02:35 -07001232 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001233 _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001234 }
Romain Guy84cac202016-12-05 12:26:02 -08001235 if (_exception) {
1236 jniThrowException(_env, _exceptionType, _exceptionMessage);
1237 }
Jesse Halld830e742013-03-29 11:02:35 -07001238}
1239
1240/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1241static void
1242android_glUniformMatrix2x3fv__IIZ_3FI
1243 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1244 jint _exception = 0;
1245 const char * _exceptionType = NULL;
1246 const char * _exceptionMessage = NULL;
1247 GLfloat *value_base = (GLfloat *) 0;
1248 jint _remaining;
1249 GLfloat *value = (GLfloat *) 0;
1250
1251 if (!value_ref) {
1252 _exception = 1;
1253 _exceptionType = "java/lang/IllegalArgumentException";
1254 _exceptionMessage = "value == null";
1255 goto exit;
1256 }
1257 if (offset < 0) {
1258 _exception = 1;
1259 _exceptionType = "java/lang/IllegalArgumentException";
1260 _exceptionMessage = "offset < 0";
1261 goto exit;
1262 }
1263 _remaining = _env->GetArrayLength(value_ref) - offset;
1264 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001265 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001266 value = value_base + offset;
1267
1268 glUniformMatrix2x3fv(
1269 (GLint)location,
1270 (GLsizei)count,
1271 (GLboolean)transpose,
1272 (GLfloat *)value
1273 );
1274
1275exit:
1276 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001277 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001278 JNI_ABORT);
1279 }
1280 if (_exception) {
1281 jniThrowException(_env, _exceptionType, _exceptionMessage);
1282 }
1283}
1284
1285/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1286static void
1287android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
1288 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001289 jint _exception = 0;
1290 const char * _exceptionType = NULL;
1291 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001292 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001293 jint _bufferOffset = (jint) 0;
1294 jint _remaining;
1295 GLfloat *value = (GLfloat *) 0;
1296
Romain Guy84cac202016-12-05 12:26:02 -08001297 if (!value_buf) {
1298 _exception = 1;
1299 _exceptionType = "java/lang/IllegalArgumentException";
1300 _exceptionMessage = "value == null";
1301 goto exit;
1302 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001303 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001304 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001305 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001306 value = (GLfloat *) (_valueBase + _bufferOffset);
1307 }
1308 glUniformMatrix2x3fv(
1309 (GLint)location,
1310 (GLsizei)count,
1311 (GLboolean)transpose,
1312 (GLfloat *)value
1313 );
Romain Guy84cac202016-12-05 12:26:02 -08001314
1315exit:
Jesse Halld830e742013-03-29 11:02:35 -07001316 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001317 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001318 }
Romain Guy84cac202016-12-05 12:26:02 -08001319 if (_exception) {
1320 jniThrowException(_env, _exceptionType, _exceptionMessage);
1321 }
Jesse Halld830e742013-03-29 11:02:35 -07001322}
1323
1324/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1325static void
1326android_glUniformMatrix3x2fv__IIZ_3FI
1327 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1328 jint _exception = 0;
1329 const char * _exceptionType = NULL;
1330 const char * _exceptionMessage = NULL;
1331 GLfloat *value_base = (GLfloat *) 0;
1332 jint _remaining;
1333 GLfloat *value = (GLfloat *) 0;
1334
1335 if (!value_ref) {
1336 _exception = 1;
1337 _exceptionType = "java/lang/IllegalArgumentException";
1338 _exceptionMessage = "value == null";
1339 goto exit;
1340 }
1341 if (offset < 0) {
1342 _exception = 1;
1343 _exceptionType = "java/lang/IllegalArgumentException";
1344 _exceptionMessage = "offset < 0";
1345 goto exit;
1346 }
1347 _remaining = _env->GetArrayLength(value_ref) - offset;
1348 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001349 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001350 value = value_base + offset;
1351
1352 glUniformMatrix3x2fv(
1353 (GLint)location,
1354 (GLsizei)count,
1355 (GLboolean)transpose,
1356 (GLfloat *)value
1357 );
1358
1359exit:
1360 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001361 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001362 JNI_ABORT);
1363 }
1364 if (_exception) {
1365 jniThrowException(_env, _exceptionType, _exceptionMessage);
1366 }
1367}
1368
1369/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1370static void
1371android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
1372 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001373 jint _exception = 0;
1374 const char * _exceptionType = NULL;
1375 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001376 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001377 jint _bufferOffset = (jint) 0;
1378 jint _remaining;
1379 GLfloat *value = (GLfloat *) 0;
1380
Romain Guy84cac202016-12-05 12:26:02 -08001381 if (!value_buf) {
1382 _exception = 1;
1383 _exceptionType = "java/lang/IllegalArgumentException";
1384 _exceptionMessage = "value == null";
1385 goto exit;
1386 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001387 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001388 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001389 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001390 value = (GLfloat *) (_valueBase + _bufferOffset);
1391 }
1392 glUniformMatrix3x2fv(
1393 (GLint)location,
1394 (GLsizei)count,
1395 (GLboolean)transpose,
1396 (GLfloat *)value
1397 );
Romain Guy84cac202016-12-05 12:26:02 -08001398
1399exit:
Jesse Halld830e742013-03-29 11:02:35 -07001400 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001401 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001402 }
Romain Guy84cac202016-12-05 12:26:02 -08001403 if (_exception) {
1404 jniThrowException(_env, _exceptionType, _exceptionMessage);
1405 }
Jesse Halld830e742013-03-29 11:02:35 -07001406}
1407
1408/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1409static void
1410android_glUniformMatrix2x4fv__IIZ_3FI
1411 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1412 jint _exception = 0;
1413 const char * _exceptionType = NULL;
1414 const char * _exceptionMessage = NULL;
1415 GLfloat *value_base = (GLfloat *) 0;
1416 jint _remaining;
1417 GLfloat *value = (GLfloat *) 0;
1418
1419 if (!value_ref) {
1420 _exception = 1;
1421 _exceptionType = "java/lang/IllegalArgumentException";
1422 _exceptionMessage = "value == null";
1423 goto exit;
1424 }
1425 if (offset < 0) {
1426 _exception = 1;
1427 _exceptionType = "java/lang/IllegalArgumentException";
1428 _exceptionMessage = "offset < 0";
1429 goto exit;
1430 }
1431 _remaining = _env->GetArrayLength(value_ref) - offset;
1432 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001433 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001434 value = value_base + offset;
1435
1436 glUniformMatrix2x4fv(
1437 (GLint)location,
1438 (GLsizei)count,
1439 (GLboolean)transpose,
1440 (GLfloat *)value
1441 );
1442
1443exit:
1444 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001445 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001446 JNI_ABORT);
1447 }
1448 if (_exception) {
1449 jniThrowException(_env, _exceptionType, _exceptionMessage);
1450 }
1451}
1452
1453/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1454static void
1455android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
1456 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001457 jint _exception = 0;
1458 const char * _exceptionType = NULL;
1459 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001460 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001461 jint _bufferOffset = (jint) 0;
1462 jint _remaining;
1463 GLfloat *value = (GLfloat *) 0;
1464
Romain Guy84cac202016-12-05 12:26:02 -08001465 if (!value_buf) {
1466 _exception = 1;
1467 _exceptionType = "java/lang/IllegalArgumentException";
1468 _exceptionMessage = "value == null";
1469 goto exit;
1470 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001471 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001472 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001473 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001474 value = (GLfloat *) (_valueBase + _bufferOffset);
1475 }
1476 glUniformMatrix2x4fv(
1477 (GLint)location,
1478 (GLsizei)count,
1479 (GLboolean)transpose,
1480 (GLfloat *)value
1481 );
Romain Guy84cac202016-12-05 12:26:02 -08001482
1483exit:
Jesse Halld830e742013-03-29 11:02:35 -07001484 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001485 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001486 }
Romain Guy84cac202016-12-05 12:26:02 -08001487 if (_exception) {
1488 jniThrowException(_env, _exceptionType, _exceptionMessage);
1489 }
Jesse Halld830e742013-03-29 11:02:35 -07001490}
1491
1492/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1493static void
1494android_glUniformMatrix4x2fv__IIZ_3FI
1495 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1496 jint _exception = 0;
1497 const char * _exceptionType = NULL;
1498 const char * _exceptionMessage = NULL;
1499 GLfloat *value_base = (GLfloat *) 0;
1500 jint _remaining;
1501 GLfloat *value = (GLfloat *) 0;
1502
1503 if (!value_ref) {
1504 _exception = 1;
1505 _exceptionType = "java/lang/IllegalArgumentException";
1506 _exceptionMessage = "value == null";
1507 goto exit;
1508 }
1509 if (offset < 0) {
1510 _exception = 1;
1511 _exceptionType = "java/lang/IllegalArgumentException";
1512 _exceptionMessage = "offset < 0";
1513 goto exit;
1514 }
1515 _remaining = _env->GetArrayLength(value_ref) - offset;
1516 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001517 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001518 value = value_base + offset;
1519
1520 glUniformMatrix4x2fv(
1521 (GLint)location,
1522 (GLsizei)count,
1523 (GLboolean)transpose,
1524 (GLfloat *)value
1525 );
1526
1527exit:
1528 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001529 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001530 JNI_ABORT);
1531 }
1532 if (_exception) {
1533 jniThrowException(_env, _exceptionType, _exceptionMessage);
1534 }
1535}
1536
1537/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1538static void
1539android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
1540 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001541 jint _exception = 0;
1542 const char * _exceptionType = NULL;
1543 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001544 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001545 jint _bufferOffset = (jint) 0;
1546 jint _remaining;
1547 GLfloat *value = (GLfloat *) 0;
1548
Romain Guy84cac202016-12-05 12:26:02 -08001549 if (!value_buf) {
1550 _exception = 1;
1551 _exceptionType = "java/lang/IllegalArgumentException";
1552 _exceptionMessage = "value == null";
1553 goto exit;
1554 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001555 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001556 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001557 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001558 value = (GLfloat *) (_valueBase + _bufferOffset);
1559 }
1560 glUniformMatrix4x2fv(
1561 (GLint)location,
1562 (GLsizei)count,
1563 (GLboolean)transpose,
1564 (GLfloat *)value
1565 );
Romain Guy84cac202016-12-05 12:26:02 -08001566
1567exit:
Jesse Halld830e742013-03-29 11:02:35 -07001568 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001569 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001570 }
Romain Guy84cac202016-12-05 12:26:02 -08001571 if (_exception) {
1572 jniThrowException(_env, _exceptionType, _exceptionMessage);
1573 }
Jesse Halld830e742013-03-29 11:02:35 -07001574}
1575
1576/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1577static void
1578android_glUniformMatrix3x4fv__IIZ_3FI
1579 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1580 jint _exception = 0;
1581 const char * _exceptionType = NULL;
1582 const char * _exceptionMessage = NULL;
1583 GLfloat *value_base = (GLfloat *) 0;
1584 jint _remaining;
1585 GLfloat *value = (GLfloat *) 0;
1586
1587 if (!value_ref) {
1588 _exception = 1;
1589 _exceptionType = "java/lang/IllegalArgumentException";
1590 _exceptionMessage = "value == null";
1591 goto exit;
1592 }
1593 if (offset < 0) {
1594 _exception = 1;
1595 _exceptionType = "java/lang/IllegalArgumentException";
1596 _exceptionMessage = "offset < 0";
1597 goto exit;
1598 }
1599 _remaining = _env->GetArrayLength(value_ref) - offset;
1600 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001601 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001602 value = value_base + offset;
1603
1604 glUniformMatrix3x4fv(
1605 (GLint)location,
1606 (GLsizei)count,
1607 (GLboolean)transpose,
1608 (GLfloat *)value
1609 );
1610
1611exit:
1612 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001613 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001614 JNI_ABORT);
1615 }
1616 if (_exception) {
1617 jniThrowException(_env, _exceptionType, _exceptionMessage);
1618 }
1619}
1620
1621/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1622static void
1623android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
1624 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001625 jint _exception = 0;
1626 const char * _exceptionType = NULL;
1627 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001628 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001629 jint _bufferOffset = (jint) 0;
1630 jint _remaining;
1631 GLfloat *value = (GLfloat *) 0;
1632
Romain Guy84cac202016-12-05 12:26:02 -08001633 if (!value_buf) {
1634 _exception = 1;
1635 _exceptionType = "java/lang/IllegalArgumentException";
1636 _exceptionMessage = "value == null";
1637 goto exit;
1638 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001639 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001640 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001641 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001642 value = (GLfloat *) (_valueBase + _bufferOffset);
1643 }
1644 glUniformMatrix3x4fv(
1645 (GLint)location,
1646 (GLsizei)count,
1647 (GLboolean)transpose,
1648 (GLfloat *)value
1649 );
Romain Guy84cac202016-12-05 12:26:02 -08001650
1651exit:
Jesse Halld830e742013-03-29 11:02:35 -07001652 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001653 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001654 }
Romain Guy84cac202016-12-05 12:26:02 -08001655 if (_exception) {
1656 jniThrowException(_env, _exceptionType, _exceptionMessage);
1657 }
Jesse Halld830e742013-03-29 11:02:35 -07001658}
1659
1660/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1661static void
1662android_glUniformMatrix4x3fv__IIZ_3FI
1663 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1664 jint _exception = 0;
1665 const char * _exceptionType = NULL;
1666 const char * _exceptionMessage = NULL;
1667 GLfloat *value_base = (GLfloat *) 0;
1668 jint _remaining;
1669 GLfloat *value = (GLfloat *) 0;
1670
1671 if (!value_ref) {
1672 _exception = 1;
1673 _exceptionType = "java/lang/IllegalArgumentException";
1674 _exceptionMessage = "value == null";
1675 goto exit;
1676 }
1677 if (offset < 0) {
1678 _exception = 1;
1679 _exceptionType = "java/lang/IllegalArgumentException";
1680 _exceptionMessage = "offset < 0";
1681 goto exit;
1682 }
1683 _remaining = _env->GetArrayLength(value_ref) - offset;
1684 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001685 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001686 value = value_base + offset;
1687
1688 glUniformMatrix4x3fv(
1689 (GLint)location,
1690 (GLsizei)count,
1691 (GLboolean)transpose,
1692 (GLfloat *)value
1693 );
1694
1695exit:
1696 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001697 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001698 JNI_ABORT);
1699 }
1700 if (_exception) {
1701 jniThrowException(_env, _exceptionType, _exceptionMessage);
1702 }
1703}
1704
1705/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1706static void
1707android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
1708 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001709 jint _exception = 0;
1710 const char * _exceptionType = NULL;
1711 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001712 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001713 jint _bufferOffset = (jint) 0;
1714 jint _remaining;
1715 GLfloat *value = (GLfloat *) 0;
1716
Romain Guy84cac202016-12-05 12:26:02 -08001717 if (!value_buf) {
1718 _exception = 1;
1719 _exceptionType = "java/lang/IllegalArgumentException";
1720 _exceptionMessage = "value == null";
1721 goto exit;
1722 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001723 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001724 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001725 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001726 value = (GLfloat *) (_valueBase + _bufferOffset);
1727 }
1728 glUniformMatrix4x3fv(
1729 (GLint)location,
1730 (GLsizei)count,
1731 (GLboolean)transpose,
1732 (GLfloat *)value
1733 );
Romain Guy84cac202016-12-05 12:26:02 -08001734
1735exit:
Jesse Halld830e742013-03-29 11:02:35 -07001736 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001737 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001738 }
Romain Guy84cac202016-12-05 12:26:02 -08001739 if (_exception) {
1740 jniThrowException(_env, _exceptionType, _exceptionMessage);
1741 }
Jesse Halld830e742013-03-29 11:02:35 -07001742}
1743
1744/* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
1745static void
1746android_glBlitFramebuffer__IIIIIIIIII
1747 (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
1748 glBlitFramebuffer(
1749 (GLint)srcX0,
1750 (GLint)srcY0,
1751 (GLint)srcX1,
1752 (GLint)srcY1,
1753 (GLint)dstX0,
1754 (GLint)dstY0,
1755 (GLint)dstX1,
1756 (GLint)dstY1,
1757 (GLbitfield)mask,
1758 (GLenum)filter
1759 );
1760}
1761
1762/* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
1763static void
1764android_glRenderbufferStorageMultisample__IIIII
1765 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
1766 glRenderbufferStorageMultisample(
1767 (GLenum)target,
1768 (GLsizei)samples,
1769 (GLenum)internalformat,
1770 (GLsizei)width,
1771 (GLsizei)height
1772 );
1773}
1774
1775/* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
1776static void
1777android_glFramebufferTextureLayer__IIIII
1778 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
1779 glFramebufferTextureLayer(
1780 (GLenum)target,
1781 (GLenum)attachment,
1782 (GLuint)texture,
1783 (GLint)level,
1784 (GLint)layer
1785 );
1786}
1787
1788/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
1789static jobject
1790android_glMapBufferRange__IIII
1791 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
1792 GLvoid* _p = glMapBufferRange((GLenum)target,
1793 (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
1794 jobject _buf = (jobject)0;
1795 if (_p) {
1796 _buf = _env->NewDirectByteBuffer(_p, length);
1797 }
1798 return _buf;
1799}
1800
1801/* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
1802static void
1803android_glFlushMappedBufferRange__III
1804 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
1805 glFlushMappedBufferRange(
1806 (GLenum)target,
1807 (GLintptr)offset,
1808 (GLsizeiptr)length
1809 );
1810}
1811
1812/* void glBindVertexArray ( GLuint array ) */
1813static void
1814android_glBindVertexArray__I
1815 (JNIEnv *_env, jobject _this, jint array) {
1816 glBindVertexArray(
1817 (GLuint)array
1818 );
1819}
1820
1821/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1822static void
1823android_glDeleteVertexArrays__I_3II
1824 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1825 jint _exception = 0;
1826 const char * _exceptionType = NULL;
1827 const char * _exceptionMessage = NULL;
1828 GLuint *arrays_base = (GLuint *) 0;
1829 jint _remaining;
1830 GLuint *arrays = (GLuint *) 0;
1831
1832 if (!arrays_ref) {
1833 _exception = 1;
1834 _exceptionType = "java/lang/IllegalArgumentException";
1835 _exceptionMessage = "arrays == null";
1836 goto exit;
1837 }
1838 if (offset < 0) {
1839 _exception = 1;
1840 _exceptionType = "java/lang/IllegalArgumentException";
1841 _exceptionMessage = "offset < 0";
1842 goto exit;
1843 }
1844 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1845 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001846 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001847 arrays = arrays_base + offset;
1848
1849 glDeleteVertexArrays(
1850 (GLsizei)n,
1851 (GLuint *)arrays
1852 );
1853
1854exit:
1855 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001856 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001857 JNI_ABORT);
1858 }
1859 if (_exception) {
1860 jniThrowException(_env, _exceptionType, _exceptionMessage);
1861 }
1862}
1863
1864/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1865static void
1866android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
1867 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001868 jint _exception = 0;
1869 const char * _exceptionType = NULL;
1870 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001871 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001872 jint _bufferOffset = (jint) 0;
1873 jint _remaining;
1874 GLuint *arrays = (GLuint *) 0;
1875
Romain Guy84cac202016-12-05 12:26:02 -08001876 if (!arrays_buf) {
1877 _exception = 1;
1878 _exceptionType = "java/lang/IllegalArgumentException";
1879 _exceptionMessage = "arrays == null";
1880 goto exit;
1881 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001882 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001883 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001884 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001885 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1886 }
1887 glDeleteVertexArrays(
1888 (GLsizei)n,
1889 (GLuint *)arrays
1890 );
Romain Guy84cac202016-12-05 12:26:02 -08001891
1892exit:
Jesse Halld830e742013-03-29 11:02:35 -07001893 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001894 _env->ReleaseIntArrayElements(_array, (jint*)arrays, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001895 }
Romain Guy84cac202016-12-05 12:26:02 -08001896 if (_exception) {
1897 jniThrowException(_env, _exceptionType, _exceptionMessage);
1898 }
Jesse Halld830e742013-03-29 11:02:35 -07001899}
1900
1901/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1902static void
1903android_glGenVertexArrays__I_3II
1904 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1905 jint _exception = 0;
1906 const char * _exceptionType = NULL;
1907 const char * _exceptionMessage = NULL;
1908 GLuint *arrays_base = (GLuint *) 0;
1909 jint _remaining;
1910 GLuint *arrays = (GLuint *) 0;
1911
1912 if (!arrays_ref) {
1913 _exception = 1;
1914 _exceptionType = "java/lang/IllegalArgumentException";
1915 _exceptionMessage = "arrays == null";
1916 goto exit;
1917 }
1918 if (offset < 0) {
1919 _exception = 1;
1920 _exceptionType = "java/lang/IllegalArgumentException";
1921 _exceptionMessage = "offset < 0";
1922 goto exit;
1923 }
1924 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1925 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001926 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001927 arrays = arrays_base + offset;
1928
1929 glGenVertexArrays(
1930 (GLsizei)n,
1931 (GLuint *)arrays
1932 );
1933
1934exit:
1935 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001936 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001937 _exception ? JNI_ABORT: 0);
1938 }
1939 if (_exception) {
1940 jniThrowException(_env, _exceptionType, _exceptionMessage);
1941 }
1942}
1943
1944/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1945static void
1946android_glGenVertexArrays__ILjava_nio_IntBuffer_2
1947 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001948 jint _exception = 0;
1949 const char * _exceptionType = NULL;
1950 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001951 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001952 jint _bufferOffset = (jint) 0;
1953 jint _remaining;
1954 GLuint *arrays = (GLuint *) 0;
1955
Romain Guy84cac202016-12-05 12:26:02 -08001956 if (!arrays_buf) {
1957 _exception = 1;
1958 _exceptionType = "java/lang/IllegalArgumentException";
1959 _exceptionMessage = "arrays == null";
1960 goto exit;
1961 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001962 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001963 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001964 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001965 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1966 }
1967 glGenVertexArrays(
1968 (GLsizei)n,
1969 (GLuint *)arrays
1970 );
Romain Guy84cac202016-12-05 12:26:02 -08001971
1972exit:
Jesse Halld830e742013-03-29 11:02:35 -07001973 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001974 _env->ReleaseIntArrayElements(_array, (jint*)arrays, _exception ? JNI_ABORT : 0);
1975 }
1976 if (_exception) {
1977 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001978 }
1979}
1980
1981/* GLboolean glIsVertexArray ( GLuint array ) */
1982static jboolean
1983android_glIsVertexArray__I
1984 (JNIEnv *_env, jobject _this, jint array) {
1985 GLboolean _returnValue;
1986 _returnValue = glIsVertexArray(
1987 (GLuint)array
1988 );
1989 return (jboolean)_returnValue;
1990}
1991
1992/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
1993static void
1994android_glGetIntegeri_v__II_3II
1995 (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
1996 jint _exception = 0;
1997 const char * _exceptionType = NULL;
1998 const char * _exceptionMessage = NULL;
1999 GLint *data_base = (GLint *) 0;
2000 jint _remaining;
2001 GLint *data = (GLint *) 0;
2002
2003 if (!data_ref) {
2004 _exception = 1;
2005 _exceptionType = "java/lang/IllegalArgumentException";
2006 _exceptionMessage = "data == null";
2007 goto exit;
2008 }
2009 if (offset < 0) {
2010 _exception = 1;
2011 _exceptionType = "java/lang/IllegalArgumentException";
2012 _exceptionMessage = "offset < 0";
2013 goto exit;
2014 }
2015 _remaining = _env->GetArrayLength(data_ref) - offset;
2016 data_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002017 _env->GetIntArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002018 data = data_base + offset;
2019
2020 glGetIntegeri_v(
2021 (GLenum)target,
2022 (GLuint)index,
2023 (GLint *)data
2024 );
2025
2026exit:
2027 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002028 _env->ReleaseIntArrayElements(data_ref, (jint*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07002029 _exception ? JNI_ABORT: 0);
2030 }
2031 if (_exception) {
2032 jniThrowException(_env, _exceptionType, _exceptionMessage);
2033 }
2034}
2035
2036/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
2037static void
2038android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
2039 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002040 jint _exception = 0;
2041 const char * _exceptionType = NULL;
2042 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002043 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002044 jint _bufferOffset = (jint) 0;
2045 jint _remaining;
2046 GLint *data = (GLint *) 0;
2047
Romain Guy84cac202016-12-05 12:26:02 -08002048 if (!data_buf) {
2049 _exception = 1;
2050 _exceptionType = "java/lang/IllegalArgumentException";
2051 _exceptionMessage = "data == null";
2052 goto exit;
2053 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002054 data = (GLint *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002055 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002056 char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002057 data = (GLint *) (_dataBase + _bufferOffset);
2058 }
2059 glGetIntegeri_v(
2060 (GLenum)target,
2061 (GLuint)index,
2062 (GLint *)data
2063 );
Romain Guy84cac202016-12-05 12:26:02 -08002064
2065exit:
Jesse Halld830e742013-03-29 11:02:35 -07002066 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002067 _env->ReleaseIntArrayElements(_array, (jint*)data, _exception ? JNI_ABORT : 0);
2068 }
2069 if (_exception) {
2070 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002071 }
2072}
2073
2074/* void glBeginTransformFeedback ( GLenum primitiveMode ) */
2075static void
2076android_glBeginTransformFeedback__I
2077 (JNIEnv *_env, jobject _this, jint primitiveMode) {
2078 glBeginTransformFeedback(
2079 (GLenum)primitiveMode
2080 );
2081}
2082
2083/* void glEndTransformFeedback ( void ) */
2084static void
2085android_glEndTransformFeedback__
2086 (JNIEnv *_env, jobject _this) {
2087 glEndTransformFeedback();
2088}
2089
2090/* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
2091static void
2092android_glBindBufferRange__IIIII
2093 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
2094 glBindBufferRange(
2095 (GLenum)target,
2096 (GLuint)index,
2097 (GLuint)buffer,
2098 (GLintptr)offset,
2099 (GLsizeiptr)size
2100 );
2101}
2102
2103/* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
2104static void
2105android_glBindBufferBase__III
2106 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
2107 glBindBufferBase(
2108 (GLenum)target,
2109 (GLuint)index,
2110 (GLuint)buffer
2111 );
2112}
2113
2114/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
2115static
2116void
2117android_glTransformFeedbackVaryings
2118 (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
2119 jint _exception = 0;
2120 const char* _exceptionType = NULL;
2121 const char* _exceptionMessage = NULL;
2122 jint _count = 0, _i;
2123 const char** _varyings = NULL;
2124 const char* _varying = NULL;
2125
2126 if (!varyings_ref) {
2127 _exception = 1;
2128 _exceptionType = "java/lang/IllegalArgumentException";
2129 _exceptionMessage = "varyings == null";
2130 goto exit;
2131 }
2132
2133 _count = _env->GetArrayLength(varyings_ref);
2134 _varyings = (const char**)calloc(_count, sizeof(const char*));
2135 for (_i = 0; _i < _count; _i++) {
2136 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2137 if (!_varying) {
2138 _exception = 1;
2139 _exceptionType = "java/lang/IllegalArgumentException";
2140 _exceptionMessage = "null varyings element";
2141 goto exit;
2142 }
2143 _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
2144 }
2145
2146 glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
2147
2148exit:
2149 for (_i = _count - 1; _i >= 0; _i--) {
2150 if (_varyings[_i]) {
2151 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2152 if (_varying) {
2153 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
2154 }
2155 }
2156 }
2157 free(_varyings);
2158 if (_exception) {
2159 jniThrowException(_env, _exceptionType, _exceptionMessage);
2160 }
2161}
2162
2163/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2164static void
2165android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
2166 (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) {
2167 jint _exception = 0;
2168 const char * _exceptionType;
2169 const char * _exceptionMessage;
2170 GLsizei *length_base = (GLsizei *) 0;
2171 jint _lengthRemaining;
2172 GLsizei *length = (GLsizei *) 0;
2173 GLint *size_base = (GLint *) 0;
2174 jint _sizeRemaining;
2175 GLint *size = (GLint *) 0;
2176 GLenum *type_base = (GLenum *) 0;
2177 jint _typeRemaining;
2178 GLenum *type = (GLenum *) 0;
2179 char *name_base = (char *) 0;
2180 jint _nameRemaining;
2181 char *name = (char *) 0;
2182
Pablo Ceballos6aff9062015-10-01 18:35:39 -07002183 if (length_ref) {
2184 if (lengthOffset < 0) {
2185 _exception = 1;
2186 _exceptionType = "java/lang/IllegalArgumentException";
2187 _exceptionMessage = "lengthOffset < 0";
2188 goto exit;
2189 }
2190 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
2191 length_base = (GLsizei *)
2192 _env->GetIntArrayElements(length_ref, (jboolean *)0);
2193 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07002194 }
Jesse Halld830e742013-03-29 11:02:35 -07002195
2196 if (!size_ref) {
2197 _exception = 1;
2198 _exceptionType = "java/lang/IllegalArgumentException";
2199 _exceptionMessage = "size == null";
2200 goto exit;
2201 }
2202 if (sizeOffset < 0) {
2203 _exception = 1;
2204 _exceptionType = "java/lang/IllegalArgumentException";
2205 _exceptionMessage = "sizeOffset < 0";
2206 goto exit;
2207 }
2208 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2209 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002210 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002211 size = size_base + sizeOffset;
2212
2213 if (!type_ref) {
2214 _exception = 1;
2215 _exceptionType = "java/lang/IllegalArgumentException";
2216 _exceptionMessage = "type == null";
2217 goto exit;
2218 }
2219 if (typeOffset < 0) {
2220 _exception = 1;
2221 _exceptionType = "java/lang/IllegalArgumentException";
2222 _exceptionMessage = "typeOffset < 0";
2223 goto exit;
2224 }
2225 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2226 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002227 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002228 type = type_base + typeOffset;
2229
2230 if (!name_ref) {
2231 _exception = 1;
2232 _exceptionType = "java/lang/IllegalArgumentException";
2233 _exceptionMessage = "name == null";
2234 goto exit;
2235 }
2236 if (nameOffset < 0) {
2237 _exception = 1;
2238 _exceptionType = "java/lang/IllegalArgumentException";
2239 _exceptionMessage = "nameOffset < 0";
2240 goto exit;
2241 }
2242 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
2243 name_base = (char *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002244 _env->GetByteArrayElements(name_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002245 name = name_base + nameOffset;
2246
2247 glGetTransformFeedbackVarying(
2248 (GLuint)program,
2249 (GLuint)index,
2250 (GLsizei)bufsize,
2251 (GLsizei *)length,
2252 (GLint *)size,
2253 (GLenum *)type,
2254 (char *)name
2255 );
2256
2257exit:
2258 if (name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002259 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base,
Jesse Halld830e742013-03-29 11:02:35 -07002260 _exception ? JNI_ABORT: 0);
2261 }
2262 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002263 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002264 _exception ? JNI_ABORT: 0);
2265 }
2266 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002267 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002268 _exception ? JNI_ABORT: 0);
2269 }
2270 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002271 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07002272 _exception ? JNI_ABORT: 0);
2273 }
2274 if (_exception) {
2275 jniThrowException(_env, _exceptionType, _exceptionMessage);
2276 }
2277}
2278
2279/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2280static void
2281android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
2282 (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 -08002283 jniThrowException(_env, "java/lang/UnsupportedOperationException", "deprecated");
2284}
2285
2286/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2287static void
2288android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
2289 (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 -07002290 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002291 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002292 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002293 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002294 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002295 jint _typeBufferOffset = (jint) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002296 jbyteArray _nameArray = (jbyteArray)0;
2297 jint _nameBufferOffset = (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07002298 jint _lengthRemaining;
2299 GLsizei *length = (GLsizei *) 0;
2300 jint _sizeRemaining;
2301 GLint *size = (GLint *) 0;
2302 jint _typeRemaining;
2303 GLenum *type = (GLenum *) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002304 jint _nameRemaining;
2305 GLchar* name = (GLchar*)0;
2306
Jesse Halld830e742013-03-29 11:02:35 -07002307
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002308 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
2309 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2310 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002311 name = (GLchar*)getPointer(_env, name_buf, (jarray*)&_nameArray, &_nameRemaining, &_nameBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002312 if (length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002313 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002314 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
2315 }
2316 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002317 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002318 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2319 }
2320 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002321 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002322 type = (GLenum *) (_typeBase + _typeBufferOffset);
2323 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002324 if (name == NULL) {
2325 char* _nameBase = (char *)_env->GetByteArrayElements(_nameArray, (jboolean*)0);
2326 name = (GLchar *) (_nameBase + _nameBufferOffset);
2327 }
Jesse Halld830e742013-03-29 11:02:35 -07002328 glGetTransformFeedbackVarying(
2329 (GLuint)program,
2330 (GLuint)index,
2331 (GLsizei)bufsize,
2332 (GLsizei *)length,
2333 (GLint *)size,
2334 (GLenum *)type,
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002335 (GLchar*)name
Jesse Halld830e742013-03-29 11:02:35 -07002336 );
2337 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002338 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002339 }
2340 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002341 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002342 }
2343 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002344 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002345 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002346 if (_nameArray) {
2347 releaseArrayPointer<jbyteArray, jbyte*, ByteArrayReleaser>(_env, _nameArray, (jbyte*)name, JNI_TRUE);
2348 }
Jesse Halld830e742013-03-29 11:02:35 -07002349}
2350
2351/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2352static jstring
2353android_glGetTransformFeedbackVarying1
2354 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
2355 jint _exception = 0;
2356 const char * _exceptionType;
2357 const char * _exceptionMessage;
2358 GLint *size_base = (GLint *) 0;
2359 jint _sizeRemaining;
2360 GLint *size = (GLint *) 0;
2361 GLenum *type_base = (GLenum *) 0;
2362 jint _typeRemaining;
2363 GLenum *type = (GLenum *) 0;
2364
2365 jstring result = 0;
2366
2367 GLint len = 0;
2368 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2369 if (!len) {
2370 return _env->NewStringUTF("");
2371 }
2372 char* buf = (char*) malloc(len);
2373
2374 if (buf == NULL) {
2375 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2376 return NULL;
2377 }
2378 if (!size_ref) {
2379 _exception = 1;
2380 _exceptionType = "java/lang/IllegalArgumentException";
2381 _exceptionMessage = "size == null";
2382 goto exit;
2383 }
2384 if (sizeOffset < 0) {
2385 _exception = 1;
2386 _exceptionType = "java/lang/IllegalArgumentException";
2387 _exceptionMessage = "sizeOffset < 0";
2388 goto exit;
2389 }
2390 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2391 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002392 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002393 size = size_base + sizeOffset;
2394
2395 if (!type_ref) {
2396 _exception = 1;
2397 _exceptionType = "java/lang/IllegalArgumentException";
2398 _exceptionMessage = "type == null";
2399 goto exit;
2400 }
2401 if (typeOffset < 0) {
2402 _exception = 1;
2403 _exceptionType = "java/lang/IllegalArgumentException";
2404 _exceptionMessage = "typeOffset < 0";
2405 goto exit;
2406 }
2407 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2408 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002409 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002410 type = type_base + typeOffset;
2411
2412 glGetTransformFeedbackVarying(
2413 (GLuint)program,
2414 (GLuint)index,
2415 (GLsizei)len,
2416 NULL,
2417 (GLint *)size,
2418 (GLenum *)type,
2419 (char *)buf
2420 );
2421exit:
2422 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002423 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002424 _exception ? JNI_ABORT: 0);
2425 }
2426 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002427 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002428 _exception ? JNI_ABORT: 0);
2429 }
2430 if (_exception != 1) {
2431 result = _env->NewStringUTF(buf);
2432 }
2433 if (buf) {
2434 free(buf);
2435 }
2436 if (_exception) {
2437 jniThrowException(_env, _exceptionType, _exceptionMessage);
2438 }
2439 if (result == 0) {
2440 result = _env->NewStringUTF("");
2441 }
2442
2443 return result;
2444}
2445
2446/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2447static jstring
2448android_glGetTransformFeedbackVarying2
2449 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002450 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002451 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002452 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002453 jint _typeBufferOffset = (jint) 0;
2454 jint _lengthRemaining;
2455 GLsizei *length = (GLsizei *) 0;
2456 jint _sizeRemaining;
2457 GLint *size = (GLint *) 0;
2458 jint _typeRemaining;
2459 GLenum *type = (GLenum *) 0;
2460
2461 jstring result = 0;
2462
2463 GLint len = 0;
2464 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2465 if (!len) {
2466 return _env->NewStringUTF("");
2467 }
2468 char* buf = (char*) malloc(len);
2469
2470 if (buf == NULL) {
2471 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2472 return NULL;
2473 }
2474
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002475 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2476 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002477 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002478 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002479 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2480 }
2481 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002482 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002483 type = (GLenum *) (_typeBase + _typeBufferOffset);
2484 }
2485 glGetTransformFeedbackVarying(
2486 (GLuint)program,
2487 (GLuint)index,
2488 (GLsizei)len,
2489 NULL,
2490 (GLint *)size,
2491 (GLenum *)type,
2492 (char *)buf
2493 );
2494
2495 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002496 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002497 }
2498 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002499 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002500 }
2501 result = _env->NewStringUTF(buf);
2502 if (buf) {
2503 free(buf);
2504 }
2505 return result;
2506}
2507/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2508static void
2509android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
2510 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08002511 jint _exception = 0;
2512 const char * _exceptionType = NULL;
2513 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07002514 jarray _array = (jarray) 0;
2515 jint _bufferOffset = (jint) 0;
2516 jint _remaining;
2517 GLvoid *pointer = (GLvoid *) 0;
2518
2519 if (pointer_buf) {
2520 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2521 if ( ! pointer ) {
2522 return;
2523 }
2524 }
2525 glVertexAttribIPointerBounds(
2526 (GLuint)index,
2527 (GLint)size,
2528 (GLenum)type,
2529 (GLsizei)stride,
2530 (GLvoid *)pointer,
2531 (GLsizei)remaining
2532 );
Romain Guy84cac202016-12-05 12:26:02 -08002533 if (_exception) {
2534 jniThrowException(_env, _exceptionType, _exceptionMessage);
2535 }
Jesse Halld830e742013-03-29 11:02:35 -07002536}
2537
2538/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
2539static void
2540android_glVertexAttribIPointer__IIIII
2541 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
2542 glVertexAttribIPointer(
2543 (GLuint)index,
2544 (GLint)size,
2545 (GLenum)type,
2546 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00002547 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -07002548 );
2549}
2550
2551/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2552static void
2553android_glGetVertexAttribIiv__II_3II
2554 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2555 jint _exception = 0;
2556 const char * _exceptionType = NULL;
2557 const char * _exceptionMessage = NULL;
2558 GLint *params_base = (GLint *) 0;
2559 jint _remaining;
2560 GLint *params = (GLint *) 0;
2561
2562 if (!params_ref) {
2563 _exception = 1;
2564 _exceptionType = "java/lang/IllegalArgumentException";
2565 _exceptionMessage = "params == null";
2566 goto exit;
2567 }
2568 if (offset < 0) {
2569 _exception = 1;
2570 _exceptionType = "java/lang/IllegalArgumentException";
2571 _exceptionMessage = "offset < 0";
2572 goto exit;
2573 }
2574 _remaining = _env->GetArrayLength(params_ref) - offset;
2575 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002576 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002577 params = params_base + offset;
2578
2579 glGetVertexAttribIiv(
2580 (GLuint)index,
2581 (GLenum)pname,
2582 (GLint *)params
2583 );
2584
2585exit:
2586 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002587 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002588 _exception ? JNI_ABORT: 0);
2589 }
2590 if (_exception) {
2591 jniThrowException(_env, _exceptionType, _exceptionMessage);
2592 }
2593}
2594
2595/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2596static void
2597android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
2598 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002599 jint _exception = 0;
2600 const char * _exceptionType = NULL;
2601 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002602 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002603 jint _bufferOffset = (jint) 0;
2604 jint _remaining;
2605 GLint *params = (GLint *) 0;
2606
Romain Guy84cac202016-12-05 12:26:02 -08002607 if (!params_buf) {
2608 _exception = 1;
2609 _exceptionType = "java/lang/IllegalArgumentException";
2610 _exceptionMessage = "params == null";
2611 goto exit;
2612 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002613 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002614 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002615 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002616 params = (GLint *) (_paramsBase + _bufferOffset);
2617 }
2618 glGetVertexAttribIiv(
2619 (GLuint)index,
2620 (GLenum)pname,
2621 (GLint *)params
2622 );
Romain Guy84cac202016-12-05 12:26:02 -08002623
2624exit:
Jesse Halld830e742013-03-29 11:02:35 -07002625 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002626 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2627 }
2628 if (_exception) {
2629 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002630 }
2631}
2632
2633/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2634static void
2635android_glGetVertexAttribIuiv__II_3II
2636 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2637 jint _exception = 0;
2638 const char * _exceptionType = NULL;
2639 const char * _exceptionMessage = NULL;
2640 GLuint *params_base = (GLuint *) 0;
2641 jint _remaining;
2642 GLuint *params = (GLuint *) 0;
2643
2644 if (!params_ref) {
2645 _exception = 1;
2646 _exceptionType = "java/lang/IllegalArgumentException";
2647 _exceptionMessage = "params == null";
2648 goto exit;
2649 }
2650 if (offset < 0) {
2651 _exception = 1;
2652 _exceptionType = "java/lang/IllegalArgumentException";
2653 _exceptionMessage = "offset < 0";
2654 goto exit;
2655 }
2656 _remaining = _env->GetArrayLength(params_ref) - offset;
2657 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002658 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002659 params = params_base + offset;
2660
2661 glGetVertexAttribIuiv(
2662 (GLuint)index,
2663 (GLenum)pname,
2664 (GLuint *)params
2665 );
2666
2667exit:
2668 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002669 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002670 _exception ? JNI_ABORT: 0);
2671 }
2672 if (_exception) {
2673 jniThrowException(_env, _exceptionType, _exceptionMessage);
2674 }
2675}
2676
2677/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2678static void
2679android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
2680 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002681 jint _exception = 0;
2682 const char * _exceptionType = NULL;
2683 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002684 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002685 jint _bufferOffset = (jint) 0;
2686 jint _remaining;
2687 GLuint *params = (GLuint *) 0;
2688
Romain Guy84cac202016-12-05 12:26:02 -08002689 if (!params_buf) {
2690 _exception = 1;
2691 _exceptionType = "java/lang/IllegalArgumentException";
2692 _exceptionMessage = "params == null";
2693 goto exit;
2694 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002695 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002696 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002697 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002698 params = (GLuint *) (_paramsBase + _bufferOffset);
2699 }
2700 glGetVertexAttribIuiv(
2701 (GLuint)index,
2702 (GLenum)pname,
2703 (GLuint *)params
2704 );
Romain Guy84cac202016-12-05 12:26:02 -08002705
2706exit:
Jesse Halld830e742013-03-29 11:02:35 -07002707 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002708 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2709 }
2710 if (_exception) {
2711 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002712 }
2713}
2714
2715/* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
2716static void
2717android_glVertexAttribI4i__IIIII
2718 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2719 glVertexAttribI4i(
2720 (GLuint)index,
2721 (GLint)x,
2722 (GLint)y,
2723 (GLint)z,
2724 (GLint)w
2725 );
2726}
2727
2728/* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
2729static void
2730android_glVertexAttribI4ui__IIIII
2731 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2732 glVertexAttribI4ui(
2733 (GLuint)index,
2734 (GLuint)x,
2735 (GLuint)y,
2736 (GLuint)z,
2737 (GLuint)w
2738 );
2739}
2740
2741/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2742static void
2743android_glVertexAttribI4iv__I_3II
2744 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2745 jint _exception = 0;
2746 const char * _exceptionType = NULL;
2747 const char * _exceptionMessage = NULL;
2748 GLint *v_base = (GLint *) 0;
2749 jint _remaining;
2750 GLint *v = (GLint *) 0;
2751
2752 if (!v_ref) {
2753 _exception = 1;
2754 _exceptionType = "java/lang/IllegalArgumentException";
2755 _exceptionMessage = "v == null";
2756 goto exit;
2757 }
2758 if (offset < 0) {
2759 _exception = 1;
2760 _exceptionType = "java/lang/IllegalArgumentException";
2761 _exceptionMessage = "offset < 0";
2762 goto exit;
2763 }
2764 _remaining = _env->GetArrayLength(v_ref) - offset;
2765 v_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002766 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002767 v = v_base + offset;
2768
2769 glVertexAttribI4iv(
2770 (GLuint)index,
2771 (GLint *)v
2772 );
2773
2774exit:
2775 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002776 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002777 JNI_ABORT);
2778 }
2779 if (_exception) {
2780 jniThrowException(_env, _exceptionType, _exceptionMessage);
2781 }
2782}
2783
2784/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2785static void
2786android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
2787 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002788 jint _exception = 0;
2789 const char * _exceptionType = NULL;
2790 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002791 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002792 jint _bufferOffset = (jint) 0;
2793 jint _remaining;
2794 GLint *v = (GLint *) 0;
2795
Romain Guy84cac202016-12-05 12:26:02 -08002796 if (!v_buf) {
2797 _exception = 1;
2798 _exceptionType = "java/lang/IllegalArgumentException";
2799 _exceptionMessage = "v == null";
2800 goto exit;
2801 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002802 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002803 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002804 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002805 v = (GLint *) (_vBase + _bufferOffset);
2806 }
2807 glVertexAttribI4iv(
2808 (GLuint)index,
2809 (GLint *)v
2810 );
Romain Guy84cac202016-12-05 12:26:02 -08002811
2812exit:
Jesse Halld830e742013-03-29 11:02:35 -07002813 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002814 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002815 }
Romain Guy84cac202016-12-05 12:26:02 -08002816 if (_exception) {
2817 jniThrowException(_env, _exceptionType, _exceptionMessage);
2818 }
Jesse Halld830e742013-03-29 11:02:35 -07002819}
2820
2821/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2822static void
2823android_glVertexAttribI4uiv__I_3II
2824 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2825 jint _exception = 0;
2826 const char * _exceptionType = NULL;
2827 const char * _exceptionMessage = NULL;
2828 GLuint *v_base = (GLuint *) 0;
2829 jint _remaining;
2830 GLuint *v = (GLuint *) 0;
2831
2832 if (!v_ref) {
2833 _exception = 1;
2834 _exceptionType = "java/lang/IllegalArgumentException";
2835 _exceptionMessage = "v == null";
2836 goto exit;
2837 }
2838 if (offset < 0) {
2839 _exception = 1;
2840 _exceptionType = "java/lang/IllegalArgumentException";
2841 _exceptionMessage = "offset < 0";
2842 goto exit;
2843 }
2844 _remaining = _env->GetArrayLength(v_ref) - offset;
2845 v_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002846 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002847 v = v_base + offset;
2848
2849 glVertexAttribI4uiv(
2850 (GLuint)index,
2851 (GLuint *)v
2852 );
2853
2854exit:
2855 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002856 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002857 JNI_ABORT);
2858 }
2859 if (_exception) {
2860 jniThrowException(_env, _exceptionType, _exceptionMessage);
2861 }
2862}
2863
2864/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2865static void
2866android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
2867 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002868 jint _exception = 0;
2869 const char * _exceptionType = NULL;
2870 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002871 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002872 jint _bufferOffset = (jint) 0;
2873 jint _remaining;
2874 GLuint *v = (GLuint *) 0;
2875
Romain Guy84cac202016-12-05 12:26:02 -08002876 if (!v_buf) {
2877 _exception = 1;
2878 _exceptionType = "java/lang/IllegalArgumentException";
2879 _exceptionMessage = "v == null";
2880 goto exit;
2881 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002882 v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002883 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002884 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002885 v = (GLuint *) (_vBase + _bufferOffset);
2886 }
2887 glVertexAttribI4uiv(
2888 (GLuint)index,
2889 (GLuint *)v
2890 );
Romain Guy84cac202016-12-05 12:26:02 -08002891
2892exit:
Jesse Halld830e742013-03-29 11:02:35 -07002893 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002894 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002895 }
Romain Guy84cac202016-12-05 12:26:02 -08002896 if (_exception) {
2897 jniThrowException(_env, _exceptionType, _exceptionMessage);
2898 }
Jesse Halld830e742013-03-29 11:02:35 -07002899}
2900
2901/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2902static void
2903android_glGetUniformuiv__II_3II
2904 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
2905 jint _exception = 0;
2906 const char * _exceptionType = NULL;
2907 const char * _exceptionMessage = NULL;
2908 GLuint *params_base = (GLuint *) 0;
2909 jint _remaining;
2910 GLuint *params = (GLuint *) 0;
2911
2912 if (!params_ref) {
2913 _exception = 1;
2914 _exceptionType = "java/lang/IllegalArgumentException";
2915 _exceptionMessage = "params == null";
2916 goto exit;
2917 }
2918 if (offset < 0) {
2919 _exception = 1;
2920 _exceptionType = "java/lang/IllegalArgumentException";
2921 _exceptionMessage = "offset < 0";
2922 goto exit;
2923 }
2924 _remaining = _env->GetArrayLength(params_ref) - offset;
2925 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002926 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002927 params = params_base + offset;
2928
2929 glGetUniformuiv(
2930 (GLuint)program,
2931 (GLint)location,
2932 (GLuint *)params
2933 );
2934
2935exit:
2936 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002937 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002938 _exception ? JNI_ABORT: 0);
2939 }
2940 if (_exception) {
2941 jniThrowException(_env, _exceptionType, _exceptionMessage);
2942 }
2943}
2944
2945/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2946static void
2947android_glGetUniformuiv__IILjava_nio_IntBuffer_2
2948 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002949 jint _exception = 0;
2950 const char * _exceptionType = NULL;
2951 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002952 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002953 jint _bufferOffset = (jint) 0;
2954 jint _remaining;
2955 GLuint *params = (GLuint *) 0;
2956
Romain Guy84cac202016-12-05 12:26:02 -08002957 if (!params_buf) {
2958 _exception = 1;
2959 _exceptionType = "java/lang/IllegalArgumentException";
2960 _exceptionMessage = "params == null";
2961 goto exit;
2962 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002963 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002964 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002965 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002966 params = (GLuint *) (_paramsBase + _bufferOffset);
2967 }
2968 glGetUniformuiv(
2969 (GLuint)program,
2970 (GLint)location,
2971 (GLuint *)params
2972 );
Romain Guy84cac202016-12-05 12:26:02 -08002973
2974exit:
Jesse Halld830e742013-03-29 11:02:35 -07002975 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002976 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2977 }
2978 if (_exception) {
2979 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002980 }
2981}
2982
2983/* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
2984static jint
2985android_glGetFragDataLocation__ILjava_lang_String_2
2986 (JNIEnv *_env, jobject _this, jint program, jstring name) {
2987 jint _exception = 0;
2988 const char * _exceptionType = NULL;
2989 const char * _exceptionMessage = NULL;
2990 GLint _returnValue = 0;
2991 const char* _nativename = 0;
2992
2993 if (!name) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07002994 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07002995 _exceptionType = "java/lang/IllegalArgumentException";
2996 _exceptionMessage = "name == null";
2997 goto exit;
2998 }
2999 _nativename = _env->GetStringUTFChars(name, 0);
3000
3001 _returnValue = glGetFragDataLocation(
3002 (GLuint)program,
3003 (GLchar *)_nativename
3004 );
3005
3006exit:
3007 if (_nativename) {
3008 _env->ReleaseStringUTFChars(name, _nativename);
3009 }
3010
3011 if (_exception) {
3012 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00003013 return (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07003014 }
3015 return (jint)_returnValue;
3016}
3017
3018/* void glUniform1ui ( GLint location, GLuint v0 ) */
3019static void
3020android_glUniform1ui__II
3021 (JNIEnv *_env, jobject _this, jint location, jint v0) {
3022 glUniform1ui(
3023 (GLint)location,
3024 (GLuint)v0
3025 );
3026}
3027
3028/* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
3029static void
3030android_glUniform2ui__III
3031 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
3032 glUniform2ui(
3033 (GLint)location,
3034 (GLuint)v0,
3035 (GLuint)v1
3036 );
3037}
3038
3039/* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
3040static void
3041android_glUniform3ui__IIII
3042 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
3043 glUniform3ui(
3044 (GLint)location,
3045 (GLuint)v0,
3046 (GLuint)v1,
3047 (GLuint)v2
3048 );
3049}
3050
3051/* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
3052static void
3053android_glUniform4ui__IIIII
3054 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
3055 glUniform4ui(
3056 (GLint)location,
3057 (GLuint)v0,
3058 (GLuint)v1,
3059 (GLuint)v2,
3060 (GLuint)v3
3061 );
3062}
3063
3064/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3065static void
3066android_glUniform1uiv__II_3II
3067 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3068 jint _exception = 0;
3069 const char * _exceptionType = NULL;
3070 const char * _exceptionMessage = NULL;
3071 GLuint *value_base = (GLuint *) 0;
3072 jint _remaining;
3073 GLuint *value = (GLuint *) 0;
3074
3075 if (!value_ref) {
3076 _exception = 1;
3077 _exceptionType = "java/lang/IllegalArgumentException";
3078 _exceptionMessage = "value == null";
3079 goto exit;
3080 }
3081 if (offset < 0) {
3082 _exception = 1;
3083 _exceptionType = "java/lang/IllegalArgumentException";
3084 _exceptionMessage = "offset < 0";
3085 goto exit;
3086 }
3087 _remaining = _env->GetArrayLength(value_ref) - offset;
3088 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003089 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003090 value = value_base + offset;
3091
3092 glUniform1uiv(
3093 (GLint)location,
3094 (GLsizei)count,
3095 (GLuint *)value
3096 );
3097
3098exit:
3099 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003100 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003101 JNI_ABORT);
3102 }
3103 if (_exception) {
3104 jniThrowException(_env, _exceptionType, _exceptionMessage);
3105 }
3106}
3107
3108/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3109static void
3110android_glUniform1uiv__IILjava_nio_IntBuffer_2
3111 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003112 jint _exception = 0;
3113 const char * _exceptionType = NULL;
3114 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003115 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003116 jint _bufferOffset = (jint) 0;
3117 jint _remaining;
3118 GLuint *value = (GLuint *) 0;
3119
Romain Guy84cac202016-12-05 12:26:02 -08003120 if (!value_buf) {
3121 _exception = 1;
3122 _exceptionType = "java/lang/IllegalArgumentException";
3123 _exceptionMessage = "value == null";
3124 goto exit;
3125 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003126 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003127 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003128 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003129 value = (GLuint *) (_valueBase + _bufferOffset);
3130 }
3131 glUniform1uiv(
3132 (GLint)location,
3133 (GLsizei)count,
3134 (GLuint *)value
3135 );
Romain Guy84cac202016-12-05 12:26:02 -08003136
3137exit:
Jesse Halld830e742013-03-29 11:02:35 -07003138 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003139 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003140 }
Romain Guy84cac202016-12-05 12:26:02 -08003141 if (_exception) {
3142 jniThrowException(_env, _exceptionType, _exceptionMessage);
3143 }
Jesse Halld830e742013-03-29 11:02:35 -07003144}
3145
3146/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3147static void
3148android_glUniform2uiv__II_3II
3149 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3150 jint _exception = 0;
3151 const char * _exceptionType = NULL;
3152 const char * _exceptionMessage = NULL;
3153 GLuint *value_base = (GLuint *) 0;
3154 jint _remaining;
3155 GLuint *value = (GLuint *) 0;
3156
3157 if (!value_ref) {
3158 _exception = 1;
3159 _exceptionType = "java/lang/IllegalArgumentException";
3160 _exceptionMessage = "value == null";
3161 goto exit;
3162 }
3163 if (offset < 0) {
3164 _exception = 1;
3165 _exceptionType = "java/lang/IllegalArgumentException";
3166 _exceptionMessage = "offset < 0";
3167 goto exit;
3168 }
3169 _remaining = _env->GetArrayLength(value_ref) - offset;
3170 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003171 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003172 value = value_base + offset;
3173
3174 glUniform2uiv(
3175 (GLint)location,
3176 (GLsizei)count,
3177 (GLuint *)value
3178 );
3179
3180exit:
3181 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003182 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003183 JNI_ABORT);
3184 }
3185 if (_exception) {
3186 jniThrowException(_env, _exceptionType, _exceptionMessage);
3187 }
3188}
3189
3190/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3191static void
3192android_glUniform2uiv__IILjava_nio_IntBuffer_2
3193 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003194 jint _exception = 0;
3195 const char * _exceptionType = NULL;
3196 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003197 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003198 jint _bufferOffset = (jint) 0;
3199 jint _remaining;
3200 GLuint *value = (GLuint *) 0;
3201
Romain Guy84cac202016-12-05 12:26:02 -08003202 if (!value_buf) {
3203 _exception = 1;
3204 _exceptionType = "java/lang/IllegalArgumentException";
3205 _exceptionMessage = "value == null";
3206 goto exit;
3207 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003208 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003209 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003210 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003211 value = (GLuint *) (_valueBase + _bufferOffset);
3212 }
3213 glUniform2uiv(
3214 (GLint)location,
3215 (GLsizei)count,
3216 (GLuint *)value
3217 );
Romain Guy84cac202016-12-05 12:26:02 -08003218
3219exit:
Jesse Halld830e742013-03-29 11:02:35 -07003220 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003221 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003222 }
Romain Guy84cac202016-12-05 12:26:02 -08003223 if (_exception) {
3224 jniThrowException(_env, _exceptionType, _exceptionMessage);
3225 }
Jesse Halld830e742013-03-29 11:02:35 -07003226}
3227
3228/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3229static void
3230android_glUniform3uiv__II_3II
3231 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3232 jint _exception = 0;
3233 const char * _exceptionType = NULL;
3234 const char * _exceptionMessage = NULL;
3235 GLuint *value_base = (GLuint *) 0;
3236 jint _remaining;
3237 GLuint *value = (GLuint *) 0;
3238
3239 if (!value_ref) {
3240 _exception = 1;
3241 _exceptionType = "java/lang/IllegalArgumentException";
3242 _exceptionMessage = "value == null";
3243 goto exit;
3244 }
3245 if (offset < 0) {
3246 _exception = 1;
3247 _exceptionType = "java/lang/IllegalArgumentException";
3248 _exceptionMessage = "offset < 0";
3249 goto exit;
3250 }
3251 _remaining = _env->GetArrayLength(value_ref) - offset;
3252 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003253 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003254 value = value_base + offset;
3255
3256 glUniform3uiv(
3257 (GLint)location,
3258 (GLsizei)count,
3259 (GLuint *)value
3260 );
3261
3262exit:
3263 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003264 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003265 JNI_ABORT);
3266 }
3267 if (_exception) {
3268 jniThrowException(_env, _exceptionType, _exceptionMessage);
3269 }
3270}
3271
3272/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3273static void
3274android_glUniform3uiv__IILjava_nio_IntBuffer_2
3275 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003276 jint _exception = 0;
3277 const char * _exceptionType = NULL;
3278 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003279 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003280 jint _bufferOffset = (jint) 0;
3281 jint _remaining;
3282 GLuint *value = (GLuint *) 0;
3283
Romain Guy84cac202016-12-05 12:26:02 -08003284 if (!value_buf) {
3285 _exception = 1;
3286 _exceptionType = "java/lang/IllegalArgumentException";
3287 _exceptionMessage = "value == null";
3288 goto exit;
3289 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003290 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003291 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003292 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003293 value = (GLuint *) (_valueBase + _bufferOffset);
3294 }
3295 glUniform3uiv(
3296 (GLint)location,
3297 (GLsizei)count,
3298 (GLuint *)value
3299 );
Romain Guy84cac202016-12-05 12:26:02 -08003300
3301exit:
Jesse Halld830e742013-03-29 11:02:35 -07003302 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003303 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003304 }
Romain Guy84cac202016-12-05 12:26:02 -08003305 if (_exception) {
3306 jniThrowException(_env, _exceptionType, _exceptionMessage);
3307 }
Jesse Halld830e742013-03-29 11:02:35 -07003308}
3309
3310/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3311static void
3312android_glUniform4uiv__II_3II
3313 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3314 jint _exception = 0;
3315 const char * _exceptionType = NULL;
3316 const char * _exceptionMessage = NULL;
3317 GLuint *value_base = (GLuint *) 0;
3318 jint _remaining;
3319 GLuint *value = (GLuint *) 0;
3320
3321 if (!value_ref) {
3322 _exception = 1;
3323 _exceptionType = "java/lang/IllegalArgumentException";
3324 _exceptionMessage = "value == null";
3325 goto exit;
3326 }
3327 if (offset < 0) {
3328 _exception = 1;
3329 _exceptionType = "java/lang/IllegalArgumentException";
3330 _exceptionMessage = "offset < 0";
3331 goto exit;
3332 }
3333 _remaining = _env->GetArrayLength(value_ref) - offset;
3334 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003335 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003336 value = value_base + offset;
3337
3338 glUniform4uiv(
3339 (GLint)location,
3340 (GLsizei)count,
3341 (GLuint *)value
3342 );
3343
3344exit:
3345 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003346 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003347 JNI_ABORT);
3348 }
3349 if (_exception) {
3350 jniThrowException(_env, _exceptionType, _exceptionMessage);
3351 }
3352}
3353
3354/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3355static void
3356android_glUniform4uiv__IILjava_nio_IntBuffer_2
3357 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003358 jint _exception = 0;
3359 const char * _exceptionType = NULL;
3360 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003361 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003362 jint _bufferOffset = (jint) 0;
3363 jint _remaining;
3364 GLuint *value = (GLuint *) 0;
3365
Romain Guy84cac202016-12-05 12:26:02 -08003366 if (!value_buf) {
3367 _exception = 1;
3368 _exceptionType = "java/lang/IllegalArgumentException";
3369 _exceptionMessage = "value == null";
3370 goto exit;
3371 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003372 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003373 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003374 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003375 value = (GLuint *) (_valueBase + _bufferOffset);
3376 }
3377 glUniform4uiv(
3378 (GLint)location,
3379 (GLsizei)count,
3380 (GLuint *)value
3381 );
Romain Guy84cac202016-12-05 12:26:02 -08003382
3383exit:
Jesse Halld830e742013-03-29 11:02:35 -07003384 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003385 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003386 }
Romain Guy84cac202016-12-05 12:26:02 -08003387 if (_exception) {
3388 jniThrowException(_env, _exceptionType, _exceptionMessage);
3389 }
Jesse Halld830e742013-03-29 11:02:35 -07003390}
3391
3392/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3393static void
3394android_glClearBufferiv__II_3II
3395 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3396 jint _exception = 0;
3397 const char * _exceptionType = NULL;
3398 const char * _exceptionMessage = NULL;
3399 GLint *value_base = (GLint *) 0;
3400 jint _remaining;
3401 GLint *value = (GLint *) 0;
3402
3403 if (!value_ref) {
3404 _exception = 1;
3405 _exceptionType = "java/lang/IllegalArgumentException";
3406 _exceptionMessage = "value == null";
3407 goto exit;
3408 }
3409 if (offset < 0) {
3410 _exception = 1;
3411 _exceptionType = "java/lang/IllegalArgumentException";
3412 _exceptionMessage = "offset < 0";
3413 goto exit;
3414 }
3415 _remaining = _env->GetArrayLength(value_ref) - offset;
3416 value_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003417 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003418 value = value_base + offset;
3419
3420 glClearBufferiv(
3421 (GLenum)buffer,
3422 (GLint)drawbuffer,
3423 (GLint *)value
3424 );
3425
3426exit:
3427 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003428 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003429 JNI_ABORT);
3430 }
3431 if (_exception) {
3432 jniThrowException(_env, _exceptionType, _exceptionMessage);
3433 }
3434}
3435
3436/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3437static void
3438android_glClearBufferiv__IILjava_nio_IntBuffer_2
3439 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003440 jint _exception = 0;
3441 const char * _exceptionType = NULL;
3442 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003443 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003444 jint _bufferOffset = (jint) 0;
3445 jint _remaining;
3446 GLint *value = (GLint *) 0;
3447
Romain Guy84cac202016-12-05 12:26:02 -08003448 if (!value_buf) {
3449 _exception = 1;
3450 _exceptionType = "java/lang/IllegalArgumentException";
3451 _exceptionMessage = "value == null";
3452 goto exit;
3453 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003454 value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003455 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003456 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003457 value = (GLint *) (_valueBase + _bufferOffset);
3458 }
3459 glClearBufferiv(
3460 (GLenum)buffer,
3461 (GLint)drawbuffer,
3462 (GLint *)value
3463 );
Romain Guy84cac202016-12-05 12:26:02 -08003464
3465exit:
Jesse Halld830e742013-03-29 11:02:35 -07003466 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003467 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003468 }
Romain Guy84cac202016-12-05 12:26:02 -08003469 if (_exception) {
3470 jniThrowException(_env, _exceptionType, _exceptionMessage);
3471 }
Jesse Halld830e742013-03-29 11:02:35 -07003472}
3473
3474/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3475static void
3476android_glClearBufferuiv__II_3II
3477 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3478 jint _exception = 0;
3479 const char * _exceptionType = NULL;
3480 const char * _exceptionMessage = NULL;
3481 GLuint *value_base = (GLuint *) 0;
3482 jint _remaining;
3483 GLuint *value = (GLuint *) 0;
3484
3485 if (!value_ref) {
3486 _exception = 1;
3487 _exceptionType = "java/lang/IllegalArgumentException";
3488 _exceptionMessage = "value == null";
3489 goto exit;
3490 }
3491 if (offset < 0) {
3492 _exception = 1;
3493 _exceptionType = "java/lang/IllegalArgumentException";
3494 _exceptionMessage = "offset < 0";
3495 goto exit;
3496 }
3497 _remaining = _env->GetArrayLength(value_ref) - offset;
3498 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003499 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003500 value = value_base + offset;
3501
3502 glClearBufferuiv(
3503 (GLenum)buffer,
3504 (GLint)drawbuffer,
3505 (GLuint *)value
3506 );
3507
3508exit:
3509 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003510 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003511 JNI_ABORT);
3512 }
3513 if (_exception) {
3514 jniThrowException(_env, _exceptionType, _exceptionMessage);
3515 }
3516}
3517
3518/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3519static void
3520android_glClearBufferuiv__IILjava_nio_IntBuffer_2
3521 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003522 jint _exception = 0;
3523 const char * _exceptionType = NULL;
3524 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003525 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003526 jint _bufferOffset = (jint) 0;
3527 jint _remaining;
3528 GLuint *value = (GLuint *) 0;
3529
Romain Guy84cac202016-12-05 12:26:02 -08003530 if (!value_buf) {
3531 _exception = 1;
3532 _exceptionType = "java/lang/IllegalArgumentException";
3533 _exceptionMessage = "value == null";
3534 goto exit;
3535 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003536 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003537 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003538 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003539 value = (GLuint *) (_valueBase + _bufferOffset);
3540 }
3541 glClearBufferuiv(
3542 (GLenum)buffer,
3543 (GLint)drawbuffer,
3544 (GLuint *)value
3545 );
Romain Guy84cac202016-12-05 12:26:02 -08003546
3547exit:
Jesse Halld830e742013-03-29 11:02:35 -07003548 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003549 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003550 }
Romain Guy84cac202016-12-05 12:26:02 -08003551 if (_exception) {
3552 jniThrowException(_env, _exceptionType, _exceptionMessage);
3553 }
Jesse Halld830e742013-03-29 11:02:35 -07003554}
3555
3556/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3557static void
3558android_glClearBufferfv__II_3FI
3559 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
3560 jint _exception = 0;
3561 const char * _exceptionType = NULL;
3562 const char * _exceptionMessage = NULL;
3563 GLfloat *value_base = (GLfloat *) 0;
3564 jint _remaining;
3565 GLfloat *value = (GLfloat *) 0;
3566
3567 if (!value_ref) {
3568 _exception = 1;
3569 _exceptionType = "java/lang/IllegalArgumentException";
3570 _exceptionMessage = "value == null";
3571 goto exit;
3572 }
3573 if (offset < 0) {
3574 _exception = 1;
3575 _exceptionType = "java/lang/IllegalArgumentException";
3576 _exceptionMessage = "offset < 0";
3577 goto exit;
3578 }
3579 _remaining = _env->GetArrayLength(value_ref) - offset;
3580 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003581 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003582 value = value_base + offset;
3583
3584 glClearBufferfv(
3585 (GLenum)buffer,
3586 (GLint)drawbuffer,
3587 (GLfloat *)value
3588 );
3589
3590exit:
3591 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003592 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003593 JNI_ABORT);
3594 }
3595 if (_exception) {
3596 jniThrowException(_env, _exceptionType, _exceptionMessage);
3597 }
3598}
3599
3600/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3601static void
3602android_glClearBufferfv__IILjava_nio_FloatBuffer_2
3603 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003604 jint _exception = 0;
3605 const char * _exceptionType = NULL;
3606 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003607 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003608 jint _bufferOffset = (jint) 0;
3609 jint _remaining;
3610 GLfloat *value = (GLfloat *) 0;
3611
Romain Guy84cac202016-12-05 12:26:02 -08003612 if (!value_buf) {
3613 _exception = 1;
3614 _exceptionType = "java/lang/IllegalArgumentException";
3615 _exceptionMessage = "value == null";
3616 goto exit;
3617 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003618 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003619 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003620 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003621 value = (GLfloat *) (_valueBase + _bufferOffset);
3622 }
3623 glClearBufferfv(
3624 (GLenum)buffer,
3625 (GLint)drawbuffer,
3626 (GLfloat *)value
3627 );
Romain Guy84cac202016-12-05 12:26:02 -08003628
3629exit:
Jesse Halld830e742013-03-29 11:02:35 -07003630 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003631 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003632 }
Romain Guy84cac202016-12-05 12:26:02 -08003633 if (_exception) {
3634 jniThrowException(_env, _exceptionType, _exceptionMessage);
3635 }
Jesse Halld830e742013-03-29 11:02:35 -07003636}
3637
3638/* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
3639static void
3640android_glClearBufferfi__IIFI
3641 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
3642 glClearBufferfi(
3643 (GLenum)buffer,
3644 (GLint)drawbuffer,
3645 (GLfloat)depth,
3646 (GLint)stencil
3647 );
3648}
3649
3650/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
3651static jstring
3652android_glGetStringi__II
3653 (JNIEnv *_env, jobject _this, jint name, jint index) {
3654 const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
3655 return _env->NewStringUTF((const char*)_chars);
3656}
3657
3658/* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
3659static void
3660android_glCopyBufferSubData__IIIII
3661 (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
3662 glCopyBufferSubData(
3663 (GLenum)readTarget,
3664 (GLenum)writeTarget,
3665 (GLintptr)readOffset,
3666 (GLintptr)writeOffset,
3667 (GLsizeiptr)size
3668 );
3669}
3670
3671/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3672static
3673void
3674android_glGetUniformIndices_array
3675 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
3676 jint _exception = 0;
3677 const char* _exceptionType = NULL;
3678 const char* _exceptionMessage = NULL;
3679 jint _count = 0;
3680 jint _i;
3681 const char** _names = NULL;
3682 GLuint* _indices_base = NULL;
3683 GLuint* _indices = NULL;
3684
3685 if (!uniformNames_ref) {
3686 _exception = 1;
3687 _exceptionType = "java/lang/IllegalArgumentException";
3688 _exceptionMessage = "uniformNames == null";
3689 goto exit;
3690 }
3691 _count = _env->GetArrayLength(uniformNames_ref);
3692 _names = (const char**)calloc(_count, sizeof(const char*));
3693 for (_i = 0; _i < _count; _i++) {
3694 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3695 if (!_name) {
3696 _exception = 1;
3697 _exceptionType = "java/lang/IllegalArgumentException";
3698 _exceptionMessage = "null uniformNames element";
3699 goto exit;
3700 }
3701 _names[_i] = _env->GetStringUTFChars(_name, 0);
3702 }
3703
3704 if (!uniformIndices_ref) {
3705 _exception = 1;
3706 _exceptionType = "java/lang/IllegalArgumentException";
3707 _exceptionMessage = "uniformIndices == null";
3708 goto exit;
3709 }
3710 if (uniformIndicesOffset < 0) {
3711 _exception = 1;
3712 _exceptionType = "java/lang/IllegalArgumentException";
3713 _exceptionMessage = "uniformIndicesOffset < 0";
3714 goto exit;
3715 }
3716 if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
3717 _exception = 1;
3718 _exceptionType = "java/lang/IllegalArgumentException";
3719 _exceptionMessage = "not enough space in uniformIndices";
3720 goto exit;
3721 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003722 _indices_base = (GLuint*)_env->GetIntArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003723 uniformIndices_ref, 0);
3724 _indices = _indices_base + uniformIndicesOffset;
3725
3726 glGetUniformIndices(program, _count, _names, _indices);
3727
3728exit:
3729 if (_indices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003730 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
3731 _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003732 }
3733 for (_i = _count - 1; _i >= 0; _i--) {
3734 if (_names[_i]) {
3735 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3736 if (_name) {
3737 _env->ReleaseStringUTFChars(_name, _names[_i]);
3738 }
3739 }
3740 }
3741 free(_names);
3742 if (_exception) {
3743 jniThrowException(_env, _exceptionType, _exceptionMessage);
3744 }
3745}
3746
3747/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3748static
3749void
3750android_glGetUniformIndices_buffer
3751 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
3752 jint _exception = 0;
3753 const char* _exceptionType = NULL;
3754 const char* _exceptionMessage = NULL;
3755 jint _count = 0;
3756 jint _i;
3757 const char** _names = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003758 jintArray _uniformIndicesArray = (jintArray)0;
Jesse Halld830e742013-03-29 11:02:35 -07003759 jint _uniformIndicesRemaining;
3760 jint _uniformIndicesOffset = 0;
3761 GLuint* _indices = NULL;
3762 char* _indicesBase = NULL;
3763
3764 if (!uniformNames_ref) {
3765 _exception = 1;
3766 _exceptionType = "java/lang/IllegalArgumentException";
3767 _exceptionMessage = "uniformNames == null";
3768 goto exit;
3769 }
3770 if (!uniformIndices_buf) {
3771 _exception = 1;
3772 _exceptionType = "java/lang/IllegalArgumentException";
3773 _exceptionMessage = "uniformIndices == null";
3774 goto exit;
3775 }
3776
3777 _count = _env->GetArrayLength(uniformNames_ref);
3778 _names = (const char**)calloc(_count, sizeof(const char*));
3779 for (_i = 0; _i < _count; _i++) {
3780 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3781 if (!_name) {
3782 _exception = 1;
3783 _exceptionType = "java/lang/IllegalArgumentException";
3784 _exceptionMessage = "null uniformNames element";
3785 goto exit;
3786 }
3787 _names[_i] = _env->GetStringUTFChars(_name, 0);
3788 }
3789
3790 _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003791 (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
Jesse Halld830e742013-03-29 11:02:35 -07003792 &_uniformIndicesOffset);
3793 if (!_indices) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003794 _indicesBase = (char*)_env->GetIntArrayElements(
3795 _uniformIndicesArray, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003796 _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
3797 }
3798 if (_uniformIndicesRemaining < _count) {
3799 _exception = 1;
3800 _exceptionType = "java/lang/IllegalArgumentException";
3801 _exceptionMessage = "not enough space in uniformIndices";
3802 goto exit;
3803 }
3804
3805 glGetUniformIndices(program, _count, _names, _indices);
3806
3807exit:
3808 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003809 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
3810 _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07003811 }
3812 for (_i = _count - 1; _i >= 0; _i--) {
3813 if (_names[_i]) {
3814 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3815 if (_name) {
3816 _env->ReleaseStringUTFChars(_name, _names[_i]);
3817 }
3818 }
3819 }
3820 free(_names);
3821 if (_exception) {
3822 jniThrowException(_env, _exceptionType, _exceptionMessage);
3823 }
3824}
Jesse Halld830e742013-03-29 11:02:35 -07003825/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3826static void
3827android_glGetActiveUniformsiv__II_3III_3II
3828 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
3829 jint _exception = 0;
3830 const char * _exceptionType = NULL;
3831 const char * _exceptionMessage = NULL;
3832 GLuint *uniformIndices_base = (GLuint *) 0;
3833 jint _uniformIndicesRemaining;
3834 GLuint *uniformIndices = (GLuint *) 0;
3835 GLint *params_base = (GLint *) 0;
3836 jint _paramsRemaining;
3837 GLint *params = (GLint *) 0;
3838
3839 if (!uniformIndices_ref) {
3840 _exception = 1;
3841 _exceptionType = "java/lang/IllegalArgumentException";
3842 _exceptionMessage = "uniformIndices == null";
3843 goto exit;
3844 }
3845 if (uniformIndicesOffset < 0) {
3846 _exception = 1;
3847 _exceptionType = "java/lang/IllegalArgumentException";
3848 _exceptionMessage = "uniformIndicesOffset < 0";
3849 goto exit;
3850 }
3851 _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
3852 uniformIndices_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003853 _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003854 uniformIndices = uniformIndices_base + uniformIndicesOffset;
3855
3856 if (!params_ref) {
3857 _exception = 1;
3858 _exceptionType = "java/lang/IllegalArgumentException";
3859 _exceptionMessage = "params == null";
3860 goto exit;
3861 }
3862 if (paramsOffset < 0) {
3863 _exception = 1;
3864 _exceptionType = "java/lang/IllegalArgumentException";
3865 _exceptionMessage = "paramsOffset < 0";
3866 goto exit;
3867 }
3868 _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
3869 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003870 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003871 params = params_base + paramsOffset;
3872
3873 glGetActiveUniformsiv(
3874 (GLuint)program,
3875 (GLsizei)uniformCount,
3876 (GLuint *)uniformIndices,
3877 (GLenum)pname,
3878 (GLint *)params
3879 );
3880
3881exit:
3882 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003883 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003884 _exception ? JNI_ABORT: 0);
3885 }
3886 if (uniformIndices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003887 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
Jesse Halld830e742013-03-29 11:02:35 -07003888 JNI_ABORT);
3889 }
3890 if (_exception) {
3891 jniThrowException(_env, _exceptionType, _exceptionMessage);
3892 }
3893}
3894
3895/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3896static void
3897android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
3898 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003899 jint _exception = 0;
3900 const char * _exceptionType = NULL;
3901 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003902 jintArray _uniformIndicesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003903 jint _uniformIndicesBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003904 jintArray _paramsArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003905 jint _paramsBufferOffset = (jint) 0;
3906 jint _uniformIndicesRemaining;
3907 GLuint *uniformIndices = (GLuint *) 0;
3908 jint _paramsRemaining;
3909 GLint *params = (GLint *) 0;
3910
Romain Guy84cac202016-12-05 12:26:02 -08003911 if (!uniformIndices_buf) {
3912 _exception = 1;
3913 _exceptionType = "java/lang/IllegalArgumentException";
3914 _exceptionMessage = "uniformIndices == null";
3915 goto exit;
3916 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003917 uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08003918 if (!params_buf) {
3919 _exception = 1;
3920 _exceptionType = "java/lang/IllegalArgumentException";
3921 _exceptionMessage = "params == null";
3922 goto exit;
3923 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003924 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003925 if (uniformIndices == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003926 char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003927 uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
3928 }
3929 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003930 char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003931 params = (GLint *) (_paramsBase + _paramsBufferOffset);
3932 }
3933 glGetActiveUniformsiv(
3934 (GLuint)program,
3935 (GLsizei)uniformCount,
3936 (GLuint *)uniformIndices,
3937 (GLenum)pname,
3938 (GLint *)params
3939 );
Romain Guy84cac202016-12-05 12:26:02 -08003940
3941exit:
Jesse Halld830e742013-03-29 11:02:35 -07003942 if (_paramsArray) {
Romain Guy84cac202016-12-05 12:26:02 -08003943 _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003944 }
3945 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003946 _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003947 }
Romain Guy84cac202016-12-05 12:26:02 -08003948 if (_exception) {
3949 jniThrowException(_env, _exceptionType, _exceptionMessage);
3950 }
Jesse Halld830e742013-03-29 11:02:35 -07003951}
3952
3953/* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
3954static jint
3955android_glGetUniformBlockIndex__ILjava_lang_String_2
3956 (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
3957 jint _exception = 0;
3958 const char * _exceptionType = NULL;
3959 const char * _exceptionMessage = NULL;
3960 GLuint _returnValue = 0;
3961 const char* _nativeuniformBlockName = 0;
3962
3963 if (!uniformBlockName) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07003964 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07003965 _exceptionType = "java/lang/IllegalArgumentException";
3966 _exceptionMessage = "uniformBlockName == null";
3967 goto exit;
3968 }
3969 _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
3970
3971 _returnValue = glGetUniformBlockIndex(
3972 (GLuint)program,
3973 (GLchar *)_nativeuniformBlockName
3974 );
3975
3976exit:
3977 if (_nativeuniformBlockName) {
3978 _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
3979 }
3980
3981 if (_exception) {
3982 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00003983 return (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07003984 }
3985 return (jint)_returnValue;
3986}
3987
3988/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3989static void
3990android_glGetActiveUniformBlockiv__III_3II
3991 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
3992 jint _exception = 0;
3993 const char * _exceptionType = NULL;
3994 const char * _exceptionMessage = NULL;
3995 GLint *params_base = (GLint *) 0;
3996 jint _remaining;
3997 GLint *params = (GLint *) 0;
3998
3999 if (!params_ref) {
4000 _exception = 1;
4001 _exceptionType = "java/lang/IllegalArgumentException";
4002 _exceptionMessage = "params == null";
4003 goto exit;
4004 }
4005 if (offset < 0) {
4006 _exception = 1;
4007 _exceptionType = "java/lang/IllegalArgumentException";
4008 _exceptionMessage = "offset < 0";
4009 goto exit;
4010 }
4011 _remaining = _env->GetArrayLength(params_ref) - offset;
4012 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004013 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004014 params = params_base + offset;
4015
4016 glGetActiveUniformBlockiv(
4017 (GLuint)program,
4018 (GLuint)uniformBlockIndex,
4019 (GLenum)pname,
4020 (GLint *)params
4021 );
4022
4023exit:
4024 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004025 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004026 _exception ? JNI_ABORT: 0);
4027 }
4028 if (_exception) {
4029 jniThrowException(_env, _exceptionType, _exceptionMessage);
4030 }
4031}
4032
4033/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
4034static void
4035android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
4036 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004037 jint _exception = 0;
4038 const char * _exceptionType = NULL;
4039 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004040 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004041 jint _bufferOffset = (jint) 0;
4042 jint _remaining;
4043 GLint *params = (GLint *) 0;
4044
Romain Guy84cac202016-12-05 12:26:02 -08004045 if (!params_buf) {
4046 _exception = 1;
4047 _exceptionType = "java/lang/IllegalArgumentException";
4048 _exceptionMessage = "params == null";
4049 goto exit;
4050 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004051 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004052 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004053 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004054 params = (GLint *) (_paramsBase + _bufferOffset);
4055 }
4056 glGetActiveUniformBlockiv(
4057 (GLuint)program,
4058 (GLuint)uniformBlockIndex,
4059 (GLenum)pname,
4060 (GLint *)params
4061 );
Romain Guy84cac202016-12-05 12:26:02 -08004062
4063exit:
Jesse Halld830e742013-03-29 11:02:35 -07004064 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004065 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4066 }
4067 if (_exception) {
4068 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004069 }
4070}
4071
4072/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4073static void
4074android_glGetActiveUniformBlockName_III_3II_3BI
4075 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
4076 jint _exception = 0;
4077 const char* _exceptionType;
4078 const char* _exceptionMessage;
4079 GLsizei* _length_base = (GLsizei*)0;
4080 jint _lengthRemaining;
4081 GLsizei* _length = (GLsizei*)0;
4082 GLchar* _name_base = (GLchar*)0;
4083 jint _nameRemaining;
4084 GLchar* _name = (GLchar*)0;
4085
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004086 if (length_ref) {
4087 if (lengthOffset < 0) {
4088 _exception = 1;
4089 _exceptionType = "java/lang/IllegalArgumentException";
4090 _exceptionMessage = "lengthOffset < 0";
4091 goto exit;
4092 }
4093 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4094 _length_base = (GLsizei*)_env->GetIntArrayElements(
4095 length_ref, (jboolean*)0);
4096 _length = _length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004097 }
Jesse Halld830e742013-03-29 11:02:35 -07004098
4099 if (!name_ref) {
4100 _exception = 1;
4101 _exceptionType = "java/lang/IllegalArgumentException";
4102 _exceptionMessage = "uniformBlockName == null";
4103 goto exit;
4104 }
4105 if (nameOffset < 0) {
4106 _exception = 1;
4107 _exceptionType = "java/lang/IllegalArgumentException";
4108 _exceptionMessage = "uniformBlockNameOffset < 0";
4109 goto exit;
4110 }
4111 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004112 _name_base = (GLchar*)_env->GetByteArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07004113 name_ref, (jboolean*)0);
4114 _name = _name_base + nameOffset;
4115
4116 glGetActiveUniformBlockName(
4117 (GLuint)program,
4118 (GLuint)uniformBlockIndex,
4119 (GLsizei)bufSize,
4120 (GLsizei*)_length,
4121 (GLchar*)_name
4122 );
4123
4124exit:
4125 if (_name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004126 _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
Jesse Halld830e742013-03-29 11:02:35 -07004127 _exception ? JNI_ABORT: 0);
4128 }
4129 if (_length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004130 _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004131 _exception ? JNI_ABORT: 0);
4132 }
4133 if (_exception) {
4134 jniThrowException(_env, _exceptionType, _exceptionMessage);
4135 }
4136}
4137
4138/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4139static void
4140android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
4141 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
4142 jint _exception = 0;
4143 const char* _exceptionType;
4144 const char* _exceptionMessage;
4145 jarray _lengthArray = (jarray)0;
4146 jint _lengthBufferOffset = (jint)0;
4147 GLsizei* _length = (GLsizei*)0;
4148 jint _lengthRemaining;
4149 jarray _nameArray = (jarray)0;
4150 jint _nameBufferOffset = (jint)0;
4151 GLchar* _name = (GLchar*)0;
4152 jint _nameRemaining;
4153
4154 _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4155 if (_length == NULL) {
4156 GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
4157 _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
4158 }
4159
4160 _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
4161 if (_name == NULL) {
4162 GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
4163 _name = (GLchar*)(_nameBase + _nameBufferOffset);
4164 }
4165
4166 glGetActiveUniformBlockName(
4167 (GLuint)program,
4168 (GLuint)uniformBlockIndex,
4169 (GLsizei)_nameRemaining,
4170 _length, _name
4171 );
4172 if (_nameArray) {
4173 releasePointer(_env, _nameArray, _name, JNI_TRUE);
4174 }
4175 if (_lengthArray) {
4176 releasePointer(_env, _lengthArray, _length, JNI_TRUE);
4177 }
4178}
4179
4180/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4181static jstring
4182android_glGetActiveUniformBlockName_II
4183 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
4184 GLint len = 0;
4185 glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
4186 GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
4187 GLchar* name = (GLchar*)malloc(len);
4188 glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
4189 len, NULL, name);
4190 jstring result = _env->NewStringUTF(name);
4191 free(name);
4192 return result;
4193}
Jesse Halld830e742013-03-29 11:02:35 -07004194/* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
4195static void
4196android_glUniformBlockBinding__III
4197 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
4198 glUniformBlockBinding(
4199 (GLuint)program,
4200 (GLuint)uniformBlockIndex,
4201 (GLuint)uniformBlockBinding
4202 );
4203}
4204
4205/* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
4206static void
4207android_glDrawArraysInstanced__IIII
4208 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
4209 glDrawArraysInstanced(
4210 (GLenum)mode,
4211 (GLint)first,
4212 (GLsizei)count,
4213 (GLsizei)instanceCount
4214 );
4215}
4216
4217/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4218static void
4219android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
4220 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
4221 jarray _array = (jarray) 0;
4222 jint _bufferOffset = (jint) 0;
4223 jint _remaining;
4224 GLvoid *indices = (GLvoid *) 0;
4225
4226 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
4227 if (indices == NULL) {
4228 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4229 indices = (GLvoid *) (_indicesBase + _bufferOffset);
4230 }
4231 glDrawElementsInstanced(
4232 (GLenum)mode,
4233 (GLsizei)count,
4234 (GLenum)type,
4235 (GLvoid *)indices,
4236 (GLsizei)instanceCount
4237 );
4238 if (_array) {
4239 releasePointer(_env, _array, indices, JNI_FALSE);
4240 }
4241}
4242
4243/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4244static void
4245android_glDrawElementsInstanced__IIIII
4246 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
4247 glDrawElementsInstanced(
4248 (GLenum)mode,
4249 (GLsizei)count,
4250 (GLenum)type,
Dan Albert10caf032015-02-23 10:41:10 -08004251 (GLvoid *)static_cast<uintptr_t>(indicesOffset),
Jesse Halld830e742013-03-29 11:02:35 -07004252 (GLsizei)instanceCount
4253 );
4254}
Jesse Halld830e742013-03-29 11:02:35 -07004255/* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
4256static jlong
4257android_glFenceSync__II
4258 (JNIEnv *_env, jobject _this, jint condition, jint flags) {
4259 GLsync _returnValue;
4260 _returnValue = glFenceSync(
4261 (GLenum)condition,
4262 (GLbitfield)flags
4263 );
4264 return (jlong)_returnValue;
4265}
4266
4267/* GLboolean glIsSync ( GLsync sync ) */
4268static jboolean
4269android_glIsSync__J
4270 (JNIEnv *_env, jobject _this, jlong sync) {
4271 GLboolean _returnValue;
4272 _returnValue = glIsSync(
4273 (GLsync)sync
4274 );
4275 return (jboolean)_returnValue;
4276}
4277
4278/* void glDeleteSync ( GLsync sync ) */
4279static void
4280android_glDeleteSync__J
4281 (JNIEnv *_env, jobject _this, jlong sync) {
4282 glDeleteSync(
4283 (GLsync)sync
4284 );
4285}
4286
4287/* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4288static jint
4289android_glClientWaitSync__JIJ
4290 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4291 GLenum _returnValue;
4292 _returnValue = glClientWaitSync(
4293 (GLsync)sync,
4294 (GLbitfield)flags,
4295 (GLuint64)timeout
4296 );
4297 return (jint)_returnValue;
4298}
4299
4300/* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4301static void
4302android_glWaitSync__JIJ
4303 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4304 glWaitSync(
4305 (GLsync)sync,
4306 (GLbitfield)flags,
4307 (GLuint64)timeout
4308 );
4309}
4310
4311/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4312static void
4313android_glGetInteger64v__I_3JI
4314 (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
4315 jint _exception = 0;
4316 const char * _exceptionType = NULL;
4317 const char * _exceptionMessage = NULL;
4318 GLint64 *params_base = (GLint64 *) 0;
4319 jint _remaining;
4320 GLint64 *params = (GLint64 *) 0;
4321
4322 if (!params_ref) {
4323 _exception = 1;
4324 _exceptionType = "java/lang/IllegalArgumentException";
4325 _exceptionMessage = "params == null";
4326 goto exit;
4327 }
4328 if (offset < 0) {
4329 _exception = 1;
4330 _exceptionType = "java/lang/IllegalArgumentException";
4331 _exceptionMessage = "offset < 0";
4332 goto exit;
4333 }
4334 _remaining = _env->GetArrayLength(params_ref) - offset;
4335 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004336 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004337 params = params_base + offset;
4338
4339 glGetInteger64v(
4340 (GLenum)pname,
4341 (GLint64 *)params
4342 );
4343
4344exit:
4345 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004346 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004347 _exception ? JNI_ABORT: 0);
4348 }
4349 if (_exception) {
4350 jniThrowException(_env, _exceptionType, _exceptionMessage);
4351 }
4352}
4353
4354/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4355static void
4356android_glGetInteger64v__ILjava_nio_LongBuffer_2
4357 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004358 jint _exception = 0;
4359 const char * _exceptionType = NULL;
4360 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004361 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004362 jint _bufferOffset = (jint) 0;
4363 jint _remaining;
4364 GLint64 *params = (GLint64 *) 0;
4365
Romain Guy84cac202016-12-05 12:26:02 -08004366 if (!params_buf) {
4367 _exception = 1;
4368 _exceptionType = "java/lang/IllegalArgumentException";
4369 _exceptionMessage = "params == null";
4370 goto exit;
4371 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004372 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004373 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004374 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004375 params = (GLint64 *) (_paramsBase + _bufferOffset);
4376 }
4377 glGetInteger64v(
4378 (GLenum)pname,
4379 (GLint64 *)params
4380 );
Romain Guy84cac202016-12-05 12:26:02 -08004381
4382exit:
Jesse Halld830e742013-03-29 11:02:35 -07004383 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004384 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4385 }
4386 if (_exception) {
4387 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004388 }
4389}
4390
4391/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4392static void
4393android_glGetSynciv__JII_3II_3II
4394 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
4395 jint _exception = 0;
4396 const char * _exceptionType = NULL;
4397 const char * _exceptionMessage = NULL;
4398 GLsizei *length_base = (GLsizei *) 0;
4399 jint _lengthRemaining;
4400 GLsizei *length = (GLsizei *) 0;
4401 GLint *values_base = (GLint *) 0;
4402 jint _valuesRemaining;
4403 GLint *values = (GLint *) 0;
4404
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004405 if (length_ref) {
4406 if (lengthOffset < 0) {
4407 _exception = 1;
4408 _exceptionType = "java/lang/IllegalArgumentException";
4409 _exceptionMessage = "lengthOffset < 0";
4410 goto exit;
4411 }
4412 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4413 length_base = (GLsizei *)
4414 _env->GetIntArrayElements(length_ref, (jboolean *)0);
4415 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004416 }
Jesse Halld830e742013-03-29 11:02:35 -07004417
4418 if (!values_ref) {
4419 _exception = 1;
4420 _exceptionType = "java/lang/IllegalArgumentException";
4421 _exceptionMessage = "values == null";
4422 goto exit;
4423 }
4424 if (valuesOffset < 0) {
4425 _exception = 1;
4426 _exceptionType = "java/lang/IllegalArgumentException";
4427 _exceptionMessage = "valuesOffset < 0";
4428 goto exit;
4429 }
4430 _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
4431 values_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004432 _env->GetIntArrayElements(values_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004433 values = values_base + valuesOffset;
4434
4435 glGetSynciv(
4436 (GLsync)sync,
4437 (GLenum)pname,
4438 (GLsizei)bufSize,
4439 (GLsizei *)length,
4440 (GLint *)values
4441 );
4442
4443exit:
4444 if (values_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004445 _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
Jesse Halld830e742013-03-29 11:02:35 -07004446 _exception ? JNI_ABORT: 0);
4447 }
4448 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004449 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004450 _exception ? JNI_ABORT: 0);
4451 }
4452 if (_exception) {
4453 jniThrowException(_env, _exceptionType, _exceptionMessage);
4454 }
4455}
4456
4457/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4458static void
4459android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4460 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004461 jint _exception = 0;
4462 const char * _exceptionType = NULL;
4463 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004464 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004465 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004466 jintArray _valuesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004467 jint _valuesBufferOffset = (jint) 0;
4468 jint _lengthRemaining;
4469 GLsizei *length = (GLsizei *) 0;
4470 jint _valuesRemaining;
4471 GLint *values = (GLint *) 0;
4472
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004473 if (length_buf) {
4474 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4475 }
Romain Guy84cac202016-12-05 12:26:02 -08004476 if (!values_buf) {
4477 _exception = 1;
4478 _exceptionType = "java/lang/IllegalArgumentException";
4479 _exceptionMessage = "values == null";
4480 goto exit;
4481 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004482 values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004483 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004484 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004485 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
4486 }
4487 if (values == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004488 char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004489 values = (GLint *) (_valuesBase + _valuesBufferOffset);
4490 }
4491 glGetSynciv(
4492 (GLsync)sync,
4493 (GLenum)pname,
4494 (GLsizei)bufSize,
4495 (GLsizei *)length,
4496 (GLint *)values
4497 );
Romain Guy84cac202016-12-05 12:26:02 -08004498
4499exit:
Jesse Halld830e742013-03-29 11:02:35 -07004500 if (_valuesArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004501 _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07004502 }
4503 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004504 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
4505 }
4506 if (_exception) {
4507 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004508 }
4509}
4510
4511/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4512static void
4513android_glGetInteger64i_v__II_3JI
4514 (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
4515 jint _exception = 0;
4516 const char * _exceptionType = NULL;
4517 const char * _exceptionMessage = NULL;
4518 GLint64 *data_base = (GLint64 *) 0;
4519 jint _remaining;
4520 GLint64 *data = (GLint64 *) 0;
4521
4522 if (!data_ref) {
4523 _exception = 1;
4524 _exceptionType = "java/lang/IllegalArgumentException";
4525 _exceptionMessage = "data == null";
4526 goto exit;
4527 }
4528 if (offset < 0) {
4529 _exception = 1;
4530 _exceptionType = "java/lang/IllegalArgumentException";
4531 _exceptionMessage = "offset < 0";
4532 goto exit;
4533 }
4534 _remaining = _env->GetArrayLength(data_ref) - offset;
4535 data_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004536 _env->GetLongArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004537 data = data_base + offset;
4538
4539 glGetInteger64i_v(
4540 (GLenum)target,
4541 (GLuint)index,
4542 (GLint64 *)data
4543 );
4544
4545exit:
4546 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004547 _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07004548 _exception ? JNI_ABORT: 0);
4549 }
4550 if (_exception) {
4551 jniThrowException(_env, _exceptionType, _exceptionMessage);
4552 }
4553}
4554
4555/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4556static void
4557android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
4558 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004559 jint _exception = 0;
4560 const char * _exceptionType = NULL;
4561 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004562 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004563 jint _bufferOffset = (jint) 0;
4564 jint _remaining;
4565 GLint64 *data = (GLint64 *) 0;
4566
Romain Guy84cac202016-12-05 12:26:02 -08004567 if (!data_buf) {
4568 _exception = 1;
4569 _exceptionType = "java/lang/IllegalArgumentException";
4570 _exceptionMessage = "data == null";
4571 goto exit;
4572 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004573 data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004574 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004575 char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004576 data = (GLint64 *) (_dataBase + _bufferOffset);
4577 }
4578 glGetInteger64i_v(
4579 (GLenum)target,
4580 (GLuint)index,
4581 (GLint64 *)data
4582 );
Romain Guy84cac202016-12-05 12:26:02 -08004583
4584exit:
Jesse Halld830e742013-03-29 11:02:35 -07004585 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004586 _env->ReleaseLongArrayElements(_array, (jlong*)data, _exception ? JNI_ABORT : 0);
4587 }
4588 if (_exception) {
4589 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004590 }
4591}
4592
4593/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4594static void
4595android_glGetBufferParameteri64v__II_3JI
4596 (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
4597 jint _exception = 0;
4598 const char * _exceptionType = NULL;
4599 const char * _exceptionMessage = NULL;
4600 GLint64 *params_base = (GLint64 *) 0;
4601 jint _remaining;
4602 GLint64 *params = (GLint64 *) 0;
4603
4604 if (!params_ref) {
4605 _exception = 1;
4606 _exceptionType = "java/lang/IllegalArgumentException";
4607 _exceptionMessage = "params == null";
4608 goto exit;
4609 }
4610 if (offset < 0) {
4611 _exception = 1;
4612 _exceptionType = "java/lang/IllegalArgumentException";
4613 _exceptionMessage = "offset < 0";
4614 goto exit;
4615 }
4616 _remaining = _env->GetArrayLength(params_ref) - offset;
4617 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004618 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004619 params = params_base + offset;
4620
4621 glGetBufferParameteri64v(
4622 (GLenum)target,
4623 (GLenum)pname,
4624 (GLint64 *)params
4625 );
4626
4627exit:
4628 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004629 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004630 _exception ? JNI_ABORT: 0);
4631 }
4632 if (_exception) {
4633 jniThrowException(_env, _exceptionType, _exceptionMessage);
4634 }
4635}
4636
4637/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4638static void
4639android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
4640 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004641 jint _exception = 0;
4642 const char * _exceptionType = NULL;
4643 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004644 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004645 jint _bufferOffset = (jint) 0;
4646 jint _remaining;
4647 GLint64 *params = (GLint64 *) 0;
4648
Romain Guy84cac202016-12-05 12:26:02 -08004649 if (!params_buf) {
4650 _exception = 1;
4651 _exceptionType = "java/lang/IllegalArgumentException";
4652 _exceptionMessage = "params == null";
4653 goto exit;
4654 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004655 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004656 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004657 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004658 params = (GLint64 *) (_paramsBase + _bufferOffset);
4659 }
4660 glGetBufferParameteri64v(
4661 (GLenum)target,
4662 (GLenum)pname,
4663 (GLint64 *)params
4664 );
Romain Guy84cac202016-12-05 12:26:02 -08004665
4666exit:
Jesse Halld830e742013-03-29 11:02:35 -07004667 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004668 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4669 }
4670 if (_exception) {
4671 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004672 }
4673}
4674
4675/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4676static void
4677android_glGenSamplers__I_3II
4678 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4679 jint _exception = 0;
4680 const char * _exceptionType = NULL;
4681 const char * _exceptionMessage = NULL;
4682 GLuint *samplers_base = (GLuint *) 0;
4683 jint _remaining;
4684 GLuint *samplers = (GLuint *) 0;
4685
4686 if (!samplers_ref) {
4687 _exception = 1;
4688 _exceptionType = "java/lang/IllegalArgumentException";
4689 _exceptionMessage = "samplers == null";
4690 goto exit;
4691 }
4692 if (offset < 0) {
4693 _exception = 1;
4694 _exceptionType = "java/lang/IllegalArgumentException";
4695 _exceptionMessage = "offset < 0";
4696 goto exit;
4697 }
4698 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4699 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004700 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004701 samplers = samplers_base + offset;
4702
4703 glGenSamplers(
4704 (GLsizei)count,
4705 (GLuint *)samplers
4706 );
4707
4708exit:
4709 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004710 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004711 _exception ? JNI_ABORT: 0);
4712 }
4713 if (_exception) {
4714 jniThrowException(_env, _exceptionType, _exceptionMessage);
4715 }
4716}
4717
4718/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4719static void
4720android_glGenSamplers__ILjava_nio_IntBuffer_2
4721 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004722 jint _exception = 0;
4723 const char * _exceptionType = NULL;
4724 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004725 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004726 jint _bufferOffset = (jint) 0;
4727 jint _remaining;
4728 GLuint *samplers = (GLuint *) 0;
4729
Romain Guy84cac202016-12-05 12:26:02 -08004730 if (!samplers_buf) {
4731 _exception = 1;
4732 _exceptionType = "java/lang/IllegalArgumentException";
4733 _exceptionMessage = "samplers == null";
4734 goto exit;
4735 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004736 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004737 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004738 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004739 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4740 }
4741 glGenSamplers(
4742 (GLsizei)count,
4743 (GLuint *)samplers
4744 );
Romain Guy84cac202016-12-05 12:26:02 -08004745
4746exit:
Jesse Halld830e742013-03-29 11:02:35 -07004747 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004748 _env->ReleaseIntArrayElements(_array, (jint*)samplers, _exception ? JNI_ABORT : 0);
4749 }
4750 if (_exception) {
4751 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004752 }
4753}
4754
4755/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4756static void
4757android_glDeleteSamplers__I_3II
4758 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4759 jint _exception = 0;
4760 const char * _exceptionType = NULL;
4761 const char * _exceptionMessage = NULL;
4762 GLuint *samplers_base = (GLuint *) 0;
4763 jint _remaining;
4764 GLuint *samplers = (GLuint *) 0;
4765
4766 if (!samplers_ref) {
4767 _exception = 1;
4768 _exceptionType = "java/lang/IllegalArgumentException";
4769 _exceptionMessage = "samplers == null";
4770 goto exit;
4771 }
4772 if (offset < 0) {
4773 _exception = 1;
4774 _exceptionType = "java/lang/IllegalArgumentException";
4775 _exceptionMessage = "offset < 0";
4776 goto exit;
4777 }
4778 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4779 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004780 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004781 samplers = samplers_base + offset;
4782
4783 glDeleteSamplers(
4784 (GLsizei)count,
4785 (GLuint *)samplers
4786 );
4787
4788exit:
4789 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004790 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004791 JNI_ABORT);
4792 }
4793 if (_exception) {
4794 jniThrowException(_env, _exceptionType, _exceptionMessage);
4795 }
4796}
4797
4798/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4799static void
4800android_glDeleteSamplers__ILjava_nio_IntBuffer_2
4801 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004802 jint _exception = 0;
4803 const char * _exceptionType = NULL;
4804 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004805 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004806 jint _bufferOffset = (jint) 0;
4807 jint _remaining;
4808 GLuint *samplers = (GLuint *) 0;
4809
Romain Guy84cac202016-12-05 12:26:02 -08004810 if (!samplers_buf) {
4811 _exception = 1;
4812 _exceptionType = "java/lang/IllegalArgumentException";
4813 _exceptionMessage = "samplers == null";
4814 goto exit;
4815 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004816 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004817 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004818 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004819 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4820 }
4821 glDeleteSamplers(
4822 (GLsizei)count,
4823 (GLuint *)samplers
4824 );
Romain Guy84cac202016-12-05 12:26:02 -08004825
4826exit:
Jesse Halld830e742013-03-29 11:02:35 -07004827 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004828 _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004829 }
Romain Guy84cac202016-12-05 12:26:02 -08004830 if (_exception) {
4831 jniThrowException(_env, _exceptionType, _exceptionMessage);
4832 }
Jesse Halld830e742013-03-29 11:02:35 -07004833}
4834
4835/* GLboolean glIsSampler ( GLuint sampler ) */
4836static jboolean
4837android_glIsSampler__I
4838 (JNIEnv *_env, jobject _this, jint sampler) {
4839 GLboolean _returnValue;
4840 _returnValue = glIsSampler(
4841 (GLuint)sampler
4842 );
4843 return (jboolean)_returnValue;
4844}
4845
4846/* void glBindSampler ( GLuint unit, GLuint sampler ) */
4847static void
4848android_glBindSampler__II
4849 (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
4850 glBindSampler(
4851 (GLuint)unit,
4852 (GLuint)sampler
4853 );
4854}
4855
4856/* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
4857static void
4858android_glSamplerParameteri__III
4859 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
4860 glSamplerParameteri(
4861 (GLuint)sampler,
4862 (GLenum)pname,
4863 (GLint)param
4864 );
4865}
4866
4867/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4868static void
4869android_glSamplerParameteriv__II_3II
4870 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
4871 jint _exception = 0;
4872 const char * _exceptionType = NULL;
4873 const char * _exceptionMessage = NULL;
4874 GLint *param_base = (GLint *) 0;
4875 jint _remaining;
4876 GLint *param = (GLint *) 0;
4877
4878 if (!param_ref) {
4879 _exception = 1;
4880 _exceptionType = "java/lang/IllegalArgumentException";
4881 _exceptionMessage = "param == null";
4882 goto exit;
4883 }
4884 if (offset < 0) {
4885 _exception = 1;
4886 _exceptionType = "java/lang/IllegalArgumentException";
4887 _exceptionMessage = "offset < 0";
4888 goto exit;
4889 }
4890 _remaining = _env->GetArrayLength(param_ref) - offset;
4891 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004892 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004893 param = param_base + offset;
4894
4895 glSamplerParameteriv(
4896 (GLuint)sampler,
4897 (GLenum)pname,
4898 (GLint *)param
4899 );
4900
4901exit:
4902 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004903 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004904 JNI_ABORT);
4905 }
4906 if (_exception) {
4907 jniThrowException(_env, _exceptionType, _exceptionMessage);
4908 }
4909}
4910
4911/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4912static void
4913android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
4914 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004915 jint _exception = 0;
4916 const char * _exceptionType = NULL;
4917 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004918 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004919 jint _bufferOffset = (jint) 0;
4920 jint _remaining;
4921 GLint *param = (GLint *) 0;
4922
Romain Guy84cac202016-12-05 12:26:02 -08004923 if (!param_buf) {
4924 _exception = 1;
4925 _exceptionType = "java/lang/IllegalArgumentException";
4926 _exceptionMessage = "param == null";
4927 goto exit;
4928 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004929 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004930 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004931 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004932 param = (GLint *) (_paramBase + _bufferOffset);
4933 }
4934 glSamplerParameteriv(
4935 (GLuint)sampler,
4936 (GLenum)pname,
4937 (GLint *)param
4938 );
Romain Guy84cac202016-12-05 12:26:02 -08004939
4940exit:
Jesse Halld830e742013-03-29 11:02:35 -07004941 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004942 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004943 }
Romain Guy84cac202016-12-05 12:26:02 -08004944 if (_exception) {
4945 jniThrowException(_env, _exceptionType, _exceptionMessage);
4946 }
Jesse Halld830e742013-03-29 11:02:35 -07004947}
4948
4949/* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
4950static void
4951android_glSamplerParameterf__IIF
4952 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
4953 glSamplerParameterf(
4954 (GLuint)sampler,
4955 (GLenum)pname,
4956 (GLfloat)param
4957 );
4958}
4959
4960/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4961static void
4962android_glSamplerParameterfv__II_3FI
4963 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
4964 jint _exception = 0;
4965 const char * _exceptionType = NULL;
4966 const char * _exceptionMessage = NULL;
4967 GLfloat *param_base = (GLfloat *) 0;
4968 jint _remaining;
4969 GLfloat *param = (GLfloat *) 0;
4970
4971 if (!param_ref) {
4972 _exception = 1;
4973 _exceptionType = "java/lang/IllegalArgumentException";
4974 _exceptionMessage = "param == null";
4975 goto exit;
4976 }
4977 if (offset < 0) {
4978 _exception = 1;
4979 _exceptionType = "java/lang/IllegalArgumentException";
4980 _exceptionMessage = "offset < 0";
4981 goto exit;
4982 }
4983 _remaining = _env->GetArrayLength(param_ref) - offset;
4984 param_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004985 _env->GetFloatArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004986 param = param_base + offset;
4987
4988 glSamplerParameterfv(
4989 (GLuint)sampler,
4990 (GLenum)pname,
4991 (GLfloat *)param
4992 );
4993
4994exit:
4995 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004996 _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004997 JNI_ABORT);
4998 }
4999 if (_exception) {
5000 jniThrowException(_env, _exceptionType, _exceptionMessage);
5001 }
5002}
5003
5004/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
5005static void
5006android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
5007 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005008 jint _exception = 0;
5009 const char * _exceptionType = NULL;
5010 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005011 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005012 jint _bufferOffset = (jint) 0;
5013 jint _remaining;
5014 GLfloat *param = (GLfloat *) 0;
5015
Romain Guy84cac202016-12-05 12:26:02 -08005016 if (!param_buf) {
5017 _exception = 1;
5018 _exceptionType = "java/lang/IllegalArgumentException";
5019 _exceptionMessage = "param == null";
5020 goto exit;
5021 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005022 param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005023 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005024 char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005025 param = (GLfloat *) (_paramBase + _bufferOffset);
5026 }
5027 glSamplerParameterfv(
5028 (GLuint)sampler,
5029 (GLenum)pname,
5030 (GLfloat *)param
5031 );
Romain Guy84cac202016-12-05 12:26:02 -08005032
5033exit:
Jesse Halld830e742013-03-29 11:02:35 -07005034 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005035 _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005036 }
Romain Guy84cac202016-12-05 12:26:02 -08005037 if (_exception) {
5038 jniThrowException(_env, _exceptionType, _exceptionMessage);
5039 }
Jesse Halld830e742013-03-29 11:02:35 -07005040}
5041
5042/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5043static void
5044android_glGetSamplerParameteriv__II_3II
5045 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
5046 jint _exception = 0;
5047 const char * _exceptionType = NULL;
5048 const char * _exceptionMessage = NULL;
5049 GLint *params_base = (GLint *) 0;
5050 jint _remaining;
5051 GLint *params = (GLint *) 0;
5052
5053 if (!params_ref) {
5054 _exception = 1;
5055 _exceptionType = "java/lang/IllegalArgumentException";
5056 _exceptionMessage = "params == null";
5057 goto exit;
5058 }
5059 if (offset < 0) {
5060 _exception = 1;
5061 _exceptionType = "java/lang/IllegalArgumentException";
5062 _exceptionMessage = "offset < 0";
5063 goto exit;
5064 }
5065 _remaining = _env->GetArrayLength(params_ref) - offset;
5066 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005067 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005068 params = params_base + offset;
5069
5070 glGetSamplerParameteriv(
5071 (GLuint)sampler,
5072 (GLenum)pname,
5073 (GLint *)params
5074 );
5075
5076exit:
5077 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005078 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005079 _exception ? JNI_ABORT: 0);
5080 }
5081 if (_exception) {
5082 jniThrowException(_env, _exceptionType, _exceptionMessage);
5083 }
5084}
5085
5086/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5087static void
5088android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
5089 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005090 jint _exception = 0;
5091 const char * _exceptionType = NULL;
5092 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005093 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005094 jint _bufferOffset = (jint) 0;
5095 jint _remaining;
5096 GLint *params = (GLint *) 0;
5097
Romain Guy84cac202016-12-05 12:26:02 -08005098 if (!params_buf) {
5099 _exception = 1;
5100 _exceptionType = "java/lang/IllegalArgumentException";
5101 _exceptionMessage = "params == null";
5102 goto exit;
5103 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005104 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005105 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005106 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005107 params = (GLint *) (_paramsBase + _bufferOffset);
5108 }
5109 glGetSamplerParameteriv(
5110 (GLuint)sampler,
5111 (GLenum)pname,
5112 (GLint *)params
5113 );
Romain Guy84cac202016-12-05 12:26:02 -08005114
5115exit:
Jesse Halld830e742013-03-29 11:02:35 -07005116 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005117 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5118 }
5119 if (_exception) {
5120 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005121 }
5122}
5123
5124/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5125static void
5126android_glGetSamplerParameterfv__II_3FI
5127 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
5128 jint _exception = 0;
5129 const char * _exceptionType = NULL;
5130 const char * _exceptionMessage = NULL;
5131 GLfloat *params_base = (GLfloat *) 0;
5132 jint _remaining;
5133 GLfloat *params = (GLfloat *) 0;
5134
5135 if (!params_ref) {
5136 _exception = 1;
5137 _exceptionType = "java/lang/IllegalArgumentException";
5138 _exceptionMessage = "params == null";
5139 goto exit;
5140 }
5141 if (offset < 0) {
5142 _exception = 1;
5143 _exceptionType = "java/lang/IllegalArgumentException";
5144 _exceptionMessage = "offset < 0";
5145 goto exit;
5146 }
5147 _remaining = _env->GetArrayLength(params_ref) - offset;
5148 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005149 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005150 params = params_base + offset;
5151
5152 glGetSamplerParameterfv(
5153 (GLuint)sampler,
5154 (GLenum)pname,
5155 (GLfloat *)params
5156 );
5157
5158exit:
5159 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005160 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005161 _exception ? JNI_ABORT: 0);
5162 }
5163 if (_exception) {
5164 jniThrowException(_env, _exceptionType, _exceptionMessage);
5165 }
5166}
5167
5168/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5169static void
5170android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
5171 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005172 jint _exception = 0;
5173 const char * _exceptionType = NULL;
5174 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005175 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005176 jint _bufferOffset = (jint) 0;
5177 jint _remaining;
5178 GLfloat *params = (GLfloat *) 0;
5179
Romain Guy84cac202016-12-05 12:26:02 -08005180 if (!params_buf) {
5181 _exception = 1;
5182 _exceptionType = "java/lang/IllegalArgumentException";
5183 _exceptionMessage = "params == null";
5184 goto exit;
5185 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005186 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005187 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005188 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005189 params = (GLfloat *) (_paramsBase + _bufferOffset);
5190 }
5191 glGetSamplerParameterfv(
5192 (GLuint)sampler,
5193 (GLenum)pname,
5194 (GLfloat *)params
5195 );
Romain Guy84cac202016-12-05 12:26:02 -08005196
5197exit:
Jesse Halld830e742013-03-29 11:02:35 -07005198 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005199 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5200 }
5201 if (_exception) {
5202 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005203 }
5204}
5205
5206/* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
5207static void
5208android_glVertexAttribDivisor__II
5209 (JNIEnv *_env, jobject _this, jint index, jint divisor) {
5210 glVertexAttribDivisor(
5211 (GLuint)index,
5212 (GLuint)divisor
5213 );
5214}
5215
5216/* void glBindTransformFeedback ( GLenum target, GLuint id ) */
5217static void
5218android_glBindTransformFeedback__II
5219 (JNIEnv *_env, jobject _this, jint target, jint id) {
5220 glBindTransformFeedback(
5221 (GLenum)target,
5222 (GLuint)id
5223 );
5224}
5225
5226/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5227static void
5228android_glDeleteTransformFeedbacks__I_3II
5229 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5230 jint _exception = 0;
5231 const char * _exceptionType = NULL;
5232 const char * _exceptionMessage = NULL;
5233 GLuint *ids_base = (GLuint *) 0;
5234 jint _remaining;
5235 GLuint *ids = (GLuint *) 0;
5236
5237 if (!ids_ref) {
5238 _exception = 1;
5239 _exceptionType = "java/lang/IllegalArgumentException";
5240 _exceptionMessage = "ids == null";
5241 goto exit;
5242 }
5243 if (offset < 0) {
5244 _exception = 1;
5245 _exceptionType = "java/lang/IllegalArgumentException";
5246 _exceptionMessage = "offset < 0";
5247 goto exit;
5248 }
5249 _remaining = _env->GetArrayLength(ids_ref) - offset;
5250 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005251 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005252 ids = ids_base + offset;
5253
5254 glDeleteTransformFeedbacks(
5255 (GLsizei)n,
5256 (GLuint *)ids
5257 );
5258
5259exit:
5260 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005261 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005262 JNI_ABORT);
5263 }
5264 if (_exception) {
5265 jniThrowException(_env, _exceptionType, _exceptionMessage);
5266 }
5267}
5268
5269/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5270static void
5271android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
5272 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005273 jint _exception = 0;
5274 const char * _exceptionType = NULL;
5275 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005276 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005277 jint _bufferOffset = (jint) 0;
5278 jint _remaining;
5279 GLuint *ids = (GLuint *) 0;
5280
Romain Guy84cac202016-12-05 12:26:02 -08005281 if (!ids_buf) {
5282 _exception = 1;
5283 _exceptionType = "java/lang/IllegalArgumentException";
5284 _exceptionMessage = "ids == null";
5285 goto exit;
5286 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005287 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005288 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005289 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005290 ids = (GLuint *) (_idsBase + _bufferOffset);
5291 }
5292 glDeleteTransformFeedbacks(
5293 (GLsizei)n,
5294 (GLuint *)ids
5295 );
Romain Guy84cac202016-12-05 12:26:02 -08005296
5297exit:
Jesse Halld830e742013-03-29 11:02:35 -07005298 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005299 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005300 }
Romain Guy84cac202016-12-05 12:26:02 -08005301 if (_exception) {
5302 jniThrowException(_env, _exceptionType, _exceptionMessage);
5303 }
Jesse Halld830e742013-03-29 11:02:35 -07005304}
5305
5306/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5307static void
5308android_glGenTransformFeedbacks__I_3II
5309 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5310 jint _exception = 0;
5311 const char * _exceptionType = NULL;
5312 const char * _exceptionMessage = NULL;
5313 GLuint *ids_base = (GLuint *) 0;
5314 jint _remaining;
5315 GLuint *ids = (GLuint *) 0;
5316
5317 if (!ids_ref) {
5318 _exception = 1;
5319 _exceptionType = "java/lang/IllegalArgumentException";
5320 _exceptionMessage = "ids == null";
5321 goto exit;
5322 }
5323 if (offset < 0) {
5324 _exception = 1;
5325 _exceptionType = "java/lang/IllegalArgumentException";
5326 _exceptionMessage = "offset < 0";
5327 goto exit;
5328 }
5329 _remaining = _env->GetArrayLength(ids_ref) - offset;
5330 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005331 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005332 ids = ids_base + offset;
5333
5334 glGenTransformFeedbacks(
5335 (GLsizei)n,
5336 (GLuint *)ids
5337 );
5338
5339exit:
5340 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005341 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005342 _exception ? JNI_ABORT: 0);
5343 }
5344 if (_exception) {
5345 jniThrowException(_env, _exceptionType, _exceptionMessage);
5346 }
5347}
5348
5349/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5350static void
5351android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
5352 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005353 jint _exception = 0;
5354 const char * _exceptionType = NULL;
5355 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005356 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005357 jint _bufferOffset = (jint) 0;
5358 jint _remaining;
5359 GLuint *ids = (GLuint *) 0;
5360
Romain Guy84cac202016-12-05 12:26:02 -08005361 if (!ids_buf) {
5362 _exception = 1;
5363 _exceptionType = "java/lang/IllegalArgumentException";
5364 _exceptionMessage = "ids == null";
5365 goto exit;
5366 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005367 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005368 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005369 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005370 ids = (GLuint *) (_idsBase + _bufferOffset);
5371 }
5372 glGenTransformFeedbacks(
5373 (GLsizei)n,
5374 (GLuint *)ids
5375 );
Romain Guy84cac202016-12-05 12:26:02 -08005376
5377exit:
Jesse Halld830e742013-03-29 11:02:35 -07005378 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005379 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
5380 }
5381 if (_exception) {
5382 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005383 }
5384}
5385
5386/* GLboolean glIsTransformFeedback ( GLuint id ) */
5387static jboolean
5388android_glIsTransformFeedback__I
5389 (JNIEnv *_env, jobject _this, jint id) {
5390 GLboolean _returnValue;
5391 _returnValue = glIsTransformFeedback(
5392 (GLuint)id
5393 );
5394 return (jboolean)_returnValue;
5395}
5396
5397/* void glPauseTransformFeedback ( void ) */
5398static void
5399android_glPauseTransformFeedback__
5400 (JNIEnv *_env, jobject _this) {
5401 glPauseTransformFeedback();
5402}
5403
5404/* void glResumeTransformFeedback ( void ) */
5405static void
5406android_glResumeTransformFeedback__
5407 (JNIEnv *_env, jobject _this) {
5408 glResumeTransformFeedback();
5409}
5410
5411/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5412static void
5413android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
5414 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
5415 jint _exception = 0;
5416 const char * _exceptionType = NULL;
5417 const char * _exceptionMessage = NULL;
5418 jarray _array = (jarray) 0;
5419 jint _bufferOffset = (jint) 0;
5420 GLsizei *length_base = (GLsizei *) 0;
5421 jint _lengthRemaining;
5422 GLsizei *length = (GLsizei *) 0;
5423 GLenum *binaryFormat_base = (GLenum *) 0;
5424 jint _binaryFormatRemaining;
5425 GLenum *binaryFormat = (GLenum *) 0;
5426 jint _binaryRemaining;
5427 GLvoid *binary = (GLvoid *) 0;
5428
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005429 if (length_ref) {
5430 if (lengthOffset < 0) {
5431 _exception = 1;
5432 _exceptionType = "java/lang/IllegalArgumentException";
5433 _exceptionMessage = "lengthOffset < 0";
5434 goto exit;
5435 }
5436 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
5437 length_base = (GLsizei *)
5438 _env->GetIntArrayElements(length_ref, (jboolean *)0);
5439 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07005440 }
Jesse Halld830e742013-03-29 11:02:35 -07005441
5442 if (!binaryFormat_ref) {
5443 _exception = 1;
5444 _exceptionType = "java/lang/IllegalArgumentException";
5445 _exceptionMessage = "binaryFormat == null";
5446 goto exit;
5447 }
5448 if (binaryFormatOffset < 0) {
5449 _exception = 1;
5450 _exceptionType = "java/lang/IllegalArgumentException";
5451 _exceptionMessage = "binaryFormatOffset < 0";
5452 goto exit;
5453 }
5454 _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
5455 binaryFormat_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005456 _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005457 binaryFormat = binaryFormat_base + binaryFormatOffset;
5458
Romain Guy84cac202016-12-05 12:26:02 -08005459 if (!binary_buf) {
5460 _exception = 1;
5461 _exceptionType = "java/lang/IllegalArgumentException";
5462 _exceptionMessage = "binary == null";
5463 goto exit;
5464 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005465 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005466 if (binary == NULL) {
5467 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5468 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5469 }
5470 glGetProgramBinary(
5471 (GLuint)program,
5472 (GLsizei)bufSize,
5473 (GLsizei *)length,
5474 (GLenum *)binaryFormat,
5475 (GLvoid *)binary
5476 );
5477
5478exit:
5479 if (_array) {
5480 releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
5481 }
5482 if (binaryFormat_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005483 _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
Jesse Halld830e742013-03-29 11:02:35 -07005484 _exception ? JNI_ABORT: 0);
5485 }
5486 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005487 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07005488 _exception ? JNI_ABORT: 0);
5489 }
5490 if (_exception) {
5491 jniThrowException(_env, _exceptionType, _exceptionMessage);
5492 }
5493}
5494
5495/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5496static void
5497android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
5498 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005499 jint _exception = 0;
5500 const char * _exceptionType = NULL;
5501 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005502 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005503 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005504 jintArray _binaryFormatArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005505 jint _binaryFormatBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005506 jintArray _binaryArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005507 jint _binaryBufferOffset = (jint) 0;
5508 jint _lengthRemaining;
5509 GLsizei *length = (GLsizei *) 0;
5510 jint _binaryFormatRemaining;
5511 GLenum *binaryFormat = (GLenum *) 0;
5512 jint _binaryRemaining;
5513 GLvoid *binary = (GLvoid *) 0;
5514
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005515 if (length_buf) {
5516 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
5517 }
Romain Guy84cac202016-12-05 12:26:02 -08005518 if (!binaryFormat_buf) {
5519 _exception = 1;
5520 _exceptionType = "java/lang/IllegalArgumentException";
5521 _exceptionMessage = "binaryFormat == null";
5522 goto exit;
5523 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005524 binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08005525 if (!binary_buf) {
5526 _exception = 1;
5527 _exceptionType = "java/lang/IllegalArgumentException";
5528 _exceptionMessage = "binary == null";
5529 goto exit;
5530 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005531 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005532 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005533 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005534 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
5535 }
5536 if (binaryFormat == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005537 char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005538 binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
5539 }
5540 if (binary == NULL) {
5541 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
5542 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
5543 }
5544 glGetProgramBinary(
5545 (GLuint)program,
5546 (GLsizei)bufSize,
5547 (GLsizei *)length,
5548 (GLenum *)binaryFormat,
5549 (GLvoid *)binary
5550 );
Romain Guy84cac202016-12-05 12:26:02 -08005551
5552exit:
Jesse Halld830e742013-03-29 11:02:35 -07005553 if (_binaryArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005554 releasePointer(_env, _binaryArray, binary, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07005555 }
5556 if (_binaryFormatArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005557 _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07005558 }
5559 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005560 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
5561 }
5562 if (_exception) {
5563 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005564 }
5565}
5566
5567/* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
5568static void
5569android_glProgramBinary__IILjava_nio_Buffer_2I
5570 (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
Romain Guy84cac202016-12-05 12:26:02 -08005571 jint _exception = 0;
5572 const char * _exceptionType = NULL;
5573 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07005574 jarray _array = (jarray) 0;
5575 jint _bufferOffset = (jint) 0;
5576 jint _remaining;
5577 GLvoid *binary = (GLvoid *) 0;
5578
Romain Guy84cac202016-12-05 12:26:02 -08005579 if (!binary_buf) {
5580 _exception = 1;
5581 _exceptionType = "java/lang/IllegalArgumentException";
5582 _exceptionMessage = "binary == null";
5583 goto exit;
5584 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005585 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005586 if (binary == NULL) {
5587 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5588 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5589 }
5590 glProgramBinary(
5591 (GLuint)program,
5592 (GLenum)binaryFormat,
5593 (GLvoid *)binary,
5594 (GLsizei)length
5595 );
Romain Guy84cac202016-12-05 12:26:02 -08005596
5597exit:
Jesse Halld830e742013-03-29 11:02:35 -07005598 if (_array) {
5599 releasePointer(_env, _array, binary, JNI_FALSE);
5600 }
Romain Guy84cac202016-12-05 12:26:02 -08005601 if (_exception) {
5602 jniThrowException(_env, _exceptionType, _exceptionMessage);
5603 }
Jesse Halld830e742013-03-29 11:02:35 -07005604}
5605
5606/* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
5607static void
5608android_glProgramParameteri__III
5609 (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
5610 glProgramParameteri(
5611 (GLuint)program,
5612 (GLenum)pname,
5613 (GLint)value
5614 );
5615}
5616
5617/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5618static void
5619android_glInvalidateFramebuffer__II_3II
5620 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
5621 jint _exception = 0;
5622 const char * _exceptionType = NULL;
5623 const char * _exceptionMessage = NULL;
5624 GLenum *attachments_base = (GLenum *) 0;
5625 jint _remaining;
5626 GLenum *attachments = (GLenum *) 0;
5627
5628 if (!attachments_ref) {
5629 _exception = 1;
5630 _exceptionType = "java/lang/IllegalArgumentException";
5631 _exceptionMessage = "attachments == null";
5632 goto exit;
5633 }
5634 if (offset < 0) {
5635 _exception = 1;
5636 _exceptionType = "java/lang/IllegalArgumentException";
5637 _exceptionMessage = "offset < 0";
5638 goto exit;
5639 }
5640 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5641 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005642 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005643 attachments = attachments_base + offset;
5644
5645 glInvalidateFramebuffer(
5646 (GLenum)target,
5647 (GLsizei)numAttachments,
5648 (GLenum *)attachments
5649 );
5650
5651exit:
5652 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005653 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005654 JNI_ABORT);
5655 }
5656 if (_exception) {
5657 jniThrowException(_env, _exceptionType, _exceptionMessage);
5658 }
5659}
5660
5661/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5662static void
5663android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
5664 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005665 jint _exception = 0;
5666 const char * _exceptionType = NULL;
5667 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005668 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005669 jint _bufferOffset = (jint) 0;
5670 jint _remaining;
5671 GLenum *attachments = (GLenum *) 0;
5672
Romain Guy84cac202016-12-05 12:26:02 -08005673 if (!attachments_buf) {
5674 _exception = 1;
5675 _exceptionType = "java/lang/IllegalArgumentException";
5676 _exceptionMessage = "attachments == null";
5677 goto exit;
5678 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005679 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005680 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005681 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005682 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5683 }
5684 glInvalidateFramebuffer(
5685 (GLenum)target,
5686 (GLsizei)numAttachments,
5687 (GLenum *)attachments
5688 );
Romain Guy84cac202016-12-05 12:26:02 -08005689
5690exit:
Jesse Halld830e742013-03-29 11:02:35 -07005691 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005692 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005693 }
Romain Guy84cac202016-12-05 12:26:02 -08005694 if (_exception) {
5695 jniThrowException(_env, _exceptionType, _exceptionMessage);
5696 }
Jesse Halld830e742013-03-29 11:02:35 -07005697}
5698
5699/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5700static void
5701android_glInvalidateSubFramebuffer__II_3IIIIII
5702 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
5703 jint _exception = 0;
5704 const char * _exceptionType = NULL;
5705 const char * _exceptionMessage = NULL;
5706 GLenum *attachments_base = (GLenum *) 0;
5707 jint _remaining;
5708 GLenum *attachments = (GLenum *) 0;
5709
5710 if (!attachments_ref) {
5711 _exception = 1;
5712 _exceptionType = "java/lang/IllegalArgumentException";
5713 _exceptionMessage = "attachments == null";
5714 goto exit;
5715 }
5716 if (offset < 0) {
5717 _exception = 1;
5718 _exceptionType = "java/lang/IllegalArgumentException";
5719 _exceptionMessage = "offset < 0";
5720 goto exit;
5721 }
5722 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5723 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005724 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005725 attachments = attachments_base + offset;
5726
5727 glInvalidateSubFramebuffer(
5728 (GLenum)target,
5729 (GLsizei)numAttachments,
5730 (GLenum *)attachments,
5731 (GLint)x,
5732 (GLint)y,
5733 (GLsizei)width,
5734 (GLsizei)height
5735 );
5736
5737exit:
5738 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005739 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005740 JNI_ABORT);
5741 }
5742 if (_exception) {
5743 jniThrowException(_env, _exceptionType, _exceptionMessage);
5744 }
5745}
5746
5747/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5748static void
5749android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
5750 (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 -08005751 jint _exception = 0;
5752 const char * _exceptionType = NULL;
5753 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005754 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005755 jint _bufferOffset = (jint) 0;
5756 jint _remaining;
5757 GLenum *attachments = (GLenum *) 0;
5758
Romain Guy84cac202016-12-05 12:26:02 -08005759 if (!attachments_buf) {
5760 _exception = 1;
5761 _exceptionType = "java/lang/IllegalArgumentException";
5762 _exceptionMessage = "attachments == null";
5763 goto exit;
5764 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005765 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005766 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005767 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005768 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5769 }
5770 glInvalidateSubFramebuffer(
5771 (GLenum)target,
5772 (GLsizei)numAttachments,
5773 (GLenum *)attachments,
5774 (GLint)x,
5775 (GLint)y,
5776 (GLsizei)width,
5777 (GLsizei)height
5778 );
Romain Guy84cac202016-12-05 12:26:02 -08005779
5780exit:
Jesse Halld830e742013-03-29 11:02:35 -07005781 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005782 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005783 }
Romain Guy84cac202016-12-05 12:26:02 -08005784 if (_exception) {
5785 jniThrowException(_env, _exceptionType, _exceptionMessage);
5786 }
Jesse Halld830e742013-03-29 11:02:35 -07005787}
5788
5789/* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
5790static void
5791android_glTexStorage2D__IIIII
5792 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
5793 glTexStorage2D(
5794 (GLenum)target,
5795 (GLsizei)levels,
5796 (GLenum)internalformat,
5797 (GLsizei)width,
5798 (GLsizei)height
5799 );
5800}
5801
5802/* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
5803static void
5804android_glTexStorage3D__IIIIII
5805 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
5806 glTexStorage3D(
5807 (GLenum)target,
5808 (GLsizei)levels,
5809 (GLenum)internalformat,
5810 (GLsizei)width,
5811 (GLsizei)height,
5812 (GLsizei)depth
5813 );
5814}
5815
5816/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5817static void
5818android_glGetInternalformativ__IIII_3II
5819 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
5820 jint _exception = 0;
5821 const char * _exceptionType = NULL;
5822 const char * _exceptionMessage = NULL;
5823 GLint *params_base = (GLint *) 0;
5824 jint _remaining;
5825 GLint *params = (GLint *) 0;
5826
5827 if (!params_ref) {
5828 _exception = 1;
5829 _exceptionType = "java/lang/IllegalArgumentException";
5830 _exceptionMessage = "params == null";
5831 goto exit;
5832 }
5833 if (offset < 0) {
5834 _exception = 1;
5835 _exceptionType = "java/lang/IllegalArgumentException";
5836 _exceptionMessage = "offset < 0";
5837 goto exit;
5838 }
5839 _remaining = _env->GetArrayLength(params_ref) - offset;
5840 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005841 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005842 params = params_base + offset;
5843
5844 glGetInternalformativ(
5845 (GLenum)target,
5846 (GLenum)internalformat,
5847 (GLenum)pname,
5848 (GLsizei)bufSize,
5849 (GLint *)params
5850 );
5851
5852exit:
5853 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005854 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005855 _exception ? JNI_ABORT: 0);
5856 }
5857 if (_exception) {
5858 jniThrowException(_env, _exceptionType, _exceptionMessage);
5859 }
5860}
5861
5862/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5863static void
5864android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
5865 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005866 jint _exception = 0;
5867 const char * _exceptionType = NULL;
5868 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005869 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005870 jint _bufferOffset = (jint) 0;
5871 jint _remaining;
5872 GLint *params = (GLint *) 0;
5873
Romain Guy84cac202016-12-05 12:26:02 -08005874 if (!params_buf) {
5875 _exception = 1;
5876 _exceptionType = "java/lang/IllegalArgumentException";
5877 _exceptionMessage = "params == null";
5878 goto exit;
5879 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005880 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005881 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005882 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005883 params = (GLint *) (_paramsBase + _bufferOffset);
5884 }
5885 glGetInternalformativ(
5886 (GLenum)target,
5887 (GLenum)internalformat,
5888 (GLenum)pname,
5889 (GLsizei)bufSize,
5890 (GLint *)params
5891 );
Romain Guy84cac202016-12-05 12:26:02 -08005892
5893exit:
Jesse Halld830e742013-03-29 11:02:35 -07005894 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005895 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5896 }
5897 if (_exception) {
5898 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005899 }
5900}
5901
Pablo Ceballos68981ff2016-02-22 11:50:31 -08005902/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
5903static void
5904android_glReadPixels__IIIIIII
5905 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
5906 glReadPixels(
5907 (GLint)x,
5908 (GLint)y,
5909 (GLsizei)width,
5910 (GLsizei)height,
5911 (GLenum)format,
5912 (GLenum)type,
5913 reinterpret_cast<GLvoid *>(offset)
5914 );
5915}
5916
Jesse Halld830e742013-03-29 11:02:35 -07005917static const char *classPathName = "android/opengl/GLES30";
5918
Daniel Micay76f6a862015-09-19 17:31:01 -04005919static const JNINativeMethod methods[] = {
Jesse Halld830e742013-03-29 11:02:35 -07005920{"_nativeClassInit", "()V", (void*)nativeClassInit },
5921{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
5922{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
5923{"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
5924{"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
5925{"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
5926{"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5927{"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
5928{"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
5929{"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
5930{"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
5931{"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5932{"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
5933{"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
5934{"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
5935{"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
5936{"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
5937{"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
5938{"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
5939{"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
5940{"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
5941{"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
5942{"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
5943{"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
5944{"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
5945{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
5946{"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
5947{"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
5948{"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
5949{"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
5950{"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
5951{"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
5952{"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
5953{"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
5954{"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
5955{"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
5956{"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
5957{"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
5958{"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
5959{"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
5960{"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
5961{"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
5962{"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
5963{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
5964{"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
5965{"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
5966{"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
5967{"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
5968{"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
5969{"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
5970{"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
5971{"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
5972{"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
5973{"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
5974{"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
5975{"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
5976{"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
5977{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
5978{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
5979{"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 -08005980{"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 -07005981{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
5982{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
5983{"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
5984{"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
5985{"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
5986{"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
5987{"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
5988{"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
5989{"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
5990{"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
5991{"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
5992{"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
5993{"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
5994{"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
5995{"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
5996{"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
5997{"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
5998{"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
5999{"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
6000{"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
6001{"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
6002{"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
6003{"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
6004{"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
6005{"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
6006{"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
6007{"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
6008{"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
6009{"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
6010{"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
6011{"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
6012{"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
6013{"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
6014{"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
6015{"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
6016{"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
6017{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
6018{"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
6019{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
Jesse Halld877efe2013-04-29 15:59:35 -07006020{"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
Jesse Halld830e742013-03-29 11:02:35 -07006021{"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
6022{"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
6023{"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
6024{"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
6025{"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
6026{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
6027{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
6028{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
6029{"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
6030{"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
6031{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
6032{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
6033{"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
6034{"glIsSync", "(J)Z", (void *) android_glIsSync__J },
6035{"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
6036{"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
6037{"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
6038{"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
6039{"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
6040{"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
6041{"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
6042{"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
6043{"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
6044{"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
6045{"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
6046{"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
6047{"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
6048{"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
6049{"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
6050{"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
6051{"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
6052{"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
6053{"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
6054{"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6055{"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
6056{"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
6057{"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6058{"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
6059{"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6060{"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
6061{"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6062{"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
6063{"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
6064{"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
6065{"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6066{"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
6067{"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6068{"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
6069{"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
6070{"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
6071{"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
6072{"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
6073{"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
6074{"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
6075{"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
6076{"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
6077{"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
6078{"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
6079{"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
6080{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
6081{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
6082{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
Pablo Ceballos68981ff2016-02-22 11:50:31 -08006083{"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
Jesse Halld830e742013-03-29 11:02:35 -07006084};
6085
6086int register_android_opengl_jni_GLES30(JNIEnv *_env)
6087{
6088 int err;
6089 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
6090 return err;
6091}