blob: a9c02195175836ac82af9aa22cf5302d4b758af4 [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 -070032
33/* special calls implemented in Android's GLES wrapper used to more
34 * efficiently bound-check passed arrays */
35extern "C" {
36#ifdef GL_VERSION_ES_CM_1_1
37GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
38 const GLvoid *ptr, GLsizei count);
39GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
40 const GLvoid *pointer, GLsizei count);
41GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
42 GLsizei stride, const GLvoid *pointer, GLsizei count);
43GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
44 GLsizei stride, const GLvoid *pointer, GLsizei count);
45GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
46 GLsizei stride, const GLvoid *pointer, GLsizei count);
47GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
48 GLsizei stride, const GLvoid *pointer, GLsizei count);
49GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
50 GLsizei stride, const GLvoid *pointer, GLsizei count);
51#endif
52#ifdef GL_ES_VERSION_2_0
53static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
54 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
55 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
56}
57#endif
58#ifdef GL_ES_VERSION_3_0
59static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count) {
61 glVertexAttribIPointer(indx, size, type, stride, pointer);
62}
63#endif
64}
65
Jesse Halld830e742013-03-29 11:02:35 -070066static void
67nativeClassInit(JNIEnv *_env, jclass glImplClass)
68{
Jesse Halld830e742013-03-29 11:02:35 -070069}
70
71static void *
72getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
73{
74 jint position;
75 jint limit;
76 jint elementSizeShift;
77 jlong pointer;
78
Orion Hodson617835922019-02-28 15:15:34 +000079 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
Jesse Halld830e742013-03-29 11:02:35 -070080 *remaining = (limit - position) << elementSizeShift;
Jesse Halld830e742013-03-29 11:02:35 -070081 if (pointer != 0L) {
Orion Hodson617835922019-02-28 15:15:34 +000082 *array = nullptr;
83 pointer += position << elementSizeShift;
Ashok Bhat01c26ea2014-02-24 09:49:07 +000084 return reinterpret_cast<void*>(pointer);
Jesse Halld830e742013-03-29 11:02:35 -070085 }
86
Orion Hodson617835922019-02-28 15:15:34 +000087 *array = jniGetNioBufferBaseArray(_env, buffer);
88 *offset = jniGetNioBufferBaseArrayOffset(_env, buffer);
89 return nullptr;
Jesse Halld830e742013-03-29 11:02:35 -070090}
91
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -070092class ByteArrayGetter {
93public:
94 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
95 return _env->GetByteArrayElements(array, is_copy);
96 }
97};
98class BooleanArrayGetter {
99public:
100 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
101 return _env->GetBooleanArrayElements(array, is_copy);
102 }
103};
104class CharArrayGetter {
105public:
106 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
107 return _env->GetCharArrayElements(array, is_copy);
108 }
109};
110class ShortArrayGetter {
111public:
112 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
113 return _env->GetShortArrayElements(array, is_copy);
114 }
115};
116class IntArrayGetter {
117public:
118 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
119 return _env->GetIntArrayElements(array, is_copy);
120 }
121};
122class LongArrayGetter {
123public:
124 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
125 return _env->GetLongArrayElements(array, is_copy);
126 }
127};
128class FloatArrayGetter {
129public:
130 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
131 return _env->GetFloatArrayElements(array, is_copy);
132 }
133};
134class DoubleArrayGetter {
135public:
136 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
137 return _env->GetDoubleArrayElements(array, is_copy);
138 }
139};
140
141template<typename JTYPEARRAY, typename ARRAYGETTER>
142static void*
143getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
144 return ARRAYGETTER::Get(_env, array, is_copy);
145}
146
147class ByteArrayReleaser {
148public:
149 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
150 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
151 }
152};
153class BooleanArrayReleaser {
154public:
155 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
156 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
157 }
158};
159class CharArrayReleaser {
160public:
161 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
162 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
163 }
164};
165class ShortArrayReleaser {
166public:
167 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
168 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
169 }
170};
171class IntArrayReleaser {
172public:
173 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
174 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
175 }
176};
177class LongArrayReleaser {
178public:
179 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
180 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
181 }
182};
183class FloatArrayReleaser {
184public:
185 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
186 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
187 }
188};
189class DoubleArrayReleaser {
190public:
191 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
192 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
193 }
194};
195
196template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
197static void
198releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
199 ARRAYRELEASER::Release(_env, array, data, commit);
200}
201
Jesse Halld830e742013-03-29 11:02:35 -0700202static void
203releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
204{
205 _env->ReleasePrimitiveArrayCritical(array, data,
206 commit ? 0 : JNI_ABORT);
207}
208
209static void *
210getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Orion Hodson617835922019-02-28 15:15:34 +0000211 jint position;
212 jint limit;
213 jint elementSizeShift;
214 jlong pointer;
215 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
216 if (pointer == 0) {
Jesse Halld830e742013-03-29 11:02:35 -0700217 jniThrowException(_env, "java/lang/IllegalArgumentException",
218 "Must use a native order direct Buffer");
Orion Hodson617835922019-02-28 15:15:34 +0000219 return nullptr;
Jesse Halld830e742013-03-29 11:02:35 -0700220 }
Orion Hodson617835922019-02-28 15:15:34 +0000221 pointer += position << elementSizeShift;
222 return reinterpret_cast<void*>(pointer);
Jesse Halld830e742013-03-29 11:02:35 -0700223}
224
225// --------------------------------------------------------------------------
226
227/*
228 * returns the number of values glGet returns for a given pname.
229 *
230 * The code below is written such that pnames requiring only one values
231 * are the default (and are not explicitely tested for). This makes the
232 * checking code much shorter/readable/efficient.
233 *
234 * This means that unknown pnames (e.g.: extensions) will default to 1. If
235 * that unknown pname needs more than 1 value, then the validation check
236 * is incomplete and the app may crash if it passed the wrong number params.
237 */
238static int getNeededCount(GLint pname) {
239 int needed = 1;
Romain Guydc43a6c2017-02-17 19:54:25 -0800240#ifdef GL_ES_VERSION_3_0
241 // GLES 3.x pnames
242 switch (pname) {
243 case GL_MAX_VIEWPORT_DIMS:
244 needed = 2;
245 break;
246
247 case GL_PROGRAM_BINARY_FORMATS:
248 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
249 break;
250 }
251#endif
252
Jesse Halld830e742013-03-29 11:02:35 -0700253#ifdef GL_ES_VERSION_2_0
254 // GLES 2.x pnames
255 switch (pname) {
256 case GL_ALIASED_LINE_WIDTH_RANGE:
257 case GL_ALIASED_POINT_SIZE_RANGE:
258 needed = 2;
259 break;
260
261 case GL_BLEND_COLOR:
262 case GL_COLOR_CLEAR_VALUE:
263 case GL_COLOR_WRITEMASK:
264 case GL_SCISSOR_BOX:
265 case GL_VIEWPORT:
266 needed = 4;
267 break;
268
269 case GL_COMPRESSED_TEXTURE_FORMATS:
270 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
271 break;
272
273 case GL_SHADER_BINARY_FORMATS:
274 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
275 break;
276 }
277#endif
278
279#ifdef GL_VERSION_ES_CM_1_1
280 // GLES 1.x pnames
281 switch (pname) {
282 case GL_ALIASED_LINE_WIDTH_RANGE:
283 case GL_ALIASED_POINT_SIZE_RANGE:
284 case GL_DEPTH_RANGE:
285 case GL_SMOOTH_LINE_WIDTH_RANGE:
286 case GL_SMOOTH_POINT_SIZE_RANGE:
287 needed = 2;
288 break;
289
290 case GL_CURRENT_NORMAL:
291 case GL_POINT_DISTANCE_ATTENUATION:
292 needed = 3;
293 break;
294
295 case GL_COLOR_CLEAR_VALUE:
296 case GL_COLOR_WRITEMASK:
297 case GL_CURRENT_COLOR:
298 case GL_CURRENT_TEXTURE_COORDS:
299 case GL_FOG_COLOR:
300 case GL_LIGHT_MODEL_AMBIENT:
301 case GL_SCISSOR_BOX:
302 case GL_VIEWPORT:
303 needed = 4;
304 break;
305
306 case GL_MODELVIEW_MATRIX:
307 case GL_PROJECTION_MATRIX:
308 case GL_TEXTURE_MATRIX:
309 needed = 16;
310 break;
311
312 case GL_COMPRESSED_TEXTURE_FORMATS:
313 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
314 break;
315 }
316#endif
317 return needed;
318}
319
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700320template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
321 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700322static void
323get
324 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
325 jint _exception = 0;
326 const char * _exceptionType;
327 const char * _exceptionMessage;
328 CTYPE *params_base = (CTYPE *) 0;
329 jint _remaining;
330 CTYPE *params = (CTYPE *) 0;
331 int _needed = 0;
332
333 if (!params_ref) {
334 _exception = 1;
335 _exceptionType = "java/lang/IllegalArgumentException";
336 _exceptionMessage = "params == null";
337 goto exit;
338 }
339 if (offset < 0) {
340 _exception = 1;
341 _exceptionType = "java/lang/IllegalArgumentException";
342 _exceptionMessage = "offset < 0";
343 goto exit;
344 }
345 _remaining = _env->GetArrayLength(params_ref) - offset;
346 _needed = getNeededCount(pname);
347 // if we didn't find this pname, we just assume the user passed
348 // an array of the right size -- this might happen with extensions
349 // or if we forget an enum here.
350 if (_remaining < _needed) {
351 _exception = 1;
352 _exceptionType = "java/lang/IllegalArgumentException";
353 _exceptionMessage = "length - offset < needed";
354 goto exit;
355 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700356 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
357 _env, params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700358 params = params_base + offset;
359
360 GET(
361 (GLenum)pname,
362 (CTYPE *)params
363 );
364
365exit:
366 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700367 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
368 _env, params_ref, params_base, !_exception);
Jesse Halld830e742013-03-29 11:02:35 -0700369 }
370 if (_exception) {
371 jniThrowException(_env, _exceptionType, _exceptionMessage);
372 }
373}
374
375
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700376template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
377 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700378static void
379getarray
380 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
381 jint _exception = 0;
382 const char * _exceptionType;
383 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700384 JTYPEARRAY _array = (JTYPEARRAY) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700385 jint _bufferOffset = (jint) 0;
386 jint _remaining;
387 CTYPE *params = (CTYPE *) 0;
388 int _needed = 0;
389
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700390 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700391 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Jesse Halld830e742013-03-29 11:02:35 -0700392 _needed = getNeededCount(pname);
393 // if we didn't find this pname, we just assume the user passed
394 // an array of the right size -- this might happen with extensions
395 // or if we forget an enum here.
396 if (_needed>0 && _remaining < _needed) {
397 _exception = 1;
398 _exceptionType = "java/lang/IllegalArgumentException";
399 _exceptionMessage = "remaining() < needed";
400 goto exit;
401 }
402 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700403 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
404 _env, _array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700405 params = (CTYPE *) (_paramsBase + _bufferOffset);
406 }
407 GET(
408 (GLenum)pname,
409 (CTYPE *)params
410 );
411
412exit:
413 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700414 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
415 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -0700416 }
417 if (_exception) {
418 jniThrowException(_env, _exceptionType, _exceptionMessage);
419 }
420}
421
422// --------------------------------------------------------------------------
423/* void glReadBuffer ( GLenum mode ) */
424static void
425android_glReadBuffer__I
426 (JNIEnv *_env, jobject _this, jint mode) {
427 glReadBuffer(
428 (GLenum)mode
429 );
430}
431
432/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
433static void
434android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
435 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800436 jint _exception = 0;
437 const char * _exceptionType = NULL;
438 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700439 jarray _array = (jarray) 0;
440 jint _bufferOffset = (jint) 0;
441 jint _remaining;
442 GLvoid *indices = (GLvoid *) 0;
443
Romain Guy84cac202016-12-05 12:26:02 -0800444 if (!indices_buf) {
445 _exception = 1;
446 _exceptionType = "java/lang/IllegalArgumentException";
447 _exceptionMessage = "indices == null";
448 goto exit;
449 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700450 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700451 if (indices == NULL) {
452 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
453 indices = (GLvoid *) (_indicesBase + _bufferOffset);
454 }
455 glDrawRangeElements(
456 (GLenum)mode,
457 (GLuint)start,
458 (GLuint)end,
459 (GLsizei)count,
460 (GLenum)type,
461 (GLvoid *)indices
462 );
Romain Guy84cac202016-12-05 12:26:02 -0800463
464exit:
Jesse Halld830e742013-03-29 11:02:35 -0700465 if (_array) {
466 releasePointer(_env, _array, indices, JNI_FALSE);
467 }
Romain Guy84cac202016-12-05 12:26:02 -0800468 if (_exception) {
469 jniThrowException(_env, _exceptionType, _exceptionMessage);
470 }
Jesse Halld830e742013-03-29 11:02:35 -0700471}
472
473/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
474static void
475android_glDrawRangeElements__IIIIII
476 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
477 glDrawRangeElements(
478 (GLenum)mode,
479 (GLuint)start,
480 (GLuint)end,
481 (GLsizei)count,
482 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000483 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700484 );
485}
486
487/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
488static void
489android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
490 (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 -0800491 jint _exception = 0;
492 const char * _exceptionType = NULL;
493 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700494 jarray _array = (jarray) 0;
495 jint _bufferOffset = (jint) 0;
496 jint _remaining;
497 GLvoid *pixels = (GLvoid *) 0;
498
Pablo Ceballos6aff9062015-10-01 18:35:39 -0700499 if (pixels_buf) {
500 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
501 }
502 if (pixels_buf && pixels == NULL) {
Jesse Halld830e742013-03-29 11:02:35 -0700503 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
504 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
505 }
506 glTexImage3D(
507 (GLenum)target,
508 (GLint)level,
509 (GLint)internalformat,
510 (GLsizei)width,
511 (GLsizei)height,
512 (GLsizei)depth,
513 (GLint)border,
514 (GLenum)format,
515 (GLenum)type,
516 (GLvoid *)pixels
517 );
518 if (_array) {
519 releasePointer(_env, _array, pixels, JNI_FALSE);
520 }
Romain Guy84cac202016-12-05 12:26:02 -0800521 if (_exception) {
522 jniThrowException(_env, _exceptionType, _exceptionMessage);
523 }
Jesse Halld830e742013-03-29 11:02:35 -0700524}
525
526/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
527static void
528android_glTexImage3D__IIIIIIIIII
529 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
530 glTexImage3D(
531 (GLenum)target,
532 (GLint)level,
533 (GLint)internalformat,
534 (GLsizei)width,
535 (GLsizei)height,
536 (GLsizei)depth,
537 (GLint)border,
538 (GLenum)format,
539 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000540 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700541 );
542}
543
544/* 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 ) */
545static void
546android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
547 (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 -0800548 jint _exception = 0;
549 const char * _exceptionType = NULL;
550 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700551 jarray _array = (jarray) 0;
552 jint _bufferOffset = (jint) 0;
553 jint _remaining;
554 GLvoid *pixels = (GLvoid *) 0;
555
Romain Guy84cac202016-12-05 12:26:02 -0800556 if (!pixels_buf) {
557 _exception = 1;
558 _exceptionType = "java/lang/IllegalArgumentException";
559 _exceptionMessage = "pixels == null";
560 goto exit;
561 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700562 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700563 if (pixels == NULL) {
564 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
565 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
566 }
567 glTexSubImage3D(
568 (GLenum)target,
569 (GLint)level,
570 (GLint)xoffset,
571 (GLint)yoffset,
572 (GLint)zoffset,
573 (GLsizei)width,
574 (GLsizei)height,
575 (GLsizei)depth,
576 (GLenum)format,
577 (GLenum)type,
578 (GLvoid *)pixels
579 );
Romain Guy84cac202016-12-05 12:26:02 -0800580
581exit:
Jesse Halld830e742013-03-29 11:02:35 -0700582 if (_array) {
583 releasePointer(_env, _array, pixels, JNI_FALSE);
584 }
Romain Guy84cac202016-12-05 12:26:02 -0800585 if (_exception) {
586 jniThrowException(_env, _exceptionType, _exceptionMessage);
587 }
Jesse Halld830e742013-03-29 11:02:35 -0700588}
589
590/* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
591static void
592android_glTexSubImage3D__IIIIIIIIIII
593 (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) {
594 glTexSubImage3D(
595 (GLenum)target,
596 (GLint)level,
597 (GLint)xoffset,
598 (GLint)yoffset,
599 (GLint)zoffset,
600 (GLsizei)width,
601 (GLsizei)height,
602 (GLsizei)depth,
603 (GLenum)format,
604 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000605 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700606 );
607}
608
609/* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
610static void
611android_glCopyTexSubImage3D__IIIIIIIII
612 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
613 glCopyTexSubImage3D(
614 (GLenum)target,
615 (GLint)level,
616 (GLint)xoffset,
617 (GLint)yoffset,
618 (GLint)zoffset,
619 (GLint)x,
620 (GLint)y,
621 (GLsizei)width,
622 (GLsizei)height
623 );
624}
625
626/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
627static void
628android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
629 (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 -0800630 jint _exception = 0;
631 const char * _exceptionType = NULL;
632 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700633 jarray _array = (jarray) 0;
634 jint _bufferOffset = (jint) 0;
635 jint _remaining;
636 GLvoid *data = (GLvoid *) 0;
637
Romain Guy84cac202016-12-05 12:26:02 -0800638 if (!data_buf) {
639 _exception = 1;
640 _exceptionType = "java/lang/IllegalArgumentException";
641 _exceptionMessage = "data == null";
642 goto exit;
643 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700644 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700645 if (data == NULL) {
646 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
647 data = (GLvoid *) (_dataBase + _bufferOffset);
648 }
649 glCompressedTexImage3D(
650 (GLenum)target,
651 (GLint)level,
652 (GLenum)internalformat,
653 (GLsizei)width,
654 (GLsizei)height,
655 (GLsizei)depth,
656 (GLint)border,
657 (GLsizei)imageSize,
658 (GLvoid *)data
659 );
Romain Guy84cac202016-12-05 12:26:02 -0800660
661exit:
Jesse Halld830e742013-03-29 11:02:35 -0700662 if (_array) {
663 releasePointer(_env, _array, data, JNI_FALSE);
664 }
Romain Guy84cac202016-12-05 12:26:02 -0800665 if (_exception) {
666 jniThrowException(_env, _exceptionType, _exceptionMessage);
667 }
Jesse Halld830e742013-03-29 11:02:35 -0700668}
669
670/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
671static void
672android_glCompressedTexImage3D__IIIIIIIII
673 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
674 glCompressedTexImage3D(
675 (GLenum)target,
676 (GLint)level,
677 (GLenum)internalformat,
678 (GLsizei)width,
679 (GLsizei)height,
680 (GLsizei)depth,
681 (GLint)border,
682 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000683 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700684 );
685}
686
687/* 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 ) */
688static void
689android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
690 (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 -0800691 jint _exception = 0;
692 const char * _exceptionType = NULL;
693 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -0700694 jarray _array = (jarray) 0;
695 jint _bufferOffset = (jint) 0;
696 jint _remaining;
697 GLvoid *data = (GLvoid *) 0;
698
Romain Guy84cac202016-12-05 12:26:02 -0800699 if (!data_buf) {
700 _exception = 1;
701 _exceptionType = "java/lang/IllegalArgumentException";
702 _exceptionMessage = "data == null";
703 goto exit;
704 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700705 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700706 if (data == NULL) {
707 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
708 data = (GLvoid *) (_dataBase + _bufferOffset);
709 }
710 glCompressedTexSubImage3D(
711 (GLenum)target,
712 (GLint)level,
713 (GLint)xoffset,
714 (GLint)yoffset,
715 (GLint)zoffset,
716 (GLsizei)width,
717 (GLsizei)height,
718 (GLsizei)depth,
719 (GLenum)format,
720 (GLsizei)imageSize,
721 (GLvoid *)data
722 );
Romain Guy84cac202016-12-05 12:26:02 -0800723
724exit:
Jesse Halld830e742013-03-29 11:02:35 -0700725 if (_array) {
726 releasePointer(_env, _array, data, JNI_FALSE);
727 }
Romain Guy84cac202016-12-05 12:26:02 -0800728 if (_exception) {
729 jniThrowException(_env, _exceptionType, _exceptionMessage);
730 }
Jesse Halld830e742013-03-29 11:02:35 -0700731}
732
733/* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
734static void
735android_glCompressedTexSubImage3D__IIIIIIIIIII
736 (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) {
737 glCompressedTexSubImage3D(
738 (GLenum)target,
739 (GLint)level,
740 (GLint)xoffset,
741 (GLint)yoffset,
742 (GLint)zoffset,
743 (GLsizei)width,
744 (GLsizei)height,
745 (GLsizei)depth,
746 (GLenum)format,
747 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000748 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700749 );
750}
751
752/* void glGenQueries ( GLsizei n, GLuint *ids ) */
753static void
754android_glGenQueries__I_3II
755 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
756 jint _exception = 0;
757 const char * _exceptionType = NULL;
758 const char * _exceptionMessage = NULL;
759 GLuint *ids_base = (GLuint *) 0;
760 jint _remaining;
761 GLuint *ids = (GLuint *) 0;
762
763 if (!ids_ref) {
764 _exception = 1;
765 _exceptionType = "java/lang/IllegalArgumentException";
766 _exceptionMessage = "ids == null";
767 goto exit;
768 }
769 if (offset < 0) {
770 _exception = 1;
771 _exceptionType = "java/lang/IllegalArgumentException";
772 _exceptionMessage = "offset < 0";
773 goto exit;
774 }
775 _remaining = _env->GetArrayLength(ids_ref) - offset;
776 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700777 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700778 ids = ids_base + offset;
779
780 glGenQueries(
781 (GLsizei)n,
782 (GLuint *)ids
783 );
784
785exit:
786 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700787 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700788 _exception ? JNI_ABORT: 0);
789 }
790 if (_exception) {
791 jniThrowException(_env, _exceptionType, _exceptionMessage);
792 }
793}
794
795/* void glGenQueries ( GLsizei n, GLuint *ids ) */
796static void
797android_glGenQueries__ILjava_nio_IntBuffer_2
798 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800799 jint _exception = 0;
800 const char * _exceptionType = NULL;
801 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700802 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700803 jint _bufferOffset = (jint) 0;
804 jint _remaining;
805 GLuint *ids = (GLuint *) 0;
806
Romain Guy84cac202016-12-05 12:26:02 -0800807 if (!ids_buf) {
808 _exception = 1;
809 _exceptionType = "java/lang/IllegalArgumentException";
810 _exceptionMessage = "ids == null";
811 goto exit;
812 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700813 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700814 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700815 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700816 ids = (GLuint *) (_idsBase + _bufferOffset);
817 }
818 glGenQueries(
819 (GLsizei)n,
820 (GLuint *)ids
821 );
Romain Guy84cac202016-12-05 12:26:02 -0800822
823exit:
Jesse Halld830e742013-03-29 11:02:35 -0700824 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -0800825 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
826 }
827 if (_exception) {
828 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -0700829 }
830}
831
832/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
833static void
834android_glDeleteQueries__I_3II
835 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
836 jint _exception = 0;
837 const char * _exceptionType = NULL;
838 const char * _exceptionMessage = NULL;
839 GLuint *ids_base = (GLuint *) 0;
840 jint _remaining;
841 GLuint *ids = (GLuint *) 0;
842
843 if (!ids_ref) {
844 _exception = 1;
845 _exceptionType = "java/lang/IllegalArgumentException";
846 _exceptionMessage = "ids == null";
847 goto exit;
848 }
849 if (offset < 0) {
850 _exception = 1;
851 _exceptionType = "java/lang/IllegalArgumentException";
852 _exceptionMessage = "offset < 0";
853 goto exit;
854 }
855 _remaining = _env->GetArrayLength(ids_ref) - offset;
856 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700857 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700858 ids = ids_base + offset;
859
860 glDeleteQueries(
861 (GLsizei)n,
862 (GLuint *)ids
863 );
864
865exit:
866 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700867 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700868 JNI_ABORT);
869 }
870 if (_exception) {
871 jniThrowException(_env, _exceptionType, _exceptionMessage);
872 }
873}
874
875/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
876static void
877android_glDeleteQueries__ILjava_nio_IntBuffer_2
878 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800879 jint _exception = 0;
880 const char * _exceptionType = NULL;
881 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700882 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700883 jint _bufferOffset = (jint) 0;
884 jint _remaining;
885 GLuint *ids = (GLuint *) 0;
886
Romain Guy84cac202016-12-05 12:26:02 -0800887 if (!ids_buf) {
888 _exception = 1;
889 _exceptionType = "java/lang/IllegalArgumentException";
890 _exceptionMessage = "ids == null";
891 goto exit;
892 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700893 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700894 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700895 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700896 ids = (GLuint *) (_idsBase + _bufferOffset);
897 }
898 glDeleteQueries(
899 (GLsizei)n,
900 (GLuint *)ids
901 );
Romain Guy84cac202016-12-05 12:26:02 -0800902
903exit:
Jesse Halld830e742013-03-29 11:02:35 -0700904 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700905 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -0700906 }
Romain Guy84cac202016-12-05 12:26:02 -0800907 if (_exception) {
908 jniThrowException(_env, _exceptionType, _exceptionMessage);
909 }
Jesse Halld830e742013-03-29 11:02:35 -0700910}
911
912/* GLboolean glIsQuery ( GLuint id ) */
913static jboolean
914android_glIsQuery__I
915 (JNIEnv *_env, jobject _this, jint id) {
916 GLboolean _returnValue;
917 _returnValue = glIsQuery(
918 (GLuint)id
919 );
920 return (jboolean)_returnValue;
921}
922
923/* void glBeginQuery ( GLenum target, GLuint id ) */
924static void
925android_glBeginQuery__II
926 (JNIEnv *_env, jobject _this, jint target, jint id) {
927 glBeginQuery(
928 (GLenum)target,
929 (GLuint)id
930 );
931}
932
933/* void glEndQuery ( GLenum target ) */
934static void
935android_glEndQuery__I
936 (JNIEnv *_env, jobject _this, jint target) {
937 glEndQuery(
938 (GLenum)target
939 );
940}
941
942/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
943static void
944android_glGetQueryiv__II_3II
945 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
946 jint _exception = 0;
947 const char * _exceptionType = NULL;
948 const char * _exceptionMessage = NULL;
949 GLint *params_base = (GLint *) 0;
950 jint _remaining;
951 GLint *params = (GLint *) 0;
952
953 if (!params_ref) {
954 _exception = 1;
955 _exceptionType = "java/lang/IllegalArgumentException";
956 _exceptionMessage = "params == null";
957 goto exit;
958 }
959 if (offset < 0) {
960 _exception = 1;
961 _exceptionType = "java/lang/IllegalArgumentException";
962 _exceptionMessage = "offset < 0";
963 goto exit;
964 }
965 _remaining = _env->GetArrayLength(params_ref) - offset;
966 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700967 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700968 params = params_base + offset;
969
970 glGetQueryiv(
971 (GLenum)target,
972 (GLenum)pname,
973 (GLint *)params
974 );
975
976exit:
977 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700978 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -0700979 _exception ? JNI_ABORT: 0);
980 }
981 if (_exception) {
982 jniThrowException(_env, _exceptionType, _exceptionMessage);
983 }
984}
985
986/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
987static void
988android_glGetQueryiv__IILjava_nio_IntBuffer_2
989 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800990 jint _exception = 0;
991 const char * _exceptionType = NULL;
992 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700993 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700994 jint _bufferOffset = (jint) 0;
995 jint _remaining;
996 GLint *params = (GLint *) 0;
997
Romain Guy84cac202016-12-05 12:26:02 -0800998 if (!params_buf) {
999 _exception = 1;
1000 _exceptionType = "java/lang/IllegalArgumentException";
1001 _exceptionMessage = "params == null";
1002 goto exit;
1003 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001004 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001005 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001006 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001007 params = (GLint *) (_paramsBase + _bufferOffset);
1008 }
1009 glGetQueryiv(
1010 (GLenum)target,
1011 (GLenum)pname,
1012 (GLint *)params
1013 );
Romain Guy84cac202016-12-05 12:26:02 -08001014
1015exit:
Jesse Halld830e742013-03-29 11:02:35 -07001016 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001017 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1018 }
1019 if (_exception) {
1020 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001021 }
1022}
1023
1024/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1025static void
1026android_glGetQueryObjectuiv__II_3II
1027 (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
1028 jint _exception = 0;
1029 const char * _exceptionType = NULL;
1030 const char * _exceptionMessage = NULL;
1031 GLuint *params_base = (GLuint *) 0;
1032 jint _remaining;
1033 GLuint *params = (GLuint *) 0;
1034
1035 if (!params_ref) {
1036 _exception = 1;
1037 _exceptionType = "java/lang/IllegalArgumentException";
1038 _exceptionMessage = "params == null";
1039 goto exit;
1040 }
1041 if (offset < 0) {
1042 _exception = 1;
1043 _exceptionType = "java/lang/IllegalArgumentException";
1044 _exceptionMessage = "offset < 0";
1045 goto exit;
1046 }
1047 _remaining = _env->GetArrayLength(params_ref) - offset;
1048 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001049 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001050 params = params_base + offset;
1051
1052 glGetQueryObjectuiv(
1053 (GLuint)id,
1054 (GLenum)pname,
1055 (GLuint *)params
1056 );
1057
1058exit:
1059 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001060 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07001061 _exception ? JNI_ABORT: 0);
1062 }
1063 if (_exception) {
1064 jniThrowException(_env, _exceptionType, _exceptionMessage);
1065 }
1066}
1067
1068/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
1069static void
1070android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
1071 (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001072 jint _exception = 0;
1073 const char * _exceptionType = NULL;
1074 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001075 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001076 jint _bufferOffset = (jint) 0;
1077 jint _remaining;
1078 GLuint *params = (GLuint *) 0;
1079
Romain Guy84cac202016-12-05 12:26:02 -08001080 if (!params_buf) {
1081 _exception = 1;
1082 _exceptionType = "java/lang/IllegalArgumentException";
1083 _exceptionMessage = "params == null";
1084 goto exit;
1085 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001086 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001087 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001088 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001089 params = (GLuint *) (_paramsBase + _bufferOffset);
1090 }
1091 glGetQueryObjectuiv(
1092 (GLuint)id,
1093 (GLenum)pname,
1094 (GLuint *)params
1095 );
Romain Guy84cac202016-12-05 12:26:02 -08001096
1097exit:
Jesse Halld830e742013-03-29 11:02:35 -07001098 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001099 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1100 }
1101 if (_exception) {
1102 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001103 }
1104}
1105
1106/* GLboolean glUnmapBuffer ( GLenum target ) */
1107static jboolean
1108android_glUnmapBuffer__I
1109 (JNIEnv *_env, jobject _this, jint target) {
1110 GLboolean _returnValue;
1111 _returnValue = glUnmapBuffer(
1112 (GLenum)target
1113 );
1114 return (jboolean)_returnValue;
1115}
1116
1117/* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
1118static jobject
1119android_glGetBufferPointerv__II
1120 (JNIEnv *_env, jobject _this, jint target, jint pname) {
1121 GLint64 _mapLength;
1122 GLvoid* _p;
1123 glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
1124 glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
1125 return _env->NewDirectByteBuffer(_p, _mapLength);
1126}
1127
1128/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1129static void
1130android_glDrawBuffers__I_3II
1131 (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
1132 jint _exception = 0;
1133 const char * _exceptionType = NULL;
1134 const char * _exceptionMessage = NULL;
1135 GLenum *bufs_base = (GLenum *) 0;
1136 jint _remaining;
1137 GLenum *bufs = (GLenum *) 0;
1138
1139 if (!bufs_ref) {
1140 _exception = 1;
1141 _exceptionType = "java/lang/IllegalArgumentException";
1142 _exceptionMessage = "bufs == null";
1143 goto exit;
1144 }
1145 if (offset < 0) {
1146 _exception = 1;
1147 _exceptionType = "java/lang/IllegalArgumentException";
1148 _exceptionMessage = "offset < 0";
1149 goto exit;
1150 }
1151 _remaining = _env->GetArrayLength(bufs_ref) - offset;
1152 bufs_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001153 _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001154 bufs = bufs_base + offset;
1155
1156 glDrawBuffers(
1157 (GLsizei)n,
1158 (GLenum *)bufs
1159 );
1160
1161exit:
1162 if (bufs_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001163 _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
Jesse Halld830e742013-03-29 11:02:35 -07001164 JNI_ABORT);
1165 }
1166 if (_exception) {
1167 jniThrowException(_env, _exceptionType, _exceptionMessage);
1168 }
1169}
1170
1171/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1172static void
1173android_glDrawBuffers__ILjava_nio_IntBuffer_2
1174 (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001175 jint _exception = 0;
1176 const char * _exceptionType = NULL;
1177 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001178 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001179 jint _bufferOffset = (jint) 0;
1180 jint _remaining;
1181 GLenum *bufs = (GLenum *) 0;
1182
Romain Guy84cac202016-12-05 12:26:02 -08001183 if (!bufs_buf) {
1184 _exception = 1;
1185 _exceptionType = "java/lang/IllegalArgumentException";
1186 _exceptionMessage = "bufs == null";
1187 goto exit;
1188 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001189 bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001190 if (bufs == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001191 char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001192 bufs = (GLenum *) (_bufsBase + _bufferOffset);
1193 }
1194 glDrawBuffers(
1195 (GLsizei)n,
1196 (GLenum *)bufs
1197 );
Romain Guy84cac202016-12-05 12:26:02 -08001198
1199exit:
Jesse Halld830e742013-03-29 11:02:35 -07001200 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001201 _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001202 }
Romain Guy84cac202016-12-05 12:26:02 -08001203 if (_exception) {
1204 jniThrowException(_env, _exceptionType, _exceptionMessage);
1205 }
Jesse Halld830e742013-03-29 11:02:35 -07001206}
1207
1208/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1209static void
1210android_glUniformMatrix2x3fv__IIZ_3FI
1211 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1212 jint _exception = 0;
1213 const char * _exceptionType = NULL;
1214 const char * _exceptionMessage = NULL;
1215 GLfloat *value_base = (GLfloat *) 0;
1216 jint _remaining;
1217 GLfloat *value = (GLfloat *) 0;
1218
1219 if (!value_ref) {
1220 _exception = 1;
1221 _exceptionType = "java/lang/IllegalArgumentException";
1222 _exceptionMessage = "value == null";
1223 goto exit;
1224 }
1225 if (offset < 0) {
1226 _exception = 1;
1227 _exceptionType = "java/lang/IllegalArgumentException";
1228 _exceptionMessage = "offset < 0";
1229 goto exit;
1230 }
1231 _remaining = _env->GetArrayLength(value_ref) - offset;
1232 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001233 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001234 value = value_base + offset;
1235
1236 glUniformMatrix2x3fv(
1237 (GLint)location,
1238 (GLsizei)count,
1239 (GLboolean)transpose,
1240 (GLfloat *)value
1241 );
1242
1243exit:
1244 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001245 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001246 JNI_ABORT);
1247 }
1248 if (_exception) {
1249 jniThrowException(_env, _exceptionType, _exceptionMessage);
1250 }
1251}
1252
1253/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1254static void
1255android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
1256 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001257 jint _exception = 0;
1258 const char * _exceptionType = NULL;
1259 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001260 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001261 jint _bufferOffset = (jint) 0;
1262 jint _remaining;
1263 GLfloat *value = (GLfloat *) 0;
1264
Romain Guy84cac202016-12-05 12:26:02 -08001265 if (!value_buf) {
1266 _exception = 1;
1267 _exceptionType = "java/lang/IllegalArgumentException";
1268 _exceptionMessage = "value == null";
1269 goto exit;
1270 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001271 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001272 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001273 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001274 value = (GLfloat *) (_valueBase + _bufferOffset);
1275 }
1276 glUniformMatrix2x3fv(
1277 (GLint)location,
1278 (GLsizei)count,
1279 (GLboolean)transpose,
1280 (GLfloat *)value
1281 );
Romain Guy84cac202016-12-05 12:26:02 -08001282
1283exit:
Jesse Halld830e742013-03-29 11:02:35 -07001284 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001285 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001286 }
Romain Guy84cac202016-12-05 12:26:02 -08001287 if (_exception) {
1288 jniThrowException(_env, _exceptionType, _exceptionMessage);
1289 }
Jesse Halld830e742013-03-29 11:02:35 -07001290}
1291
1292/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1293static void
1294android_glUniformMatrix3x2fv__IIZ_3FI
1295 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1296 jint _exception = 0;
1297 const char * _exceptionType = NULL;
1298 const char * _exceptionMessage = NULL;
1299 GLfloat *value_base = (GLfloat *) 0;
1300 jint _remaining;
1301 GLfloat *value = (GLfloat *) 0;
1302
1303 if (!value_ref) {
1304 _exception = 1;
1305 _exceptionType = "java/lang/IllegalArgumentException";
1306 _exceptionMessage = "value == null";
1307 goto exit;
1308 }
1309 if (offset < 0) {
1310 _exception = 1;
1311 _exceptionType = "java/lang/IllegalArgumentException";
1312 _exceptionMessage = "offset < 0";
1313 goto exit;
1314 }
1315 _remaining = _env->GetArrayLength(value_ref) - offset;
1316 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001317 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001318 value = value_base + offset;
1319
1320 glUniformMatrix3x2fv(
1321 (GLint)location,
1322 (GLsizei)count,
1323 (GLboolean)transpose,
1324 (GLfloat *)value
1325 );
1326
1327exit:
1328 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001329 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001330 JNI_ABORT);
1331 }
1332 if (_exception) {
1333 jniThrowException(_env, _exceptionType, _exceptionMessage);
1334 }
1335}
1336
1337/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1338static void
1339android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
1340 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001341 jint _exception = 0;
1342 const char * _exceptionType = NULL;
1343 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001344 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001345 jint _bufferOffset = (jint) 0;
1346 jint _remaining;
1347 GLfloat *value = (GLfloat *) 0;
1348
Romain Guy84cac202016-12-05 12:26:02 -08001349 if (!value_buf) {
1350 _exception = 1;
1351 _exceptionType = "java/lang/IllegalArgumentException";
1352 _exceptionMessage = "value == null";
1353 goto exit;
1354 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001355 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001356 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001357 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001358 value = (GLfloat *) (_valueBase + _bufferOffset);
1359 }
1360 glUniformMatrix3x2fv(
1361 (GLint)location,
1362 (GLsizei)count,
1363 (GLboolean)transpose,
1364 (GLfloat *)value
1365 );
Romain Guy84cac202016-12-05 12:26:02 -08001366
1367exit:
Jesse Halld830e742013-03-29 11:02:35 -07001368 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001369 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001370 }
Romain Guy84cac202016-12-05 12:26:02 -08001371 if (_exception) {
1372 jniThrowException(_env, _exceptionType, _exceptionMessage);
1373 }
Jesse Halld830e742013-03-29 11:02:35 -07001374}
1375
1376/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1377static void
1378android_glUniformMatrix2x4fv__IIZ_3FI
1379 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1380 jint _exception = 0;
1381 const char * _exceptionType = NULL;
1382 const char * _exceptionMessage = NULL;
1383 GLfloat *value_base = (GLfloat *) 0;
1384 jint _remaining;
1385 GLfloat *value = (GLfloat *) 0;
1386
1387 if (!value_ref) {
1388 _exception = 1;
1389 _exceptionType = "java/lang/IllegalArgumentException";
1390 _exceptionMessage = "value == null";
1391 goto exit;
1392 }
1393 if (offset < 0) {
1394 _exception = 1;
1395 _exceptionType = "java/lang/IllegalArgumentException";
1396 _exceptionMessage = "offset < 0";
1397 goto exit;
1398 }
1399 _remaining = _env->GetArrayLength(value_ref) - offset;
1400 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001401 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001402 value = value_base + offset;
1403
1404 glUniformMatrix2x4fv(
1405 (GLint)location,
1406 (GLsizei)count,
1407 (GLboolean)transpose,
1408 (GLfloat *)value
1409 );
1410
1411exit:
1412 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001413 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001414 JNI_ABORT);
1415 }
1416 if (_exception) {
1417 jniThrowException(_env, _exceptionType, _exceptionMessage);
1418 }
1419}
1420
1421/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1422static void
1423android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
1424 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001425 jint _exception = 0;
1426 const char * _exceptionType = NULL;
1427 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001428 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001429 jint _bufferOffset = (jint) 0;
1430 jint _remaining;
1431 GLfloat *value = (GLfloat *) 0;
1432
Romain Guy84cac202016-12-05 12:26:02 -08001433 if (!value_buf) {
1434 _exception = 1;
1435 _exceptionType = "java/lang/IllegalArgumentException";
1436 _exceptionMessage = "value == null";
1437 goto exit;
1438 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001439 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001440 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001441 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001442 value = (GLfloat *) (_valueBase + _bufferOffset);
1443 }
1444 glUniformMatrix2x4fv(
1445 (GLint)location,
1446 (GLsizei)count,
1447 (GLboolean)transpose,
1448 (GLfloat *)value
1449 );
Romain Guy84cac202016-12-05 12:26:02 -08001450
1451exit:
Jesse Halld830e742013-03-29 11:02:35 -07001452 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001453 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001454 }
Romain Guy84cac202016-12-05 12:26:02 -08001455 if (_exception) {
1456 jniThrowException(_env, _exceptionType, _exceptionMessage);
1457 }
Jesse Halld830e742013-03-29 11:02:35 -07001458}
1459
1460/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1461static void
1462android_glUniformMatrix4x2fv__IIZ_3FI
1463 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1464 jint _exception = 0;
1465 const char * _exceptionType = NULL;
1466 const char * _exceptionMessage = NULL;
1467 GLfloat *value_base = (GLfloat *) 0;
1468 jint _remaining;
1469 GLfloat *value = (GLfloat *) 0;
1470
1471 if (!value_ref) {
1472 _exception = 1;
1473 _exceptionType = "java/lang/IllegalArgumentException";
1474 _exceptionMessage = "value == null";
1475 goto exit;
1476 }
1477 if (offset < 0) {
1478 _exception = 1;
1479 _exceptionType = "java/lang/IllegalArgumentException";
1480 _exceptionMessage = "offset < 0";
1481 goto exit;
1482 }
1483 _remaining = _env->GetArrayLength(value_ref) - offset;
1484 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001485 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001486 value = value_base + offset;
1487
1488 glUniformMatrix4x2fv(
1489 (GLint)location,
1490 (GLsizei)count,
1491 (GLboolean)transpose,
1492 (GLfloat *)value
1493 );
1494
1495exit:
1496 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001497 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001498 JNI_ABORT);
1499 }
1500 if (_exception) {
1501 jniThrowException(_env, _exceptionType, _exceptionMessage);
1502 }
1503}
1504
1505/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1506static void
1507android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
1508 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001509 jint _exception = 0;
1510 const char * _exceptionType = NULL;
1511 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001512 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001513 jint _bufferOffset = (jint) 0;
1514 jint _remaining;
1515 GLfloat *value = (GLfloat *) 0;
1516
Romain Guy84cac202016-12-05 12:26:02 -08001517 if (!value_buf) {
1518 _exception = 1;
1519 _exceptionType = "java/lang/IllegalArgumentException";
1520 _exceptionMessage = "value == null";
1521 goto exit;
1522 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001523 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001524 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001525 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001526 value = (GLfloat *) (_valueBase + _bufferOffset);
1527 }
1528 glUniformMatrix4x2fv(
1529 (GLint)location,
1530 (GLsizei)count,
1531 (GLboolean)transpose,
1532 (GLfloat *)value
1533 );
Romain Guy84cac202016-12-05 12:26:02 -08001534
1535exit:
Jesse Halld830e742013-03-29 11:02:35 -07001536 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001537 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001538 }
Romain Guy84cac202016-12-05 12:26:02 -08001539 if (_exception) {
1540 jniThrowException(_env, _exceptionType, _exceptionMessage);
1541 }
Jesse Halld830e742013-03-29 11:02:35 -07001542}
1543
1544/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1545static void
1546android_glUniformMatrix3x4fv__IIZ_3FI
1547 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1548 jint _exception = 0;
1549 const char * _exceptionType = NULL;
1550 const char * _exceptionMessage = NULL;
1551 GLfloat *value_base = (GLfloat *) 0;
1552 jint _remaining;
1553 GLfloat *value = (GLfloat *) 0;
1554
1555 if (!value_ref) {
1556 _exception = 1;
1557 _exceptionType = "java/lang/IllegalArgumentException";
1558 _exceptionMessage = "value == null";
1559 goto exit;
1560 }
1561 if (offset < 0) {
1562 _exception = 1;
1563 _exceptionType = "java/lang/IllegalArgumentException";
1564 _exceptionMessage = "offset < 0";
1565 goto exit;
1566 }
1567 _remaining = _env->GetArrayLength(value_ref) - offset;
1568 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001569 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001570 value = value_base + offset;
1571
1572 glUniformMatrix3x4fv(
1573 (GLint)location,
1574 (GLsizei)count,
1575 (GLboolean)transpose,
1576 (GLfloat *)value
1577 );
1578
1579exit:
1580 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001581 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001582 JNI_ABORT);
1583 }
1584 if (_exception) {
1585 jniThrowException(_env, _exceptionType, _exceptionMessage);
1586 }
1587}
1588
1589/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1590static void
1591android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
1592 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001593 jint _exception = 0;
1594 const char * _exceptionType = NULL;
1595 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001596 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001597 jint _bufferOffset = (jint) 0;
1598 jint _remaining;
1599 GLfloat *value = (GLfloat *) 0;
1600
Romain Guy84cac202016-12-05 12:26:02 -08001601 if (!value_buf) {
1602 _exception = 1;
1603 _exceptionType = "java/lang/IllegalArgumentException";
1604 _exceptionMessage = "value == null";
1605 goto exit;
1606 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001607 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001608 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001609 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001610 value = (GLfloat *) (_valueBase + _bufferOffset);
1611 }
1612 glUniformMatrix3x4fv(
1613 (GLint)location,
1614 (GLsizei)count,
1615 (GLboolean)transpose,
1616 (GLfloat *)value
1617 );
Romain Guy84cac202016-12-05 12:26:02 -08001618
1619exit:
Jesse Halld830e742013-03-29 11:02:35 -07001620 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001621 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001622 }
Romain Guy84cac202016-12-05 12:26:02 -08001623 if (_exception) {
1624 jniThrowException(_env, _exceptionType, _exceptionMessage);
1625 }
Jesse Halld830e742013-03-29 11:02:35 -07001626}
1627
1628/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1629static void
1630android_glUniformMatrix4x3fv__IIZ_3FI
1631 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1632 jint _exception = 0;
1633 const char * _exceptionType = NULL;
1634 const char * _exceptionMessage = NULL;
1635 GLfloat *value_base = (GLfloat *) 0;
1636 jint _remaining;
1637 GLfloat *value = (GLfloat *) 0;
1638
1639 if (!value_ref) {
1640 _exception = 1;
1641 _exceptionType = "java/lang/IllegalArgumentException";
1642 _exceptionMessage = "value == null";
1643 goto exit;
1644 }
1645 if (offset < 0) {
1646 _exception = 1;
1647 _exceptionType = "java/lang/IllegalArgumentException";
1648 _exceptionMessage = "offset < 0";
1649 goto exit;
1650 }
1651 _remaining = _env->GetArrayLength(value_ref) - offset;
1652 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001653 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001654 value = value_base + offset;
1655
1656 glUniformMatrix4x3fv(
1657 (GLint)location,
1658 (GLsizei)count,
1659 (GLboolean)transpose,
1660 (GLfloat *)value
1661 );
1662
1663exit:
1664 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001665 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001666 JNI_ABORT);
1667 }
1668 if (_exception) {
1669 jniThrowException(_env, _exceptionType, _exceptionMessage);
1670 }
1671}
1672
1673/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1674static void
1675android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
1676 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001677 jint _exception = 0;
1678 const char * _exceptionType = NULL;
1679 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001680 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001681 jint _bufferOffset = (jint) 0;
1682 jint _remaining;
1683 GLfloat *value = (GLfloat *) 0;
1684
Romain Guy84cac202016-12-05 12:26:02 -08001685 if (!value_buf) {
1686 _exception = 1;
1687 _exceptionType = "java/lang/IllegalArgumentException";
1688 _exceptionMessage = "value == null";
1689 goto exit;
1690 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001691 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001692 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001693 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001694 value = (GLfloat *) (_valueBase + _bufferOffset);
1695 }
1696 glUniformMatrix4x3fv(
1697 (GLint)location,
1698 (GLsizei)count,
1699 (GLboolean)transpose,
1700 (GLfloat *)value
1701 );
Romain Guy84cac202016-12-05 12:26:02 -08001702
1703exit:
Jesse Halld830e742013-03-29 11:02:35 -07001704 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001705 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001706 }
Romain Guy84cac202016-12-05 12:26:02 -08001707 if (_exception) {
1708 jniThrowException(_env, _exceptionType, _exceptionMessage);
1709 }
Jesse Halld830e742013-03-29 11:02:35 -07001710}
1711
1712/* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
1713static void
1714android_glBlitFramebuffer__IIIIIIIIII
1715 (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
1716 glBlitFramebuffer(
1717 (GLint)srcX0,
1718 (GLint)srcY0,
1719 (GLint)srcX1,
1720 (GLint)srcY1,
1721 (GLint)dstX0,
1722 (GLint)dstY0,
1723 (GLint)dstX1,
1724 (GLint)dstY1,
1725 (GLbitfield)mask,
1726 (GLenum)filter
1727 );
1728}
1729
1730/* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
1731static void
1732android_glRenderbufferStorageMultisample__IIIII
1733 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
1734 glRenderbufferStorageMultisample(
1735 (GLenum)target,
1736 (GLsizei)samples,
1737 (GLenum)internalformat,
1738 (GLsizei)width,
1739 (GLsizei)height
1740 );
1741}
1742
1743/* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
1744static void
1745android_glFramebufferTextureLayer__IIIII
1746 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
1747 glFramebufferTextureLayer(
1748 (GLenum)target,
1749 (GLenum)attachment,
1750 (GLuint)texture,
1751 (GLint)level,
1752 (GLint)layer
1753 );
1754}
1755
1756/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
1757static jobject
1758android_glMapBufferRange__IIII
1759 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
1760 GLvoid* _p = glMapBufferRange((GLenum)target,
1761 (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
1762 jobject _buf = (jobject)0;
1763 if (_p) {
1764 _buf = _env->NewDirectByteBuffer(_p, length);
1765 }
1766 return _buf;
1767}
1768
1769/* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
1770static void
1771android_glFlushMappedBufferRange__III
1772 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
1773 glFlushMappedBufferRange(
1774 (GLenum)target,
1775 (GLintptr)offset,
1776 (GLsizeiptr)length
1777 );
1778}
1779
1780/* void glBindVertexArray ( GLuint array ) */
1781static void
1782android_glBindVertexArray__I
1783 (JNIEnv *_env, jobject _this, jint array) {
1784 glBindVertexArray(
1785 (GLuint)array
1786 );
1787}
1788
1789/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1790static void
1791android_glDeleteVertexArrays__I_3II
1792 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1793 jint _exception = 0;
1794 const char * _exceptionType = NULL;
1795 const char * _exceptionMessage = NULL;
1796 GLuint *arrays_base = (GLuint *) 0;
1797 jint _remaining;
1798 GLuint *arrays = (GLuint *) 0;
1799
1800 if (!arrays_ref) {
1801 _exception = 1;
1802 _exceptionType = "java/lang/IllegalArgumentException";
1803 _exceptionMessage = "arrays == null";
1804 goto exit;
1805 }
1806 if (offset < 0) {
1807 _exception = 1;
1808 _exceptionType = "java/lang/IllegalArgumentException";
1809 _exceptionMessage = "offset < 0";
1810 goto exit;
1811 }
1812 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1813 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001814 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001815 arrays = arrays_base + offset;
1816
1817 glDeleteVertexArrays(
1818 (GLsizei)n,
1819 (GLuint *)arrays
1820 );
1821
1822exit:
1823 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001824 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001825 JNI_ABORT);
1826 }
1827 if (_exception) {
1828 jniThrowException(_env, _exceptionType, _exceptionMessage);
1829 }
1830}
1831
1832/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1833static void
1834android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
1835 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001836 jint _exception = 0;
1837 const char * _exceptionType = NULL;
1838 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001839 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001840 jint _bufferOffset = (jint) 0;
1841 jint _remaining;
1842 GLuint *arrays = (GLuint *) 0;
1843
Romain Guy84cac202016-12-05 12:26:02 -08001844 if (!arrays_buf) {
1845 _exception = 1;
1846 _exceptionType = "java/lang/IllegalArgumentException";
1847 _exceptionMessage = "arrays == null";
1848 goto exit;
1849 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001850 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001851 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001852 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001853 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1854 }
1855 glDeleteVertexArrays(
1856 (GLsizei)n,
1857 (GLuint *)arrays
1858 );
Romain Guy84cac202016-12-05 12:26:02 -08001859
1860exit:
Jesse Halld830e742013-03-29 11:02:35 -07001861 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001862 _env->ReleaseIntArrayElements(_array, (jint*)arrays, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001863 }
Romain Guy84cac202016-12-05 12:26:02 -08001864 if (_exception) {
1865 jniThrowException(_env, _exceptionType, _exceptionMessage);
1866 }
Jesse Halld830e742013-03-29 11:02:35 -07001867}
1868
1869/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1870static void
1871android_glGenVertexArrays__I_3II
1872 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1873 jint _exception = 0;
1874 const char * _exceptionType = NULL;
1875 const char * _exceptionMessage = NULL;
1876 GLuint *arrays_base = (GLuint *) 0;
1877 jint _remaining;
1878 GLuint *arrays = (GLuint *) 0;
1879
1880 if (!arrays_ref) {
1881 _exception = 1;
1882 _exceptionType = "java/lang/IllegalArgumentException";
1883 _exceptionMessage = "arrays == null";
1884 goto exit;
1885 }
1886 if (offset < 0) {
1887 _exception = 1;
1888 _exceptionType = "java/lang/IllegalArgumentException";
1889 _exceptionMessage = "offset < 0";
1890 goto exit;
1891 }
1892 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1893 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001894 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001895 arrays = arrays_base + offset;
1896
1897 glGenVertexArrays(
1898 (GLsizei)n,
1899 (GLuint *)arrays
1900 );
1901
1902exit:
1903 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001904 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001905 _exception ? JNI_ABORT: 0);
1906 }
1907 if (_exception) {
1908 jniThrowException(_env, _exceptionType, _exceptionMessage);
1909 }
1910}
1911
1912/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1913static void
1914android_glGenVertexArrays__ILjava_nio_IntBuffer_2
1915 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001916 jint _exception = 0;
1917 const char * _exceptionType = NULL;
1918 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001919 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001920 jint _bufferOffset = (jint) 0;
1921 jint _remaining;
1922 GLuint *arrays = (GLuint *) 0;
1923
Romain Guy84cac202016-12-05 12:26:02 -08001924 if (!arrays_buf) {
1925 _exception = 1;
1926 _exceptionType = "java/lang/IllegalArgumentException";
1927 _exceptionMessage = "arrays == null";
1928 goto exit;
1929 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001930 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001931 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001932 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001933 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1934 }
1935 glGenVertexArrays(
1936 (GLsizei)n,
1937 (GLuint *)arrays
1938 );
Romain Guy84cac202016-12-05 12:26:02 -08001939
1940exit:
Jesse Halld830e742013-03-29 11:02:35 -07001941 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001942 _env->ReleaseIntArrayElements(_array, (jint*)arrays, _exception ? JNI_ABORT : 0);
1943 }
1944 if (_exception) {
1945 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07001946 }
1947}
1948
1949/* GLboolean glIsVertexArray ( GLuint array ) */
1950static jboolean
1951android_glIsVertexArray__I
1952 (JNIEnv *_env, jobject _this, jint array) {
1953 GLboolean _returnValue;
1954 _returnValue = glIsVertexArray(
1955 (GLuint)array
1956 );
1957 return (jboolean)_returnValue;
1958}
1959
1960/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
1961static void
1962android_glGetIntegeri_v__II_3II
1963 (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
1964 jint _exception = 0;
1965 const char * _exceptionType = NULL;
1966 const char * _exceptionMessage = NULL;
1967 GLint *data_base = (GLint *) 0;
1968 jint _remaining;
1969 GLint *data = (GLint *) 0;
1970
1971 if (!data_ref) {
1972 _exception = 1;
1973 _exceptionType = "java/lang/IllegalArgumentException";
1974 _exceptionMessage = "data == null";
1975 goto exit;
1976 }
1977 if (offset < 0) {
1978 _exception = 1;
1979 _exceptionType = "java/lang/IllegalArgumentException";
1980 _exceptionMessage = "offset < 0";
1981 goto exit;
1982 }
1983 _remaining = _env->GetArrayLength(data_ref) - offset;
1984 data_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001985 _env->GetIntArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001986 data = data_base + offset;
1987
1988 glGetIntegeri_v(
1989 (GLenum)target,
1990 (GLuint)index,
1991 (GLint *)data
1992 );
1993
1994exit:
1995 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001996 _env->ReleaseIntArrayElements(data_ref, (jint*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07001997 _exception ? JNI_ABORT: 0);
1998 }
1999 if (_exception) {
2000 jniThrowException(_env, _exceptionType, _exceptionMessage);
2001 }
2002}
2003
2004/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
2005static void
2006android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
2007 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002008 jint _exception = 0;
2009 const char * _exceptionType = NULL;
2010 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002011 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002012 jint _bufferOffset = (jint) 0;
2013 jint _remaining;
2014 GLint *data = (GLint *) 0;
2015
Romain Guy84cac202016-12-05 12:26:02 -08002016 if (!data_buf) {
2017 _exception = 1;
2018 _exceptionType = "java/lang/IllegalArgumentException";
2019 _exceptionMessage = "data == null";
2020 goto exit;
2021 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002022 data = (GLint *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002023 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002024 char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002025 data = (GLint *) (_dataBase + _bufferOffset);
2026 }
2027 glGetIntegeri_v(
2028 (GLenum)target,
2029 (GLuint)index,
2030 (GLint *)data
2031 );
Romain Guy84cac202016-12-05 12:26:02 -08002032
2033exit:
Jesse Halld830e742013-03-29 11:02:35 -07002034 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002035 _env->ReleaseIntArrayElements(_array, (jint*)data, _exception ? JNI_ABORT : 0);
2036 }
2037 if (_exception) {
2038 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002039 }
2040}
2041
2042/* void glBeginTransformFeedback ( GLenum primitiveMode ) */
2043static void
2044android_glBeginTransformFeedback__I
2045 (JNIEnv *_env, jobject _this, jint primitiveMode) {
2046 glBeginTransformFeedback(
2047 (GLenum)primitiveMode
2048 );
2049}
2050
2051/* void glEndTransformFeedback ( void ) */
2052static void
2053android_glEndTransformFeedback__
2054 (JNIEnv *_env, jobject _this) {
2055 glEndTransformFeedback();
2056}
2057
2058/* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
2059static void
2060android_glBindBufferRange__IIIII
2061 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
2062 glBindBufferRange(
2063 (GLenum)target,
2064 (GLuint)index,
2065 (GLuint)buffer,
2066 (GLintptr)offset,
2067 (GLsizeiptr)size
2068 );
2069}
2070
2071/* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
2072static void
2073android_glBindBufferBase__III
2074 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
2075 glBindBufferBase(
2076 (GLenum)target,
2077 (GLuint)index,
2078 (GLuint)buffer
2079 );
2080}
2081
2082/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
2083static
2084void
2085android_glTransformFeedbackVaryings
2086 (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
2087 jint _exception = 0;
2088 const char* _exceptionType = NULL;
2089 const char* _exceptionMessage = NULL;
2090 jint _count = 0, _i;
2091 const char** _varyings = NULL;
2092 const char* _varying = NULL;
2093
2094 if (!varyings_ref) {
2095 _exception = 1;
2096 _exceptionType = "java/lang/IllegalArgumentException";
2097 _exceptionMessage = "varyings == null";
2098 goto exit;
2099 }
2100
2101 _count = _env->GetArrayLength(varyings_ref);
2102 _varyings = (const char**)calloc(_count, sizeof(const char*));
2103 for (_i = 0; _i < _count; _i++) {
2104 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2105 if (!_varying) {
2106 _exception = 1;
2107 _exceptionType = "java/lang/IllegalArgumentException";
2108 _exceptionMessage = "null varyings element";
2109 goto exit;
2110 }
2111 _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
2112 }
2113
2114 glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
2115
2116exit:
2117 for (_i = _count - 1; _i >= 0; _i--) {
2118 if (_varyings[_i]) {
2119 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
2120 if (_varying) {
2121 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
2122 }
2123 }
2124 }
2125 free(_varyings);
2126 if (_exception) {
2127 jniThrowException(_env, _exceptionType, _exceptionMessage);
2128 }
2129}
2130
2131/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2132static void
2133android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
2134 (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) {
2135 jint _exception = 0;
2136 const char * _exceptionType;
2137 const char * _exceptionMessage;
2138 GLsizei *length_base = (GLsizei *) 0;
2139 jint _lengthRemaining;
2140 GLsizei *length = (GLsizei *) 0;
2141 GLint *size_base = (GLint *) 0;
2142 jint _sizeRemaining;
2143 GLint *size = (GLint *) 0;
2144 GLenum *type_base = (GLenum *) 0;
2145 jint _typeRemaining;
2146 GLenum *type = (GLenum *) 0;
2147 char *name_base = (char *) 0;
2148 jint _nameRemaining;
2149 char *name = (char *) 0;
2150
Pablo Ceballos6aff9062015-10-01 18:35:39 -07002151 if (length_ref) {
2152 if (lengthOffset < 0) {
2153 _exception = 1;
2154 _exceptionType = "java/lang/IllegalArgumentException";
2155 _exceptionMessage = "lengthOffset < 0";
2156 goto exit;
2157 }
2158 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
2159 length_base = (GLsizei *)
2160 _env->GetIntArrayElements(length_ref, (jboolean *)0);
2161 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07002162 }
Jesse Halld830e742013-03-29 11:02:35 -07002163
2164 if (!size_ref) {
2165 _exception = 1;
2166 _exceptionType = "java/lang/IllegalArgumentException";
2167 _exceptionMessage = "size == null";
2168 goto exit;
2169 }
2170 if (sizeOffset < 0) {
2171 _exception = 1;
2172 _exceptionType = "java/lang/IllegalArgumentException";
2173 _exceptionMessage = "sizeOffset < 0";
2174 goto exit;
2175 }
2176 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2177 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002178 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002179 size = size_base + sizeOffset;
2180
2181 if (!type_ref) {
2182 _exception = 1;
2183 _exceptionType = "java/lang/IllegalArgumentException";
2184 _exceptionMessage = "type == null";
2185 goto exit;
2186 }
2187 if (typeOffset < 0) {
2188 _exception = 1;
2189 _exceptionType = "java/lang/IllegalArgumentException";
2190 _exceptionMessage = "typeOffset < 0";
2191 goto exit;
2192 }
2193 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2194 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002195 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002196 type = type_base + typeOffset;
2197
2198 if (!name_ref) {
2199 _exception = 1;
2200 _exceptionType = "java/lang/IllegalArgumentException";
2201 _exceptionMessage = "name == null";
2202 goto exit;
2203 }
2204 if (nameOffset < 0) {
2205 _exception = 1;
2206 _exceptionType = "java/lang/IllegalArgumentException";
2207 _exceptionMessage = "nameOffset < 0";
2208 goto exit;
2209 }
2210 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
2211 name_base = (char *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002212 _env->GetByteArrayElements(name_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002213 name = name_base + nameOffset;
2214
2215 glGetTransformFeedbackVarying(
2216 (GLuint)program,
2217 (GLuint)index,
2218 (GLsizei)bufsize,
2219 (GLsizei *)length,
2220 (GLint *)size,
2221 (GLenum *)type,
2222 (char *)name
2223 );
2224
2225exit:
2226 if (name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002227 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base,
Jesse Halld830e742013-03-29 11:02:35 -07002228 _exception ? JNI_ABORT: 0);
2229 }
2230 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002231 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002232 _exception ? JNI_ABORT: 0);
2233 }
2234 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002235 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002236 _exception ? JNI_ABORT: 0);
2237 }
2238 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002239 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07002240 _exception ? JNI_ABORT: 0);
2241 }
2242 if (_exception) {
2243 jniThrowException(_env, _exceptionType, _exceptionMessage);
2244 }
2245}
2246
2247/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2248static void
2249android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
2250 (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 -08002251 jniThrowException(_env, "java/lang/UnsupportedOperationException", "deprecated");
2252}
2253
2254/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2255static void
2256android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
2257 (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 -07002258 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002259 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002260 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002261 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002262 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002263 jint _typeBufferOffset = (jint) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002264 jbyteArray _nameArray = (jbyteArray)0;
2265 jint _nameBufferOffset = (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07002266 jint _lengthRemaining;
2267 GLsizei *length = (GLsizei *) 0;
2268 jint _sizeRemaining;
2269 GLint *size = (GLint *) 0;
2270 jint _typeRemaining;
2271 GLenum *type = (GLenum *) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002272 jint _nameRemaining;
2273 GLchar* name = (GLchar*)0;
2274
Jesse Halld830e742013-03-29 11:02:35 -07002275
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002276 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
2277 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2278 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002279 name = (GLchar*)getPointer(_env, name_buf, (jarray*)&_nameArray, &_nameRemaining, &_nameBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002280 if (length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002281 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002282 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
2283 }
2284 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002285 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002286 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2287 }
2288 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002289 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002290 type = (GLenum *) (_typeBase + _typeBufferOffset);
2291 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002292 if (name == NULL) {
2293 char* _nameBase = (char *)_env->GetByteArrayElements(_nameArray, (jboolean*)0);
2294 name = (GLchar *) (_nameBase + _nameBufferOffset);
2295 }
Jesse Halld830e742013-03-29 11:02:35 -07002296 glGetTransformFeedbackVarying(
2297 (GLuint)program,
2298 (GLuint)index,
2299 (GLsizei)bufsize,
2300 (GLsizei *)length,
2301 (GLint *)size,
2302 (GLenum *)type,
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002303 (GLchar*)name
Jesse Halld830e742013-03-29 11:02:35 -07002304 );
2305 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002306 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002307 }
2308 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002309 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002310 }
2311 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002312 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002313 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002314 if (_nameArray) {
2315 releaseArrayPointer<jbyteArray, jbyte*, ByteArrayReleaser>(_env, _nameArray, (jbyte*)name, JNI_TRUE);
2316 }
Jesse Halld830e742013-03-29 11:02:35 -07002317}
2318
2319/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2320static jstring
2321android_glGetTransformFeedbackVarying1
2322 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
2323 jint _exception = 0;
2324 const char * _exceptionType;
2325 const char * _exceptionMessage;
2326 GLint *size_base = (GLint *) 0;
2327 jint _sizeRemaining;
2328 GLint *size = (GLint *) 0;
2329 GLenum *type_base = (GLenum *) 0;
2330 jint _typeRemaining;
2331 GLenum *type = (GLenum *) 0;
2332
2333 jstring result = 0;
2334
2335 GLint len = 0;
2336 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2337 if (!len) {
2338 return _env->NewStringUTF("");
2339 }
2340 char* buf = (char*) malloc(len);
2341
2342 if (buf == NULL) {
2343 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2344 return NULL;
2345 }
2346 if (!size_ref) {
2347 _exception = 1;
2348 _exceptionType = "java/lang/IllegalArgumentException";
2349 _exceptionMessage = "size == null";
2350 goto exit;
2351 }
2352 if (sizeOffset < 0) {
2353 _exception = 1;
2354 _exceptionType = "java/lang/IllegalArgumentException";
2355 _exceptionMessage = "sizeOffset < 0";
2356 goto exit;
2357 }
2358 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2359 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002360 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002361 size = size_base + sizeOffset;
2362
2363 if (!type_ref) {
2364 _exception = 1;
2365 _exceptionType = "java/lang/IllegalArgumentException";
2366 _exceptionMessage = "type == null";
2367 goto exit;
2368 }
2369 if (typeOffset < 0) {
2370 _exception = 1;
2371 _exceptionType = "java/lang/IllegalArgumentException";
2372 _exceptionMessage = "typeOffset < 0";
2373 goto exit;
2374 }
2375 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2376 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002377 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002378 type = type_base + typeOffset;
2379
2380 glGetTransformFeedbackVarying(
2381 (GLuint)program,
2382 (GLuint)index,
2383 (GLsizei)len,
2384 NULL,
2385 (GLint *)size,
2386 (GLenum *)type,
2387 (char *)buf
2388 );
2389exit:
2390 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002391 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002392 _exception ? JNI_ABORT: 0);
2393 }
2394 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002395 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002396 _exception ? JNI_ABORT: 0);
2397 }
2398 if (_exception != 1) {
2399 result = _env->NewStringUTF(buf);
2400 }
2401 if (buf) {
2402 free(buf);
2403 }
2404 if (_exception) {
2405 jniThrowException(_env, _exceptionType, _exceptionMessage);
2406 }
2407 if (result == 0) {
2408 result = _env->NewStringUTF("");
2409 }
2410
2411 return result;
2412}
2413
2414/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2415static jstring
2416android_glGetTransformFeedbackVarying2
2417 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002418 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002419 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002420 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002421 jint _typeBufferOffset = (jint) 0;
2422 jint _lengthRemaining;
2423 GLsizei *length = (GLsizei *) 0;
2424 jint _sizeRemaining;
2425 GLint *size = (GLint *) 0;
2426 jint _typeRemaining;
2427 GLenum *type = (GLenum *) 0;
2428
2429 jstring result = 0;
2430
2431 GLint len = 0;
2432 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2433 if (!len) {
2434 return _env->NewStringUTF("");
2435 }
2436 char* buf = (char*) malloc(len);
2437
2438 if (buf == NULL) {
2439 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2440 return NULL;
2441 }
2442
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002443 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2444 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002445 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002446 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002447 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2448 }
2449 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002450 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002451 type = (GLenum *) (_typeBase + _typeBufferOffset);
2452 }
2453 glGetTransformFeedbackVarying(
2454 (GLuint)program,
2455 (GLuint)index,
2456 (GLsizei)len,
2457 NULL,
2458 (GLint *)size,
2459 (GLenum *)type,
2460 (char *)buf
2461 );
2462
2463 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002464 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002465 }
2466 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002467 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002468 }
2469 result = _env->NewStringUTF(buf);
2470 if (buf) {
2471 free(buf);
2472 }
2473 return result;
2474}
2475/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2476static void
2477android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
2478 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08002479 jint _exception = 0;
2480 const char * _exceptionType = NULL;
2481 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07002482 jarray _array = (jarray) 0;
2483 jint _bufferOffset = (jint) 0;
2484 jint _remaining;
2485 GLvoid *pointer = (GLvoid *) 0;
2486
2487 if (pointer_buf) {
2488 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2489 if ( ! pointer ) {
2490 return;
2491 }
2492 }
2493 glVertexAttribIPointerBounds(
2494 (GLuint)index,
2495 (GLint)size,
2496 (GLenum)type,
2497 (GLsizei)stride,
2498 (GLvoid *)pointer,
2499 (GLsizei)remaining
2500 );
Romain Guy84cac202016-12-05 12:26:02 -08002501 if (_exception) {
2502 jniThrowException(_env, _exceptionType, _exceptionMessage);
2503 }
Jesse Halld830e742013-03-29 11:02:35 -07002504}
2505
2506/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
2507static void
2508android_glVertexAttribIPointer__IIIII
2509 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
2510 glVertexAttribIPointer(
2511 (GLuint)index,
2512 (GLint)size,
2513 (GLenum)type,
2514 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00002515 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -07002516 );
2517}
2518
2519/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2520static void
2521android_glGetVertexAttribIiv__II_3II
2522 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2523 jint _exception = 0;
2524 const char * _exceptionType = NULL;
2525 const char * _exceptionMessage = NULL;
2526 GLint *params_base = (GLint *) 0;
2527 jint _remaining;
2528 GLint *params = (GLint *) 0;
2529
2530 if (!params_ref) {
2531 _exception = 1;
2532 _exceptionType = "java/lang/IllegalArgumentException";
2533 _exceptionMessage = "params == null";
2534 goto exit;
2535 }
2536 if (offset < 0) {
2537 _exception = 1;
2538 _exceptionType = "java/lang/IllegalArgumentException";
2539 _exceptionMessage = "offset < 0";
2540 goto exit;
2541 }
2542 _remaining = _env->GetArrayLength(params_ref) - offset;
2543 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002544 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002545 params = params_base + offset;
2546
2547 glGetVertexAttribIiv(
2548 (GLuint)index,
2549 (GLenum)pname,
2550 (GLint *)params
2551 );
2552
2553exit:
2554 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002555 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002556 _exception ? JNI_ABORT: 0);
2557 }
2558 if (_exception) {
2559 jniThrowException(_env, _exceptionType, _exceptionMessage);
2560 }
2561}
2562
2563/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2564static void
2565android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
2566 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002567 jint _exception = 0;
2568 const char * _exceptionType = NULL;
2569 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002570 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002571 jint _bufferOffset = (jint) 0;
2572 jint _remaining;
2573 GLint *params = (GLint *) 0;
2574
Romain Guy84cac202016-12-05 12:26:02 -08002575 if (!params_buf) {
2576 _exception = 1;
2577 _exceptionType = "java/lang/IllegalArgumentException";
2578 _exceptionMessage = "params == null";
2579 goto exit;
2580 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002581 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002582 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002583 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002584 params = (GLint *) (_paramsBase + _bufferOffset);
2585 }
2586 glGetVertexAttribIiv(
2587 (GLuint)index,
2588 (GLenum)pname,
2589 (GLint *)params
2590 );
Romain Guy84cac202016-12-05 12:26:02 -08002591
2592exit:
Jesse Halld830e742013-03-29 11:02:35 -07002593 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002594 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2595 }
2596 if (_exception) {
2597 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002598 }
2599}
2600
2601/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2602static void
2603android_glGetVertexAttribIuiv__II_3II
2604 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2605 jint _exception = 0;
2606 const char * _exceptionType = NULL;
2607 const char * _exceptionMessage = NULL;
2608 GLuint *params_base = (GLuint *) 0;
2609 jint _remaining;
2610 GLuint *params = (GLuint *) 0;
2611
2612 if (!params_ref) {
2613 _exception = 1;
2614 _exceptionType = "java/lang/IllegalArgumentException";
2615 _exceptionMessage = "params == null";
2616 goto exit;
2617 }
2618 if (offset < 0) {
2619 _exception = 1;
2620 _exceptionType = "java/lang/IllegalArgumentException";
2621 _exceptionMessage = "offset < 0";
2622 goto exit;
2623 }
2624 _remaining = _env->GetArrayLength(params_ref) - offset;
2625 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002626 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002627 params = params_base + offset;
2628
2629 glGetVertexAttribIuiv(
2630 (GLuint)index,
2631 (GLenum)pname,
2632 (GLuint *)params
2633 );
2634
2635exit:
2636 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002637 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002638 _exception ? JNI_ABORT: 0);
2639 }
2640 if (_exception) {
2641 jniThrowException(_env, _exceptionType, _exceptionMessage);
2642 }
2643}
2644
2645/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2646static void
2647android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
2648 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002649 jint _exception = 0;
2650 const char * _exceptionType = NULL;
2651 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002652 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002653 jint _bufferOffset = (jint) 0;
2654 jint _remaining;
2655 GLuint *params = (GLuint *) 0;
2656
Romain Guy84cac202016-12-05 12:26:02 -08002657 if (!params_buf) {
2658 _exception = 1;
2659 _exceptionType = "java/lang/IllegalArgumentException";
2660 _exceptionMessage = "params == null";
2661 goto exit;
2662 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002663 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002664 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002665 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002666 params = (GLuint *) (_paramsBase + _bufferOffset);
2667 }
2668 glGetVertexAttribIuiv(
2669 (GLuint)index,
2670 (GLenum)pname,
2671 (GLuint *)params
2672 );
Romain Guy84cac202016-12-05 12:26:02 -08002673
2674exit:
Jesse Halld830e742013-03-29 11:02:35 -07002675 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002676 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2677 }
2678 if (_exception) {
2679 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002680 }
2681}
2682
2683/* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
2684static void
2685android_glVertexAttribI4i__IIIII
2686 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2687 glVertexAttribI4i(
2688 (GLuint)index,
2689 (GLint)x,
2690 (GLint)y,
2691 (GLint)z,
2692 (GLint)w
2693 );
2694}
2695
2696/* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
2697static void
2698android_glVertexAttribI4ui__IIIII
2699 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2700 glVertexAttribI4ui(
2701 (GLuint)index,
2702 (GLuint)x,
2703 (GLuint)y,
2704 (GLuint)z,
2705 (GLuint)w
2706 );
2707}
2708
2709/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2710static void
2711android_glVertexAttribI4iv__I_3II
2712 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2713 jint _exception = 0;
2714 const char * _exceptionType = NULL;
2715 const char * _exceptionMessage = NULL;
2716 GLint *v_base = (GLint *) 0;
2717 jint _remaining;
2718 GLint *v = (GLint *) 0;
2719
2720 if (!v_ref) {
2721 _exception = 1;
2722 _exceptionType = "java/lang/IllegalArgumentException";
2723 _exceptionMessage = "v == null";
2724 goto exit;
2725 }
2726 if (offset < 0) {
2727 _exception = 1;
2728 _exceptionType = "java/lang/IllegalArgumentException";
2729 _exceptionMessage = "offset < 0";
2730 goto exit;
2731 }
2732 _remaining = _env->GetArrayLength(v_ref) - offset;
2733 v_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002734 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002735 v = v_base + offset;
2736
2737 glVertexAttribI4iv(
2738 (GLuint)index,
2739 (GLint *)v
2740 );
2741
2742exit:
2743 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002744 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002745 JNI_ABORT);
2746 }
2747 if (_exception) {
2748 jniThrowException(_env, _exceptionType, _exceptionMessage);
2749 }
2750}
2751
2752/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2753static void
2754android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
2755 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002756 jint _exception = 0;
2757 const char * _exceptionType = NULL;
2758 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002759 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002760 jint _bufferOffset = (jint) 0;
2761 jint _remaining;
2762 GLint *v = (GLint *) 0;
2763
Romain Guy84cac202016-12-05 12:26:02 -08002764 if (!v_buf) {
2765 _exception = 1;
2766 _exceptionType = "java/lang/IllegalArgumentException";
2767 _exceptionMessage = "v == null";
2768 goto exit;
2769 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002770 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002771 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002772 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002773 v = (GLint *) (_vBase + _bufferOffset);
2774 }
2775 glVertexAttribI4iv(
2776 (GLuint)index,
2777 (GLint *)v
2778 );
Romain Guy84cac202016-12-05 12:26:02 -08002779
2780exit:
Jesse Halld830e742013-03-29 11:02:35 -07002781 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002782 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002783 }
Romain Guy84cac202016-12-05 12:26:02 -08002784 if (_exception) {
2785 jniThrowException(_env, _exceptionType, _exceptionMessage);
2786 }
Jesse Halld830e742013-03-29 11:02:35 -07002787}
2788
2789/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2790static void
2791android_glVertexAttribI4uiv__I_3II
2792 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2793 jint _exception = 0;
2794 const char * _exceptionType = NULL;
2795 const char * _exceptionMessage = NULL;
2796 GLuint *v_base = (GLuint *) 0;
2797 jint _remaining;
2798 GLuint *v = (GLuint *) 0;
2799
2800 if (!v_ref) {
2801 _exception = 1;
2802 _exceptionType = "java/lang/IllegalArgumentException";
2803 _exceptionMessage = "v == null";
2804 goto exit;
2805 }
2806 if (offset < 0) {
2807 _exception = 1;
2808 _exceptionType = "java/lang/IllegalArgumentException";
2809 _exceptionMessage = "offset < 0";
2810 goto exit;
2811 }
2812 _remaining = _env->GetArrayLength(v_ref) - offset;
2813 v_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002814 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002815 v = v_base + offset;
2816
2817 glVertexAttribI4uiv(
2818 (GLuint)index,
2819 (GLuint *)v
2820 );
2821
2822exit:
2823 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002824 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002825 JNI_ABORT);
2826 }
2827 if (_exception) {
2828 jniThrowException(_env, _exceptionType, _exceptionMessage);
2829 }
2830}
2831
2832/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2833static void
2834android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
2835 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002836 jint _exception = 0;
2837 const char * _exceptionType = NULL;
2838 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002839 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002840 jint _bufferOffset = (jint) 0;
2841 jint _remaining;
2842 GLuint *v = (GLuint *) 0;
2843
Romain Guy84cac202016-12-05 12:26:02 -08002844 if (!v_buf) {
2845 _exception = 1;
2846 _exceptionType = "java/lang/IllegalArgumentException";
2847 _exceptionMessage = "v == null";
2848 goto exit;
2849 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002850 v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002851 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002852 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002853 v = (GLuint *) (_vBase + _bufferOffset);
2854 }
2855 glVertexAttribI4uiv(
2856 (GLuint)index,
2857 (GLuint *)v
2858 );
Romain Guy84cac202016-12-05 12:26:02 -08002859
2860exit:
Jesse Halld830e742013-03-29 11:02:35 -07002861 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002862 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002863 }
Romain Guy84cac202016-12-05 12:26:02 -08002864 if (_exception) {
2865 jniThrowException(_env, _exceptionType, _exceptionMessage);
2866 }
Jesse Halld830e742013-03-29 11:02:35 -07002867}
2868
2869/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2870static void
2871android_glGetUniformuiv__II_3II
2872 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
2873 jint _exception = 0;
2874 const char * _exceptionType = NULL;
2875 const char * _exceptionMessage = NULL;
2876 GLuint *params_base = (GLuint *) 0;
2877 jint _remaining;
2878 GLuint *params = (GLuint *) 0;
2879
2880 if (!params_ref) {
2881 _exception = 1;
2882 _exceptionType = "java/lang/IllegalArgumentException";
2883 _exceptionMessage = "params == null";
2884 goto exit;
2885 }
2886 if (offset < 0) {
2887 _exception = 1;
2888 _exceptionType = "java/lang/IllegalArgumentException";
2889 _exceptionMessage = "offset < 0";
2890 goto exit;
2891 }
2892 _remaining = _env->GetArrayLength(params_ref) - offset;
2893 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002894 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002895 params = params_base + offset;
2896
2897 glGetUniformuiv(
2898 (GLuint)program,
2899 (GLint)location,
2900 (GLuint *)params
2901 );
2902
2903exit:
2904 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002905 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002906 _exception ? JNI_ABORT: 0);
2907 }
2908 if (_exception) {
2909 jniThrowException(_env, _exceptionType, _exceptionMessage);
2910 }
2911}
2912
2913/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2914static void
2915android_glGetUniformuiv__IILjava_nio_IntBuffer_2
2916 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002917 jint _exception = 0;
2918 const char * _exceptionType = NULL;
2919 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002920 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002921 jint _bufferOffset = (jint) 0;
2922 jint _remaining;
2923 GLuint *params = (GLuint *) 0;
2924
Romain Guy84cac202016-12-05 12:26:02 -08002925 if (!params_buf) {
2926 _exception = 1;
2927 _exceptionType = "java/lang/IllegalArgumentException";
2928 _exceptionMessage = "params == null";
2929 goto exit;
2930 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002931 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002932 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002933 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002934 params = (GLuint *) (_paramsBase + _bufferOffset);
2935 }
2936 glGetUniformuiv(
2937 (GLuint)program,
2938 (GLint)location,
2939 (GLuint *)params
2940 );
Romain Guy84cac202016-12-05 12:26:02 -08002941
2942exit:
Jesse Halld830e742013-03-29 11:02:35 -07002943 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002944 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2945 }
2946 if (_exception) {
2947 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07002948 }
2949}
2950
2951/* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
2952static jint
2953android_glGetFragDataLocation__ILjava_lang_String_2
2954 (JNIEnv *_env, jobject _this, jint program, jstring name) {
2955 jint _exception = 0;
2956 const char * _exceptionType = NULL;
2957 const char * _exceptionMessage = NULL;
2958 GLint _returnValue = 0;
2959 const char* _nativename = 0;
2960
2961 if (!name) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07002962 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07002963 _exceptionType = "java/lang/IllegalArgumentException";
2964 _exceptionMessage = "name == null";
2965 goto exit;
2966 }
2967 _nativename = _env->GetStringUTFChars(name, 0);
2968
2969 _returnValue = glGetFragDataLocation(
2970 (GLuint)program,
2971 (GLchar *)_nativename
2972 );
2973
2974exit:
2975 if (_nativename) {
2976 _env->ReleaseStringUTFChars(name, _nativename);
2977 }
2978
2979 if (_exception) {
2980 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00002981 return (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07002982 }
2983 return (jint)_returnValue;
2984}
2985
2986/* void glUniform1ui ( GLint location, GLuint v0 ) */
2987static void
2988android_glUniform1ui__II
2989 (JNIEnv *_env, jobject _this, jint location, jint v0) {
2990 glUniform1ui(
2991 (GLint)location,
2992 (GLuint)v0
2993 );
2994}
2995
2996/* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
2997static void
2998android_glUniform2ui__III
2999 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
3000 glUniform2ui(
3001 (GLint)location,
3002 (GLuint)v0,
3003 (GLuint)v1
3004 );
3005}
3006
3007/* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
3008static void
3009android_glUniform3ui__IIII
3010 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
3011 glUniform3ui(
3012 (GLint)location,
3013 (GLuint)v0,
3014 (GLuint)v1,
3015 (GLuint)v2
3016 );
3017}
3018
3019/* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
3020static void
3021android_glUniform4ui__IIIII
3022 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
3023 glUniform4ui(
3024 (GLint)location,
3025 (GLuint)v0,
3026 (GLuint)v1,
3027 (GLuint)v2,
3028 (GLuint)v3
3029 );
3030}
3031
3032/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3033static void
3034android_glUniform1uiv__II_3II
3035 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3036 jint _exception = 0;
3037 const char * _exceptionType = NULL;
3038 const char * _exceptionMessage = NULL;
3039 GLuint *value_base = (GLuint *) 0;
3040 jint _remaining;
3041 GLuint *value = (GLuint *) 0;
3042
3043 if (!value_ref) {
3044 _exception = 1;
3045 _exceptionType = "java/lang/IllegalArgumentException";
3046 _exceptionMessage = "value == null";
3047 goto exit;
3048 }
3049 if (offset < 0) {
3050 _exception = 1;
3051 _exceptionType = "java/lang/IllegalArgumentException";
3052 _exceptionMessage = "offset < 0";
3053 goto exit;
3054 }
3055 _remaining = _env->GetArrayLength(value_ref) - offset;
3056 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003057 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003058 value = value_base + offset;
3059
3060 glUniform1uiv(
3061 (GLint)location,
3062 (GLsizei)count,
3063 (GLuint *)value
3064 );
3065
3066exit:
3067 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003068 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003069 JNI_ABORT);
3070 }
3071 if (_exception) {
3072 jniThrowException(_env, _exceptionType, _exceptionMessage);
3073 }
3074}
3075
3076/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
3077static void
3078android_glUniform1uiv__IILjava_nio_IntBuffer_2
3079 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003080 jint _exception = 0;
3081 const char * _exceptionType = NULL;
3082 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003083 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003084 jint _bufferOffset = (jint) 0;
3085 jint _remaining;
3086 GLuint *value = (GLuint *) 0;
3087
Romain Guy84cac202016-12-05 12:26:02 -08003088 if (!value_buf) {
3089 _exception = 1;
3090 _exceptionType = "java/lang/IllegalArgumentException";
3091 _exceptionMessage = "value == null";
3092 goto exit;
3093 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003094 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003095 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003096 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003097 value = (GLuint *) (_valueBase + _bufferOffset);
3098 }
3099 glUniform1uiv(
3100 (GLint)location,
3101 (GLsizei)count,
3102 (GLuint *)value
3103 );
Romain Guy84cac202016-12-05 12:26:02 -08003104
3105exit:
Jesse Halld830e742013-03-29 11:02:35 -07003106 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003107 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003108 }
Romain Guy84cac202016-12-05 12:26:02 -08003109 if (_exception) {
3110 jniThrowException(_env, _exceptionType, _exceptionMessage);
3111 }
Jesse Halld830e742013-03-29 11:02:35 -07003112}
3113
3114/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3115static void
3116android_glUniform2uiv__II_3II
3117 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3118 jint _exception = 0;
3119 const char * _exceptionType = NULL;
3120 const char * _exceptionMessage = NULL;
3121 GLuint *value_base = (GLuint *) 0;
3122 jint _remaining;
3123 GLuint *value = (GLuint *) 0;
3124
3125 if (!value_ref) {
3126 _exception = 1;
3127 _exceptionType = "java/lang/IllegalArgumentException";
3128 _exceptionMessage = "value == null";
3129 goto exit;
3130 }
3131 if (offset < 0) {
3132 _exception = 1;
3133 _exceptionType = "java/lang/IllegalArgumentException";
3134 _exceptionMessage = "offset < 0";
3135 goto exit;
3136 }
3137 _remaining = _env->GetArrayLength(value_ref) - offset;
3138 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003139 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003140 value = value_base + offset;
3141
3142 glUniform2uiv(
3143 (GLint)location,
3144 (GLsizei)count,
3145 (GLuint *)value
3146 );
3147
3148exit:
3149 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003150 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003151 JNI_ABORT);
3152 }
3153 if (_exception) {
3154 jniThrowException(_env, _exceptionType, _exceptionMessage);
3155 }
3156}
3157
3158/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
3159static void
3160android_glUniform2uiv__IILjava_nio_IntBuffer_2
3161 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003162 jint _exception = 0;
3163 const char * _exceptionType = NULL;
3164 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003165 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003166 jint _bufferOffset = (jint) 0;
3167 jint _remaining;
3168 GLuint *value = (GLuint *) 0;
3169
Romain Guy84cac202016-12-05 12:26:02 -08003170 if (!value_buf) {
3171 _exception = 1;
3172 _exceptionType = "java/lang/IllegalArgumentException";
3173 _exceptionMessage = "value == null";
3174 goto exit;
3175 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003176 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003177 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003178 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003179 value = (GLuint *) (_valueBase + _bufferOffset);
3180 }
3181 glUniform2uiv(
3182 (GLint)location,
3183 (GLsizei)count,
3184 (GLuint *)value
3185 );
Romain Guy84cac202016-12-05 12:26:02 -08003186
3187exit:
Jesse Halld830e742013-03-29 11:02:35 -07003188 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003189 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003190 }
Romain Guy84cac202016-12-05 12:26:02 -08003191 if (_exception) {
3192 jniThrowException(_env, _exceptionType, _exceptionMessage);
3193 }
Jesse Halld830e742013-03-29 11:02:35 -07003194}
3195
3196/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3197static void
3198android_glUniform3uiv__II_3II
3199 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3200 jint _exception = 0;
3201 const char * _exceptionType = NULL;
3202 const char * _exceptionMessage = NULL;
3203 GLuint *value_base = (GLuint *) 0;
3204 jint _remaining;
3205 GLuint *value = (GLuint *) 0;
3206
3207 if (!value_ref) {
3208 _exception = 1;
3209 _exceptionType = "java/lang/IllegalArgumentException";
3210 _exceptionMessage = "value == null";
3211 goto exit;
3212 }
3213 if (offset < 0) {
3214 _exception = 1;
3215 _exceptionType = "java/lang/IllegalArgumentException";
3216 _exceptionMessage = "offset < 0";
3217 goto exit;
3218 }
3219 _remaining = _env->GetArrayLength(value_ref) - offset;
3220 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003221 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003222 value = value_base + offset;
3223
3224 glUniform3uiv(
3225 (GLint)location,
3226 (GLsizei)count,
3227 (GLuint *)value
3228 );
3229
3230exit:
3231 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003232 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003233 JNI_ABORT);
3234 }
3235 if (_exception) {
3236 jniThrowException(_env, _exceptionType, _exceptionMessage);
3237 }
3238}
3239
3240/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
3241static void
3242android_glUniform3uiv__IILjava_nio_IntBuffer_2
3243 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003244 jint _exception = 0;
3245 const char * _exceptionType = NULL;
3246 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003247 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003248 jint _bufferOffset = (jint) 0;
3249 jint _remaining;
3250 GLuint *value = (GLuint *) 0;
3251
Romain Guy84cac202016-12-05 12:26:02 -08003252 if (!value_buf) {
3253 _exception = 1;
3254 _exceptionType = "java/lang/IllegalArgumentException";
3255 _exceptionMessage = "value == null";
3256 goto exit;
3257 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003258 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003259 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003260 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003261 value = (GLuint *) (_valueBase + _bufferOffset);
3262 }
3263 glUniform3uiv(
3264 (GLint)location,
3265 (GLsizei)count,
3266 (GLuint *)value
3267 );
Romain Guy84cac202016-12-05 12:26:02 -08003268
3269exit:
Jesse Halld830e742013-03-29 11:02:35 -07003270 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003271 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003272 }
Romain Guy84cac202016-12-05 12:26:02 -08003273 if (_exception) {
3274 jniThrowException(_env, _exceptionType, _exceptionMessage);
3275 }
Jesse Halld830e742013-03-29 11:02:35 -07003276}
3277
3278/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3279static void
3280android_glUniform4uiv__II_3II
3281 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
3282 jint _exception = 0;
3283 const char * _exceptionType = NULL;
3284 const char * _exceptionMessage = NULL;
3285 GLuint *value_base = (GLuint *) 0;
3286 jint _remaining;
3287 GLuint *value = (GLuint *) 0;
3288
3289 if (!value_ref) {
3290 _exception = 1;
3291 _exceptionType = "java/lang/IllegalArgumentException";
3292 _exceptionMessage = "value == null";
3293 goto exit;
3294 }
3295 if (offset < 0) {
3296 _exception = 1;
3297 _exceptionType = "java/lang/IllegalArgumentException";
3298 _exceptionMessage = "offset < 0";
3299 goto exit;
3300 }
3301 _remaining = _env->GetArrayLength(value_ref) - offset;
3302 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003303 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003304 value = value_base + offset;
3305
3306 glUniform4uiv(
3307 (GLint)location,
3308 (GLsizei)count,
3309 (GLuint *)value
3310 );
3311
3312exit:
3313 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003314 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003315 JNI_ABORT);
3316 }
3317 if (_exception) {
3318 jniThrowException(_env, _exceptionType, _exceptionMessage);
3319 }
3320}
3321
3322/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
3323static void
3324android_glUniform4uiv__IILjava_nio_IntBuffer_2
3325 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003326 jint _exception = 0;
3327 const char * _exceptionType = NULL;
3328 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003329 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003330 jint _bufferOffset = (jint) 0;
3331 jint _remaining;
3332 GLuint *value = (GLuint *) 0;
3333
Romain Guy84cac202016-12-05 12:26:02 -08003334 if (!value_buf) {
3335 _exception = 1;
3336 _exceptionType = "java/lang/IllegalArgumentException";
3337 _exceptionMessage = "value == null";
3338 goto exit;
3339 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003340 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003341 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003342 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003343 value = (GLuint *) (_valueBase + _bufferOffset);
3344 }
3345 glUniform4uiv(
3346 (GLint)location,
3347 (GLsizei)count,
3348 (GLuint *)value
3349 );
Romain Guy84cac202016-12-05 12:26:02 -08003350
3351exit:
Jesse Halld830e742013-03-29 11:02:35 -07003352 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003353 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003354 }
Romain Guy84cac202016-12-05 12:26:02 -08003355 if (_exception) {
3356 jniThrowException(_env, _exceptionType, _exceptionMessage);
3357 }
Jesse Halld830e742013-03-29 11:02:35 -07003358}
3359
3360/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3361static void
3362android_glClearBufferiv__II_3II
3363 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3364 jint _exception = 0;
3365 const char * _exceptionType = NULL;
3366 const char * _exceptionMessage = NULL;
3367 GLint *value_base = (GLint *) 0;
3368 jint _remaining;
3369 GLint *value = (GLint *) 0;
3370
3371 if (!value_ref) {
3372 _exception = 1;
3373 _exceptionType = "java/lang/IllegalArgumentException";
3374 _exceptionMessage = "value == null";
3375 goto exit;
3376 }
3377 if (offset < 0) {
3378 _exception = 1;
3379 _exceptionType = "java/lang/IllegalArgumentException";
3380 _exceptionMessage = "offset < 0";
3381 goto exit;
3382 }
3383 _remaining = _env->GetArrayLength(value_ref) - offset;
3384 value_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003385 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003386 value = value_base + offset;
3387
3388 glClearBufferiv(
3389 (GLenum)buffer,
3390 (GLint)drawbuffer,
3391 (GLint *)value
3392 );
3393
3394exit:
3395 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003396 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003397 JNI_ABORT);
3398 }
3399 if (_exception) {
3400 jniThrowException(_env, _exceptionType, _exceptionMessage);
3401 }
3402}
3403
3404/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3405static void
3406android_glClearBufferiv__IILjava_nio_IntBuffer_2
3407 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003408 jint _exception = 0;
3409 const char * _exceptionType = NULL;
3410 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003411 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003412 jint _bufferOffset = (jint) 0;
3413 jint _remaining;
3414 GLint *value = (GLint *) 0;
3415
Romain Guy84cac202016-12-05 12:26:02 -08003416 if (!value_buf) {
3417 _exception = 1;
3418 _exceptionType = "java/lang/IllegalArgumentException";
3419 _exceptionMessage = "value == null";
3420 goto exit;
3421 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003422 value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003423 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003424 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003425 value = (GLint *) (_valueBase + _bufferOffset);
3426 }
3427 glClearBufferiv(
3428 (GLenum)buffer,
3429 (GLint)drawbuffer,
3430 (GLint *)value
3431 );
Romain Guy84cac202016-12-05 12:26:02 -08003432
3433exit:
Jesse Halld830e742013-03-29 11:02:35 -07003434 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003435 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003436 }
Romain Guy84cac202016-12-05 12:26:02 -08003437 if (_exception) {
3438 jniThrowException(_env, _exceptionType, _exceptionMessage);
3439 }
Jesse Halld830e742013-03-29 11:02:35 -07003440}
3441
3442/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3443static void
3444android_glClearBufferuiv__II_3II
3445 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3446 jint _exception = 0;
3447 const char * _exceptionType = NULL;
3448 const char * _exceptionMessage = NULL;
3449 GLuint *value_base = (GLuint *) 0;
3450 jint _remaining;
3451 GLuint *value = (GLuint *) 0;
3452
3453 if (!value_ref) {
3454 _exception = 1;
3455 _exceptionType = "java/lang/IllegalArgumentException";
3456 _exceptionMessage = "value == null";
3457 goto exit;
3458 }
3459 if (offset < 0) {
3460 _exception = 1;
3461 _exceptionType = "java/lang/IllegalArgumentException";
3462 _exceptionMessage = "offset < 0";
3463 goto exit;
3464 }
3465 _remaining = _env->GetArrayLength(value_ref) - offset;
3466 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003467 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003468 value = value_base + offset;
3469
3470 glClearBufferuiv(
3471 (GLenum)buffer,
3472 (GLint)drawbuffer,
3473 (GLuint *)value
3474 );
3475
3476exit:
3477 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003478 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003479 JNI_ABORT);
3480 }
3481 if (_exception) {
3482 jniThrowException(_env, _exceptionType, _exceptionMessage);
3483 }
3484}
3485
3486/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3487static void
3488android_glClearBufferuiv__IILjava_nio_IntBuffer_2
3489 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003490 jint _exception = 0;
3491 const char * _exceptionType = NULL;
3492 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003493 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003494 jint _bufferOffset = (jint) 0;
3495 jint _remaining;
3496 GLuint *value = (GLuint *) 0;
3497
Romain Guy84cac202016-12-05 12:26:02 -08003498 if (!value_buf) {
3499 _exception = 1;
3500 _exceptionType = "java/lang/IllegalArgumentException";
3501 _exceptionMessage = "value == null";
3502 goto exit;
3503 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003504 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003505 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003506 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003507 value = (GLuint *) (_valueBase + _bufferOffset);
3508 }
3509 glClearBufferuiv(
3510 (GLenum)buffer,
3511 (GLint)drawbuffer,
3512 (GLuint *)value
3513 );
Romain Guy84cac202016-12-05 12:26:02 -08003514
3515exit:
Jesse Halld830e742013-03-29 11:02:35 -07003516 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003517 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003518 }
Romain Guy84cac202016-12-05 12:26:02 -08003519 if (_exception) {
3520 jniThrowException(_env, _exceptionType, _exceptionMessage);
3521 }
Jesse Halld830e742013-03-29 11:02:35 -07003522}
3523
3524/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3525static void
3526android_glClearBufferfv__II_3FI
3527 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
3528 jint _exception = 0;
3529 const char * _exceptionType = NULL;
3530 const char * _exceptionMessage = NULL;
3531 GLfloat *value_base = (GLfloat *) 0;
3532 jint _remaining;
3533 GLfloat *value = (GLfloat *) 0;
3534
3535 if (!value_ref) {
3536 _exception = 1;
3537 _exceptionType = "java/lang/IllegalArgumentException";
3538 _exceptionMessage = "value == null";
3539 goto exit;
3540 }
3541 if (offset < 0) {
3542 _exception = 1;
3543 _exceptionType = "java/lang/IllegalArgumentException";
3544 _exceptionMessage = "offset < 0";
3545 goto exit;
3546 }
3547 _remaining = _env->GetArrayLength(value_ref) - offset;
3548 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003549 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003550 value = value_base + offset;
3551
3552 glClearBufferfv(
3553 (GLenum)buffer,
3554 (GLint)drawbuffer,
3555 (GLfloat *)value
3556 );
3557
3558exit:
3559 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003560 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003561 JNI_ABORT);
3562 }
3563 if (_exception) {
3564 jniThrowException(_env, _exceptionType, _exceptionMessage);
3565 }
3566}
3567
3568/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3569static void
3570android_glClearBufferfv__IILjava_nio_FloatBuffer_2
3571 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003572 jint _exception = 0;
3573 const char * _exceptionType = NULL;
3574 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003575 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003576 jint _bufferOffset = (jint) 0;
3577 jint _remaining;
3578 GLfloat *value = (GLfloat *) 0;
3579
Romain Guy84cac202016-12-05 12:26:02 -08003580 if (!value_buf) {
3581 _exception = 1;
3582 _exceptionType = "java/lang/IllegalArgumentException";
3583 _exceptionMessage = "value == null";
3584 goto exit;
3585 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003586 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003587 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003588 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003589 value = (GLfloat *) (_valueBase + _bufferOffset);
3590 }
3591 glClearBufferfv(
3592 (GLenum)buffer,
3593 (GLint)drawbuffer,
3594 (GLfloat *)value
3595 );
Romain Guy84cac202016-12-05 12:26:02 -08003596
3597exit:
Jesse Halld830e742013-03-29 11:02:35 -07003598 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003599 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003600 }
Romain Guy84cac202016-12-05 12:26:02 -08003601 if (_exception) {
3602 jniThrowException(_env, _exceptionType, _exceptionMessage);
3603 }
Jesse Halld830e742013-03-29 11:02:35 -07003604}
3605
3606/* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
3607static void
3608android_glClearBufferfi__IIFI
3609 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
3610 glClearBufferfi(
3611 (GLenum)buffer,
3612 (GLint)drawbuffer,
3613 (GLfloat)depth,
3614 (GLint)stencil
3615 );
3616}
3617
3618/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
3619static jstring
3620android_glGetStringi__II
3621 (JNIEnv *_env, jobject _this, jint name, jint index) {
3622 const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
3623 return _env->NewStringUTF((const char*)_chars);
3624}
3625
3626/* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
3627static void
3628android_glCopyBufferSubData__IIIII
3629 (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
3630 glCopyBufferSubData(
3631 (GLenum)readTarget,
3632 (GLenum)writeTarget,
3633 (GLintptr)readOffset,
3634 (GLintptr)writeOffset,
3635 (GLsizeiptr)size
3636 );
3637}
3638
3639/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3640static
3641void
3642android_glGetUniformIndices_array
3643 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
3644 jint _exception = 0;
3645 const char* _exceptionType = NULL;
3646 const char* _exceptionMessage = NULL;
3647 jint _count = 0;
3648 jint _i;
3649 const char** _names = NULL;
3650 GLuint* _indices_base = NULL;
3651 GLuint* _indices = NULL;
3652
3653 if (!uniformNames_ref) {
3654 _exception = 1;
3655 _exceptionType = "java/lang/IllegalArgumentException";
3656 _exceptionMessage = "uniformNames == null";
3657 goto exit;
3658 }
3659 _count = _env->GetArrayLength(uniformNames_ref);
3660 _names = (const char**)calloc(_count, sizeof(const char*));
3661 for (_i = 0; _i < _count; _i++) {
3662 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3663 if (!_name) {
3664 _exception = 1;
3665 _exceptionType = "java/lang/IllegalArgumentException";
3666 _exceptionMessage = "null uniformNames element";
3667 goto exit;
3668 }
3669 _names[_i] = _env->GetStringUTFChars(_name, 0);
3670 }
3671
3672 if (!uniformIndices_ref) {
3673 _exception = 1;
3674 _exceptionType = "java/lang/IllegalArgumentException";
3675 _exceptionMessage = "uniformIndices == null";
3676 goto exit;
3677 }
3678 if (uniformIndicesOffset < 0) {
3679 _exception = 1;
3680 _exceptionType = "java/lang/IllegalArgumentException";
3681 _exceptionMessage = "uniformIndicesOffset < 0";
3682 goto exit;
3683 }
3684 if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
3685 _exception = 1;
3686 _exceptionType = "java/lang/IllegalArgumentException";
3687 _exceptionMessage = "not enough space in uniformIndices";
3688 goto exit;
3689 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003690 _indices_base = (GLuint*)_env->GetIntArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003691 uniformIndices_ref, 0);
3692 _indices = _indices_base + uniformIndicesOffset;
3693
3694 glGetUniformIndices(program, _count, _names, _indices);
3695
3696exit:
3697 if (_indices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003698 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
3699 _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003700 }
3701 for (_i = _count - 1; _i >= 0; _i--) {
3702 if (_names[_i]) {
3703 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3704 if (_name) {
3705 _env->ReleaseStringUTFChars(_name, _names[_i]);
3706 }
3707 }
3708 }
3709 free(_names);
3710 if (_exception) {
3711 jniThrowException(_env, _exceptionType, _exceptionMessage);
3712 }
3713}
3714
3715/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3716static
3717void
3718android_glGetUniformIndices_buffer
3719 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
3720 jint _exception = 0;
3721 const char* _exceptionType = NULL;
3722 const char* _exceptionMessage = NULL;
3723 jint _count = 0;
3724 jint _i;
3725 const char** _names = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003726 jintArray _uniformIndicesArray = (jintArray)0;
Jesse Halld830e742013-03-29 11:02:35 -07003727 jint _uniformIndicesRemaining;
3728 jint _uniformIndicesOffset = 0;
3729 GLuint* _indices = NULL;
3730 char* _indicesBase = NULL;
3731
3732 if (!uniformNames_ref) {
3733 _exception = 1;
3734 _exceptionType = "java/lang/IllegalArgumentException";
3735 _exceptionMessage = "uniformNames == null";
3736 goto exit;
3737 }
3738 if (!uniformIndices_buf) {
3739 _exception = 1;
3740 _exceptionType = "java/lang/IllegalArgumentException";
3741 _exceptionMessage = "uniformIndices == null";
3742 goto exit;
3743 }
3744
3745 _count = _env->GetArrayLength(uniformNames_ref);
3746 _names = (const char**)calloc(_count, sizeof(const char*));
3747 for (_i = 0; _i < _count; _i++) {
3748 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3749 if (!_name) {
3750 _exception = 1;
3751 _exceptionType = "java/lang/IllegalArgumentException";
3752 _exceptionMessage = "null uniformNames element";
3753 goto exit;
3754 }
3755 _names[_i] = _env->GetStringUTFChars(_name, 0);
3756 }
3757
3758 _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003759 (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
Jesse Halld830e742013-03-29 11:02:35 -07003760 &_uniformIndicesOffset);
3761 if (!_indices) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003762 _indicesBase = (char*)_env->GetIntArrayElements(
3763 _uniformIndicesArray, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003764 _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
3765 }
3766 if (_uniformIndicesRemaining < _count) {
3767 _exception = 1;
3768 _exceptionType = "java/lang/IllegalArgumentException";
3769 _exceptionMessage = "not enough space in uniformIndices";
3770 goto exit;
3771 }
3772
3773 glGetUniformIndices(program, _count, _names, _indices);
3774
3775exit:
3776 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003777 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
3778 _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07003779 }
3780 for (_i = _count - 1; _i >= 0; _i--) {
3781 if (_names[_i]) {
3782 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3783 if (_name) {
3784 _env->ReleaseStringUTFChars(_name, _names[_i]);
3785 }
3786 }
3787 }
3788 free(_names);
3789 if (_exception) {
3790 jniThrowException(_env, _exceptionType, _exceptionMessage);
3791 }
3792}
Jesse Halld830e742013-03-29 11:02:35 -07003793/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3794static void
3795android_glGetActiveUniformsiv__II_3III_3II
3796 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
3797 jint _exception = 0;
3798 const char * _exceptionType = NULL;
3799 const char * _exceptionMessage = NULL;
3800 GLuint *uniformIndices_base = (GLuint *) 0;
3801 jint _uniformIndicesRemaining;
3802 GLuint *uniformIndices = (GLuint *) 0;
3803 GLint *params_base = (GLint *) 0;
3804 jint _paramsRemaining;
3805 GLint *params = (GLint *) 0;
3806
3807 if (!uniformIndices_ref) {
3808 _exception = 1;
3809 _exceptionType = "java/lang/IllegalArgumentException";
3810 _exceptionMessage = "uniformIndices == null";
3811 goto exit;
3812 }
3813 if (uniformIndicesOffset < 0) {
3814 _exception = 1;
3815 _exceptionType = "java/lang/IllegalArgumentException";
3816 _exceptionMessage = "uniformIndicesOffset < 0";
3817 goto exit;
3818 }
3819 _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
3820 uniformIndices_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003821 _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003822 uniformIndices = uniformIndices_base + uniformIndicesOffset;
3823
3824 if (!params_ref) {
3825 _exception = 1;
3826 _exceptionType = "java/lang/IllegalArgumentException";
3827 _exceptionMessage = "params == null";
3828 goto exit;
3829 }
3830 if (paramsOffset < 0) {
3831 _exception = 1;
3832 _exceptionType = "java/lang/IllegalArgumentException";
3833 _exceptionMessage = "paramsOffset < 0";
3834 goto exit;
3835 }
3836 _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
3837 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003838 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003839 params = params_base + paramsOffset;
3840
3841 glGetActiveUniformsiv(
3842 (GLuint)program,
3843 (GLsizei)uniformCount,
3844 (GLuint *)uniformIndices,
3845 (GLenum)pname,
3846 (GLint *)params
3847 );
3848
3849exit:
3850 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003851 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003852 _exception ? JNI_ABORT: 0);
3853 }
3854 if (uniformIndices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003855 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
Jesse Halld830e742013-03-29 11:02:35 -07003856 JNI_ABORT);
3857 }
3858 if (_exception) {
3859 jniThrowException(_env, _exceptionType, _exceptionMessage);
3860 }
3861}
3862
3863/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3864static void
3865android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
3866 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003867 jint _exception = 0;
3868 const char * _exceptionType = NULL;
3869 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003870 jintArray _uniformIndicesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003871 jint _uniformIndicesBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003872 jintArray _paramsArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003873 jint _paramsBufferOffset = (jint) 0;
3874 jint _uniformIndicesRemaining;
3875 GLuint *uniformIndices = (GLuint *) 0;
3876 jint _paramsRemaining;
3877 GLint *params = (GLint *) 0;
3878
Romain Guy84cac202016-12-05 12:26:02 -08003879 if (!uniformIndices_buf) {
3880 _exception = 1;
3881 _exceptionType = "java/lang/IllegalArgumentException";
3882 _exceptionMessage = "uniformIndices == null";
3883 goto exit;
3884 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003885 uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08003886 if (!params_buf) {
3887 _exception = 1;
3888 _exceptionType = "java/lang/IllegalArgumentException";
3889 _exceptionMessage = "params == null";
3890 goto exit;
3891 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003892 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003893 if (uniformIndices == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003894 char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003895 uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
3896 }
3897 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003898 char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003899 params = (GLint *) (_paramsBase + _paramsBufferOffset);
3900 }
3901 glGetActiveUniformsiv(
3902 (GLuint)program,
3903 (GLsizei)uniformCount,
3904 (GLuint *)uniformIndices,
3905 (GLenum)pname,
3906 (GLint *)params
3907 );
Romain Guy84cac202016-12-05 12:26:02 -08003908
3909exit:
Jesse Halld830e742013-03-29 11:02:35 -07003910 if (_paramsArray) {
Romain Guy84cac202016-12-05 12:26:02 -08003911 _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003912 }
3913 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003914 _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003915 }
Romain Guy84cac202016-12-05 12:26:02 -08003916 if (_exception) {
3917 jniThrowException(_env, _exceptionType, _exceptionMessage);
3918 }
Jesse Halld830e742013-03-29 11:02:35 -07003919}
3920
3921/* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
3922static jint
3923android_glGetUniformBlockIndex__ILjava_lang_String_2
3924 (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
3925 jint _exception = 0;
3926 const char * _exceptionType = NULL;
3927 const char * _exceptionMessage = NULL;
3928 GLuint _returnValue = 0;
3929 const char* _nativeuniformBlockName = 0;
3930
3931 if (!uniformBlockName) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07003932 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07003933 _exceptionType = "java/lang/IllegalArgumentException";
3934 _exceptionMessage = "uniformBlockName == null";
3935 goto exit;
3936 }
3937 _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
3938
3939 _returnValue = glGetUniformBlockIndex(
3940 (GLuint)program,
3941 (GLchar *)_nativeuniformBlockName
3942 );
3943
3944exit:
3945 if (_nativeuniformBlockName) {
3946 _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
3947 }
3948
3949 if (_exception) {
3950 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00003951 return (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07003952 }
3953 return (jint)_returnValue;
3954}
3955
3956/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3957static void
3958android_glGetActiveUniformBlockiv__III_3II
3959 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
3960 jint _exception = 0;
3961 const char * _exceptionType = NULL;
3962 const char * _exceptionMessage = NULL;
3963 GLint *params_base = (GLint *) 0;
3964 jint _remaining;
3965 GLint *params = (GLint *) 0;
3966
3967 if (!params_ref) {
3968 _exception = 1;
3969 _exceptionType = "java/lang/IllegalArgumentException";
3970 _exceptionMessage = "params == null";
3971 goto exit;
3972 }
3973 if (offset < 0) {
3974 _exception = 1;
3975 _exceptionType = "java/lang/IllegalArgumentException";
3976 _exceptionMessage = "offset < 0";
3977 goto exit;
3978 }
3979 _remaining = _env->GetArrayLength(params_ref) - offset;
3980 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003981 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003982 params = params_base + offset;
3983
3984 glGetActiveUniformBlockiv(
3985 (GLuint)program,
3986 (GLuint)uniformBlockIndex,
3987 (GLenum)pname,
3988 (GLint *)params
3989 );
3990
3991exit:
3992 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003993 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003994 _exception ? JNI_ABORT: 0);
3995 }
3996 if (_exception) {
3997 jniThrowException(_env, _exceptionType, _exceptionMessage);
3998 }
3999}
4000
4001/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
4002static void
4003android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
4004 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004005 jint _exception = 0;
4006 const char * _exceptionType = NULL;
4007 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004008 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004009 jint _bufferOffset = (jint) 0;
4010 jint _remaining;
4011 GLint *params = (GLint *) 0;
4012
Romain Guy84cac202016-12-05 12:26:02 -08004013 if (!params_buf) {
4014 _exception = 1;
4015 _exceptionType = "java/lang/IllegalArgumentException";
4016 _exceptionMessage = "params == null";
4017 goto exit;
4018 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004019 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004020 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004021 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004022 params = (GLint *) (_paramsBase + _bufferOffset);
4023 }
4024 glGetActiveUniformBlockiv(
4025 (GLuint)program,
4026 (GLuint)uniformBlockIndex,
4027 (GLenum)pname,
4028 (GLint *)params
4029 );
Romain Guy84cac202016-12-05 12:26:02 -08004030
4031exit:
Jesse Halld830e742013-03-29 11:02:35 -07004032 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004033 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4034 }
4035 if (_exception) {
4036 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004037 }
4038}
4039
4040/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4041static void
4042android_glGetActiveUniformBlockName_III_3II_3BI
4043 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
4044 jint _exception = 0;
4045 const char* _exceptionType;
4046 const char* _exceptionMessage;
4047 GLsizei* _length_base = (GLsizei*)0;
4048 jint _lengthRemaining;
4049 GLsizei* _length = (GLsizei*)0;
4050 GLchar* _name_base = (GLchar*)0;
4051 jint _nameRemaining;
4052 GLchar* _name = (GLchar*)0;
4053
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004054 if (length_ref) {
4055 if (lengthOffset < 0) {
4056 _exception = 1;
4057 _exceptionType = "java/lang/IllegalArgumentException";
4058 _exceptionMessage = "lengthOffset < 0";
4059 goto exit;
4060 }
4061 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4062 _length_base = (GLsizei*)_env->GetIntArrayElements(
4063 length_ref, (jboolean*)0);
4064 _length = _length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004065 }
Jesse Halld830e742013-03-29 11:02:35 -07004066
4067 if (!name_ref) {
4068 _exception = 1;
4069 _exceptionType = "java/lang/IllegalArgumentException";
4070 _exceptionMessage = "uniformBlockName == null";
4071 goto exit;
4072 }
4073 if (nameOffset < 0) {
4074 _exception = 1;
4075 _exceptionType = "java/lang/IllegalArgumentException";
4076 _exceptionMessage = "uniformBlockNameOffset < 0";
4077 goto exit;
4078 }
4079 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004080 _name_base = (GLchar*)_env->GetByteArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07004081 name_ref, (jboolean*)0);
4082 _name = _name_base + nameOffset;
4083
4084 glGetActiveUniformBlockName(
4085 (GLuint)program,
4086 (GLuint)uniformBlockIndex,
4087 (GLsizei)bufSize,
4088 (GLsizei*)_length,
4089 (GLchar*)_name
4090 );
4091
4092exit:
4093 if (_name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004094 _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
Jesse Halld830e742013-03-29 11:02:35 -07004095 _exception ? JNI_ABORT: 0);
4096 }
4097 if (_length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004098 _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004099 _exception ? JNI_ABORT: 0);
4100 }
4101 if (_exception) {
4102 jniThrowException(_env, _exceptionType, _exceptionMessage);
4103 }
4104}
4105
4106/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4107static void
4108android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
4109 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
4110 jint _exception = 0;
4111 const char* _exceptionType;
4112 const char* _exceptionMessage;
4113 jarray _lengthArray = (jarray)0;
4114 jint _lengthBufferOffset = (jint)0;
4115 GLsizei* _length = (GLsizei*)0;
4116 jint _lengthRemaining;
4117 jarray _nameArray = (jarray)0;
4118 jint _nameBufferOffset = (jint)0;
4119 GLchar* _name = (GLchar*)0;
4120 jint _nameRemaining;
4121
4122 _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4123 if (_length == NULL) {
4124 GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
4125 _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
4126 }
4127
4128 _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
4129 if (_name == NULL) {
4130 GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
4131 _name = (GLchar*)(_nameBase + _nameBufferOffset);
4132 }
4133
4134 glGetActiveUniformBlockName(
4135 (GLuint)program,
4136 (GLuint)uniformBlockIndex,
4137 (GLsizei)_nameRemaining,
4138 _length, _name
4139 );
4140 if (_nameArray) {
4141 releasePointer(_env, _nameArray, _name, JNI_TRUE);
4142 }
4143 if (_lengthArray) {
4144 releasePointer(_env, _lengthArray, _length, JNI_TRUE);
4145 }
4146}
4147
4148/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
4149static jstring
4150android_glGetActiveUniformBlockName_II
4151 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
4152 GLint len = 0;
4153 glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
4154 GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
4155 GLchar* name = (GLchar*)malloc(len);
4156 glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
4157 len, NULL, name);
4158 jstring result = _env->NewStringUTF(name);
4159 free(name);
4160 return result;
4161}
Jesse Halld830e742013-03-29 11:02:35 -07004162/* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
4163static void
4164android_glUniformBlockBinding__III
4165 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
4166 glUniformBlockBinding(
4167 (GLuint)program,
4168 (GLuint)uniformBlockIndex,
4169 (GLuint)uniformBlockBinding
4170 );
4171}
4172
4173/* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
4174static void
4175android_glDrawArraysInstanced__IIII
4176 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
4177 glDrawArraysInstanced(
4178 (GLenum)mode,
4179 (GLint)first,
4180 (GLsizei)count,
4181 (GLsizei)instanceCount
4182 );
4183}
4184
4185/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4186static void
4187android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
4188 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
4189 jarray _array = (jarray) 0;
4190 jint _bufferOffset = (jint) 0;
4191 jint _remaining;
4192 GLvoid *indices = (GLvoid *) 0;
4193
4194 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
4195 if (indices == NULL) {
4196 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4197 indices = (GLvoid *) (_indicesBase + _bufferOffset);
4198 }
4199 glDrawElementsInstanced(
4200 (GLenum)mode,
4201 (GLsizei)count,
4202 (GLenum)type,
4203 (GLvoid *)indices,
4204 (GLsizei)instanceCount
4205 );
4206 if (_array) {
4207 releasePointer(_env, _array, indices, JNI_FALSE);
4208 }
4209}
4210
4211/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
4212static void
4213android_glDrawElementsInstanced__IIIII
4214 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
4215 glDrawElementsInstanced(
4216 (GLenum)mode,
4217 (GLsizei)count,
4218 (GLenum)type,
Dan Albert10caf032015-02-23 10:41:10 -08004219 (GLvoid *)static_cast<uintptr_t>(indicesOffset),
Jesse Halld830e742013-03-29 11:02:35 -07004220 (GLsizei)instanceCount
4221 );
4222}
Jesse Halld830e742013-03-29 11:02:35 -07004223/* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
4224static jlong
4225android_glFenceSync__II
4226 (JNIEnv *_env, jobject _this, jint condition, jint flags) {
4227 GLsync _returnValue;
4228 _returnValue = glFenceSync(
4229 (GLenum)condition,
4230 (GLbitfield)flags
4231 );
4232 return (jlong)_returnValue;
4233}
4234
4235/* GLboolean glIsSync ( GLsync sync ) */
4236static jboolean
4237android_glIsSync__J
4238 (JNIEnv *_env, jobject _this, jlong sync) {
4239 GLboolean _returnValue;
4240 _returnValue = glIsSync(
4241 (GLsync)sync
4242 );
4243 return (jboolean)_returnValue;
4244}
4245
4246/* void glDeleteSync ( GLsync sync ) */
4247static void
4248android_glDeleteSync__J
4249 (JNIEnv *_env, jobject _this, jlong sync) {
4250 glDeleteSync(
4251 (GLsync)sync
4252 );
4253}
4254
4255/* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4256static jint
4257android_glClientWaitSync__JIJ
4258 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4259 GLenum _returnValue;
4260 _returnValue = glClientWaitSync(
4261 (GLsync)sync,
4262 (GLbitfield)flags,
4263 (GLuint64)timeout
4264 );
4265 return (jint)_returnValue;
4266}
4267
4268/* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
4269static void
4270android_glWaitSync__JIJ
4271 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
4272 glWaitSync(
4273 (GLsync)sync,
4274 (GLbitfield)flags,
4275 (GLuint64)timeout
4276 );
4277}
4278
4279/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4280static void
4281android_glGetInteger64v__I_3JI
4282 (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
4283 jint _exception = 0;
4284 const char * _exceptionType = NULL;
4285 const char * _exceptionMessage = NULL;
4286 GLint64 *params_base = (GLint64 *) 0;
4287 jint _remaining;
4288 GLint64 *params = (GLint64 *) 0;
4289
4290 if (!params_ref) {
4291 _exception = 1;
4292 _exceptionType = "java/lang/IllegalArgumentException";
4293 _exceptionMessage = "params == null";
4294 goto exit;
4295 }
4296 if (offset < 0) {
4297 _exception = 1;
4298 _exceptionType = "java/lang/IllegalArgumentException";
4299 _exceptionMessage = "offset < 0";
4300 goto exit;
4301 }
4302 _remaining = _env->GetArrayLength(params_ref) - offset;
4303 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004304 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004305 params = params_base + offset;
4306
4307 glGetInteger64v(
4308 (GLenum)pname,
4309 (GLint64 *)params
4310 );
4311
4312exit:
4313 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004314 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004315 _exception ? JNI_ABORT: 0);
4316 }
4317 if (_exception) {
4318 jniThrowException(_env, _exceptionType, _exceptionMessage);
4319 }
4320}
4321
4322/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
4323static void
4324android_glGetInteger64v__ILjava_nio_LongBuffer_2
4325 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004326 jint _exception = 0;
4327 const char * _exceptionType = NULL;
4328 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004329 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004330 jint _bufferOffset = (jint) 0;
4331 jint _remaining;
4332 GLint64 *params = (GLint64 *) 0;
4333
Romain Guy84cac202016-12-05 12:26:02 -08004334 if (!params_buf) {
4335 _exception = 1;
4336 _exceptionType = "java/lang/IllegalArgumentException";
4337 _exceptionMessage = "params == null";
4338 goto exit;
4339 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004340 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004341 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004342 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004343 params = (GLint64 *) (_paramsBase + _bufferOffset);
4344 }
4345 glGetInteger64v(
4346 (GLenum)pname,
4347 (GLint64 *)params
4348 );
Romain Guy84cac202016-12-05 12:26:02 -08004349
4350exit:
Jesse Halld830e742013-03-29 11:02:35 -07004351 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004352 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4353 }
4354 if (_exception) {
4355 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004356 }
4357}
4358
4359/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4360static void
4361android_glGetSynciv__JII_3II_3II
4362 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
4363 jint _exception = 0;
4364 const char * _exceptionType = NULL;
4365 const char * _exceptionMessage = NULL;
4366 GLsizei *length_base = (GLsizei *) 0;
4367 jint _lengthRemaining;
4368 GLsizei *length = (GLsizei *) 0;
4369 GLint *values_base = (GLint *) 0;
4370 jint _valuesRemaining;
4371 GLint *values = (GLint *) 0;
4372
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004373 if (length_ref) {
4374 if (lengthOffset < 0) {
4375 _exception = 1;
4376 _exceptionType = "java/lang/IllegalArgumentException";
4377 _exceptionMessage = "lengthOffset < 0";
4378 goto exit;
4379 }
4380 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4381 length_base = (GLsizei *)
4382 _env->GetIntArrayElements(length_ref, (jboolean *)0);
4383 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004384 }
Jesse Halld830e742013-03-29 11:02:35 -07004385
4386 if (!values_ref) {
4387 _exception = 1;
4388 _exceptionType = "java/lang/IllegalArgumentException";
4389 _exceptionMessage = "values == null";
4390 goto exit;
4391 }
4392 if (valuesOffset < 0) {
4393 _exception = 1;
4394 _exceptionType = "java/lang/IllegalArgumentException";
4395 _exceptionMessage = "valuesOffset < 0";
4396 goto exit;
4397 }
4398 _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
4399 values_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004400 _env->GetIntArrayElements(values_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004401 values = values_base + valuesOffset;
4402
4403 glGetSynciv(
4404 (GLsync)sync,
4405 (GLenum)pname,
4406 (GLsizei)bufSize,
4407 (GLsizei *)length,
4408 (GLint *)values
4409 );
4410
4411exit:
4412 if (values_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004413 _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
Jesse Halld830e742013-03-29 11:02:35 -07004414 _exception ? JNI_ABORT: 0);
4415 }
4416 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004417 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004418 _exception ? JNI_ABORT: 0);
4419 }
4420 if (_exception) {
4421 jniThrowException(_env, _exceptionType, _exceptionMessage);
4422 }
4423}
4424
4425/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
4426static void
4427android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4428 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004429 jint _exception = 0;
4430 const char * _exceptionType = NULL;
4431 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004432 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004433 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004434 jintArray _valuesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004435 jint _valuesBufferOffset = (jint) 0;
4436 jint _lengthRemaining;
4437 GLsizei *length = (GLsizei *) 0;
4438 jint _valuesRemaining;
4439 GLint *values = (GLint *) 0;
4440
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004441 if (length_buf) {
4442 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4443 }
Romain Guy84cac202016-12-05 12:26:02 -08004444 if (!values_buf) {
4445 _exception = 1;
4446 _exceptionType = "java/lang/IllegalArgumentException";
4447 _exceptionMessage = "values == null";
4448 goto exit;
4449 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004450 values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004451 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004452 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004453 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
4454 }
4455 if (values == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004456 char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004457 values = (GLint *) (_valuesBase + _valuesBufferOffset);
4458 }
4459 glGetSynciv(
4460 (GLsync)sync,
4461 (GLenum)pname,
4462 (GLsizei)bufSize,
4463 (GLsizei *)length,
4464 (GLint *)values
4465 );
Romain Guy84cac202016-12-05 12:26:02 -08004466
4467exit:
Jesse Halld830e742013-03-29 11:02:35 -07004468 if (_valuesArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004469 _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07004470 }
4471 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08004472 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
4473 }
4474 if (_exception) {
4475 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004476 }
4477}
4478
4479/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4480static void
4481android_glGetInteger64i_v__II_3JI
4482 (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
4483 jint _exception = 0;
4484 const char * _exceptionType = NULL;
4485 const char * _exceptionMessage = NULL;
4486 GLint64 *data_base = (GLint64 *) 0;
4487 jint _remaining;
4488 GLint64 *data = (GLint64 *) 0;
4489
4490 if (!data_ref) {
4491 _exception = 1;
4492 _exceptionType = "java/lang/IllegalArgumentException";
4493 _exceptionMessage = "data == null";
4494 goto exit;
4495 }
4496 if (offset < 0) {
4497 _exception = 1;
4498 _exceptionType = "java/lang/IllegalArgumentException";
4499 _exceptionMessage = "offset < 0";
4500 goto exit;
4501 }
4502 _remaining = _env->GetArrayLength(data_ref) - offset;
4503 data_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004504 _env->GetLongArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004505 data = data_base + offset;
4506
4507 glGetInteger64i_v(
4508 (GLenum)target,
4509 (GLuint)index,
4510 (GLint64 *)data
4511 );
4512
4513exit:
4514 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004515 _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07004516 _exception ? JNI_ABORT: 0);
4517 }
4518 if (_exception) {
4519 jniThrowException(_env, _exceptionType, _exceptionMessage);
4520 }
4521}
4522
4523/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4524static void
4525android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
4526 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004527 jint _exception = 0;
4528 const char * _exceptionType = NULL;
4529 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004530 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004531 jint _bufferOffset = (jint) 0;
4532 jint _remaining;
4533 GLint64 *data = (GLint64 *) 0;
4534
Romain Guy84cac202016-12-05 12:26:02 -08004535 if (!data_buf) {
4536 _exception = 1;
4537 _exceptionType = "java/lang/IllegalArgumentException";
4538 _exceptionMessage = "data == null";
4539 goto exit;
4540 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004541 data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004542 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004543 char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004544 data = (GLint64 *) (_dataBase + _bufferOffset);
4545 }
4546 glGetInteger64i_v(
4547 (GLenum)target,
4548 (GLuint)index,
4549 (GLint64 *)data
4550 );
Romain Guy84cac202016-12-05 12:26:02 -08004551
4552exit:
Jesse Halld830e742013-03-29 11:02:35 -07004553 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004554 _env->ReleaseLongArrayElements(_array, (jlong*)data, _exception ? JNI_ABORT : 0);
4555 }
4556 if (_exception) {
4557 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004558 }
4559}
4560
4561/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4562static void
4563android_glGetBufferParameteri64v__II_3JI
4564 (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
4565 jint _exception = 0;
4566 const char * _exceptionType = NULL;
4567 const char * _exceptionMessage = NULL;
4568 GLint64 *params_base = (GLint64 *) 0;
4569 jint _remaining;
4570 GLint64 *params = (GLint64 *) 0;
4571
4572 if (!params_ref) {
4573 _exception = 1;
4574 _exceptionType = "java/lang/IllegalArgumentException";
4575 _exceptionMessage = "params == null";
4576 goto exit;
4577 }
4578 if (offset < 0) {
4579 _exception = 1;
4580 _exceptionType = "java/lang/IllegalArgumentException";
4581 _exceptionMessage = "offset < 0";
4582 goto exit;
4583 }
4584 _remaining = _env->GetArrayLength(params_ref) - offset;
4585 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004586 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004587 params = params_base + offset;
4588
4589 glGetBufferParameteri64v(
4590 (GLenum)target,
4591 (GLenum)pname,
4592 (GLint64 *)params
4593 );
4594
4595exit:
4596 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004597 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004598 _exception ? JNI_ABORT: 0);
4599 }
4600 if (_exception) {
4601 jniThrowException(_env, _exceptionType, _exceptionMessage);
4602 }
4603}
4604
4605/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4606static void
4607android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
4608 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004609 jint _exception = 0;
4610 const char * _exceptionType = NULL;
4611 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004612 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004613 jint _bufferOffset = (jint) 0;
4614 jint _remaining;
4615 GLint64 *params = (GLint64 *) 0;
4616
Romain Guy84cac202016-12-05 12:26:02 -08004617 if (!params_buf) {
4618 _exception = 1;
4619 _exceptionType = "java/lang/IllegalArgumentException";
4620 _exceptionMessage = "params == null";
4621 goto exit;
4622 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004623 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004624 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004625 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004626 params = (GLint64 *) (_paramsBase + _bufferOffset);
4627 }
4628 glGetBufferParameteri64v(
4629 (GLenum)target,
4630 (GLenum)pname,
4631 (GLint64 *)params
4632 );
Romain Guy84cac202016-12-05 12:26:02 -08004633
4634exit:
Jesse Halld830e742013-03-29 11:02:35 -07004635 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004636 _env->ReleaseLongArrayElements(_array, (jlong*)params, _exception ? JNI_ABORT : 0);
4637 }
4638 if (_exception) {
4639 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004640 }
4641}
4642
4643/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4644static void
4645android_glGenSamplers__I_3II
4646 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4647 jint _exception = 0;
4648 const char * _exceptionType = NULL;
4649 const char * _exceptionMessage = NULL;
4650 GLuint *samplers_base = (GLuint *) 0;
4651 jint _remaining;
4652 GLuint *samplers = (GLuint *) 0;
4653
4654 if (!samplers_ref) {
4655 _exception = 1;
4656 _exceptionType = "java/lang/IllegalArgumentException";
4657 _exceptionMessage = "samplers == null";
4658 goto exit;
4659 }
4660 if (offset < 0) {
4661 _exception = 1;
4662 _exceptionType = "java/lang/IllegalArgumentException";
4663 _exceptionMessage = "offset < 0";
4664 goto exit;
4665 }
4666 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4667 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004668 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004669 samplers = samplers_base + offset;
4670
4671 glGenSamplers(
4672 (GLsizei)count,
4673 (GLuint *)samplers
4674 );
4675
4676exit:
4677 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004678 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004679 _exception ? JNI_ABORT: 0);
4680 }
4681 if (_exception) {
4682 jniThrowException(_env, _exceptionType, _exceptionMessage);
4683 }
4684}
4685
4686/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4687static void
4688android_glGenSamplers__ILjava_nio_IntBuffer_2
4689 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004690 jint _exception = 0;
4691 const char * _exceptionType = NULL;
4692 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004693 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004694 jint _bufferOffset = (jint) 0;
4695 jint _remaining;
4696 GLuint *samplers = (GLuint *) 0;
4697
Romain Guy84cac202016-12-05 12:26:02 -08004698 if (!samplers_buf) {
4699 _exception = 1;
4700 _exceptionType = "java/lang/IllegalArgumentException";
4701 _exceptionMessage = "samplers == null";
4702 goto exit;
4703 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004704 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004705 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004706 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004707 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4708 }
4709 glGenSamplers(
4710 (GLsizei)count,
4711 (GLuint *)samplers
4712 );
Romain Guy84cac202016-12-05 12:26:02 -08004713
4714exit:
Jesse Halld830e742013-03-29 11:02:35 -07004715 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004716 _env->ReleaseIntArrayElements(_array, (jint*)samplers, _exception ? JNI_ABORT : 0);
4717 }
4718 if (_exception) {
4719 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07004720 }
4721}
4722
4723/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4724static void
4725android_glDeleteSamplers__I_3II
4726 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4727 jint _exception = 0;
4728 const char * _exceptionType = NULL;
4729 const char * _exceptionMessage = NULL;
4730 GLuint *samplers_base = (GLuint *) 0;
4731 jint _remaining;
4732 GLuint *samplers = (GLuint *) 0;
4733
4734 if (!samplers_ref) {
4735 _exception = 1;
4736 _exceptionType = "java/lang/IllegalArgumentException";
4737 _exceptionMessage = "samplers == null";
4738 goto exit;
4739 }
4740 if (offset < 0) {
4741 _exception = 1;
4742 _exceptionType = "java/lang/IllegalArgumentException";
4743 _exceptionMessage = "offset < 0";
4744 goto exit;
4745 }
4746 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4747 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004748 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004749 samplers = samplers_base + offset;
4750
4751 glDeleteSamplers(
4752 (GLsizei)count,
4753 (GLuint *)samplers
4754 );
4755
4756exit:
4757 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004758 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004759 JNI_ABORT);
4760 }
4761 if (_exception) {
4762 jniThrowException(_env, _exceptionType, _exceptionMessage);
4763 }
4764}
4765
4766/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4767static void
4768android_glDeleteSamplers__ILjava_nio_IntBuffer_2
4769 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004770 jint _exception = 0;
4771 const char * _exceptionType = NULL;
4772 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004773 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004774 jint _bufferOffset = (jint) 0;
4775 jint _remaining;
4776 GLuint *samplers = (GLuint *) 0;
4777
Romain Guy84cac202016-12-05 12:26:02 -08004778 if (!samplers_buf) {
4779 _exception = 1;
4780 _exceptionType = "java/lang/IllegalArgumentException";
4781 _exceptionMessage = "samplers == null";
4782 goto exit;
4783 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004784 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004785 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004786 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004787 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4788 }
4789 glDeleteSamplers(
4790 (GLsizei)count,
4791 (GLuint *)samplers
4792 );
Romain Guy84cac202016-12-05 12:26:02 -08004793
4794exit:
Jesse Halld830e742013-03-29 11:02:35 -07004795 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004796 _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004797 }
Romain Guy84cac202016-12-05 12:26:02 -08004798 if (_exception) {
4799 jniThrowException(_env, _exceptionType, _exceptionMessage);
4800 }
Jesse Halld830e742013-03-29 11:02:35 -07004801}
4802
4803/* GLboolean glIsSampler ( GLuint sampler ) */
4804static jboolean
4805android_glIsSampler__I
4806 (JNIEnv *_env, jobject _this, jint sampler) {
4807 GLboolean _returnValue;
4808 _returnValue = glIsSampler(
4809 (GLuint)sampler
4810 );
4811 return (jboolean)_returnValue;
4812}
4813
4814/* void glBindSampler ( GLuint unit, GLuint sampler ) */
4815static void
4816android_glBindSampler__II
4817 (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
4818 glBindSampler(
4819 (GLuint)unit,
4820 (GLuint)sampler
4821 );
4822}
4823
4824/* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
4825static void
4826android_glSamplerParameteri__III
4827 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
4828 glSamplerParameteri(
4829 (GLuint)sampler,
4830 (GLenum)pname,
4831 (GLint)param
4832 );
4833}
4834
4835/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4836static void
4837android_glSamplerParameteriv__II_3II
4838 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
4839 jint _exception = 0;
4840 const char * _exceptionType = NULL;
4841 const char * _exceptionMessage = NULL;
4842 GLint *param_base = (GLint *) 0;
4843 jint _remaining;
4844 GLint *param = (GLint *) 0;
4845
4846 if (!param_ref) {
4847 _exception = 1;
4848 _exceptionType = "java/lang/IllegalArgumentException";
4849 _exceptionMessage = "param == null";
4850 goto exit;
4851 }
4852 if (offset < 0) {
4853 _exception = 1;
4854 _exceptionType = "java/lang/IllegalArgumentException";
4855 _exceptionMessage = "offset < 0";
4856 goto exit;
4857 }
4858 _remaining = _env->GetArrayLength(param_ref) - offset;
4859 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004860 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004861 param = param_base + offset;
4862
4863 glSamplerParameteriv(
4864 (GLuint)sampler,
4865 (GLenum)pname,
4866 (GLint *)param
4867 );
4868
4869exit:
4870 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004871 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004872 JNI_ABORT);
4873 }
4874 if (_exception) {
4875 jniThrowException(_env, _exceptionType, _exceptionMessage);
4876 }
4877}
4878
4879/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4880static void
4881android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
4882 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004883 jint _exception = 0;
4884 const char * _exceptionType = NULL;
4885 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004886 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004887 jint _bufferOffset = (jint) 0;
4888 jint _remaining;
4889 GLint *param = (GLint *) 0;
4890
Romain Guy84cac202016-12-05 12:26:02 -08004891 if (!param_buf) {
4892 _exception = 1;
4893 _exceptionType = "java/lang/IllegalArgumentException";
4894 _exceptionMessage = "param == null";
4895 goto exit;
4896 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004897 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004898 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004899 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004900 param = (GLint *) (_paramBase + _bufferOffset);
4901 }
4902 glSamplerParameteriv(
4903 (GLuint)sampler,
4904 (GLenum)pname,
4905 (GLint *)param
4906 );
Romain Guy84cac202016-12-05 12:26:02 -08004907
4908exit:
Jesse Halld830e742013-03-29 11:02:35 -07004909 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004910 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004911 }
Romain Guy84cac202016-12-05 12:26:02 -08004912 if (_exception) {
4913 jniThrowException(_env, _exceptionType, _exceptionMessage);
4914 }
Jesse Halld830e742013-03-29 11:02:35 -07004915}
4916
4917/* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
4918static void
4919android_glSamplerParameterf__IIF
4920 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
4921 glSamplerParameterf(
4922 (GLuint)sampler,
4923 (GLenum)pname,
4924 (GLfloat)param
4925 );
4926}
4927
4928/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4929static void
4930android_glSamplerParameterfv__II_3FI
4931 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
4932 jint _exception = 0;
4933 const char * _exceptionType = NULL;
4934 const char * _exceptionMessage = NULL;
4935 GLfloat *param_base = (GLfloat *) 0;
4936 jint _remaining;
4937 GLfloat *param = (GLfloat *) 0;
4938
4939 if (!param_ref) {
4940 _exception = 1;
4941 _exceptionType = "java/lang/IllegalArgumentException";
4942 _exceptionMessage = "param == null";
4943 goto exit;
4944 }
4945 if (offset < 0) {
4946 _exception = 1;
4947 _exceptionType = "java/lang/IllegalArgumentException";
4948 _exceptionMessage = "offset < 0";
4949 goto exit;
4950 }
4951 _remaining = _env->GetArrayLength(param_ref) - offset;
4952 param_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004953 _env->GetFloatArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004954 param = param_base + offset;
4955
4956 glSamplerParameterfv(
4957 (GLuint)sampler,
4958 (GLenum)pname,
4959 (GLfloat *)param
4960 );
4961
4962exit:
4963 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004964 _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004965 JNI_ABORT);
4966 }
4967 if (_exception) {
4968 jniThrowException(_env, _exceptionType, _exceptionMessage);
4969 }
4970}
4971
4972/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4973static void
4974android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
4975 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004976 jint _exception = 0;
4977 const char * _exceptionType = NULL;
4978 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004979 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004980 jint _bufferOffset = (jint) 0;
4981 jint _remaining;
4982 GLfloat *param = (GLfloat *) 0;
4983
Romain Guy84cac202016-12-05 12:26:02 -08004984 if (!param_buf) {
4985 _exception = 1;
4986 _exceptionType = "java/lang/IllegalArgumentException";
4987 _exceptionMessage = "param == null";
4988 goto exit;
4989 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004990 param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004991 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004992 char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004993 param = (GLfloat *) (_paramBase + _bufferOffset);
4994 }
4995 glSamplerParameterfv(
4996 (GLuint)sampler,
4997 (GLenum)pname,
4998 (GLfloat *)param
4999 );
Romain Guy84cac202016-12-05 12:26:02 -08005000
5001exit:
Jesse Halld830e742013-03-29 11:02:35 -07005002 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005003 _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005004 }
Romain Guy84cac202016-12-05 12:26:02 -08005005 if (_exception) {
5006 jniThrowException(_env, _exceptionType, _exceptionMessage);
5007 }
Jesse Halld830e742013-03-29 11:02:35 -07005008}
5009
5010/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5011static void
5012android_glGetSamplerParameteriv__II_3II
5013 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
5014 jint _exception = 0;
5015 const char * _exceptionType = NULL;
5016 const char * _exceptionMessage = NULL;
5017 GLint *params_base = (GLint *) 0;
5018 jint _remaining;
5019 GLint *params = (GLint *) 0;
5020
5021 if (!params_ref) {
5022 _exception = 1;
5023 _exceptionType = "java/lang/IllegalArgumentException";
5024 _exceptionMessage = "params == null";
5025 goto exit;
5026 }
5027 if (offset < 0) {
5028 _exception = 1;
5029 _exceptionType = "java/lang/IllegalArgumentException";
5030 _exceptionMessage = "offset < 0";
5031 goto exit;
5032 }
5033 _remaining = _env->GetArrayLength(params_ref) - offset;
5034 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005035 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005036 params = params_base + offset;
5037
5038 glGetSamplerParameteriv(
5039 (GLuint)sampler,
5040 (GLenum)pname,
5041 (GLint *)params
5042 );
5043
5044exit:
5045 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005046 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005047 _exception ? JNI_ABORT: 0);
5048 }
5049 if (_exception) {
5050 jniThrowException(_env, _exceptionType, _exceptionMessage);
5051 }
5052}
5053
5054/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
5055static void
5056android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
5057 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005058 jint _exception = 0;
5059 const char * _exceptionType = NULL;
5060 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005061 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005062 jint _bufferOffset = (jint) 0;
5063 jint _remaining;
5064 GLint *params = (GLint *) 0;
5065
Romain Guy84cac202016-12-05 12:26:02 -08005066 if (!params_buf) {
5067 _exception = 1;
5068 _exceptionType = "java/lang/IllegalArgumentException";
5069 _exceptionMessage = "params == null";
5070 goto exit;
5071 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005072 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005073 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005074 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005075 params = (GLint *) (_paramsBase + _bufferOffset);
5076 }
5077 glGetSamplerParameteriv(
5078 (GLuint)sampler,
5079 (GLenum)pname,
5080 (GLint *)params
5081 );
Romain Guy84cac202016-12-05 12:26:02 -08005082
5083exit:
Jesse Halld830e742013-03-29 11:02:35 -07005084 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005085 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5086 }
5087 if (_exception) {
5088 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005089 }
5090}
5091
5092/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5093static void
5094android_glGetSamplerParameterfv__II_3FI
5095 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
5096 jint _exception = 0;
5097 const char * _exceptionType = NULL;
5098 const char * _exceptionMessage = NULL;
5099 GLfloat *params_base = (GLfloat *) 0;
5100 jint _remaining;
5101 GLfloat *params = (GLfloat *) 0;
5102
5103 if (!params_ref) {
5104 _exception = 1;
5105 _exceptionType = "java/lang/IllegalArgumentException";
5106 _exceptionMessage = "params == null";
5107 goto exit;
5108 }
5109 if (offset < 0) {
5110 _exception = 1;
5111 _exceptionType = "java/lang/IllegalArgumentException";
5112 _exceptionMessage = "offset < 0";
5113 goto exit;
5114 }
5115 _remaining = _env->GetArrayLength(params_ref) - offset;
5116 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005117 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005118 params = params_base + offset;
5119
5120 glGetSamplerParameterfv(
5121 (GLuint)sampler,
5122 (GLenum)pname,
5123 (GLfloat *)params
5124 );
5125
5126exit:
5127 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005128 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005129 _exception ? JNI_ABORT: 0);
5130 }
5131 if (_exception) {
5132 jniThrowException(_env, _exceptionType, _exceptionMessage);
5133 }
5134}
5135
5136/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
5137static void
5138android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
5139 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005140 jint _exception = 0;
5141 const char * _exceptionType = NULL;
5142 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005143 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005144 jint _bufferOffset = (jint) 0;
5145 jint _remaining;
5146 GLfloat *params = (GLfloat *) 0;
5147
Romain Guy84cac202016-12-05 12:26:02 -08005148 if (!params_buf) {
5149 _exception = 1;
5150 _exceptionType = "java/lang/IllegalArgumentException";
5151 _exceptionMessage = "params == null";
5152 goto exit;
5153 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005154 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005155 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005156 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005157 params = (GLfloat *) (_paramsBase + _bufferOffset);
5158 }
5159 glGetSamplerParameterfv(
5160 (GLuint)sampler,
5161 (GLenum)pname,
5162 (GLfloat *)params
5163 );
Romain Guy84cac202016-12-05 12:26:02 -08005164
5165exit:
Jesse Halld830e742013-03-29 11:02:35 -07005166 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005167 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5168 }
5169 if (_exception) {
5170 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005171 }
5172}
5173
5174/* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
5175static void
5176android_glVertexAttribDivisor__II
5177 (JNIEnv *_env, jobject _this, jint index, jint divisor) {
5178 glVertexAttribDivisor(
5179 (GLuint)index,
5180 (GLuint)divisor
5181 );
5182}
5183
5184/* void glBindTransformFeedback ( GLenum target, GLuint id ) */
5185static void
5186android_glBindTransformFeedback__II
5187 (JNIEnv *_env, jobject _this, jint target, jint id) {
5188 glBindTransformFeedback(
5189 (GLenum)target,
5190 (GLuint)id
5191 );
5192}
5193
5194/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5195static void
5196android_glDeleteTransformFeedbacks__I_3II
5197 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5198 jint _exception = 0;
5199 const char * _exceptionType = NULL;
5200 const char * _exceptionMessage = NULL;
5201 GLuint *ids_base = (GLuint *) 0;
5202 jint _remaining;
5203 GLuint *ids = (GLuint *) 0;
5204
5205 if (!ids_ref) {
5206 _exception = 1;
5207 _exceptionType = "java/lang/IllegalArgumentException";
5208 _exceptionMessage = "ids == null";
5209 goto exit;
5210 }
5211 if (offset < 0) {
5212 _exception = 1;
5213 _exceptionType = "java/lang/IllegalArgumentException";
5214 _exceptionMessage = "offset < 0";
5215 goto exit;
5216 }
5217 _remaining = _env->GetArrayLength(ids_ref) - offset;
5218 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005219 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005220 ids = ids_base + offset;
5221
5222 glDeleteTransformFeedbacks(
5223 (GLsizei)n,
5224 (GLuint *)ids
5225 );
5226
5227exit:
5228 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005229 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005230 JNI_ABORT);
5231 }
5232 if (_exception) {
5233 jniThrowException(_env, _exceptionType, _exceptionMessage);
5234 }
5235}
5236
5237/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
5238static void
5239android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
5240 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005241 jint _exception = 0;
5242 const char * _exceptionType = NULL;
5243 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005244 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005245 jint _bufferOffset = (jint) 0;
5246 jint _remaining;
5247 GLuint *ids = (GLuint *) 0;
5248
Romain Guy84cac202016-12-05 12:26:02 -08005249 if (!ids_buf) {
5250 _exception = 1;
5251 _exceptionType = "java/lang/IllegalArgumentException";
5252 _exceptionMessage = "ids == null";
5253 goto exit;
5254 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005255 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005256 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005257 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005258 ids = (GLuint *) (_idsBase + _bufferOffset);
5259 }
5260 glDeleteTransformFeedbacks(
5261 (GLsizei)n,
5262 (GLuint *)ids
5263 );
Romain Guy84cac202016-12-05 12:26:02 -08005264
5265exit:
Jesse Halld830e742013-03-29 11:02:35 -07005266 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005267 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005268 }
Romain Guy84cac202016-12-05 12:26:02 -08005269 if (_exception) {
5270 jniThrowException(_env, _exceptionType, _exceptionMessage);
5271 }
Jesse Halld830e742013-03-29 11:02:35 -07005272}
5273
5274/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5275static void
5276android_glGenTransformFeedbacks__I_3II
5277 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
5278 jint _exception = 0;
5279 const char * _exceptionType = NULL;
5280 const char * _exceptionMessage = NULL;
5281 GLuint *ids_base = (GLuint *) 0;
5282 jint _remaining;
5283 GLuint *ids = (GLuint *) 0;
5284
5285 if (!ids_ref) {
5286 _exception = 1;
5287 _exceptionType = "java/lang/IllegalArgumentException";
5288 _exceptionMessage = "ids == null";
5289 goto exit;
5290 }
5291 if (offset < 0) {
5292 _exception = 1;
5293 _exceptionType = "java/lang/IllegalArgumentException";
5294 _exceptionMessage = "offset < 0";
5295 goto exit;
5296 }
5297 _remaining = _env->GetArrayLength(ids_ref) - offset;
5298 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005299 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005300 ids = ids_base + offset;
5301
5302 glGenTransformFeedbacks(
5303 (GLsizei)n,
5304 (GLuint *)ids
5305 );
5306
5307exit:
5308 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005309 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07005310 _exception ? JNI_ABORT: 0);
5311 }
5312 if (_exception) {
5313 jniThrowException(_env, _exceptionType, _exceptionMessage);
5314 }
5315}
5316
5317/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
5318static void
5319android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
5320 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005321 jint _exception = 0;
5322 const char * _exceptionType = NULL;
5323 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005324 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005325 jint _bufferOffset = (jint) 0;
5326 jint _remaining;
5327 GLuint *ids = (GLuint *) 0;
5328
Romain Guy84cac202016-12-05 12:26:02 -08005329 if (!ids_buf) {
5330 _exception = 1;
5331 _exceptionType = "java/lang/IllegalArgumentException";
5332 _exceptionMessage = "ids == null";
5333 goto exit;
5334 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005335 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005336 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005337 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005338 ids = (GLuint *) (_idsBase + _bufferOffset);
5339 }
5340 glGenTransformFeedbacks(
5341 (GLsizei)n,
5342 (GLuint *)ids
5343 );
Romain Guy84cac202016-12-05 12:26:02 -08005344
5345exit:
Jesse Halld830e742013-03-29 11:02:35 -07005346 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005347 _env->ReleaseIntArrayElements(_array, (jint*)ids, _exception ? JNI_ABORT : 0);
5348 }
5349 if (_exception) {
5350 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005351 }
5352}
5353
5354/* GLboolean glIsTransformFeedback ( GLuint id ) */
5355static jboolean
5356android_glIsTransformFeedback__I
5357 (JNIEnv *_env, jobject _this, jint id) {
5358 GLboolean _returnValue;
5359 _returnValue = glIsTransformFeedback(
5360 (GLuint)id
5361 );
5362 return (jboolean)_returnValue;
5363}
5364
5365/* void glPauseTransformFeedback ( void ) */
5366static void
5367android_glPauseTransformFeedback__
5368 (JNIEnv *_env, jobject _this) {
5369 glPauseTransformFeedback();
5370}
5371
5372/* void glResumeTransformFeedback ( void ) */
5373static void
5374android_glResumeTransformFeedback__
5375 (JNIEnv *_env, jobject _this) {
5376 glResumeTransformFeedback();
5377}
5378
5379/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5380static void
5381android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
5382 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
5383 jint _exception = 0;
5384 const char * _exceptionType = NULL;
5385 const char * _exceptionMessage = NULL;
5386 jarray _array = (jarray) 0;
5387 jint _bufferOffset = (jint) 0;
5388 GLsizei *length_base = (GLsizei *) 0;
5389 jint _lengthRemaining;
5390 GLsizei *length = (GLsizei *) 0;
5391 GLenum *binaryFormat_base = (GLenum *) 0;
5392 jint _binaryFormatRemaining;
5393 GLenum *binaryFormat = (GLenum *) 0;
5394 jint _binaryRemaining;
5395 GLvoid *binary = (GLvoid *) 0;
5396
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005397 if (length_ref) {
5398 if (lengthOffset < 0) {
5399 _exception = 1;
5400 _exceptionType = "java/lang/IllegalArgumentException";
5401 _exceptionMessage = "lengthOffset < 0";
5402 goto exit;
5403 }
5404 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
5405 length_base = (GLsizei *)
5406 _env->GetIntArrayElements(length_ref, (jboolean *)0);
5407 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07005408 }
Jesse Halld830e742013-03-29 11:02:35 -07005409
5410 if (!binaryFormat_ref) {
5411 _exception = 1;
5412 _exceptionType = "java/lang/IllegalArgumentException";
5413 _exceptionMessage = "binaryFormat == null";
5414 goto exit;
5415 }
5416 if (binaryFormatOffset < 0) {
5417 _exception = 1;
5418 _exceptionType = "java/lang/IllegalArgumentException";
5419 _exceptionMessage = "binaryFormatOffset < 0";
5420 goto exit;
5421 }
5422 _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
5423 binaryFormat_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005424 _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005425 binaryFormat = binaryFormat_base + binaryFormatOffset;
5426
Romain Guy84cac202016-12-05 12:26:02 -08005427 if (!binary_buf) {
5428 _exception = 1;
5429 _exceptionType = "java/lang/IllegalArgumentException";
5430 _exceptionMessage = "binary == null";
5431 goto exit;
5432 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005433 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005434 if (binary == NULL) {
5435 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5436 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5437 }
5438 glGetProgramBinary(
5439 (GLuint)program,
5440 (GLsizei)bufSize,
5441 (GLsizei *)length,
5442 (GLenum *)binaryFormat,
5443 (GLvoid *)binary
5444 );
5445
5446exit:
5447 if (_array) {
5448 releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
5449 }
5450 if (binaryFormat_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005451 _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
Jesse Halld830e742013-03-29 11:02:35 -07005452 _exception ? JNI_ABORT: 0);
5453 }
5454 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005455 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07005456 _exception ? JNI_ABORT: 0);
5457 }
5458 if (_exception) {
5459 jniThrowException(_env, _exceptionType, _exceptionMessage);
5460 }
5461}
5462
5463/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
5464static void
5465android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
5466 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005467 jint _exception = 0;
5468 const char * _exceptionType = NULL;
5469 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005470 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005471 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005472 jintArray _binaryFormatArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005473 jint _binaryFormatBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005474 jintArray _binaryArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005475 jint _binaryBufferOffset = (jint) 0;
5476 jint _lengthRemaining;
5477 GLsizei *length = (GLsizei *) 0;
5478 jint _binaryFormatRemaining;
5479 GLenum *binaryFormat = (GLenum *) 0;
5480 jint _binaryRemaining;
5481 GLvoid *binary = (GLvoid *) 0;
5482
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005483 if (length_buf) {
5484 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
5485 }
Romain Guy84cac202016-12-05 12:26:02 -08005486 if (!binaryFormat_buf) {
5487 _exception = 1;
5488 _exceptionType = "java/lang/IllegalArgumentException";
5489 _exceptionMessage = "binaryFormat == null";
5490 goto exit;
5491 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005492 binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
Romain Guy84cac202016-12-05 12:26:02 -08005493 if (!binary_buf) {
5494 _exception = 1;
5495 _exceptionType = "java/lang/IllegalArgumentException";
5496 _exceptionMessage = "binary == null";
5497 goto exit;
5498 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005499 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07005500 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005501 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005502 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
5503 }
5504 if (binaryFormat == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005505 char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005506 binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
5507 }
5508 if (binary == NULL) {
5509 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
5510 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
5511 }
5512 glGetProgramBinary(
5513 (GLuint)program,
5514 (GLsizei)bufSize,
5515 (GLsizei *)length,
5516 (GLenum *)binaryFormat,
5517 (GLvoid *)binary
5518 );
Romain Guy84cac202016-12-05 12:26:02 -08005519
5520exit:
Jesse Halld830e742013-03-29 11:02:35 -07005521 if (_binaryArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005522 releasePointer(_env, _binaryArray, binary, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07005523 }
5524 if (_binaryFormatArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005525 _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07005526 }
5527 if (_lengthArray) {
Romain Guy84cac202016-12-05 12:26:02 -08005528 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, _exception ? JNI_ABORT : 0);
5529 }
5530 if (_exception) {
5531 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005532 }
5533}
5534
5535/* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
5536static void
5537android_glProgramBinary__IILjava_nio_Buffer_2I
5538 (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
Romain Guy84cac202016-12-05 12:26:02 -08005539 jint _exception = 0;
5540 const char * _exceptionType = NULL;
5541 const char * _exceptionMessage = NULL;
Jesse Halld830e742013-03-29 11:02:35 -07005542 jarray _array = (jarray) 0;
5543 jint _bufferOffset = (jint) 0;
5544 jint _remaining;
5545 GLvoid *binary = (GLvoid *) 0;
5546
Romain Guy84cac202016-12-05 12:26:02 -08005547 if (!binary_buf) {
5548 _exception = 1;
5549 _exceptionType = "java/lang/IllegalArgumentException";
5550 _exceptionMessage = "binary == null";
5551 goto exit;
5552 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005553 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005554 if (binary == NULL) {
5555 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5556 binary = (GLvoid *) (_binaryBase + _bufferOffset);
5557 }
5558 glProgramBinary(
5559 (GLuint)program,
5560 (GLenum)binaryFormat,
5561 (GLvoid *)binary,
5562 (GLsizei)length
5563 );
Romain Guy84cac202016-12-05 12:26:02 -08005564
5565exit:
Jesse Halld830e742013-03-29 11:02:35 -07005566 if (_array) {
5567 releasePointer(_env, _array, binary, JNI_FALSE);
5568 }
Romain Guy84cac202016-12-05 12:26:02 -08005569 if (_exception) {
5570 jniThrowException(_env, _exceptionType, _exceptionMessage);
5571 }
Jesse Halld830e742013-03-29 11:02:35 -07005572}
5573
5574/* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
5575static void
5576android_glProgramParameteri__III
5577 (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
5578 glProgramParameteri(
5579 (GLuint)program,
5580 (GLenum)pname,
5581 (GLint)value
5582 );
5583}
5584
5585/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5586static void
5587android_glInvalidateFramebuffer__II_3II
5588 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
5589 jint _exception = 0;
5590 const char * _exceptionType = NULL;
5591 const char * _exceptionMessage = NULL;
5592 GLenum *attachments_base = (GLenum *) 0;
5593 jint _remaining;
5594 GLenum *attachments = (GLenum *) 0;
5595
5596 if (!attachments_ref) {
5597 _exception = 1;
5598 _exceptionType = "java/lang/IllegalArgumentException";
5599 _exceptionMessage = "attachments == null";
5600 goto exit;
5601 }
5602 if (offset < 0) {
5603 _exception = 1;
5604 _exceptionType = "java/lang/IllegalArgumentException";
5605 _exceptionMessage = "offset < 0";
5606 goto exit;
5607 }
5608 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5609 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005610 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005611 attachments = attachments_base + offset;
5612
5613 glInvalidateFramebuffer(
5614 (GLenum)target,
5615 (GLsizei)numAttachments,
5616 (GLenum *)attachments
5617 );
5618
5619exit:
5620 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005621 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005622 JNI_ABORT);
5623 }
5624 if (_exception) {
5625 jniThrowException(_env, _exceptionType, _exceptionMessage);
5626 }
5627}
5628
5629/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
5630static void
5631android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
5632 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005633 jint _exception = 0;
5634 const char * _exceptionType = NULL;
5635 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005636 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005637 jint _bufferOffset = (jint) 0;
5638 jint _remaining;
5639 GLenum *attachments = (GLenum *) 0;
5640
Romain Guy84cac202016-12-05 12:26:02 -08005641 if (!attachments_buf) {
5642 _exception = 1;
5643 _exceptionType = "java/lang/IllegalArgumentException";
5644 _exceptionMessage = "attachments == null";
5645 goto exit;
5646 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005647 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005648 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005649 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005650 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5651 }
5652 glInvalidateFramebuffer(
5653 (GLenum)target,
5654 (GLsizei)numAttachments,
5655 (GLenum *)attachments
5656 );
Romain Guy84cac202016-12-05 12:26:02 -08005657
5658exit:
Jesse Halld830e742013-03-29 11:02:35 -07005659 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005660 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005661 }
Romain Guy84cac202016-12-05 12:26:02 -08005662 if (_exception) {
5663 jniThrowException(_env, _exceptionType, _exceptionMessage);
5664 }
Jesse Halld830e742013-03-29 11:02:35 -07005665}
5666
5667/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5668static void
5669android_glInvalidateSubFramebuffer__II_3IIIIII
5670 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
5671 jint _exception = 0;
5672 const char * _exceptionType = NULL;
5673 const char * _exceptionMessage = NULL;
5674 GLenum *attachments_base = (GLenum *) 0;
5675 jint _remaining;
5676 GLenum *attachments = (GLenum *) 0;
5677
5678 if (!attachments_ref) {
5679 _exception = 1;
5680 _exceptionType = "java/lang/IllegalArgumentException";
5681 _exceptionMessage = "attachments == null";
5682 goto exit;
5683 }
5684 if (offset < 0) {
5685 _exception = 1;
5686 _exceptionType = "java/lang/IllegalArgumentException";
5687 _exceptionMessage = "offset < 0";
5688 goto exit;
5689 }
5690 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5691 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005692 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005693 attachments = attachments_base + offset;
5694
5695 glInvalidateSubFramebuffer(
5696 (GLenum)target,
5697 (GLsizei)numAttachments,
5698 (GLenum *)attachments,
5699 (GLint)x,
5700 (GLint)y,
5701 (GLsizei)width,
5702 (GLsizei)height
5703 );
5704
5705exit:
5706 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005707 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005708 JNI_ABORT);
5709 }
5710 if (_exception) {
5711 jniThrowException(_env, _exceptionType, _exceptionMessage);
5712 }
5713}
5714
5715/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5716static void
5717android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
5718 (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 -08005719 jint _exception = 0;
5720 const char * _exceptionType = NULL;
5721 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005722 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005723 jint _bufferOffset = (jint) 0;
5724 jint _remaining;
5725 GLenum *attachments = (GLenum *) 0;
5726
Romain Guy84cac202016-12-05 12:26:02 -08005727 if (!attachments_buf) {
5728 _exception = 1;
5729 _exceptionType = "java/lang/IllegalArgumentException";
5730 _exceptionMessage = "attachments == null";
5731 goto exit;
5732 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005733 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005734 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005735 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005736 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5737 }
5738 glInvalidateSubFramebuffer(
5739 (GLenum)target,
5740 (GLsizei)numAttachments,
5741 (GLenum *)attachments,
5742 (GLint)x,
5743 (GLint)y,
5744 (GLsizei)width,
5745 (GLsizei)height
5746 );
Romain Guy84cac202016-12-05 12:26:02 -08005747
5748exit:
Jesse Halld830e742013-03-29 11:02:35 -07005749 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005750 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005751 }
Romain Guy84cac202016-12-05 12:26:02 -08005752 if (_exception) {
5753 jniThrowException(_env, _exceptionType, _exceptionMessage);
5754 }
Jesse Halld830e742013-03-29 11:02:35 -07005755}
5756
5757/* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
5758static void
5759android_glTexStorage2D__IIIII
5760 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
5761 glTexStorage2D(
5762 (GLenum)target,
5763 (GLsizei)levels,
5764 (GLenum)internalformat,
5765 (GLsizei)width,
5766 (GLsizei)height
5767 );
5768}
5769
5770/* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
5771static void
5772android_glTexStorage3D__IIIIII
5773 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
5774 glTexStorage3D(
5775 (GLenum)target,
5776 (GLsizei)levels,
5777 (GLenum)internalformat,
5778 (GLsizei)width,
5779 (GLsizei)height,
5780 (GLsizei)depth
5781 );
5782}
5783
5784/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5785static void
5786android_glGetInternalformativ__IIII_3II
5787 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
5788 jint _exception = 0;
5789 const char * _exceptionType = NULL;
5790 const char * _exceptionMessage = NULL;
5791 GLint *params_base = (GLint *) 0;
5792 jint _remaining;
5793 GLint *params = (GLint *) 0;
5794
5795 if (!params_ref) {
5796 _exception = 1;
5797 _exceptionType = "java/lang/IllegalArgumentException";
5798 _exceptionMessage = "params == null";
5799 goto exit;
5800 }
5801 if (offset < 0) {
5802 _exception = 1;
5803 _exceptionType = "java/lang/IllegalArgumentException";
5804 _exceptionMessage = "offset < 0";
5805 goto exit;
5806 }
5807 _remaining = _env->GetArrayLength(params_ref) - offset;
5808 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005809 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005810 params = params_base + offset;
5811
5812 glGetInternalformativ(
5813 (GLenum)target,
5814 (GLenum)internalformat,
5815 (GLenum)pname,
5816 (GLsizei)bufSize,
5817 (GLint *)params
5818 );
5819
5820exit:
5821 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005822 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005823 _exception ? JNI_ABORT: 0);
5824 }
5825 if (_exception) {
5826 jniThrowException(_env, _exceptionType, _exceptionMessage);
5827 }
5828}
5829
5830/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5831static void
5832android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
5833 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005834 jint _exception = 0;
5835 const char * _exceptionType = NULL;
5836 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005837 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005838 jint _bufferOffset = (jint) 0;
5839 jint _remaining;
5840 GLint *params = (GLint *) 0;
5841
Romain Guy84cac202016-12-05 12:26:02 -08005842 if (!params_buf) {
5843 _exception = 1;
5844 _exceptionType = "java/lang/IllegalArgumentException";
5845 _exceptionMessage = "params == null";
5846 goto exit;
5847 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005848 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005849 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005850 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005851 params = (GLint *) (_paramsBase + _bufferOffset);
5852 }
5853 glGetInternalformativ(
5854 (GLenum)target,
5855 (GLenum)internalformat,
5856 (GLenum)pname,
5857 (GLsizei)bufSize,
5858 (GLint *)params
5859 );
Romain Guy84cac202016-12-05 12:26:02 -08005860
5861exit:
Jesse Halld830e742013-03-29 11:02:35 -07005862 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005863 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5864 }
5865 if (_exception) {
5866 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Halld830e742013-03-29 11:02:35 -07005867 }
5868}
5869
Pablo Ceballos68981ff2016-02-22 11:50:31 -08005870/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
5871static void
5872android_glReadPixels__IIIIIII
5873 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
5874 glReadPixels(
5875 (GLint)x,
5876 (GLint)y,
5877 (GLsizei)width,
5878 (GLsizei)height,
5879 (GLenum)format,
5880 (GLenum)type,
5881 reinterpret_cast<GLvoid *>(offset)
5882 );
5883}
5884
Jesse Halld830e742013-03-29 11:02:35 -07005885static const char *classPathName = "android/opengl/GLES30";
5886
Daniel Micay76f6a862015-09-19 17:31:01 -04005887static const JNINativeMethod methods[] = {
Jesse Halld830e742013-03-29 11:02:35 -07005888{"_nativeClassInit", "()V", (void*)nativeClassInit },
5889{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
5890{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
5891{"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
5892{"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
5893{"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
5894{"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5895{"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
5896{"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
5897{"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
5898{"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
5899{"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5900{"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
5901{"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
5902{"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
5903{"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
5904{"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
5905{"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
5906{"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
5907{"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
5908{"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
5909{"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
5910{"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
5911{"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
5912{"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
5913{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
5914{"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
5915{"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
5916{"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
5917{"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
5918{"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
5919{"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
5920{"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
5921{"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
5922{"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
5923{"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
5924{"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
5925{"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
5926{"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
5927{"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
5928{"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
5929{"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
5930{"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
5931{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
5932{"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
5933{"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
5934{"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
5935{"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
5936{"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
5937{"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
5938{"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
5939{"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
5940{"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
5941{"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
5942{"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
5943{"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
5944{"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
5945{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
5946{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
5947{"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 -08005948{"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 -07005949{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
5950{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
5951{"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
5952{"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
5953{"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
5954{"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
5955{"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
5956{"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
5957{"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
5958{"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
5959{"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
5960{"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
5961{"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
5962{"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
5963{"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
5964{"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
5965{"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
5966{"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
5967{"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
5968{"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
5969{"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
5970{"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
5971{"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
5972{"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
5973{"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
5974{"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
5975{"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
5976{"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
5977{"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
5978{"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
5979{"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
5980{"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
5981{"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
5982{"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
5983{"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
5984{"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
5985{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
5986{"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
5987{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
Jesse Halld877efe2013-04-29 15:59:35 -07005988{"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
Jesse Halld830e742013-03-29 11:02:35 -07005989{"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
5990{"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
5991{"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
5992{"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
5993{"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
5994{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
5995{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
5996{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
5997{"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
5998{"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
5999{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
6000{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
6001{"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
6002{"glIsSync", "(J)Z", (void *) android_glIsSync__J },
6003{"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
6004{"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
6005{"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
6006{"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
6007{"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
6008{"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
6009{"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
6010{"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
6011{"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
6012{"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
6013{"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
6014{"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
6015{"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
6016{"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
6017{"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
6018{"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
6019{"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
6020{"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
6021{"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
6022{"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6023{"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
6024{"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
6025{"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6026{"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
6027{"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
6028{"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
6029{"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
6030{"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
6031{"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
6032{"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
6033{"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6034{"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
6035{"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
6036{"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
6037{"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
6038{"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
6039{"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
6040{"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
6041{"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
6042{"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
6043{"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
6044{"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
6045{"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
6046{"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
6047{"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
6048{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
6049{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
6050{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
Pablo Ceballos68981ff2016-02-22 11:50:31 -08006051{"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
Jesse Halld830e742013-03-29 11:02:35 -07006052};
6053
6054int register_android_opengl_jni_GLES30(JNIEnv *_env)
6055{
6056 int err;
6057 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
6058 return err;
6059}