blob: 2d69eaa516c3427828aefa623bbf71e9d7997ad3 [file] [log] [blame]
Jesse Halld830e742013-03-29 11:02:35 -07001/*
2**
3** Copyright 2013, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18// This source file is automatically generated
19
Andreas Gampebfe63332014-11-12 14:12:45 -080020#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22#pragma GCC diagnostic ignored "-Wunused-function"
23
Jesse Halld830e742013-03-29 11:02:35 -070024#include <GLES3/gl3.h>
25#include <GLES3/gl3ext.h>
26
Jesse Hall9626f822014-05-19 20:57:49 -070027#include <jni.h>
28#include <JNIHelp.h>
Jesse Halld830e742013-03-29 11:02:35 -070029#include <android_runtime/AndroidRuntime.h>
30#include <utils/misc.h>
31#include <assert.h>
32
33static int initialized = 0;
34
35static jclass nioAccessClass;
36static jclass bufferClass;
37static jmethodID getBasePointerID;
38static jmethodID getBaseArrayID;
39static jmethodID getBaseArrayOffsetID;
40static jfieldID positionID;
41static jfieldID limitID;
42static jfieldID elementSizeShiftID;
43
44
45/* special calls implemented in Android's GLES wrapper used to more
46 * efficiently bound-check passed arrays */
47extern "C" {
48#ifdef GL_VERSION_ES_CM_1_1
49GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
63#endif
64#ifdef GL_ES_VERSION_2_0
65static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
66 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
67 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
68}
69#endif
70#ifdef GL_ES_VERSION_3_0
71static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
72 GLsizei stride, const GLvoid *pointer, GLsizei count) {
73 glVertexAttribIPointer(indx, size, type, stride, pointer);
74}
75#endif
76}
77
78/* Cache method IDs each time the class is loaded. */
79
80static void
81nativeClassInit(JNIEnv *_env, jclass glImplClass)
82{
83 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
84 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
85
86 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
87 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
88
89 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
90 "getBasePointer", "(Ljava/nio/Buffer;)J");
91 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
93 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
94 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
95
96 positionID = _env->GetFieldID(bufferClass, "position", "I");
97 limitID = _env->GetFieldID(bufferClass, "limit", "I");
98 elementSizeShiftID =
99 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
100}
101
102static void *
103getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
104{
105 jint position;
106 jint limit;
107 jint elementSizeShift;
108 jlong pointer;
109
110 position = _env->GetIntField(buffer, positionID);
111 limit = _env->GetIntField(buffer, limitID);
112 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
113 *remaining = (limit - position) << elementSizeShift;
114 pointer = _env->CallStaticLongMethod(nioAccessClass,
115 getBasePointerID, buffer);
116 if (pointer != 0L) {
117 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000118 return reinterpret_cast<void*>(pointer);
Jesse Halld830e742013-03-29 11:02:35 -0700119 }
120
121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
122 getBaseArrayID, buffer);
123 *offset = _env->CallStaticIntMethod(nioAccessClass,
124 getBaseArrayOffsetID, buffer);
125
126 return NULL;
127}
128
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700129class ByteArrayGetter {
130public:
131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
132 return _env->GetByteArrayElements(array, is_copy);
133 }
134};
135class BooleanArrayGetter {
136public:
137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
138 return _env->GetBooleanArrayElements(array, is_copy);
139 }
140};
141class CharArrayGetter {
142public:
143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
144 return _env->GetCharArrayElements(array, is_copy);
145 }
146};
147class ShortArrayGetter {
148public:
149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
150 return _env->GetShortArrayElements(array, is_copy);
151 }
152};
153class IntArrayGetter {
154public:
155 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
156 return _env->GetIntArrayElements(array, is_copy);
157 }
158};
159class LongArrayGetter {
160public:
161 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
162 return _env->GetLongArrayElements(array, is_copy);
163 }
164};
165class FloatArrayGetter {
166public:
167 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
168 return _env->GetFloatArrayElements(array, is_copy);
169 }
170};
171class DoubleArrayGetter {
172public:
173 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
174 return _env->GetDoubleArrayElements(array, is_copy);
175 }
176};
177
178template<typename JTYPEARRAY, typename ARRAYGETTER>
179static void*
180getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
181 return ARRAYGETTER::Get(_env, array, is_copy);
182}
183
184class ByteArrayReleaser {
185public:
186 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
187 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
188 }
189};
190class BooleanArrayReleaser {
191public:
192 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
193 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
194 }
195};
196class CharArrayReleaser {
197public:
198 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
199 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
200 }
201};
202class ShortArrayReleaser {
203public:
204 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
205 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
206 }
207};
208class IntArrayReleaser {
209public:
210 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
211 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
212 }
213};
214class LongArrayReleaser {
215public:
216 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
217 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
218 }
219};
220class FloatArrayReleaser {
221public:
222 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
223 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
224 }
225};
226class DoubleArrayReleaser {
227public:
228 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
229 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
230 }
231};
232
233template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
234static void
235releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
236 ARRAYRELEASER::Release(_env, array, data, commit);
237}
238
Jesse Halld830e742013-03-29 11:02:35 -0700239static void
240releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
241{
242 _env->ReleasePrimitiveArrayCritical(array, data,
243 commit ? 0 : JNI_ABORT);
244}
245
246static void *
247getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
248 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
249 if (buf) {
250 jint position = _env->GetIntField(buffer, positionID);
251 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
252 buf += position << elementSizeShift;
253 } else {
254 jniThrowException(_env, "java/lang/IllegalArgumentException",
255 "Must use a native order direct Buffer");
256 }
257 return (void*) buf;
258}
259
260// --------------------------------------------------------------------------
261
262/*
263 * returns the number of values glGet returns for a given pname.
264 *
265 * The code below is written such that pnames requiring only one values
266 * are the default (and are not explicitely tested for). This makes the
267 * checking code much shorter/readable/efficient.
268 *
269 * This means that unknown pnames (e.g.: extensions) will default to 1. If
270 * that unknown pname needs more than 1 value, then the validation check
271 * is incomplete and the app may crash if it passed the wrong number params.
272 */
273static int getNeededCount(GLint pname) {
274 int needed = 1;
275#ifdef GL_ES_VERSION_2_0
276 // GLES 2.x pnames
277 switch (pname) {
278 case GL_ALIASED_LINE_WIDTH_RANGE:
279 case GL_ALIASED_POINT_SIZE_RANGE:
280 needed = 2;
281 break;
282
283 case GL_BLEND_COLOR:
284 case GL_COLOR_CLEAR_VALUE:
285 case GL_COLOR_WRITEMASK:
286 case GL_SCISSOR_BOX:
287 case GL_VIEWPORT:
288 needed = 4;
289 break;
290
291 case GL_COMPRESSED_TEXTURE_FORMATS:
292 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
293 break;
294
295 case GL_SHADER_BINARY_FORMATS:
296 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
297 break;
298 }
299#endif
300
301#ifdef GL_VERSION_ES_CM_1_1
302 // GLES 1.x pnames
303 switch (pname) {
304 case GL_ALIASED_LINE_WIDTH_RANGE:
305 case GL_ALIASED_POINT_SIZE_RANGE:
306 case GL_DEPTH_RANGE:
307 case GL_SMOOTH_LINE_WIDTH_RANGE:
308 case GL_SMOOTH_POINT_SIZE_RANGE:
309 needed = 2;
310 break;
311
312 case GL_CURRENT_NORMAL:
313 case GL_POINT_DISTANCE_ATTENUATION:
314 needed = 3;
315 break;
316
317 case GL_COLOR_CLEAR_VALUE:
318 case GL_COLOR_WRITEMASK:
319 case GL_CURRENT_COLOR:
320 case GL_CURRENT_TEXTURE_COORDS:
321 case GL_FOG_COLOR:
322 case GL_LIGHT_MODEL_AMBIENT:
323 case GL_SCISSOR_BOX:
324 case GL_VIEWPORT:
325 needed = 4;
326 break;
327
328 case GL_MODELVIEW_MATRIX:
329 case GL_PROJECTION_MATRIX:
330 case GL_TEXTURE_MATRIX:
331 needed = 16;
332 break;
333
334 case GL_COMPRESSED_TEXTURE_FORMATS:
335 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
336 break;
337 }
338#endif
339 return needed;
340}
341
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700342template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
343 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700344static void
345get
346 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
347 jint _exception = 0;
348 const char * _exceptionType;
349 const char * _exceptionMessage;
350 CTYPE *params_base = (CTYPE *) 0;
351 jint _remaining;
352 CTYPE *params = (CTYPE *) 0;
353 int _needed = 0;
354
355 if (!params_ref) {
356 _exception = 1;
357 _exceptionType = "java/lang/IllegalArgumentException";
358 _exceptionMessage = "params == null";
359 goto exit;
360 }
361 if (offset < 0) {
362 _exception = 1;
363 _exceptionType = "java/lang/IllegalArgumentException";
364 _exceptionMessage = "offset < 0";
365 goto exit;
366 }
367 _remaining = _env->GetArrayLength(params_ref) - offset;
368 _needed = getNeededCount(pname);
369 // if we didn't find this pname, we just assume the user passed
370 // an array of the right size -- this might happen with extensions
371 // or if we forget an enum here.
372 if (_remaining < _needed) {
373 _exception = 1;
374 _exceptionType = "java/lang/IllegalArgumentException";
375 _exceptionMessage = "length - offset < needed";
376 goto exit;
377 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700378 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
379 _env, params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700380 params = params_base + offset;
381
382 GET(
383 (GLenum)pname,
384 (CTYPE *)params
385 );
386
387exit:
388 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700389 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
390 _env, params_ref, params_base, !_exception);
Jesse Halld830e742013-03-29 11:02:35 -0700391 }
392 if (_exception) {
393 jniThrowException(_env, _exceptionType, _exceptionMessage);
394 }
395}
396
397
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700398template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
399 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Jesse Halld830e742013-03-29 11:02:35 -0700400static void
401getarray
402 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
403 jint _exception = 0;
404 const char * _exceptionType;
405 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700406 JTYPEARRAY _array = (JTYPEARRAY) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700407 jint _bufferOffset = (jint) 0;
408 jint _remaining;
409 CTYPE *params = (CTYPE *) 0;
410 int _needed = 0;
411
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700412 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700413 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Jesse Halld830e742013-03-29 11:02:35 -0700414 _needed = getNeededCount(pname);
415 // if we didn't find this pname, we just assume the user passed
416 // an array of the right size -- this might happen with extensions
417 // or if we forget an enum here.
418 if (_needed>0 && _remaining < _needed) {
419 _exception = 1;
420 _exceptionType = "java/lang/IllegalArgumentException";
421 _exceptionMessage = "remaining() < needed";
422 goto exit;
423 }
424 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700425 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
426 _env, _array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700427 params = (CTYPE *) (_paramsBase + _bufferOffset);
428 }
429 GET(
430 (GLenum)pname,
431 (CTYPE *)params
432 );
433
434exit:
435 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700436 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
437 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -0700438 }
439 if (_exception) {
440 jniThrowException(_env, _exceptionType, _exceptionMessage);
441 }
442}
443
444// --------------------------------------------------------------------------
445/* void glReadBuffer ( GLenum mode ) */
446static void
447android_glReadBuffer__I
448 (JNIEnv *_env, jobject _this, jint mode) {
449 glReadBuffer(
450 (GLenum)mode
451 );
452}
453
454/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
455static void
456android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
457 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
458 jarray _array = (jarray) 0;
459 jint _bufferOffset = (jint) 0;
460 jint _remaining;
461 GLvoid *indices = (GLvoid *) 0;
462
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700463 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700464 if (indices == NULL) {
465 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
466 indices = (GLvoid *) (_indicesBase + _bufferOffset);
467 }
468 glDrawRangeElements(
469 (GLenum)mode,
470 (GLuint)start,
471 (GLuint)end,
472 (GLsizei)count,
473 (GLenum)type,
474 (GLvoid *)indices
475 );
476 if (_array) {
477 releasePointer(_env, _array, indices, JNI_FALSE);
478 }
479}
480
481/* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
482static void
483android_glDrawRangeElements__IIIIII
484 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
485 glDrawRangeElements(
486 (GLenum)mode,
487 (GLuint)start,
488 (GLuint)end,
489 (GLsizei)count,
490 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000491 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700492 );
493}
494
495/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
496static void
497android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
498 (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) {
499 jarray _array = (jarray) 0;
500 jint _bufferOffset = (jint) 0;
501 jint _remaining;
502 GLvoid *pixels = (GLvoid *) 0;
503
Pablo Ceballos6aff9062015-10-01 18:35:39 -0700504 if (pixels_buf) {
505 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
506 }
507 if (pixels_buf && pixels == NULL) {
Jesse Halld830e742013-03-29 11:02:35 -0700508 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
509 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
510 }
511 glTexImage3D(
512 (GLenum)target,
513 (GLint)level,
514 (GLint)internalformat,
515 (GLsizei)width,
516 (GLsizei)height,
517 (GLsizei)depth,
518 (GLint)border,
519 (GLenum)format,
520 (GLenum)type,
521 (GLvoid *)pixels
522 );
523 if (_array) {
524 releasePointer(_env, _array, pixels, JNI_FALSE);
525 }
526}
527
528/* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
529static void
530android_glTexImage3D__IIIIIIIIII
531 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
532 glTexImage3D(
533 (GLenum)target,
534 (GLint)level,
535 (GLint)internalformat,
536 (GLsizei)width,
537 (GLsizei)height,
538 (GLsizei)depth,
539 (GLint)border,
540 (GLenum)format,
541 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000542 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700543 );
544}
545
546/* 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 ) */
547static void
548android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
549 (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) {
550 jarray _array = (jarray) 0;
551 jint _bufferOffset = (jint) 0;
552 jint _remaining;
553 GLvoid *pixels = (GLvoid *) 0;
554
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700555 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700556 if (pixels == NULL) {
557 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
558 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
559 }
560 glTexSubImage3D(
561 (GLenum)target,
562 (GLint)level,
563 (GLint)xoffset,
564 (GLint)yoffset,
565 (GLint)zoffset,
566 (GLsizei)width,
567 (GLsizei)height,
568 (GLsizei)depth,
569 (GLenum)format,
570 (GLenum)type,
571 (GLvoid *)pixels
572 );
573 if (_array) {
574 releasePointer(_env, _array, pixels, JNI_FALSE);
575 }
576}
577
578/* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
579static void
580android_glTexSubImage3D__IIIIIIIIIII
581 (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) {
582 glTexSubImage3D(
583 (GLenum)target,
584 (GLint)level,
585 (GLint)xoffset,
586 (GLint)yoffset,
587 (GLint)zoffset,
588 (GLsizei)width,
589 (GLsizei)height,
590 (GLsizei)depth,
591 (GLenum)format,
592 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000593 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700594 );
595}
596
597/* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
598static void
599android_glCopyTexSubImage3D__IIIIIIIII
600 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
601 glCopyTexSubImage3D(
602 (GLenum)target,
603 (GLint)level,
604 (GLint)xoffset,
605 (GLint)yoffset,
606 (GLint)zoffset,
607 (GLint)x,
608 (GLint)y,
609 (GLsizei)width,
610 (GLsizei)height
611 );
612}
613
614/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
615static void
616android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
617 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jobject data_buf) {
618 jarray _array = (jarray) 0;
619 jint _bufferOffset = (jint) 0;
620 jint _remaining;
621 GLvoid *data = (GLvoid *) 0;
622
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700623 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700624 if (data == NULL) {
625 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
626 data = (GLvoid *) (_dataBase + _bufferOffset);
627 }
628 glCompressedTexImage3D(
629 (GLenum)target,
630 (GLint)level,
631 (GLenum)internalformat,
632 (GLsizei)width,
633 (GLsizei)height,
634 (GLsizei)depth,
635 (GLint)border,
636 (GLsizei)imageSize,
637 (GLvoid *)data
638 );
639 if (_array) {
640 releasePointer(_env, _array, data, JNI_FALSE);
641 }
642}
643
644/* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
645static void
646android_glCompressedTexImage3D__IIIIIIIII
647 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
648 glCompressedTexImage3D(
649 (GLenum)target,
650 (GLint)level,
651 (GLenum)internalformat,
652 (GLsizei)width,
653 (GLsizei)height,
654 (GLsizei)depth,
655 (GLint)border,
656 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000657 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700658 );
659}
660
661/* 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 ) */
662static void
663android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
664 (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) {
665 jarray _array = (jarray) 0;
666 jint _bufferOffset = (jint) 0;
667 jint _remaining;
668 GLvoid *data = (GLvoid *) 0;
669
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700670 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700671 if (data == NULL) {
672 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
673 data = (GLvoid *) (_dataBase + _bufferOffset);
674 }
675 glCompressedTexSubImage3D(
676 (GLenum)target,
677 (GLint)level,
678 (GLint)xoffset,
679 (GLint)yoffset,
680 (GLint)zoffset,
681 (GLsizei)width,
682 (GLsizei)height,
683 (GLsizei)depth,
684 (GLenum)format,
685 (GLsizei)imageSize,
686 (GLvoid *)data
687 );
688 if (_array) {
689 releasePointer(_env, _array, data, JNI_FALSE);
690 }
691}
692
693/* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
694static void
695android_glCompressedTexSubImage3D__IIIIIIIIIII
696 (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) {
697 glCompressedTexSubImage3D(
698 (GLenum)target,
699 (GLint)level,
700 (GLint)xoffset,
701 (GLint)yoffset,
702 (GLint)zoffset,
703 (GLsizei)width,
704 (GLsizei)height,
705 (GLsizei)depth,
706 (GLenum)format,
707 (GLsizei)imageSize,
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000708 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -0700709 );
710}
711
712/* void glGenQueries ( GLsizei n, GLuint *ids ) */
713static void
714android_glGenQueries__I_3II
715 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
716 jint _exception = 0;
717 const char * _exceptionType = NULL;
718 const char * _exceptionMessage = NULL;
719 GLuint *ids_base = (GLuint *) 0;
720 jint _remaining;
721 GLuint *ids = (GLuint *) 0;
722
723 if (!ids_ref) {
724 _exception = 1;
725 _exceptionType = "java/lang/IllegalArgumentException";
726 _exceptionMessage = "ids == null";
727 goto exit;
728 }
729 if (offset < 0) {
730 _exception = 1;
731 _exceptionType = "java/lang/IllegalArgumentException";
732 _exceptionMessage = "offset < 0";
733 goto exit;
734 }
735 _remaining = _env->GetArrayLength(ids_ref) - offset;
736 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700737 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700738 ids = ids_base + offset;
739
740 glGenQueries(
741 (GLsizei)n,
742 (GLuint *)ids
743 );
744
745exit:
746 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700747 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700748 _exception ? JNI_ABORT: 0);
749 }
750 if (_exception) {
751 jniThrowException(_env, _exceptionType, _exceptionMessage);
752 }
753}
754
755/* void glGenQueries ( GLsizei n, GLuint *ids ) */
756static void
757android_glGenQueries__ILjava_nio_IntBuffer_2
758 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700759 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700760 jint _bufferOffset = (jint) 0;
761 jint _remaining;
762 GLuint *ids = (GLuint *) 0;
763
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700764 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700765 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700766 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700767 ids = (GLuint *) (_idsBase + _bufferOffset);
768 }
769 glGenQueries(
770 (GLsizei)n,
771 (GLuint *)ids
772 );
773 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700774 _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
Jesse Halld830e742013-03-29 11:02:35 -0700775 }
776}
777
778/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
779static void
780android_glDeleteQueries__I_3II
781 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
782 jint _exception = 0;
783 const char * _exceptionType = NULL;
784 const char * _exceptionMessage = NULL;
785 GLuint *ids_base = (GLuint *) 0;
786 jint _remaining;
787 GLuint *ids = (GLuint *) 0;
788
789 if (!ids_ref) {
790 _exception = 1;
791 _exceptionType = "java/lang/IllegalArgumentException";
792 _exceptionMessage = "ids == null";
793 goto exit;
794 }
795 if (offset < 0) {
796 _exception = 1;
797 _exceptionType = "java/lang/IllegalArgumentException";
798 _exceptionMessage = "offset < 0";
799 goto exit;
800 }
801 _remaining = _env->GetArrayLength(ids_ref) - offset;
802 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700803 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700804 ids = ids_base + offset;
805
806 glDeleteQueries(
807 (GLsizei)n,
808 (GLuint *)ids
809 );
810
811exit:
812 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700813 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -0700814 JNI_ABORT);
815 }
816 if (_exception) {
817 jniThrowException(_env, _exceptionType, _exceptionMessage);
818 }
819}
820
821/* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
822static void
823android_glDeleteQueries__ILjava_nio_IntBuffer_2
824 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700825 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700826 jint _bufferOffset = (jint) 0;
827 jint _remaining;
828 GLuint *ids = (GLuint *) 0;
829
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700830 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700831 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700832 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700833 ids = (GLuint *) (_idsBase + _bufferOffset);
834 }
835 glDeleteQueries(
836 (GLsizei)n,
837 (GLuint *)ids
838 );
839 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700840 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -0700841 }
842}
843
844/* GLboolean glIsQuery ( GLuint id ) */
845static jboolean
846android_glIsQuery__I
847 (JNIEnv *_env, jobject _this, jint id) {
848 GLboolean _returnValue;
849 _returnValue = glIsQuery(
850 (GLuint)id
851 );
852 return (jboolean)_returnValue;
853}
854
855/* void glBeginQuery ( GLenum target, GLuint id ) */
856static void
857android_glBeginQuery__II
858 (JNIEnv *_env, jobject _this, jint target, jint id) {
859 glBeginQuery(
860 (GLenum)target,
861 (GLuint)id
862 );
863}
864
865/* void glEndQuery ( GLenum target ) */
866static void
867android_glEndQuery__I
868 (JNIEnv *_env, jobject _this, jint target) {
869 glEndQuery(
870 (GLenum)target
871 );
872}
873
874/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
875static void
876android_glGetQueryiv__II_3II
877 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
878 jint _exception = 0;
879 const char * _exceptionType = NULL;
880 const char * _exceptionMessage = NULL;
881 GLint *params_base = (GLint *) 0;
882 jint _remaining;
883 GLint *params = (GLint *) 0;
884
885 if (!params_ref) {
886 _exception = 1;
887 _exceptionType = "java/lang/IllegalArgumentException";
888 _exceptionMessage = "params == null";
889 goto exit;
890 }
891 if (offset < 0) {
892 _exception = 1;
893 _exceptionType = "java/lang/IllegalArgumentException";
894 _exceptionMessage = "offset < 0";
895 goto exit;
896 }
897 _remaining = _env->GetArrayLength(params_ref) - offset;
898 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700899 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -0700900 params = params_base + offset;
901
902 glGetQueryiv(
903 (GLenum)target,
904 (GLenum)pname,
905 (GLint *)params
906 );
907
908exit:
909 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700910 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -0700911 _exception ? JNI_ABORT: 0);
912 }
913 if (_exception) {
914 jniThrowException(_env, _exceptionType, _exceptionMessage);
915 }
916}
917
918/* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
919static void
920android_glGetQueryiv__IILjava_nio_IntBuffer_2
921 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700922 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700923 jint _bufferOffset = (jint) 0;
924 jint _remaining;
925 GLint *params = (GLint *) 0;
926
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700927 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700928 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700929 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700930 params = (GLint *) (_paramsBase + _bufferOffset);
931 }
932 glGetQueryiv(
933 (GLenum)target,
934 (GLenum)pname,
935 (GLint *)params
936 );
937 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700938 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -0700939 }
940}
941
942/* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
943static void
944android_glGetQueryObjectuiv__II_3II
945 (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
946 jint _exception = 0;
947 const char * _exceptionType = NULL;
948 const char * _exceptionMessage = NULL;
949 GLuint *params_base = (GLuint *) 0;
950 jint _remaining;
951 GLuint *params = (GLuint *) 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 = (GLuint *)
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 glGetQueryObjectuiv(
971 (GLuint)id,
972 (GLenum)pname,
973 (GLuint *)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 glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
987static void
988android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
989 (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700990 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -0700991 jint _bufferOffset = (jint) 0;
992 jint _remaining;
993 GLuint *params = (GLuint *) 0;
994
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700995 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -0700996 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700997 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -0700998 params = (GLuint *) (_paramsBase + _bufferOffset);
999 }
1000 glGetQueryObjectuiv(
1001 (GLuint)id,
1002 (GLenum)pname,
1003 (GLuint *)params
1004 );
1005 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001006 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07001007 }
1008}
1009
1010/* GLboolean glUnmapBuffer ( GLenum target ) */
1011static jboolean
1012android_glUnmapBuffer__I
1013 (JNIEnv *_env, jobject _this, jint target) {
1014 GLboolean _returnValue;
1015 _returnValue = glUnmapBuffer(
1016 (GLenum)target
1017 );
1018 return (jboolean)_returnValue;
1019}
1020
1021/* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
1022static jobject
1023android_glGetBufferPointerv__II
1024 (JNIEnv *_env, jobject _this, jint target, jint pname) {
1025 GLint64 _mapLength;
1026 GLvoid* _p;
1027 glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
1028 glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
1029 return _env->NewDirectByteBuffer(_p, _mapLength);
1030}
1031
1032/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1033static void
1034android_glDrawBuffers__I_3II
1035 (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
1036 jint _exception = 0;
1037 const char * _exceptionType = NULL;
1038 const char * _exceptionMessage = NULL;
1039 GLenum *bufs_base = (GLenum *) 0;
1040 jint _remaining;
1041 GLenum *bufs = (GLenum *) 0;
1042
1043 if (!bufs_ref) {
1044 _exception = 1;
1045 _exceptionType = "java/lang/IllegalArgumentException";
1046 _exceptionMessage = "bufs == null";
1047 goto exit;
1048 }
1049 if (offset < 0) {
1050 _exception = 1;
1051 _exceptionType = "java/lang/IllegalArgumentException";
1052 _exceptionMessage = "offset < 0";
1053 goto exit;
1054 }
1055 _remaining = _env->GetArrayLength(bufs_ref) - offset;
1056 bufs_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001057 _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001058 bufs = bufs_base + offset;
1059
1060 glDrawBuffers(
1061 (GLsizei)n,
1062 (GLenum *)bufs
1063 );
1064
1065exit:
1066 if (bufs_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001067 _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
Jesse Halld830e742013-03-29 11:02:35 -07001068 JNI_ABORT);
1069 }
1070 if (_exception) {
1071 jniThrowException(_env, _exceptionType, _exceptionMessage);
1072 }
1073}
1074
1075/* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
1076static void
1077android_glDrawBuffers__ILjava_nio_IntBuffer_2
1078 (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001079 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001080 jint _bufferOffset = (jint) 0;
1081 jint _remaining;
1082 GLenum *bufs = (GLenum *) 0;
1083
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001084 bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001085 if (bufs == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001086 char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001087 bufs = (GLenum *) (_bufsBase + _bufferOffset);
1088 }
1089 glDrawBuffers(
1090 (GLsizei)n,
1091 (GLenum *)bufs
1092 );
1093 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001094 _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001095 }
1096}
1097
1098/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1099static void
1100android_glUniformMatrix2x3fv__IIZ_3FI
1101 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1102 jint _exception = 0;
1103 const char * _exceptionType = NULL;
1104 const char * _exceptionMessage = NULL;
1105 GLfloat *value_base = (GLfloat *) 0;
1106 jint _remaining;
1107 GLfloat *value = (GLfloat *) 0;
1108
1109 if (!value_ref) {
1110 _exception = 1;
1111 _exceptionType = "java/lang/IllegalArgumentException";
1112 _exceptionMessage = "value == null";
1113 goto exit;
1114 }
1115 if (offset < 0) {
1116 _exception = 1;
1117 _exceptionType = "java/lang/IllegalArgumentException";
1118 _exceptionMessage = "offset < 0";
1119 goto exit;
1120 }
1121 _remaining = _env->GetArrayLength(value_ref) - offset;
1122 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001123 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001124 value = value_base + offset;
1125
1126 glUniformMatrix2x3fv(
1127 (GLint)location,
1128 (GLsizei)count,
1129 (GLboolean)transpose,
1130 (GLfloat *)value
1131 );
1132
1133exit:
1134 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001135 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001136 JNI_ABORT);
1137 }
1138 if (_exception) {
1139 jniThrowException(_env, _exceptionType, _exceptionMessage);
1140 }
1141}
1142
1143/* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1144static void
1145android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
1146 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001147 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001148 jint _bufferOffset = (jint) 0;
1149 jint _remaining;
1150 GLfloat *value = (GLfloat *) 0;
1151
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001152 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001153 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001154 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001155 value = (GLfloat *) (_valueBase + _bufferOffset);
1156 }
1157 glUniformMatrix2x3fv(
1158 (GLint)location,
1159 (GLsizei)count,
1160 (GLboolean)transpose,
1161 (GLfloat *)value
1162 );
1163 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001164 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001165 }
1166}
1167
1168/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1169static void
1170android_glUniformMatrix3x2fv__IIZ_3FI
1171 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1172 jint _exception = 0;
1173 const char * _exceptionType = NULL;
1174 const char * _exceptionMessage = NULL;
1175 GLfloat *value_base = (GLfloat *) 0;
1176 jint _remaining;
1177 GLfloat *value = (GLfloat *) 0;
1178
1179 if (!value_ref) {
1180 _exception = 1;
1181 _exceptionType = "java/lang/IllegalArgumentException";
1182 _exceptionMessage = "value == null";
1183 goto exit;
1184 }
1185 if (offset < 0) {
1186 _exception = 1;
1187 _exceptionType = "java/lang/IllegalArgumentException";
1188 _exceptionMessage = "offset < 0";
1189 goto exit;
1190 }
1191 _remaining = _env->GetArrayLength(value_ref) - offset;
1192 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001193 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001194 value = value_base + offset;
1195
1196 glUniformMatrix3x2fv(
1197 (GLint)location,
1198 (GLsizei)count,
1199 (GLboolean)transpose,
1200 (GLfloat *)value
1201 );
1202
1203exit:
1204 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001205 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001206 JNI_ABORT);
1207 }
1208 if (_exception) {
1209 jniThrowException(_env, _exceptionType, _exceptionMessage);
1210 }
1211}
1212
1213/* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1214static void
1215android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
1216 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001217 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001218 jint _bufferOffset = (jint) 0;
1219 jint _remaining;
1220 GLfloat *value = (GLfloat *) 0;
1221
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001222 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001223 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001224 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001225 value = (GLfloat *) (_valueBase + _bufferOffset);
1226 }
1227 glUniformMatrix3x2fv(
1228 (GLint)location,
1229 (GLsizei)count,
1230 (GLboolean)transpose,
1231 (GLfloat *)value
1232 );
1233 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001234 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001235 }
1236}
1237
1238/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1239static void
1240android_glUniformMatrix2x4fv__IIZ_3FI
1241 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1242 jint _exception = 0;
1243 const char * _exceptionType = NULL;
1244 const char * _exceptionMessage = NULL;
1245 GLfloat *value_base = (GLfloat *) 0;
1246 jint _remaining;
1247 GLfloat *value = (GLfloat *) 0;
1248
1249 if (!value_ref) {
1250 _exception = 1;
1251 _exceptionType = "java/lang/IllegalArgumentException";
1252 _exceptionMessage = "value == null";
1253 goto exit;
1254 }
1255 if (offset < 0) {
1256 _exception = 1;
1257 _exceptionType = "java/lang/IllegalArgumentException";
1258 _exceptionMessage = "offset < 0";
1259 goto exit;
1260 }
1261 _remaining = _env->GetArrayLength(value_ref) - offset;
1262 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001263 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001264 value = value_base + offset;
1265
1266 glUniformMatrix2x4fv(
1267 (GLint)location,
1268 (GLsizei)count,
1269 (GLboolean)transpose,
1270 (GLfloat *)value
1271 );
1272
1273exit:
1274 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001275 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001276 JNI_ABORT);
1277 }
1278 if (_exception) {
1279 jniThrowException(_env, _exceptionType, _exceptionMessage);
1280 }
1281}
1282
1283/* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1284static void
1285android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
1286 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001287 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001288 jint _bufferOffset = (jint) 0;
1289 jint _remaining;
1290 GLfloat *value = (GLfloat *) 0;
1291
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001292 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001293 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001294 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001295 value = (GLfloat *) (_valueBase + _bufferOffset);
1296 }
1297 glUniformMatrix2x4fv(
1298 (GLint)location,
1299 (GLsizei)count,
1300 (GLboolean)transpose,
1301 (GLfloat *)value
1302 );
1303 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001304 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001305 }
1306}
1307
1308/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1309static void
1310android_glUniformMatrix4x2fv__IIZ_3FI
1311 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1312 jint _exception = 0;
1313 const char * _exceptionType = NULL;
1314 const char * _exceptionMessage = NULL;
1315 GLfloat *value_base = (GLfloat *) 0;
1316 jint _remaining;
1317 GLfloat *value = (GLfloat *) 0;
1318
1319 if (!value_ref) {
1320 _exception = 1;
1321 _exceptionType = "java/lang/IllegalArgumentException";
1322 _exceptionMessage = "value == null";
1323 goto exit;
1324 }
1325 if (offset < 0) {
1326 _exception = 1;
1327 _exceptionType = "java/lang/IllegalArgumentException";
1328 _exceptionMessage = "offset < 0";
1329 goto exit;
1330 }
1331 _remaining = _env->GetArrayLength(value_ref) - offset;
1332 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001333 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001334 value = value_base + offset;
1335
1336 glUniformMatrix4x2fv(
1337 (GLint)location,
1338 (GLsizei)count,
1339 (GLboolean)transpose,
1340 (GLfloat *)value
1341 );
1342
1343exit:
1344 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001345 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001346 JNI_ABORT);
1347 }
1348 if (_exception) {
1349 jniThrowException(_env, _exceptionType, _exceptionMessage);
1350 }
1351}
1352
1353/* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1354static void
1355android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
1356 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001357 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001358 jint _bufferOffset = (jint) 0;
1359 jint _remaining;
1360 GLfloat *value = (GLfloat *) 0;
1361
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001362 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001363 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001364 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001365 value = (GLfloat *) (_valueBase + _bufferOffset);
1366 }
1367 glUniformMatrix4x2fv(
1368 (GLint)location,
1369 (GLsizei)count,
1370 (GLboolean)transpose,
1371 (GLfloat *)value
1372 );
1373 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001374 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001375 }
1376}
1377
1378/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1379static void
1380android_glUniformMatrix3x4fv__IIZ_3FI
1381 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1382 jint _exception = 0;
1383 const char * _exceptionType = NULL;
1384 const char * _exceptionMessage = NULL;
1385 GLfloat *value_base = (GLfloat *) 0;
1386 jint _remaining;
1387 GLfloat *value = (GLfloat *) 0;
1388
1389 if (!value_ref) {
1390 _exception = 1;
1391 _exceptionType = "java/lang/IllegalArgumentException";
1392 _exceptionMessage = "value == null";
1393 goto exit;
1394 }
1395 if (offset < 0) {
1396 _exception = 1;
1397 _exceptionType = "java/lang/IllegalArgumentException";
1398 _exceptionMessage = "offset < 0";
1399 goto exit;
1400 }
1401 _remaining = _env->GetArrayLength(value_ref) - offset;
1402 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001403 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001404 value = value_base + offset;
1405
1406 glUniformMatrix3x4fv(
1407 (GLint)location,
1408 (GLsizei)count,
1409 (GLboolean)transpose,
1410 (GLfloat *)value
1411 );
1412
1413exit:
1414 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001415 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001416 JNI_ABORT);
1417 }
1418 if (_exception) {
1419 jniThrowException(_env, _exceptionType, _exceptionMessage);
1420 }
1421}
1422
1423/* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1424static void
1425android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
1426 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001427 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001428 jint _bufferOffset = (jint) 0;
1429 jint _remaining;
1430 GLfloat *value = (GLfloat *) 0;
1431
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001432 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001433 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001434 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001435 value = (GLfloat *) (_valueBase + _bufferOffset);
1436 }
1437 glUniformMatrix3x4fv(
1438 (GLint)location,
1439 (GLsizei)count,
1440 (GLboolean)transpose,
1441 (GLfloat *)value
1442 );
1443 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001444 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001445 }
1446}
1447
1448/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1449static void
1450android_glUniformMatrix4x3fv__IIZ_3FI
1451 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
1452 jint _exception = 0;
1453 const char * _exceptionType = NULL;
1454 const char * _exceptionMessage = NULL;
1455 GLfloat *value_base = (GLfloat *) 0;
1456 jint _remaining;
1457 GLfloat *value = (GLfloat *) 0;
1458
1459 if (!value_ref) {
1460 _exception = 1;
1461 _exceptionType = "java/lang/IllegalArgumentException";
1462 _exceptionMessage = "value == null";
1463 goto exit;
1464 }
1465 if (offset < 0) {
1466 _exception = 1;
1467 _exceptionType = "java/lang/IllegalArgumentException";
1468 _exceptionMessage = "offset < 0";
1469 goto exit;
1470 }
1471 _remaining = _env->GetArrayLength(value_ref) - offset;
1472 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001473 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001474 value = value_base + offset;
1475
1476 glUniformMatrix4x3fv(
1477 (GLint)location,
1478 (GLsizei)count,
1479 (GLboolean)transpose,
1480 (GLfloat *)value
1481 );
1482
1483exit:
1484 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001485 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07001486 JNI_ABORT);
1487 }
1488 if (_exception) {
1489 jniThrowException(_env, _exceptionType, _exceptionMessage);
1490 }
1491}
1492
1493/* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
1494static void
1495android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
1496 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001497 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001498 jint _bufferOffset = (jint) 0;
1499 jint _remaining;
1500 GLfloat *value = (GLfloat *) 0;
1501
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001502 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001503 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001504 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001505 value = (GLfloat *) (_valueBase + _bufferOffset);
1506 }
1507 glUniformMatrix4x3fv(
1508 (GLint)location,
1509 (GLsizei)count,
1510 (GLboolean)transpose,
1511 (GLfloat *)value
1512 );
1513 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001514 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001515 }
1516}
1517
1518/* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
1519static void
1520android_glBlitFramebuffer__IIIIIIIIII
1521 (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
1522 glBlitFramebuffer(
1523 (GLint)srcX0,
1524 (GLint)srcY0,
1525 (GLint)srcX1,
1526 (GLint)srcY1,
1527 (GLint)dstX0,
1528 (GLint)dstY0,
1529 (GLint)dstX1,
1530 (GLint)dstY1,
1531 (GLbitfield)mask,
1532 (GLenum)filter
1533 );
1534}
1535
1536/* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
1537static void
1538android_glRenderbufferStorageMultisample__IIIII
1539 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
1540 glRenderbufferStorageMultisample(
1541 (GLenum)target,
1542 (GLsizei)samples,
1543 (GLenum)internalformat,
1544 (GLsizei)width,
1545 (GLsizei)height
1546 );
1547}
1548
1549/* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
1550static void
1551android_glFramebufferTextureLayer__IIIII
1552 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
1553 glFramebufferTextureLayer(
1554 (GLenum)target,
1555 (GLenum)attachment,
1556 (GLuint)texture,
1557 (GLint)level,
1558 (GLint)layer
1559 );
1560}
1561
1562/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
1563static jobject
1564android_glMapBufferRange__IIII
1565 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
1566 GLvoid* _p = glMapBufferRange((GLenum)target,
1567 (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
1568 jobject _buf = (jobject)0;
1569 if (_p) {
1570 _buf = _env->NewDirectByteBuffer(_p, length);
1571 }
1572 return _buf;
1573}
1574
1575/* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
1576static void
1577android_glFlushMappedBufferRange__III
1578 (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
1579 glFlushMappedBufferRange(
1580 (GLenum)target,
1581 (GLintptr)offset,
1582 (GLsizeiptr)length
1583 );
1584}
1585
1586/* void glBindVertexArray ( GLuint array ) */
1587static void
1588android_glBindVertexArray__I
1589 (JNIEnv *_env, jobject _this, jint array) {
1590 glBindVertexArray(
1591 (GLuint)array
1592 );
1593}
1594
1595/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1596static void
1597android_glDeleteVertexArrays__I_3II
1598 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1599 jint _exception = 0;
1600 const char * _exceptionType = NULL;
1601 const char * _exceptionMessage = NULL;
1602 GLuint *arrays_base = (GLuint *) 0;
1603 jint _remaining;
1604 GLuint *arrays = (GLuint *) 0;
1605
1606 if (!arrays_ref) {
1607 _exception = 1;
1608 _exceptionType = "java/lang/IllegalArgumentException";
1609 _exceptionMessage = "arrays == null";
1610 goto exit;
1611 }
1612 if (offset < 0) {
1613 _exception = 1;
1614 _exceptionType = "java/lang/IllegalArgumentException";
1615 _exceptionMessage = "offset < 0";
1616 goto exit;
1617 }
1618 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1619 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001620 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001621 arrays = arrays_base + offset;
1622
1623 glDeleteVertexArrays(
1624 (GLsizei)n,
1625 (GLuint *)arrays
1626 );
1627
1628exit:
1629 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001630 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001631 JNI_ABORT);
1632 }
1633 if (_exception) {
1634 jniThrowException(_env, _exceptionType, _exceptionMessage);
1635 }
1636}
1637
1638/* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
1639static void
1640android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
1641 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001642 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001643 jint _bufferOffset = (jint) 0;
1644 jint _remaining;
1645 GLuint *arrays = (GLuint *) 0;
1646
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001647 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001648 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001649 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001650 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1651 }
1652 glDeleteVertexArrays(
1653 (GLsizei)n,
1654 (GLuint *)arrays
1655 );
1656 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001657 _env->ReleaseIntArrayElements(_array, (jint*)arrays, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07001658 }
1659}
1660
1661/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1662static void
1663android_glGenVertexArrays__I_3II
1664 (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
1665 jint _exception = 0;
1666 const char * _exceptionType = NULL;
1667 const char * _exceptionMessage = NULL;
1668 GLuint *arrays_base = (GLuint *) 0;
1669 jint _remaining;
1670 GLuint *arrays = (GLuint *) 0;
1671
1672 if (!arrays_ref) {
1673 _exception = 1;
1674 _exceptionType = "java/lang/IllegalArgumentException";
1675 _exceptionMessage = "arrays == null";
1676 goto exit;
1677 }
1678 if (offset < 0) {
1679 _exception = 1;
1680 _exceptionType = "java/lang/IllegalArgumentException";
1681 _exceptionMessage = "offset < 0";
1682 goto exit;
1683 }
1684 _remaining = _env->GetArrayLength(arrays_ref) - offset;
1685 arrays_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001686 _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001687 arrays = arrays_base + offset;
1688
1689 glGenVertexArrays(
1690 (GLsizei)n,
1691 (GLuint *)arrays
1692 );
1693
1694exit:
1695 if (arrays_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001696 _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
Jesse Halld830e742013-03-29 11:02:35 -07001697 _exception ? JNI_ABORT: 0);
1698 }
1699 if (_exception) {
1700 jniThrowException(_env, _exceptionType, _exceptionMessage);
1701 }
1702}
1703
1704/* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
1705static void
1706android_glGenVertexArrays__ILjava_nio_IntBuffer_2
1707 (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001708 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001709 jint _bufferOffset = (jint) 0;
1710 jint _remaining;
1711 GLuint *arrays = (GLuint *) 0;
1712
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001713 arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001714 if (arrays == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001715 char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001716 arrays = (GLuint *) (_arraysBase + _bufferOffset);
1717 }
1718 glGenVertexArrays(
1719 (GLsizei)n,
1720 (GLuint *)arrays
1721 );
1722 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001723 _env->ReleaseIntArrayElements(_array, (jint*)arrays, 0);
Jesse Halld830e742013-03-29 11:02:35 -07001724 }
1725}
1726
1727/* GLboolean glIsVertexArray ( GLuint array ) */
1728static jboolean
1729android_glIsVertexArray__I
1730 (JNIEnv *_env, jobject _this, jint array) {
1731 GLboolean _returnValue;
1732 _returnValue = glIsVertexArray(
1733 (GLuint)array
1734 );
1735 return (jboolean)_returnValue;
1736}
1737
1738/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
1739static void
1740android_glGetIntegeri_v__II_3II
1741 (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
1742 jint _exception = 0;
1743 const char * _exceptionType = NULL;
1744 const char * _exceptionMessage = NULL;
1745 GLint *data_base = (GLint *) 0;
1746 jint _remaining;
1747 GLint *data = (GLint *) 0;
1748
1749 if (!data_ref) {
1750 _exception = 1;
1751 _exceptionType = "java/lang/IllegalArgumentException";
1752 _exceptionMessage = "data == null";
1753 goto exit;
1754 }
1755 if (offset < 0) {
1756 _exception = 1;
1757 _exceptionType = "java/lang/IllegalArgumentException";
1758 _exceptionMessage = "offset < 0";
1759 goto exit;
1760 }
1761 _remaining = _env->GetArrayLength(data_ref) - offset;
1762 data_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001763 _env->GetIntArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001764 data = data_base + offset;
1765
1766 glGetIntegeri_v(
1767 (GLenum)target,
1768 (GLuint)index,
1769 (GLint *)data
1770 );
1771
1772exit:
1773 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001774 _env->ReleaseIntArrayElements(data_ref, (jint*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07001775 _exception ? JNI_ABORT: 0);
1776 }
1777 if (_exception) {
1778 jniThrowException(_env, _exceptionType, _exceptionMessage);
1779 }
1780}
1781
1782/* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
1783static void
1784android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
1785 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001786 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07001787 jint _bufferOffset = (jint) 0;
1788 jint _remaining;
1789 GLint *data = (GLint *) 0;
1790
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001791 data = (GLint *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07001792 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001793 char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07001794 data = (GLint *) (_dataBase + _bufferOffset);
1795 }
1796 glGetIntegeri_v(
1797 (GLenum)target,
1798 (GLuint)index,
1799 (GLint *)data
1800 );
1801 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001802 _env->ReleaseIntArrayElements(_array, (jint*)data, 0);
Jesse Halld830e742013-03-29 11:02:35 -07001803 }
1804}
1805
1806/* void glBeginTransformFeedback ( GLenum primitiveMode ) */
1807static void
1808android_glBeginTransformFeedback__I
1809 (JNIEnv *_env, jobject _this, jint primitiveMode) {
1810 glBeginTransformFeedback(
1811 (GLenum)primitiveMode
1812 );
1813}
1814
1815/* void glEndTransformFeedback ( void ) */
1816static void
1817android_glEndTransformFeedback__
1818 (JNIEnv *_env, jobject _this) {
1819 glEndTransformFeedback();
1820}
1821
1822/* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
1823static void
1824android_glBindBufferRange__IIIII
1825 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
1826 glBindBufferRange(
1827 (GLenum)target,
1828 (GLuint)index,
1829 (GLuint)buffer,
1830 (GLintptr)offset,
1831 (GLsizeiptr)size
1832 );
1833}
1834
1835/* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
1836static void
1837android_glBindBufferBase__III
1838 (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
1839 glBindBufferBase(
1840 (GLenum)target,
1841 (GLuint)index,
1842 (GLuint)buffer
1843 );
1844}
1845
1846/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
1847static
1848void
1849android_glTransformFeedbackVaryings
1850 (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
1851 jint _exception = 0;
1852 const char* _exceptionType = NULL;
1853 const char* _exceptionMessage = NULL;
1854 jint _count = 0, _i;
1855 const char** _varyings = NULL;
1856 const char* _varying = NULL;
1857
1858 if (!varyings_ref) {
1859 _exception = 1;
1860 _exceptionType = "java/lang/IllegalArgumentException";
1861 _exceptionMessage = "varyings == null";
1862 goto exit;
1863 }
1864
1865 _count = _env->GetArrayLength(varyings_ref);
1866 _varyings = (const char**)calloc(_count, sizeof(const char*));
1867 for (_i = 0; _i < _count; _i++) {
1868 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
1869 if (!_varying) {
1870 _exception = 1;
1871 _exceptionType = "java/lang/IllegalArgumentException";
1872 _exceptionMessage = "null varyings element";
1873 goto exit;
1874 }
1875 _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
1876 }
1877
1878 glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
1879
1880exit:
1881 for (_i = _count - 1; _i >= 0; _i--) {
1882 if (_varyings[_i]) {
1883 jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
1884 if (_varying) {
1885 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
1886 }
1887 }
1888 }
1889 free(_varyings);
1890 if (_exception) {
1891 jniThrowException(_env, _exceptionType, _exceptionMessage);
1892 }
1893}
1894
1895/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
1896static void
1897android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
1898 (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) {
1899 jint _exception = 0;
1900 const char * _exceptionType;
1901 const char * _exceptionMessage;
1902 GLsizei *length_base = (GLsizei *) 0;
1903 jint _lengthRemaining;
1904 GLsizei *length = (GLsizei *) 0;
1905 GLint *size_base = (GLint *) 0;
1906 jint _sizeRemaining;
1907 GLint *size = (GLint *) 0;
1908 GLenum *type_base = (GLenum *) 0;
1909 jint _typeRemaining;
1910 GLenum *type = (GLenum *) 0;
1911 char *name_base = (char *) 0;
1912 jint _nameRemaining;
1913 char *name = (char *) 0;
1914
Pablo Ceballos6aff9062015-10-01 18:35:39 -07001915 if (length_ref) {
1916 if (lengthOffset < 0) {
1917 _exception = 1;
1918 _exceptionType = "java/lang/IllegalArgumentException";
1919 _exceptionMessage = "lengthOffset < 0";
1920 goto exit;
1921 }
1922 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
1923 length_base = (GLsizei *)
1924 _env->GetIntArrayElements(length_ref, (jboolean *)0);
1925 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07001926 }
Jesse Halld830e742013-03-29 11:02:35 -07001927
1928 if (!size_ref) {
1929 _exception = 1;
1930 _exceptionType = "java/lang/IllegalArgumentException";
1931 _exceptionMessage = "size == null";
1932 goto exit;
1933 }
1934 if (sizeOffset < 0) {
1935 _exception = 1;
1936 _exceptionType = "java/lang/IllegalArgumentException";
1937 _exceptionMessage = "sizeOffset < 0";
1938 goto exit;
1939 }
1940 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
1941 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001942 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001943 size = size_base + sizeOffset;
1944
1945 if (!type_ref) {
1946 _exception = 1;
1947 _exceptionType = "java/lang/IllegalArgumentException";
1948 _exceptionMessage = "type == null";
1949 goto exit;
1950 }
1951 if (typeOffset < 0) {
1952 _exception = 1;
1953 _exceptionType = "java/lang/IllegalArgumentException";
1954 _exceptionMessage = "typeOffset < 0";
1955 goto exit;
1956 }
1957 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
1958 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001959 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001960 type = type_base + typeOffset;
1961
1962 if (!name_ref) {
1963 _exception = 1;
1964 _exceptionType = "java/lang/IllegalArgumentException";
1965 _exceptionMessage = "name == null";
1966 goto exit;
1967 }
1968 if (nameOffset < 0) {
1969 _exception = 1;
1970 _exceptionType = "java/lang/IllegalArgumentException";
1971 _exceptionMessage = "nameOffset < 0";
1972 goto exit;
1973 }
1974 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
1975 name_base = (char *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001976 _env->GetByteArrayElements(name_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07001977 name = name_base + nameOffset;
1978
1979 glGetTransformFeedbackVarying(
1980 (GLuint)program,
1981 (GLuint)index,
1982 (GLsizei)bufsize,
1983 (GLsizei *)length,
1984 (GLint *)size,
1985 (GLenum *)type,
1986 (char *)name
1987 );
1988
1989exit:
1990 if (name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001991 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base,
Jesse Halld830e742013-03-29 11:02:35 -07001992 _exception ? JNI_ABORT: 0);
1993 }
1994 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001995 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07001996 _exception ? JNI_ABORT: 0);
1997 }
1998 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001999 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002000 _exception ? JNI_ABORT: 0);
2001 }
2002 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002003 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07002004 _exception ? JNI_ABORT: 0);
2005 }
2006 if (_exception) {
2007 jniThrowException(_env, _exceptionType, _exceptionMessage);
2008 }
2009}
2010
2011/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2012static void
2013android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
2014 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002015 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002016 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002017 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002018 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002019 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002020 jint _typeBufferOffset = (jint) 0;
2021 jint _lengthRemaining;
2022 GLsizei *length = (GLsizei *) 0;
2023 jint _sizeRemaining;
2024 GLint *size = (GLint *) 0;
2025 jint _typeRemaining;
2026 GLenum *type = (GLenum *) 0;
2027
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002028 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
2029 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2030 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002031 if (length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002032 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002033 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
2034 }
2035 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002036 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002037 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2038 }
2039 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002040 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002041 type = (GLenum *) (_typeBase + _typeBufferOffset);
2042 }
2043 glGetTransformFeedbackVarying(
2044 (GLuint)program,
2045 (GLuint)index,
2046 (GLsizei)bufsize,
2047 (GLsizei *)length,
2048 (GLint *)size,
2049 (GLenum *)type,
Dan Albert10caf032015-02-23 10:41:10 -08002050 // The cast below is incorrect. The driver will end up writing to the
2051 // address specified by name, which will always crash the process since
2052 // it is guaranteed to be in low memory. The additional static_cast
2053 // suppresses the warning for now. http://b/19478262
2054 (char *)static_cast<uintptr_t>(name)
Jesse Halld830e742013-03-29 11:02:35 -07002055 );
2056 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002057 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002058 }
2059 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002060 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002061 }
2062 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002063 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002064 }
2065}
2066
2067/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2068static jstring
2069android_glGetTransformFeedbackVarying1
2070 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
2071 jint _exception = 0;
2072 const char * _exceptionType;
2073 const char * _exceptionMessage;
2074 GLint *size_base = (GLint *) 0;
2075 jint _sizeRemaining;
2076 GLint *size = (GLint *) 0;
2077 GLenum *type_base = (GLenum *) 0;
2078 jint _typeRemaining;
2079 GLenum *type = (GLenum *) 0;
2080
2081 jstring result = 0;
2082
2083 GLint len = 0;
2084 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2085 if (!len) {
2086 return _env->NewStringUTF("");
2087 }
2088 char* buf = (char*) malloc(len);
2089
2090 if (buf == NULL) {
2091 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2092 return NULL;
2093 }
2094 if (!size_ref) {
2095 _exception = 1;
2096 _exceptionType = "java/lang/IllegalArgumentException";
2097 _exceptionMessage = "size == null";
2098 goto exit;
2099 }
2100 if (sizeOffset < 0) {
2101 _exception = 1;
2102 _exceptionType = "java/lang/IllegalArgumentException";
2103 _exceptionMessage = "sizeOffset < 0";
2104 goto exit;
2105 }
2106 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2107 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002108 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002109 size = size_base + sizeOffset;
2110
2111 if (!type_ref) {
2112 _exception = 1;
2113 _exceptionType = "java/lang/IllegalArgumentException";
2114 _exceptionMessage = "type == null";
2115 goto exit;
2116 }
2117 if (typeOffset < 0) {
2118 _exception = 1;
2119 _exceptionType = "java/lang/IllegalArgumentException";
2120 _exceptionMessage = "typeOffset < 0";
2121 goto exit;
2122 }
2123 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2124 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002125 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002126 type = type_base + typeOffset;
2127
2128 glGetTransformFeedbackVarying(
2129 (GLuint)program,
2130 (GLuint)index,
2131 (GLsizei)len,
2132 NULL,
2133 (GLint *)size,
2134 (GLenum *)type,
2135 (char *)buf
2136 );
2137exit:
2138 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002139 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002140 _exception ? JNI_ABORT: 0);
2141 }
2142 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002143 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002144 _exception ? JNI_ABORT: 0);
2145 }
2146 if (_exception != 1) {
2147 result = _env->NewStringUTF(buf);
2148 }
2149 if (buf) {
2150 free(buf);
2151 }
2152 if (_exception) {
2153 jniThrowException(_env, _exceptionType, _exceptionMessage);
2154 }
2155 if (result == 0) {
2156 result = _env->NewStringUTF("");
2157 }
2158
2159 return result;
2160}
2161
2162/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2163static jstring
2164android_glGetTransformFeedbackVarying2
2165 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002166 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002167 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002168 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002169 jint _typeBufferOffset = (jint) 0;
2170 jint _lengthRemaining;
2171 GLsizei *length = (GLsizei *) 0;
2172 jint _sizeRemaining;
2173 GLint *size = (GLint *) 0;
2174 jint _typeRemaining;
2175 GLenum *type = (GLenum *) 0;
2176
2177 jstring result = 0;
2178
2179 GLint len = 0;
2180 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2181 if (!len) {
2182 return _env->NewStringUTF("");
2183 }
2184 char* buf = (char*) malloc(len);
2185
2186 if (buf == NULL) {
2187 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2188 return NULL;
2189 }
2190
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002191 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2192 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002193 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002194 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002195 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2196 }
2197 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002198 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002199 type = (GLenum *) (_typeBase + _typeBufferOffset);
2200 }
2201 glGetTransformFeedbackVarying(
2202 (GLuint)program,
2203 (GLuint)index,
2204 (GLsizei)len,
2205 NULL,
2206 (GLint *)size,
2207 (GLenum *)type,
2208 (char *)buf
2209 );
2210
2211 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002212 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002213 }
2214 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002215 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002216 }
2217 result = _env->NewStringUTF(buf);
2218 if (buf) {
2219 free(buf);
2220 }
2221 return result;
2222}
2223/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2224static void
2225android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
2226 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2227 jarray _array = (jarray) 0;
2228 jint _bufferOffset = (jint) 0;
2229 jint _remaining;
2230 GLvoid *pointer = (GLvoid *) 0;
2231
2232 if (pointer_buf) {
2233 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2234 if ( ! pointer ) {
2235 return;
2236 }
2237 }
2238 glVertexAttribIPointerBounds(
2239 (GLuint)index,
2240 (GLint)size,
2241 (GLenum)type,
2242 (GLsizei)stride,
2243 (GLvoid *)pointer,
2244 (GLsizei)remaining
2245 );
2246}
2247
2248/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
2249static void
2250android_glVertexAttribIPointer__IIIII
2251 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
2252 glVertexAttribIPointer(
2253 (GLuint)index,
2254 (GLint)size,
2255 (GLenum)type,
2256 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00002257 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -07002258 );
2259}
2260
2261/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2262static void
2263android_glGetVertexAttribIiv__II_3II
2264 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2265 jint _exception = 0;
2266 const char * _exceptionType = NULL;
2267 const char * _exceptionMessage = NULL;
2268 GLint *params_base = (GLint *) 0;
2269 jint _remaining;
2270 GLint *params = (GLint *) 0;
2271
2272 if (!params_ref) {
2273 _exception = 1;
2274 _exceptionType = "java/lang/IllegalArgumentException";
2275 _exceptionMessage = "params == null";
2276 goto exit;
2277 }
2278 if (offset < 0) {
2279 _exception = 1;
2280 _exceptionType = "java/lang/IllegalArgumentException";
2281 _exceptionMessage = "offset < 0";
2282 goto exit;
2283 }
2284 _remaining = _env->GetArrayLength(params_ref) - offset;
2285 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002286 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002287 params = params_base + offset;
2288
2289 glGetVertexAttribIiv(
2290 (GLuint)index,
2291 (GLenum)pname,
2292 (GLint *)params
2293 );
2294
2295exit:
2296 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002297 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002298 _exception ? JNI_ABORT: 0);
2299 }
2300 if (_exception) {
2301 jniThrowException(_env, _exceptionType, _exceptionMessage);
2302 }
2303}
2304
2305/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2306static void
2307android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
2308 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002309 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002310 jint _bufferOffset = (jint) 0;
2311 jint _remaining;
2312 GLint *params = (GLint *) 0;
2313
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002314 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002315 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002316 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002317 params = (GLint *) (_paramsBase + _bufferOffset);
2318 }
2319 glGetVertexAttribIiv(
2320 (GLuint)index,
2321 (GLenum)pname,
2322 (GLint *)params
2323 );
2324 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002325 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002326 }
2327}
2328
2329/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2330static void
2331android_glGetVertexAttribIuiv__II_3II
2332 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2333 jint _exception = 0;
2334 const char * _exceptionType = NULL;
2335 const char * _exceptionMessage = NULL;
2336 GLuint *params_base = (GLuint *) 0;
2337 jint _remaining;
2338 GLuint *params = (GLuint *) 0;
2339
2340 if (!params_ref) {
2341 _exception = 1;
2342 _exceptionType = "java/lang/IllegalArgumentException";
2343 _exceptionMessage = "params == null";
2344 goto exit;
2345 }
2346 if (offset < 0) {
2347 _exception = 1;
2348 _exceptionType = "java/lang/IllegalArgumentException";
2349 _exceptionMessage = "offset < 0";
2350 goto exit;
2351 }
2352 _remaining = _env->GetArrayLength(params_ref) - offset;
2353 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002354 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002355 params = params_base + offset;
2356
2357 glGetVertexAttribIuiv(
2358 (GLuint)index,
2359 (GLenum)pname,
2360 (GLuint *)params
2361 );
2362
2363exit:
2364 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002365 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002366 _exception ? JNI_ABORT: 0);
2367 }
2368 if (_exception) {
2369 jniThrowException(_env, _exceptionType, _exceptionMessage);
2370 }
2371}
2372
2373/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2374static void
2375android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
2376 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002377 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002378 jint _bufferOffset = (jint) 0;
2379 jint _remaining;
2380 GLuint *params = (GLuint *) 0;
2381
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002382 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002383 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002384 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002385 params = (GLuint *) (_paramsBase + _bufferOffset);
2386 }
2387 glGetVertexAttribIuiv(
2388 (GLuint)index,
2389 (GLenum)pname,
2390 (GLuint *)params
2391 );
2392 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002393 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002394 }
2395}
2396
2397/* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
2398static void
2399android_glVertexAttribI4i__IIIII
2400 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2401 glVertexAttribI4i(
2402 (GLuint)index,
2403 (GLint)x,
2404 (GLint)y,
2405 (GLint)z,
2406 (GLint)w
2407 );
2408}
2409
2410/* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
2411static void
2412android_glVertexAttribI4ui__IIIII
2413 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2414 glVertexAttribI4ui(
2415 (GLuint)index,
2416 (GLuint)x,
2417 (GLuint)y,
2418 (GLuint)z,
2419 (GLuint)w
2420 );
2421}
2422
2423/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2424static void
2425android_glVertexAttribI4iv__I_3II
2426 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2427 jint _exception = 0;
2428 const char * _exceptionType = NULL;
2429 const char * _exceptionMessage = NULL;
2430 GLint *v_base = (GLint *) 0;
2431 jint _remaining;
2432 GLint *v = (GLint *) 0;
2433
2434 if (!v_ref) {
2435 _exception = 1;
2436 _exceptionType = "java/lang/IllegalArgumentException";
2437 _exceptionMessage = "v == null";
2438 goto exit;
2439 }
2440 if (offset < 0) {
2441 _exception = 1;
2442 _exceptionType = "java/lang/IllegalArgumentException";
2443 _exceptionMessage = "offset < 0";
2444 goto exit;
2445 }
2446 _remaining = _env->GetArrayLength(v_ref) - offset;
2447 v_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002448 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002449 v = v_base + offset;
2450
2451 glVertexAttribI4iv(
2452 (GLuint)index,
2453 (GLint *)v
2454 );
2455
2456exit:
2457 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002458 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002459 JNI_ABORT);
2460 }
2461 if (_exception) {
2462 jniThrowException(_env, _exceptionType, _exceptionMessage);
2463 }
2464}
2465
2466/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2467static void
2468android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
2469 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002470 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002471 jint _bufferOffset = (jint) 0;
2472 jint _remaining;
2473 GLint *v = (GLint *) 0;
2474
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002475 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002476 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002477 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002478 v = (GLint *) (_vBase + _bufferOffset);
2479 }
2480 glVertexAttribI4iv(
2481 (GLuint)index,
2482 (GLint *)v
2483 );
2484 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002485 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002486 }
2487}
2488
2489/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2490static void
2491android_glVertexAttribI4uiv__I_3II
2492 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2493 jint _exception = 0;
2494 const char * _exceptionType = NULL;
2495 const char * _exceptionMessage = NULL;
2496 GLuint *v_base = (GLuint *) 0;
2497 jint _remaining;
2498 GLuint *v = (GLuint *) 0;
2499
2500 if (!v_ref) {
2501 _exception = 1;
2502 _exceptionType = "java/lang/IllegalArgumentException";
2503 _exceptionMessage = "v == null";
2504 goto exit;
2505 }
2506 if (offset < 0) {
2507 _exception = 1;
2508 _exceptionType = "java/lang/IllegalArgumentException";
2509 _exceptionMessage = "offset < 0";
2510 goto exit;
2511 }
2512 _remaining = _env->GetArrayLength(v_ref) - offset;
2513 v_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002514 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002515 v = v_base + offset;
2516
2517 glVertexAttribI4uiv(
2518 (GLuint)index,
2519 (GLuint *)v
2520 );
2521
2522exit:
2523 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002524 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002525 JNI_ABORT);
2526 }
2527 if (_exception) {
2528 jniThrowException(_env, _exceptionType, _exceptionMessage);
2529 }
2530}
2531
2532/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2533static void
2534android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
2535 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002536 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002537 jint _bufferOffset = (jint) 0;
2538 jint _remaining;
2539 GLuint *v = (GLuint *) 0;
2540
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002541 v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002542 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002543 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002544 v = (GLuint *) (_vBase + _bufferOffset);
2545 }
2546 glVertexAttribI4uiv(
2547 (GLuint)index,
2548 (GLuint *)v
2549 );
2550 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002551 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002552 }
2553}
2554
2555/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2556static void
2557android_glGetUniformuiv__II_3II
2558 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
2559 jint _exception = 0;
2560 const char * _exceptionType = NULL;
2561 const char * _exceptionMessage = NULL;
2562 GLuint *params_base = (GLuint *) 0;
2563 jint _remaining;
2564 GLuint *params = (GLuint *) 0;
2565
2566 if (!params_ref) {
2567 _exception = 1;
2568 _exceptionType = "java/lang/IllegalArgumentException";
2569 _exceptionMessage = "params == null";
2570 goto exit;
2571 }
2572 if (offset < 0) {
2573 _exception = 1;
2574 _exceptionType = "java/lang/IllegalArgumentException";
2575 _exceptionMessage = "offset < 0";
2576 goto exit;
2577 }
2578 _remaining = _env->GetArrayLength(params_ref) - offset;
2579 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002580 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002581 params = params_base + offset;
2582
2583 glGetUniformuiv(
2584 (GLuint)program,
2585 (GLint)location,
2586 (GLuint *)params
2587 );
2588
2589exit:
2590 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002591 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002592 _exception ? JNI_ABORT: 0);
2593 }
2594 if (_exception) {
2595 jniThrowException(_env, _exceptionType, _exceptionMessage);
2596 }
2597}
2598
2599/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2600static void
2601android_glGetUniformuiv__IILjava_nio_IntBuffer_2
2602 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002603 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002604 jint _bufferOffset = (jint) 0;
2605 jint _remaining;
2606 GLuint *params = (GLuint *) 0;
2607
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002608 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002609 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002610 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002611 params = (GLuint *) (_paramsBase + _bufferOffset);
2612 }
2613 glGetUniformuiv(
2614 (GLuint)program,
2615 (GLint)location,
2616 (GLuint *)params
2617 );
2618 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002619 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002620 }
2621}
2622
2623/* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
2624static jint
2625android_glGetFragDataLocation__ILjava_lang_String_2
2626 (JNIEnv *_env, jobject _this, jint program, jstring name) {
2627 jint _exception = 0;
2628 const char * _exceptionType = NULL;
2629 const char * _exceptionMessage = NULL;
2630 GLint _returnValue = 0;
2631 const char* _nativename = 0;
2632
2633 if (!name) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07002634 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07002635 _exceptionType = "java/lang/IllegalArgumentException";
2636 _exceptionMessage = "name == null";
2637 goto exit;
2638 }
2639 _nativename = _env->GetStringUTFChars(name, 0);
2640
2641 _returnValue = glGetFragDataLocation(
2642 (GLuint)program,
2643 (GLchar *)_nativename
2644 );
2645
2646exit:
2647 if (_nativename) {
2648 _env->ReleaseStringUTFChars(name, _nativename);
2649 }
2650
2651 if (_exception) {
2652 jniThrowException(_env, _exceptionType, _exceptionMessage);
2653 }
2654 return (jint)_returnValue;
2655}
2656
2657/* void glUniform1ui ( GLint location, GLuint v0 ) */
2658static void
2659android_glUniform1ui__II
2660 (JNIEnv *_env, jobject _this, jint location, jint v0) {
2661 glUniform1ui(
2662 (GLint)location,
2663 (GLuint)v0
2664 );
2665}
2666
2667/* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
2668static void
2669android_glUniform2ui__III
2670 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
2671 glUniform2ui(
2672 (GLint)location,
2673 (GLuint)v0,
2674 (GLuint)v1
2675 );
2676}
2677
2678/* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
2679static void
2680android_glUniform3ui__IIII
2681 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
2682 glUniform3ui(
2683 (GLint)location,
2684 (GLuint)v0,
2685 (GLuint)v1,
2686 (GLuint)v2
2687 );
2688}
2689
2690/* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
2691static void
2692android_glUniform4ui__IIIII
2693 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
2694 glUniform4ui(
2695 (GLint)location,
2696 (GLuint)v0,
2697 (GLuint)v1,
2698 (GLuint)v2,
2699 (GLuint)v3
2700 );
2701}
2702
2703/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
2704static void
2705android_glUniform1uiv__II_3II
2706 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2707 jint _exception = 0;
2708 const char * _exceptionType = NULL;
2709 const char * _exceptionMessage = NULL;
2710 GLuint *value_base = (GLuint *) 0;
2711 jint _remaining;
2712 GLuint *value = (GLuint *) 0;
2713
2714 if (!value_ref) {
2715 _exception = 1;
2716 _exceptionType = "java/lang/IllegalArgumentException";
2717 _exceptionMessage = "value == null";
2718 goto exit;
2719 }
2720 if (offset < 0) {
2721 _exception = 1;
2722 _exceptionType = "java/lang/IllegalArgumentException";
2723 _exceptionMessage = "offset < 0";
2724 goto exit;
2725 }
2726 _remaining = _env->GetArrayLength(value_ref) - offset;
2727 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002728 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002729 value = value_base + offset;
2730
2731 glUniform1uiv(
2732 (GLint)location,
2733 (GLsizei)count,
2734 (GLuint *)value
2735 );
2736
2737exit:
2738 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002739 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002740 JNI_ABORT);
2741 }
2742 if (_exception) {
2743 jniThrowException(_env, _exceptionType, _exceptionMessage);
2744 }
2745}
2746
2747/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
2748static void
2749android_glUniform1uiv__IILjava_nio_IntBuffer_2
2750 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002751 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002752 jint _bufferOffset = (jint) 0;
2753 jint _remaining;
2754 GLuint *value = (GLuint *) 0;
2755
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002756 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002757 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002758 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002759 value = (GLuint *) (_valueBase + _bufferOffset);
2760 }
2761 glUniform1uiv(
2762 (GLint)location,
2763 (GLsizei)count,
2764 (GLuint *)value
2765 );
2766 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002767 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002768 }
2769}
2770
2771/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
2772static void
2773android_glUniform2uiv__II_3II
2774 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2775 jint _exception = 0;
2776 const char * _exceptionType = NULL;
2777 const char * _exceptionMessage = NULL;
2778 GLuint *value_base = (GLuint *) 0;
2779 jint _remaining;
2780 GLuint *value = (GLuint *) 0;
2781
2782 if (!value_ref) {
2783 _exception = 1;
2784 _exceptionType = "java/lang/IllegalArgumentException";
2785 _exceptionMessage = "value == null";
2786 goto exit;
2787 }
2788 if (offset < 0) {
2789 _exception = 1;
2790 _exceptionType = "java/lang/IllegalArgumentException";
2791 _exceptionMessage = "offset < 0";
2792 goto exit;
2793 }
2794 _remaining = _env->GetArrayLength(value_ref) - offset;
2795 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002796 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002797 value = value_base + offset;
2798
2799 glUniform2uiv(
2800 (GLint)location,
2801 (GLsizei)count,
2802 (GLuint *)value
2803 );
2804
2805exit:
2806 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002807 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002808 JNI_ABORT);
2809 }
2810 if (_exception) {
2811 jniThrowException(_env, _exceptionType, _exceptionMessage);
2812 }
2813}
2814
2815/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
2816static void
2817android_glUniform2uiv__IILjava_nio_IntBuffer_2
2818 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002819 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002820 jint _bufferOffset = (jint) 0;
2821 jint _remaining;
2822 GLuint *value = (GLuint *) 0;
2823
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002824 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002825 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002826 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002827 value = (GLuint *) (_valueBase + _bufferOffset);
2828 }
2829 glUniform2uiv(
2830 (GLint)location,
2831 (GLsizei)count,
2832 (GLuint *)value
2833 );
2834 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002835 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002836 }
2837}
2838
2839/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
2840static void
2841android_glUniform3uiv__II_3II
2842 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2843 jint _exception = 0;
2844 const char * _exceptionType = NULL;
2845 const char * _exceptionMessage = NULL;
2846 GLuint *value_base = (GLuint *) 0;
2847 jint _remaining;
2848 GLuint *value = (GLuint *) 0;
2849
2850 if (!value_ref) {
2851 _exception = 1;
2852 _exceptionType = "java/lang/IllegalArgumentException";
2853 _exceptionMessage = "value == null";
2854 goto exit;
2855 }
2856 if (offset < 0) {
2857 _exception = 1;
2858 _exceptionType = "java/lang/IllegalArgumentException";
2859 _exceptionMessage = "offset < 0";
2860 goto exit;
2861 }
2862 _remaining = _env->GetArrayLength(value_ref) - offset;
2863 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002864 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002865 value = value_base + offset;
2866
2867 glUniform3uiv(
2868 (GLint)location,
2869 (GLsizei)count,
2870 (GLuint *)value
2871 );
2872
2873exit:
2874 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002875 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002876 JNI_ABORT);
2877 }
2878 if (_exception) {
2879 jniThrowException(_env, _exceptionType, _exceptionMessage);
2880 }
2881}
2882
2883/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
2884static void
2885android_glUniform3uiv__IILjava_nio_IntBuffer_2
2886 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002887 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002888 jint _bufferOffset = (jint) 0;
2889 jint _remaining;
2890 GLuint *value = (GLuint *) 0;
2891
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002892 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002893 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002894 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002895 value = (GLuint *) (_valueBase + _bufferOffset);
2896 }
2897 glUniform3uiv(
2898 (GLint)location,
2899 (GLsizei)count,
2900 (GLuint *)value
2901 );
2902 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002903 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002904 }
2905}
2906
2907/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
2908static void
2909android_glUniform4uiv__II_3II
2910 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2911 jint _exception = 0;
2912 const char * _exceptionType = NULL;
2913 const char * _exceptionMessage = NULL;
2914 GLuint *value_base = (GLuint *) 0;
2915 jint _remaining;
2916 GLuint *value = (GLuint *) 0;
2917
2918 if (!value_ref) {
2919 _exception = 1;
2920 _exceptionType = "java/lang/IllegalArgumentException";
2921 _exceptionMessage = "value == null";
2922 goto exit;
2923 }
2924 if (offset < 0) {
2925 _exception = 1;
2926 _exceptionType = "java/lang/IllegalArgumentException";
2927 _exceptionMessage = "offset < 0";
2928 goto exit;
2929 }
2930 _remaining = _env->GetArrayLength(value_ref) - offset;
2931 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002932 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002933 value = value_base + offset;
2934
2935 glUniform4uiv(
2936 (GLint)location,
2937 (GLsizei)count,
2938 (GLuint *)value
2939 );
2940
2941exit:
2942 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002943 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002944 JNI_ABORT);
2945 }
2946 if (_exception) {
2947 jniThrowException(_env, _exceptionType, _exceptionMessage);
2948 }
2949}
2950
2951/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
2952static void
2953android_glUniform4uiv__IILjava_nio_IntBuffer_2
2954 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002955 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002956 jint _bufferOffset = (jint) 0;
2957 jint _remaining;
2958 GLuint *value = (GLuint *) 0;
2959
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002960 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002961 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002962 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002963 value = (GLuint *) (_valueBase + _bufferOffset);
2964 }
2965 glUniform4uiv(
2966 (GLint)location,
2967 (GLsizei)count,
2968 (GLuint *)value
2969 );
2970 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002971 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002972 }
2973}
2974
2975/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
2976static void
2977android_glClearBufferiv__II_3II
2978 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
2979 jint _exception = 0;
2980 const char * _exceptionType = NULL;
2981 const char * _exceptionMessage = NULL;
2982 GLint *value_base = (GLint *) 0;
2983 jint _remaining;
2984 GLint *value = (GLint *) 0;
2985
2986 if (!value_ref) {
2987 _exception = 1;
2988 _exceptionType = "java/lang/IllegalArgumentException";
2989 _exceptionMessage = "value == null";
2990 goto exit;
2991 }
2992 if (offset < 0) {
2993 _exception = 1;
2994 _exceptionType = "java/lang/IllegalArgumentException";
2995 _exceptionMessage = "offset < 0";
2996 goto exit;
2997 }
2998 _remaining = _env->GetArrayLength(value_ref) - offset;
2999 value_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003000 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003001 value = value_base + offset;
3002
3003 glClearBufferiv(
3004 (GLenum)buffer,
3005 (GLint)drawbuffer,
3006 (GLint *)value
3007 );
3008
3009exit:
3010 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003011 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003012 JNI_ABORT);
3013 }
3014 if (_exception) {
3015 jniThrowException(_env, _exceptionType, _exceptionMessage);
3016 }
3017}
3018
3019/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3020static void
3021android_glClearBufferiv__IILjava_nio_IntBuffer_2
3022 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003023 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003024 jint _bufferOffset = (jint) 0;
3025 jint _remaining;
3026 GLint *value = (GLint *) 0;
3027
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003028 value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003029 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003030 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003031 value = (GLint *) (_valueBase + _bufferOffset);
3032 }
3033 glClearBufferiv(
3034 (GLenum)buffer,
3035 (GLint)drawbuffer,
3036 (GLint *)value
3037 );
3038 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003039 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003040 }
3041}
3042
3043/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3044static void
3045android_glClearBufferuiv__II_3II
3046 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3047 jint _exception = 0;
3048 const char * _exceptionType = NULL;
3049 const char * _exceptionMessage = NULL;
3050 GLuint *value_base = (GLuint *) 0;
3051 jint _remaining;
3052 GLuint *value = (GLuint *) 0;
3053
3054 if (!value_ref) {
3055 _exception = 1;
3056 _exceptionType = "java/lang/IllegalArgumentException";
3057 _exceptionMessage = "value == null";
3058 goto exit;
3059 }
3060 if (offset < 0) {
3061 _exception = 1;
3062 _exceptionType = "java/lang/IllegalArgumentException";
3063 _exceptionMessage = "offset < 0";
3064 goto exit;
3065 }
3066 _remaining = _env->GetArrayLength(value_ref) - offset;
3067 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003068 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003069 value = value_base + offset;
3070
3071 glClearBufferuiv(
3072 (GLenum)buffer,
3073 (GLint)drawbuffer,
3074 (GLuint *)value
3075 );
3076
3077exit:
3078 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003079 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003080 JNI_ABORT);
3081 }
3082 if (_exception) {
3083 jniThrowException(_env, _exceptionType, _exceptionMessage);
3084 }
3085}
3086
3087/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3088static void
3089android_glClearBufferuiv__IILjava_nio_IntBuffer_2
3090 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003091 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003092 jint _bufferOffset = (jint) 0;
3093 jint _remaining;
3094 GLuint *value = (GLuint *) 0;
3095
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003096 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003097 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003098 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003099 value = (GLuint *) (_valueBase + _bufferOffset);
3100 }
3101 glClearBufferuiv(
3102 (GLenum)buffer,
3103 (GLint)drawbuffer,
3104 (GLuint *)value
3105 );
3106 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 }
3109}
3110
3111/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3112static void
3113android_glClearBufferfv__II_3FI
3114 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
3115 jint _exception = 0;
3116 const char * _exceptionType = NULL;
3117 const char * _exceptionMessage = NULL;
3118 GLfloat *value_base = (GLfloat *) 0;
3119 jint _remaining;
3120 GLfloat *value = (GLfloat *) 0;
3121
3122 if (!value_ref) {
3123 _exception = 1;
3124 _exceptionType = "java/lang/IllegalArgumentException";
3125 _exceptionMessage = "value == null";
3126 goto exit;
3127 }
3128 if (offset < 0) {
3129 _exception = 1;
3130 _exceptionType = "java/lang/IllegalArgumentException";
3131 _exceptionMessage = "offset < 0";
3132 goto exit;
3133 }
3134 _remaining = _env->GetArrayLength(value_ref) - offset;
3135 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003136 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003137 value = value_base + offset;
3138
3139 glClearBufferfv(
3140 (GLenum)buffer,
3141 (GLint)drawbuffer,
3142 (GLfloat *)value
3143 );
3144
3145exit:
3146 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003147 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003148 JNI_ABORT);
3149 }
3150 if (_exception) {
3151 jniThrowException(_env, _exceptionType, _exceptionMessage);
3152 }
3153}
3154
3155/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3156static void
3157android_glClearBufferfv__IILjava_nio_FloatBuffer_2
3158 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003159 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003160 jint _bufferOffset = (jint) 0;
3161 jint _remaining;
3162 GLfloat *value = (GLfloat *) 0;
3163
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003164 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003165 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003166 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003167 value = (GLfloat *) (_valueBase + _bufferOffset);
3168 }
3169 glClearBufferfv(
3170 (GLenum)buffer,
3171 (GLint)drawbuffer,
3172 (GLfloat *)value
3173 );
3174 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003175 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003176 }
3177}
3178
3179/* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
3180static void
3181android_glClearBufferfi__IIFI
3182 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
3183 glClearBufferfi(
3184 (GLenum)buffer,
3185 (GLint)drawbuffer,
3186 (GLfloat)depth,
3187 (GLint)stencil
3188 );
3189}
3190
3191/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
3192static jstring
3193android_glGetStringi__II
3194 (JNIEnv *_env, jobject _this, jint name, jint index) {
3195 const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
3196 return _env->NewStringUTF((const char*)_chars);
3197}
3198
3199/* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
3200static void
3201android_glCopyBufferSubData__IIIII
3202 (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
3203 glCopyBufferSubData(
3204 (GLenum)readTarget,
3205 (GLenum)writeTarget,
3206 (GLintptr)readOffset,
3207 (GLintptr)writeOffset,
3208 (GLsizeiptr)size
3209 );
3210}
3211
3212/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3213static
3214void
3215android_glGetUniformIndices_array
3216 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
3217 jint _exception = 0;
3218 const char* _exceptionType = NULL;
3219 const char* _exceptionMessage = NULL;
3220 jint _count = 0;
3221 jint _i;
3222 const char** _names = NULL;
3223 GLuint* _indices_base = NULL;
3224 GLuint* _indices = NULL;
3225
3226 if (!uniformNames_ref) {
3227 _exception = 1;
3228 _exceptionType = "java/lang/IllegalArgumentException";
3229 _exceptionMessage = "uniformNames == null";
3230 goto exit;
3231 }
3232 _count = _env->GetArrayLength(uniformNames_ref);
3233 _names = (const char**)calloc(_count, sizeof(const char*));
3234 for (_i = 0; _i < _count; _i++) {
3235 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3236 if (!_name) {
3237 _exception = 1;
3238 _exceptionType = "java/lang/IllegalArgumentException";
3239 _exceptionMessage = "null uniformNames element";
3240 goto exit;
3241 }
3242 _names[_i] = _env->GetStringUTFChars(_name, 0);
3243 }
3244
3245 if (!uniformIndices_ref) {
3246 _exception = 1;
3247 _exceptionType = "java/lang/IllegalArgumentException";
3248 _exceptionMessage = "uniformIndices == null";
3249 goto exit;
3250 }
3251 if (uniformIndicesOffset < 0) {
3252 _exception = 1;
3253 _exceptionType = "java/lang/IllegalArgumentException";
3254 _exceptionMessage = "uniformIndicesOffset < 0";
3255 goto exit;
3256 }
3257 if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
3258 _exception = 1;
3259 _exceptionType = "java/lang/IllegalArgumentException";
3260 _exceptionMessage = "not enough space in uniformIndices";
3261 goto exit;
3262 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003263 _indices_base = (GLuint*)_env->GetIntArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003264 uniformIndices_ref, 0);
3265 _indices = _indices_base + uniformIndicesOffset;
3266
3267 glGetUniformIndices(program, _count, _names, _indices);
3268
3269exit:
3270 if (_indices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003271 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
3272 _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003273 }
3274 for (_i = _count - 1; _i >= 0; _i--) {
3275 if (_names[_i]) {
3276 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3277 if (_name) {
3278 _env->ReleaseStringUTFChars(_name, _names[_i]);
3279 }
3280 }
3281 }
3282 free(_names);
3283 if (_exception) {
3284 jniThrowException(_env, _exceptionType, _exceptionMessage);
3285 }
3286}
3287
3288/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3289static
3290void
3291android_glGetUniformIndices_buffer
3292 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
3293 jint _exception = 0;
3294 const char* _exceptionType = NULL;
3295 const char* _exceptionMessage = NULL;
3296 jint _count = 0;
3297 jint _i;
3298 const char** _names = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003299 jintArray _uniformIndicesArray = (jintArray)0;
Jesse Halld830e742013-03-29 11:02:35 -07003300 jint _uniformIndicesRemaining;
3301 jint _uniformIndicesOffset = 0;
3302 GLuint* _indices = NULL;
3303 char* _indicesBase = NULL;
3304
3305 if (!uniformNames_ref) {
3306 _exception = 1;
3307 _exceptionType = "java/lang/IllegalArgumentException";
3308 _exceptionMessage = "uniformNames == null";
3309 goto exit;
3310 }
3311 if (!uniformIndices_buf) {
3312 _exception = 1;
3313 _exceptionType = "java/lang/IllegalArgumentException";
3314 _exceptionMessage = "uniformIndices == null";
3315 goto exit;
3316 }
3317
3318 _count = _env->GetArrayLength(uniformNames_ref);
3319 _names = (const char**)calloc(_count, sizeof(const char*));
3320 for (_i = 0; _i < _count; _i++) {
3321 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3322 if (!_name) {
3323 _exception = 1;
3324 _exceptionType = "java/lang/IllegalArgumentException";
3325 _exceptionMessage = "null uniformNames element";
3326 goto exit;
3327 }
3328 _names[_i] = _env->GetStringUTFChars(_name, 0);
3329 }
3330
3331 _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003332 (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
Jesse Halld830e742013-03-29 11:02:35 -07003333 &_uniformIndicesOffset);
3334 if (!_indices) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003335 _indicesBase = (char*)_env->GetIntArrayElements(
3336 _uniformIndicesArray, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003337 _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
3338 }
3339 if (_uniformIndicesRemaining < _count) {
3340 _exception = 1;
3341 _exceptionType = "java/lang/IllegalArgumentException";
3342 _exceptionMessage = "not enough space in uniformIndices";
3343 goto exit;
3344 }
3345
3346 glGetUniformIndices(program, _count, _names, _indices);
3347
3348exit:
3349 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003350 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
3351 _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07003352 }
3353 for (_i = _count - 1; _i >= 0; _i--) {
3354 if (_names[_i]) {
3355 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3356 if (_name) {
3357 _env->ReleaseStringUTFChars(_name, _names[_i]);
3358 }
3359 }
3360 }
3361 free(_names);
3362 if (_exception) {
3363 jniThrowException(_env, _exceptionType, _exceptionMessage);
3364 }
3365}
Jesse Halld830e742013-03-29 11:02:35 -07003366/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3367static void
3368android_glGetActiveUniformsiv__II_3III_3II
3369 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
3370 jint _exception = 0;
3371 const char * _exceptionType = NULL;
3372 const char * _exceptionMessage = NULL;
3373 GLuint *uniformIndices_base = (GLuint *) 0;
3374 jint _uniformIndicesRemaining;
3375 GLuint *uniformIndices = (GLuint *) 0;
3376 GLint *params_base = (GLint *) 0;
3377 jint _paramsRemaining;
3378 GLint *params = (GLint *) 0;
3379
3380 if (!uniformIndices_ref) {
3381 _exception = 1;
3382 _exceptionType = "java/lang/IllegalArgumentException";
3383 _exceptionMessage = "uniformIndices == null";
3384 goto exit;
3385 }
3386 if (uniformIndicesOffset < 0) {
3387 _exception = 1;
3388 _exceptionType = "java/lang/IllegalArgumentException";
3389 _exceptionMessage = "uniformIndicesOffset < 0";
3390 goto exit;
3391 }
3392 _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
3393 uniformIndices_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003394 _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003395 uniformIndices = uniformIndices_base + uniformIndicesOffset;
3396
3397 if (!params_ref) {
3398 _exception = 1;
3399 _exceptionType = "java/lang/IllegalArgumentException";
3400 _exceptionMessage = "params == null";
3401 goto exit;
3402 }
3403 if (paramsOffset < 0) {
3404 _exception = 1;
3405 _exceptionType = "java/lang/IllegalArgumentException";
3406 _exceptionMessage = "paramsOffset < 0";
3407 goto exit;
3408 }
3409 _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
3410 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003411 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003412 params = params_base + paramsOffset;
3413
3414 glGetActiveUniformsiv(
3415 (GLuint)program,
3416 (GLsizei)uniformCount,
3417 (GLuint *)uniformIndices,
3418 (GLenum)pname,
3419 (GLint *)params
3420 );
3421
3422exit:
3423 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003424 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003425 _exception ? JNI_ABORT: 0);
3426 }
3427 if (uniformIndices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003428 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
Jesse Halld830e742013-03-29 11:02:35 -07003429 JNI_ABORT);
3430 }
3431 if (_exception) {
3432 jniThrowException(_env, _exceptionType, _exceptionMessage);
3433 }
3434}
3435
3436/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3437static void
3438android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
3439 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003440 jintArray _uniformIndicesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003441 jint _uniformIndicesBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003442 jintArray _paramsArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003443 jint _paramsBufferOffset = (jint) 0;
3444 jint _uniformIndicesRemaining;
3445 GLuint *uniformIndices = (GLuint *) 0;
3446 jint _paramsRemaining;
3447 GLint *params = (GLint *) 0;
3448
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003449 uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
3450 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003451 if (uniformIndices == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003452 char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003453 uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
3454 }
3455 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003456 char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003457 params = (GLint *) (_paramsBase + _paramsBufferOffset);
3458 }
3459 glGetActiveUniformsiv(
3460 (GLuint)program,
3461 (GLsizei)uniformCount,
3462 (GLuint *)uniformIndices,
3463 (GLenum)pname,
3464 (GLint *)params
3465 );
3466 if (_paramsArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003467 _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003468 }
3469 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003470 _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003471 }
3472}
3473
3474/* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
3475static jint
3476android_glGetUniformBlockIndex__ILjava_lang_String_2
3477 (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
3478 jint _exception = 0;
3479 const char * _exceptionType = NULL;
3480 const char * _exceptionMessage = NULL;
3481 GLuint _returnValue = 0;
3482 const char* _nativeuniformBlockName = 0;
3483
3484 if (!uniformBlockName) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07003485 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07003486 _exceptionType = "java/lang/IllegalArgumentException";
3487 _exceptionMessage = "uniformBlockName == null";
3488 goto exit;
3489 }
3490 _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
3491
3492 _returnValue = glGetUniformBlockIndex(
3493 (GLuint)program,
3494 (GLchar *)_nativeuniformBlockName
3495 );
3496
3497exit:
3498 if (_nativeuniformBlockName) {
3499 _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
3500 }
3501
3502 if (_exception) {
3503 jniThrowException(_env, _exceptionType, _exceptionMessage);
3504 }
3505 return (jint)_returnValue;
3506}
3507
3508/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3509static void
3510android_glGetActiveUniformBlockiv__III_3II
3511 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
3512 jint _exception = 0;
3513 const char * _exceptionType = NULL;
3514 const char * _exceptionMessage = NULL;
3515 GLint *params_base = (GLint *) 0;
3516 jint _remaining;
3517 GLint *params = (GLint *) 0;
3518
3519 if (!params_ref) {
3520 _exception = 1;
3521 _exceptionType = "java/lang/IllegalArgumentException";
3522 _exceptionMessage = "params == null";
3523 goto exit;
3524 }
3525 if (offset < 0) {
3526 _exception = 1;
3527 _exceptionType = "java/lang/IllegalArgumentException";
3528 _exceptionMessage = "offset < 0";
3529 goto exit;
3530 }
3531 _remaining = _env->GetArrayLength(params_ref) - offset;
3532 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003533 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003534 params = params_base + offset;
3535
3536 glGetActiveUniformBlockiv(
3537 (GLuint)program,
3538 (GLuint)uniformBlockIndex,
3539 (GLenum)pname,
3540 (GLint *)params
3541 );
3542
3543exit:
3544 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003545 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003546 _exception ? JNI_ABORT: 0);
3547 }
3548 if (_exception) {
3549 jniThrowException(_env, _exceptionType, _exceptionMessage);
3550 }
3551}
3552
3553/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3554static void
3555android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
3556 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003557 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003558 jint _bufferOffset = (jint) 0;
3559 jint _remaining;
3560 GLint *params = (GLint *) 0;
3561
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003562 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003563 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003564 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003565 params = (GLint *) (_paramsBase + _bufferOffset);
3566 }
3567 glGetActiveUniformBlockiv(
3568 (GLuint)program,
3569 (GLuint)uniformBlockIndex,
3570 (GLenum)pname,
3571 (GLint *)params
3572 );
3573 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003574 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003575 }
3576}
3577
3578/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3579static void
3580android_glGetActiveUniformBlockName_III_3II_3BI
3581 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
3582 jint _exception = 0;
3583 const char* _exceptionType;
3584 const char* _exceptionMessage;
3585 GLsizei* _length_base = (GLsizei*)0;
3586 jint _lengthRemaining;
3587 GLsizei* _length = (GLsizei*)0;
3588 GLchar* _name_base = (GLchar*)0;
3589 jint _nameRemaining;
3590 GLchar* _name = (GLchar*)0;
3591
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003592 if (length_ref) {
3593 if (lengthOffset < 0) {
3594 _exception = 1;
3595 _exceptionType = "java/lang/IllegalArgumentException";
3596 _exceptionMessage = "lengthOffset < 0";
3597 goto exit;
3598 }
3599 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
3600 _length_base = (GLsizei*)_env->GetIntArrayElements(
3601 length_ref, (jboolean*)0);
3602 _length = _length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07003603 }
Jesse Halld830e742013-03-29 11:02:35 -07003604
3605 if (!name_ref) {
3606 _exception = 1;
3607 _exceptionType = "java/lang/IllegalArgumentException";
3608 _exceptionMessage = "uniformBlockName == null";
3609 goto exit;
3610 }
3611 if (nameOffset < 0) {
3612 _exception = 1;
3613 _exceptionType = "java/lang/IllegalArgumentException";
3614 _exceptionMessage = "uniformBlockNameOffset < 0";
3615 goto exit;
3616 }
3617 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003618 _name_base = (GLchar*)_env->GetByteArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003619 name_ref, (jboolean*)0);
3620 _name = _name_base + nameOffset;
3621
3622 glGetActiveUniformBlockName(
3623 (GLuint)program,
3624 (GLuint)uniformBlockIndex,
3625 (GLsizei)bufSize,
3626 (GLsizei*)_length,
3627 (GLchar*)_name
3628 );
3629
3630exit:
3631 if (_name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003632 _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
Jesse Halld830e742013-03-29 11:02:35 -07003633 _exception ? JNI_ABORT: 0);
3634 }
3635 if (_length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003636 _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
Jesse Halld830e742013-03-29 11:02:35 -07003637 _exception ? JNI_ABORT: 0);
3638 }
3639 if (_exception) {
3640 jniThrowException(_env, _exceptionType, _exceptionMessage);
3641 }
3642}
3643
3644/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3645static void
3646android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
3647 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
3648 jint _exception = 0;
3649 const char* _exceptionType;
3650 const char* _exceptionMessage;
3651 jarray _lengthArray = (jarray)0;
3652 jint _lengthBufferOffset = (jint)0;
3653 GLsizei* _length = (GLsizei*)0;
3654 jint _lengthRemaining;
3655 jarray _nameArray = (jarray)0;
3656 jint _nameBufferOffset = (jint)0;
3657 GLchar* _name = (GLchar*)0;
3658 jint _nameRemaining;
3659
3660 _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
3661 if (_length == NULL) {
3662 GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
3663 _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
3664 }
3665
3666 _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
3667 if (_name == NULL) {
3668 GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
3669 _name = (GLchar*)(_nameBase + _nameBufferOffset);
3670 }
3671
3672 glGetActiveUniformBlockName(
3673 (GLuint)program,
3674 (GLuint)uniformBlockIndex,
3675 (GLsizei)_nameRemaining,
3676 _length, _name
3677 );
3678 if (_nameArray) {
3679 releasePointer(_env, _nameArray, _name, JNI_TRUE);
3680 }
3681 if (_lengthArray) {
3682 releasePointer(_env, _lengthArray, _length, JNI_TRUE);
3683 }
3684}
3685
3686/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3687static jstring
3688android_glGetActiveUniformBlockName_II
3689 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
3690 GLint len = 0;
3691 glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
3692 GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
3693 GLchar* name = (GLchar*)malloc(len);
3694 glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
3695 len, NULL, name);
3696 jstring result = _env->NewStringUTF(name);
3697 free(name);
3698 return result;
3699}
Jesse Halld830e742013-03-29 11:02:35 -07003700/* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
3701static void
3702android_glUniformBlockBinding__III
3703 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
3704 glUniformBlockBinding(
3705 (GLuint)program,
3706 (GLuint)uniformBlockIndex,
3707 (GLuint)uniformBlockBinding
3708 );
3709}
3710
3711/* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
3712static void
3713android_glDrawArraysInstanced__IIII
3714 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
3715 glDrawArraysInstanced(
3716 (GLenum)mode,
3717 (GLint)first,
3718 (GLsizei)count,
3719 (GLsizei)instanceCount
3720 );
3721}
3722
3723/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
3724static void
3725android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
3726 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
3727 jarray _array = (jarray) 0;
3728 jint _bufferOffset = (jint) 0;
3729 jint _remaining;
3730 GLvoid *indices = (GLvoid *) 0;
3731
3732 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
3733 if (indices == NULL) {
3734 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3735 indices = (GLvoid *) (_indicesBase + _bufferOffset);
3736 }
3737 glDrawElementsInstanced(
3738 (GLenum)mode,
3739 (GLsizei)count,
3740 (GLenum)type,
3741 (GLvoid *)indices,
3742 (GLsizei)instanceCount
3743 );
3744 if (_array) {
3745 releasePointer(_env, _array, indices, JNI_FALSE);
3746 }
3747}
3748
3749/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
3750static void
3751android_glDrawElementsInstanced__IIIII
3752 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
3753 glDrawElementsInstanced(
3754 (GLenum)mode,
3755 (GLsizei)count,
3756 (GLenum)type,
Dan Albert10caf032015-02-23 10:41:10 -08003757 (GLvoid *)static_cast<uintptr_t>(indicesOffset),
Jesse Halld830e742013-03-29 11:02:35 -07003758 (GLsizei)instanceCount
3759 );
3760}
Jesse Halld830e742013-03-29 11:02:35 -07003761/* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
3762static jlong
3763android_glFenceSync__II
3764 (JNIEnv *_env, jobject _this, jint condition, jint flags) {
3765 GLsync _returnValue;
3766 _returnValue = glFenceSync(
3767 (GLenum)condition,
3768 (GLbitfield)flags
3769 );
3770 return (jlong)_returnValue;
3771}
3772
3773/* GLboolean glIsSync ( GLsync sync ) */
3774static jboolean
3775android_glIsSync__J
3776 (JNIEnv *_env, jobject _this, jlong sync) {
3777 GLboolean _returnValue;
3778 _returnValue = glIsSync(
3779 (GLsync)sync
3780 );
3781 return (jboolean)_returnValue;
3782}
3783
3784/* void glDeleteSync ( GLsync sync ) */
3785static void
3786android_glDeleteSync__J
3787 (JNIEnv *_env, jobject _this, jlong sync) {
3788 glDeleteSync(
3789 (GLsync)sync
3790 );
3791}
3792
3793/* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
3794static jint
3795android_glClientWaitSync__JIJ
3796 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
3797 GLenum _returnValue;
3798 _returnValue = glClientWaitSync(
3799 (GLsync)sync,
3800 (GLbitfield)flags,
3801 (GLuint64)timeout
3802 );
3803 return (jint)_returnValue;
3804}
3805
3806/* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
3807static void
3808android_glWaitSync__JIJ
3809 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
3810 glWaitSync(
3811 (GLsync)sync,
3812 (GLbitfield)flags,
3813 (GLuint64)timeout
3814 );
3815}
3816
3817/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
3818static void
3819android_glGetInteger64v__I_3JI
3820 (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
3821 jint _exception = 0;
3822 const char * _exceptionType = NULL;
3823 const char * _exceptionMessage = NULL;
3824 GLint64 *params_base = (GLint64 *) 0;
3825 jint _remaining;
3826 GLint64 *params = (GLint64 *) 0;
3827
3828 if (!params_ref) {
3829 _exception = 1;
3830 _exceptionType = "java/lang/IllegalArgumentException";
3831 _exceptionMessage = "params == null";
3832 goto exit;
3833 }
3834 if (offset < 0) {
3835 _exception = 1;
3836 _exceptionType = "java/lang/IllegalArgumentException";
3837 _exceptionMessage = "offset < 0";
3838 goto exit;
3839 }
3840 _remaining = _env->GetArrayLength(params_ref) - offset;
3841 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003842 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003843 params = params_base + offset;
3844
3845 glGetInteger64v(
3846 (GLenum)pname,
3847 (GLint64 *)params
3848 );
3849
3850exit:
3851 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003852 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003853 _exception ? JNI_ABORT: 0);
3854 }
3855 if (_exception) {
3856 jniThrowException(_env, _exceptionType, _exceptionMessage);
3857 }
3858}
3859
3860/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
3861static void
3862android_glGetInteger64v__ILjava_nio_LongBuffer_2
3863 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003864 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003865 jint _bufferOffset = (jint) 0;
3866 jint _remaining;
3867 GLint64 *params = (GLint64 *) 0;
3868
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003869 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003870 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003871 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003872 params = (GLint64 *) (_paramsBase + _bufferOffset);
3873 }
3874 glGetInteger64v(
3875 (GLenum)pname,
3876 (GLint64 *)params
3877 );
3878 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003879 _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003880 }
3881}
3882
3883/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
3884static void
3885android_glGetSynciv__JII_3II_3II
3886 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
3887 jint _exception = 0;
3888 const char * _exceptionType = NULL;
3889 const char * _exceptionMessage = NULL;
3890 GLsizei *length_base = (GLsizei *) 0;
3891 jint _lengthRemaining;
3892 GLsizei *length = (GLsizei *) 0;
3893 GLint *values_base = (GLint *) 0;
3894 jint _valuesRemaining;
3895 GLint *values = (GLint *) 0;
3896
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003897 if (length_ref) {
3898 if (lengthOffset < 0) {
3899 _exception = 1;
3900 _exceptionType = "java/lang/IllegalArgumentException";
3901 _exceptionMessage = "lengthOffset < 0";
3902 goto exit;
3903 }
3904 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
3905 length_base = (GLsizei *)
3906 _env->GetIntArrayElements(length_ref, (jboolean *)0);
3907 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07003908 }
Jesse Halld830e742013-03-29 11:02:35 -07003909
3910 if (!values_ref) {
3911 _exception = 1;
3912 _exceptionType = "java/lang/IllegalArgumentException";
3913 _exceptionMessage = "values == null";
3914 goto exit;
3915 }
3916 if (valuesOffset < 0) {
3917 _exception = 1;
3918 _exceptionType = "java/lang/IllegalArgumentException";
3919 _exceptionMessage = "valuesOffset < 0";
3920 goto exit;
3921 }
3922 _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
3923 values_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003924 _env->GetIntArrayElements(values_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003925 values = values_base + valuesOffset;
3926
3927 glGetSynciv(
3928 (GLsync)sync,
3929 (GLenum)pname,
3930 (GLsizei)bufSize,
3931 (GLsizei *)length,
3932 (GLint *)values
3933 );
3934
3935exit:
3936 if (values_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003937 _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
Jesse Halld830e742013-03-29 11:02:35 -07003938 _exception ? JNI_ABORT: 0);
3939 }
3940 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003941 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07003942 _exception ? JNI_ABORT: 0);
3943 }
3944 if (_exception) {
3945 jniThrowException(_env, _exceptionType, _exceptionMessage);
3946 }
3947}
3948
3949/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
3950static void
3951android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
3952 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003953 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003954 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003955 jintArray _valuesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003956 jint _valuesBufferOffset = (jint) 0;
3957 jint _lengthRemaining;
3958 GLsizei *length = (GLsizei *) 0;
3959 jint _valuesRemaining;
3960 GLint *values = (GLint *) 0;
3961
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003962 if (length_buf) {
3963 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
3964 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003965 values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003966 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003967 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003968 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
3969 }
3970 if (values == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003971 char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003972 values = (GLint *) (_valuesBase + _valuesBufferOffset);
3973 }
3974 glGetSynciv(
3975 (GLsync)sync,
3976 (GLenum)pname,
3977 (GLsizei)bufSize,
3978 (GLsizei *)length,
3979 (GLint *)values
3980 );
3981 if (_valuesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003982 _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003983 }
3984 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003985 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003986 }
3987}
3988
3989/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
3990static void
3991android_glGetInteger64i_v__II_3JI
3992 (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
3993 jint _exception = 0;
3994 const char * _exceptionType = NULL;
3995 const char * _exceptionMessage = NULL;
3996 GLint64 *data_base = (GLint64 *) 0;
3997 jint _remaining;
3998 GLint64 *data = (GLint64 *) 0;
3999
4000 if (!data_ref) {
4001 _exception = 1;
4002 _exceptionType = "java/lang/IllegalArgumentException";
4003 _exceptionMessage = "data == null";
4004 goto exit;
4005 }
4006 if (offset < 0) {
4007 _exception = 1;
4008 _exceptionType = "java/lang/IllegalArgumentException";
4009 _exceptionMessage = "offset < 0";
4010 goto exit;
4011 }
4012 _remaining = _env->GetArrayLength(data_ref) - offset;
4013 data_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004014 _env->GetLongArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004015 data = data_base + offset;
4016
4017 glGetInteger64i_v(
4018 (GLenum)target,
4019 (GLuint)index,
4020 (GLint64 *)data
4021 );
4022
4023exit:
4024 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004025 _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07004026 _exception ? JNI_ABORT: 0);
4027 }
4028 if (_exception) {
4029 jniThrowException(_env, _exceptionType, _exceptionMessage);
4030 }
4031}
4032
4033/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4034static void
4035android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
4036 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004037 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004038 jint _bufferOffset = (jint) 0;
4039 jint _remaining;
4040 GLint64 *data = (GLint64 *) 0;
4041
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004042 data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004043 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004044 char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004045 data = (GLint64 *) (_dataBase + _bufferOffset);
4046 }
4047 glGetInteger64i_v(
4048 (GLenum)target,
4049 (GLuint)index,
4050 (GLint64 *)data
4051 );
4052 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004053 _env->ReleaseLongArrayElements(_array, (jlong*)data, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004054 }
4055}
4056
4057/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4058static void
4059android_glGetBufferParameteri64v__II_3JI
4060 (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
4061 jint _exception = 0;
4062 const char * _exceptionType = NULL;
4063 const char * _exceptionMessage = NULL;
4064 GLint64 *params_base = (GLint64 *) 0;
4065 jint _remaining;
4066 GLint64 *params = (GLint64 *) 0;
4067
4068 if (!params_ref) {
4069 _exception = 1;
4070 _exceptionType = "java/lang/IllegalArgumentException";
4071 _exceptionMessage = "params == null";
4072 goto exit;
4073 }
4074 if (offset < 0) {
4075 _exception = 1;
4076 _exceptionType = "java/lang/IllegalArgumentException";
4077 _exceptionMessage = "offset < 0";
4078 goto exit;
4079 }
4080 _remaining = _env->GetArrayLength(params_ref) - offset;
4081 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004082 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004083 params = params_base + offset;
4084
4085 glGetBufferParameteri64v(
4086 (GLenum)target,
4087 (GLenum)pname,
4088 (GLint64 *)params
4089 );
4090
4091exit:
4092 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004093 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004094 _exception ? JNI_ABORT: 0);
4095 }
4096 if (_exception) {
4097 jniThrowException(_env, _exceptionType, _exceptionMessage);
4098 }
4099}
4100
4101/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4102static void
4103android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
4104 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004105 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004106 jint _bufferOffset = (jint) 0;
4107 jint _remaining;
4108 GLint64 *params = (GLint64 *) 0;
4109
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004110 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004111 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004112 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004113 params = (GLint64 *) (_paramsBase + _bufferOffset);
4114 }
4115 glGetBufferParameteri64v(
4116 (GLenum)target,
4117 (GLenum)pname,
4118 (GLint64 *)params
4119 );
4120 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004121 _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004122 }
4123}
4124
4125/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4126static void
4127android_glGenSamplers__I_3II
4128 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4129 jint _exception = 0;
4130 const char * _exceptionType = NULL;
4131 const char * _exceptionMessage = NULL;
4132 GLuint *samplers_base = (GLuint *) 0;
4133 jint _remaining;
4134 GLuint *samplers = (GLuint *) 0;
4135
4136 if (!samplers_ref) {
4137 _exception = 1;
4138 _exceptionType = "java/lang/IllegalArgumentException";
4139 _exceptionMessage = "samplers == null";
4140 goto exit;
4141 }
4142 if (offset < 0) {
4143 _exception = 1;
4144 _exceptionType = "java/lang/IllegalArgumentException";
4145 _exceptionMessage = "offset < 0";
4146 goto exit;
4147 }
4148 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4149 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004150 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004151 samplers = samplers_base + offset;
4152
4153 glGenSamplers(
4154 (GLsizei)count,
4155 (GLuint *)samplers
4156 );
4157
4158exit:
4159 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004160 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004161 _exception ? JNI_ABORT: 0);
4162 }
4163 if (_exception) {
4164 jniThrowException(_env, _exceptionType, _exceptionMessage);
4165 }
4166}
4167
4168/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4169static void
4170android_glGenSamplers__ILjava_nio_IntBuffer_2
4171 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004172 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004173 jint _bufferOffset = (jint) 0;
4174 jint _remaining;
4175 GLuint *samplers = (GLuint *) 0;
4176
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004177 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004178 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004179 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004180 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4181 }
4182 glGenSamplers(
4183 (GLsizei)count,
4184 (GLuint *)samplers
4185 );
4186 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004187 _env->ReleaseIntArrayElements(_array, (jint*)samplers, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004188 }
4189}
4190
4191/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4192static void
4193android_glDeleteSamplers__I_3II
4194 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4195 jint _exception = 0;
4196 const char * _exceptionType = NULL;
4197 const char * _exceptionMessage = NULL;
4198 GLuint *samplers_base = (GLuint *) 0;
4199 jint _remaining;
4200 GLuint *samplers = (GLuint *) 0;
4201
4202 if (!samplers_ref) {
4203 _exception = 1;
4204 _exceptionType = "java/lang/IllegalArgumentException";
4205 _exceptionMessage = "samplers == null";
4206 goto exit;
4207 }
4208 if (offset < 0) {
4209 _exception = 1;
4210 _exceptionType = "java/lang/IllegalArgumentException";
4211 _exceptionMessage = "offset < 0";
4212 goto exit;
4213 }
4214 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4215 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004216 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004217 samplers = samplers_base + offset;
4218
4219 glDeleteSamplers(
4220 (GLsizei)count,
4221 (GLuint *)samplers
4222 );
4223
4224exit:
4225 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004226 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004227 JNI_ABORT);
4228 }
4229 if (_exception) {
4230 jniThrowException(_env, _exceptionType, _exceptionMessage);
4231 }
4232}
4233
4234/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4235static void
4236android_glDeleteSamplers__ILjava_nio_IntBuffer_2
4237 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004238 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004239 jint _bufferOffset = (jint) 0;
4240 jint _remaining;
4241 GLuint *samplers = (GLuint *) 0;
4242
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004243 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004244 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004245 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004246 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4247 }
4248 glDeleteSamplers(
4249 (GLsizei)count,
4250 (GLuint *)samplers
4251 );
4252 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004253 _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004254 }
4255}
4256
4257/* GLboolean glIsSampler ( GLuint sampler ) */
4258static jboolean
4259android_glIsSampler__I
4260 (JNIEnv *_env, jobject _this, jint sampler) {
4261 GLboolean _returnValue;
4262 _returnValue = glIsSampler(
4263 (GLuint)sampler
4264 );
4265 return (jboolean)_returnValue;
4266}
4267
4268/* void glBindSampler ( GLuint unit, GLuint sampler ) */
4269static void
4270android_glBindSampler__II
4271 (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
4272 glBindSampler(
4273 (GLuint)unit,
4274 (GLuint)sampler
4275 );
4276}
4277
4278/* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
4279static void
4280android_glSamplerParameteri__III
4281 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
4282 glSamplerParameteri(
4283 (GLuint)sampler,
4284 (GLenum)pname,
4285 (GLint)param
4286 );
4287}
4288
4289/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4290static void
4291android_glSamplerParameteriv__II_3II
4292 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
4293 jint _exception = 0;
4294 const char * _exceptionType = NULL;
4295 const char * _exceptionMessage = NULL;
4296 GLint *param_base = (GLint *) 0;
4297 jint _remaining;
4298 GLint *param = (GLint *) 0;
4299
4300 if (!param_ref) {
4301 _exception = 1;
4302 _exceptionType = "java/lang/IllegalArgumentException";
4303 _exceptionMessage = "param == null";
4304 goto exit;
4305 }
4306 if (offset < 0) {
4307 _exception = 1;
4308 _exceptionType = "java/lang/IllegalArgumentException";
4309 _exceptionMessage = "offset < 0";
4310 goto exit;
4311 }
4312 _remaining = _env->GetArrayLength(param_ref) - offset;
4313 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004314 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004315 param = param_base + offset;
4316
4317 glSamplerParameteriv(
4318 (GLuint)sampler,
4319 (GLenum)pname,
4320 (GLint *)param
4321 );
4322
4323exit:
4324 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004325 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004326 JNI_ABORT);
4327 }
4328 if (_exception) {
4329 jniThrowException(_env, _exceptionType, _exceptionMessage);
4330 }
4331}
4332
4333/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4334static void
4335android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
4336 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004337 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004338 jint _bufferOffset = (jint) 0;
4339 jint _remaining;
4340 GLint *param = (GLint *) 0;
4341
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004342 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004343 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004344 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004345 param = (GLint *) (_paramBase + _bufferOffset);
4346 }
4347 glSamplerParameteriv(
4348 (GLuint)sampler,
4349 (GLenum)pname,
4350 (GLint *)param
4351 );
4352 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004353 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004354 }
4355}
4356
4357/* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
4358static void
4359android_glSamplerParameterf__IIF
4360 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
4361 glSamplerParameterf(
4362 (GLuint)sampler,
4363 (GLenum)pname,
4364 (GLfloat)param
4365 );
4366}
4367
4368/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4369static void
4370android_glSamplerParameterfv__II_3FI
4371 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
4372 jint _exception = 0;
4373 const char * _exceptionType = NULL;
4374 const char * _exceptionMessage = NULL;
4375 GLfloat *param_base = (GLfloat *) 0;
4376 jint _remaining;
4377 GLfloat *param = (GLfloat *) 0;
4378
4379 if (!param_ref) {
4380 _exception = 1;
4381 _exceptionType = "java/lang/IllegalArgumentException";
4382 _exceptionMessage = "param == null";
4383 goto exit;
4384 }
4385 if (offset < 0) {
4386 _exception = 1;
4387 _exceptionType = "java/lang/IllegalArgumentException";
4388 _exceptionMessage = "offset < 0";
4389 goto exit;
4390 }
4391 _remaining = _env->GetArrayLength(param_ref) - offset;
4392 param_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004393 _env->GetFloatArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004394 param = param_base + offset;
4395
4396 glSamplerParameterfv(
4397 (GLuint)sampler,
4398 (GLenum)pname,
4399 (GLfloat *)param
4400 );
4401
4402exit:
4403 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004404 _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004405 JNI_ABORT);
4406 }
4407 if (_exception) {
4408 jniThrowException(_env, _exceptionType, _exceptionMessage);
4409 }
4410}
4411
4412/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4413static void
4414android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
4415 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004416 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004417 jint _bufferOffset = (jint) 0;
4418 jint _remaining;
4419 GLfloat *param = (GLfloat *) 0;
4420
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004421 param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004422 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004423 char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004424 param = (GLfloat *) (_paramBase + _bufferOffset);
4425 }
4426 glSamplerParameterfv(
4427 (GLuint)sampler,
4428 (GLenum)pname,
4429 (GLfloat *)param
4430 );
4431 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004432 _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004433 }
4434}
4435
4436/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
4437static void
4438android_glGetSamplerParameteriv__II_3II
4439 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
4440 jint _exception = 0;
4441 const char * _exceptionType = NULL;
4442 const char * _exceptionMessage = NULL;
4443 GLint *params_base = (GLint *) 0;
4444 jint _remaining;
4445 GLint *params = (GLint *) 0;
4446
4447 if (!params_ref) {
4448 _exception = 1;
4449 _exceptionType = "java/lang/IllegalArgumentException";
4450 _exceptionMessage = "params == null";
4451 goto exit;
4452 }
4453 if (offset < 0) {
4454 _exception = 1;
4455 _exceptionType = "java/lang/IllegalArgumentException";
4456 _exceptionMessage = "offset < 0";
4457 goto exit;
4458 }
4459 _remaining = _env->GetArrayLength(params_ref) - offset;
4460 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004461 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004462 params = params_base + offset;
4463
4464 glGetSamplerParameteriv(
4465 (GLuint)sampler,
4466 (GLenum)pname,
4467 (GLint *)params
4468 );
4469
4470exit:
4471 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004472 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004473 _exception ? JNI_ABORT: 0);
4474 }
4475 if (_exception) {
4476 jniThrowException(_env, _exceptionType, _exceptionMessage);
4477 }
4478}
4479
4480/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
4481static void
4482android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
4483 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004484 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004485 jint _bufferOffset = (jint) 0;
4486 jint _remaining;
4487 GLint *params = (GLint *) 0;
4488
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004489 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004490 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004491 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004492 params = (GLint *) (_paramsBase + _bufferOffset);
4493 }
4494 glGetSamplerParameteriv(
4495 (GLuint)sampler,
4496 (GLenum)pname,
4497 (GLint *)params
4498 );
4499 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004500 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004501 }
4502}
4503
4504/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
4505static void
4506android_glGetSamplerParameterfv__II_3FI
4507 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
4508 jint _exception = 0;
4509 const char * _exceptionType = NULL;
4510 const char * _exceptionMessage = NULL;
4511 GLfloat *params_base = (GLfloat *) 0;
4512 jint _remaining;
4513 GLfloat *params = (GLfloat *) 0;
4514
4515 if (!params_ref) {
4516 _exception = 1;
4517 _exceptionType = "java/lang/IllegalArgumentException";
4518 _exceptionMessage = "params == null";
4519 goto exit;
4520 }
4521 if (offset < 0) {
4522 _exception = 1;
4523 _exceptionType = "java/lang/IllegalArgumentException";
4524 _exceptionMessage = "offset < 0";
4525 goto exit;
4526 }
4527 _remaining = _env->GetArrayLength(params_ref) - offset;
4528 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004529 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004530 params = params_base + offset;
4531
4532 glGetSamplerParameterfv(
4533 (GLuint)sampler,
4534 (GLenum)pname,
4535 (GLfloat *)params
4536 );
4537
4538exit:
4539 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004540 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004541 _exception ? JNI_ABORT: 0);
4542 }
4543 if (_exception) {
4544 jniThrowException(_env, _exceptionType, _exceptionMessage);
4545 }
4546}
4547
4548/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
4549static void
4550android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
4551 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004552 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004553 jint _bufferOffset = (jint) 0;
4554 jint _remaining;
4555 GLfloat *params = (GLfloat *) 0;
4556
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004557 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004558 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004559 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004560 params = (GLfloat *) (_paramsBase + _bufferOffset);
4561 }
4562 glGetSamplerParameterfv(
4563 (GLuint)sampler,
4564 (GLenum)pname,
4565 (GLfloat *)params
4566 );
4567 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004568 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004569 }
4570}
4571
4572/* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
4573static void
4574android_glVertexAttribDivisor__II
4575 (JNIEnv *_env, jobject _this, jint index, jint divisor) {
4576 glVertexAttribDivisor(
4577 (GLuint)index,
4578 (GLuint)divisor
4579 );
4580}
4581
4582/* void glBindTransformFeedback ( GLenum target, GLuint id ) */
4583static void
4584android_glBindTransformFeedback__II
4585 (JNIEnv *_env, jobject _this, jint target, jint id) {
4586 glBindTransformFeedback(
4587 (GLenum)target,
4588 (GLuint)id
4589 );
4590}
4591
4592/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
4593static void
4594android_glDeleteTransformFeedbacks__I_3II
4595 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
4596 jint _exception = 0;
4597 const char * _exceptionType = NULL;
4598 const char * _exceptionMessage = NULL;
4599 GLuint *ids_base = (GLuint *) 0;
4600 jint _remaining;
4601 GLuint *ids = (GLuint *) 0;
4602
4603 if (!ids_ref) {
4604 _exception = 1;
4605 _exceptionType = "java/lang/IllegalArgumentException";
4606 _exceptionMessage = "ids == null";
4607 goto exit;
4608 }
4609 if (offset < 0) {
4610 _exception = 1;
4611 _exceptionType = "java/lang/IllegalArgumentException";
4612 _exceptionMessage = "offset < 0";
4613 goto exit;
4614 }
4615 _remaining = _env->GetArrayLength(ids_ref) - offset;
4616 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004617 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004618 ids = ids_base + offset;
4619
4620 glDeleteTransformFeedbacks(
4621 (GLsizei)n,
4622 (GLuint *)ids
4623 );
4624
4625exit:
4626 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004627 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07004628 JNI_ABORT);
4629 }
4630 if (_exception) {
4631 jniThrowException(_env, _exceptionType, _exceptionMessage);
4632 }
4633}
4634
4635/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
4636static void
4637android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
4638 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004639 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004640 jint _bufferOffset = (jint) 0;
4641 jint _remaining;
4642 GLuint *ids = (GLuint *) 0;
4643
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004644 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004645 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004646 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004647 ids = (GLuint *) (_idsBase + _bufferOffset);
4648 }
4649 glDeleteTransformFeedbacks(
4650 (GLsizei)n,
4651 (GLuint *)ids
4652 );
4653 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004654 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004655 }
4656}
4657
4658/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
4659static void
4660android_glGenTransformFeedbacks__I_3II
4661 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
4662 jint _exception = 0;
4663 const char * _exceptionType = NULL;
4664 const char * _exceptionMessage = NULL;
4665 GLuint *ids_base = (GLuint *) 0;
4666 jint _remaining;
4667 GLuint *ids = (GLuint *) 0;
4668
4669 if (!ids_ref) {
4670 _exception = 1;
4671 _exceptionType = "java/lang/IllegalArgumentException";
4672 _exceptionMessage = "ids == null";
4673 goto exit;
4674 }
4675 if (offset < 0) {
4676 _exception = 1;
4677 _exceptionType = "java/lang/IllegalArgumentException";
4678 _exceptionMessage = "offset < 0";
4679 goto exit;
4680 }
4681 _remaining = _env->GetArrayLength(ids_ref) - offset;
4682 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004683 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004684 ids = ids_base + offset;
4685
4686 glGenTransformFeedbacks(
4687 (GLsizei)n,
4688 (GLuint *)ids
4689 );
4690
4691exit:
4692 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004693 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07004694 _exception ? JNI_ABORT: 0);
4695 }
4696 if (_exception) {
4697 jniThrowException(_env, _exceptionType, _exceptionMessage);
4698 }
4699}
4700
4701/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
4702static void
4703android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
4704 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004705 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004706 jint _bufferOffset = (jint) 0;
4707 jint _remaining;
4708 GLuint *ids = (GLuint *) 0;
4709
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004710 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004711 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004712 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004713 ids = (GLuint *) (_idsBase + _bufferOffset);
4714 }
4715 glGenTransformFeedbacks(
4716 (GLsizei)n,
4717 (GLuint *)ids
4718 );
4719 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004720 _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004721 }
4722}
4723
4724/* GLboolean glIsTransformFeedback ( GLuint id ) */
4725static jboolean
4726android_glIsTransformFeedback__I
4727 (JNIEnv *_env, jobject _this, jint id) {
4728 GLboolean _returnValue;
4729 _returnValue = glIsTransformFeedback(
4730 (GLuint)id
4731 );
4732 return (jboolean)_returnValue;
4733}
4734
4735/* void glPauseTransformFeedback ( void ) */
4736static void
4737android_glPauseTransformFeedback__
4738 (JNIEnv *_env, jobject _this) {
4739 glPauseTransformFeedback();
4740}
4741
4742/* void glResumeTransformFeedback ( void ) */
4743static void
4744android_glResumeTransformFeedback__
4745 (JNIEnv *_env, jobject _this) {
4746 glResumeTransformFeedback();
4747}
4748
4749/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
4750static void
4751android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
4752 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
4753 jint _exception = 0;
4754 const char * _exceptionType = NULL;
4755 const char * _exceptionMessage = NULL;
4756 jarray _array = (jarray) 0;
4757 jint _bufferOffset = (jint) 0;
4758 GLsizei *length_base = (GLsizei *) 0;
4759 jint _lengthRemaining;
4760 GLsizei *length = (GLsizei *) 0;
4761 GLenum *binaryFormat_base = (GLenum *) 0;
4762 jint _binaryFormatRemaining;
4763 GLenum *binaryFormat = (GLenum *) 0;
4764 jint _binaryRemaining;
4765 GLvoid *binary = (GLvoid *) 0;
4766
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004767 if (length_ref) {
4768 if (lengthOffset < 0) {
4769 _exception = 1;
4770 _exceptionType = "java/lang/IllegalArgumentException";
4771 _exceptionMessage = "lengthOffset < 0";
4772 goto exit;
4773 }
4774 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4775 length_base = (GLsizei *)
4776 _env->GetIntArrayElements(length_ref, (jboolean *)0);
4777 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004778 }
Jesse Halld830e742013-03-29 11:02:35 -07004779
4780 if (!binaryFormat_ref) {
4781 _exception = 1;
4782 _exceptionType = "java/lang/IllegalArgumentException";
4783 _exceptionMessage = "binaryFormat == null";
4784 goto exit;
4785 }
4786 if (binaryFormatOffset < 0) {
4787 _exception = 1;
4788 _exceptionType = "java/lang/IllegalArgumentException";
4789 _exceptionMessage = "binaryFormatOffset < 0";
4790 goto exit;
4791 }
4792 _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
4793 binaryFormat_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004794 _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004795 binaryFormat = binaryFormat_base + binaryFormatOffset;
4796
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004797 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004798 if (binary == NULL) {
4799 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4800 binary = (GLvoid *) (_binaryBase + _bufferOffset);
4801 }
4802 glGetProgramBinary(
4803 (GLuint)program,
4804 (GLsizei)bufSize,
4805 (GLsizei *)length,
4806 (GLenum *)binaryFormat,
4807 (GLvoid *)binary
4808 );
4809
4810exit:
4811 if (_array) {
4812 releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
4813 }
4814 if (binaryFormat_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004815 _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
Jesse Halld830e742013-03-29 11:02:35 -07004816 _exception ? JNI_ABORT: 0);
4817 }
4818 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004819 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004820 _exception ? JNI_ABORT: 0);
4821 }
4822 if (_exception) {
4823 jniThrowException(_env, _exceptionType, _exceptionMessage);
4824 }
4825}
4826
4827/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
4828static void
4829android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
4830 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004831 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004832 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004833 jintArray _binaryFormatArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004834 jint _binaryFormatBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004835 jintArray _binaryArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004836 jint _binaryBufferOffset = (jint) 0;
4837 jint _lengthRemaining;
4838 GLsizei *length = (GLsizei *) 0;
4839 jint _binaryFormatRemaining;
4840 GLenum *binaryFormat = (GLenum *) 0;
4841 jint _binaryRemaining;
4842 GLvoid *binary = (GLvoid *) 0;
4843
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004844 if (length_buf) {
4845 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4846 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004847 binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
4848 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004849 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004850 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004851 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
4852 }
4853 if (binaryFormat == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004854 char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004855 binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
4856 }
4857 if (binary == NULL) {
4858 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
4859 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
4860 }
4861 glGetProgramBinary(
4862 (GLuint)program,
4863 (GLsizei)bufSize,
4864 (GLsizei *)length,
4865 (GLenum *)binaryFormat,
4866 (GLvoid *)binary
4867 );
4868 if (_binaryArray) {
4869 releasePointer(_env, _binaryArray, binary, JNI_TRUE);
4870 }
4871 if (_binaryFormatArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004872 _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004873 }
4874 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004875 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004876 }
4877}
4878
4879/* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
4880static void
4881android_glProgramBinary__IILjava_nio_Buffer_2I
4882 (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
4883 jarray _array = (jarray) 0;
4884 jint _bufferOffset = (jint) 0;
4885 jint _remaining;
4886 GLvoid *binary = (GLvoid *) 0;
4887
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004888 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004889 if (binary == NULL) {
4890 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4891 binary = (GLvoid *) (_binaryBase + _bufferOffset);
4892 }
4893 glProgramBinary(
4894 (GLuint)program,
4895 (GLenum)binaryFormat,
4896 (GLvoid *)binary,
4897 (GLsizei)length
4898 );
4899 if (_array) {
4900 releasePointer(_env, _array, binary, JNI_FALSE);
4901 }
4902}
4903
4904/* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
4905static void
4906android_glProgramParameteri__III
4907 (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
4908 glProgramParameteri(
4909 (GLuint)program,
4910 (GLenum)pname,
4911 (GLint)value
4912 );
4913}
4914
4915/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
4916static void
4917android_glInvalidateFramebuffer__II_3II
4918 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
4919 jint _exception = 0;
4920 const char * _exceptionType = NULL;
4921 const char * _exceptionMessage = NULL;
4922 GLenum *attachments_base = (GLenum *) 0;
4923 jint _remaining;
4924 GLenum *attachments = (GLenum *) 0;
4925
4926 if (!attachments_ref) {
4927 _exception = 1;
4928 _exceptionType = "java/lang/IllegalArgumentException";
4929 _exceptionMessage = "attachments == null";
4930 goto exit;
4931 }
4932 if (offset < 0) {
4933 _exception = 1;
4934 _exceptionType = "java/lang/IllegalArgumentException";
4935 _exceptionMessage = "offset < 0";
4936 goto exit;
4937 }
4938 _remaining = _env->GetArrayLength(attachments_ref) - offset;
4939 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004940 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004941 attachments = attachments_base + offset;
4942
4943 glInvalidateFramebuffer(
4944 (GLenum)target,
4945 (GLsizei)numAttachments,
4946 (GLenum *)attachments
4947 );
4948
4949exit:
4950 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004951 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07004952 JNI_ABORT);
4953 }
4954 if (_exception) {
4955 jniThrowException(_env, _exceptionType, _exceptionMessage);
4956 }
4957}
4958
4959/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
4960static void
4961android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
4962 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004963 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004964 jint _bufferOffset = (jint) 0;
4965 jint _remaining;
4966 GLenum *attachments = (GLenum *) 0;
4967
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004968 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004969 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004970 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004971 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
4972 }
4973 glInvalidateFramebuffer(
4974 (GLenum)target,
4975 (GLsizei)numAttachments,
4976 (GLenum *)attachments
4977 );
4978 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004979 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004980 }
4981}
4982
4983/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
4984static void
4985android_glInvalidateSubFramebuffer__II_3IIIIII
4986 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
4987 jint _exception = 0;
4988 const char * _exceptionType = NULL;
4989 const char * _exceptionMessage = NULL;
4990 GLenum *attachments_base = (GLenum *) 0;
4991 jint _remaining;
4992 GLenum *attachments = (GLenum *) 0;
4993
4994 if (!attachments_ref) {
4995 _exception = 1;
4996 _exceptionType = "java/lang/IllegalArgumentException";
4997 _exceptionMessage = "attachments == null";
4998 goto exit;
4999 }
5000 if (offset < 0) {
5001 _exception = 1;
5002 _exceptionType = "java/lang/IllegalArgumentException";
5003 _exceptionMessage = "offset < 0";
5004 goto exit;
5005 }
5006 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5007 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005008 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005009 attachments = attachments_base + offset;
5010
5011 glInvalidateSubFramebuffer(
5012 (GLenum)target,
5013 (GLsizei)numAttachments,
5014 (GLenum *)attachments,
5015 (GLint)x,
5016 (GLint)y,
5017 (GLsizei)width,
5018 (GLsizei)height
5019 );
5020
5021exit:
5022 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005023 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005024 JNI_ABORT);
5025 }
5026 if (_exception) {
5027 jniThrowException(_env, _exceptionType, _exceptionMessage);
5028 }
5029}
5030
5031/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5032static void
5033android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
5034 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf, jint x, jint y, jint width, jint height) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005035 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005036 jint _bufferOffset = (jint) 0;
5037 jint _remaining;
5038 GLenum *attachments = (GLenum *) 0;
5039
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005040 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005041 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005042 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005043 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5044 }
5045 glInvalidateSubFramebuffer(
5046 (GLenum)target,
5047 (GLsizei)numAttachments,
5048 (GLenum *)attachments,
5049 (GLint)x,
5050 (GLint)y,
5051 (GLsizei)width,
5052 (GLsizei)height
5053 );
5054 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005055 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005056 }
5057}
5058
5059/* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
5060static void
5061android_glTexStorage2D__IIIII
5062 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
5063 glTexStorage2D(
5064 (GLenum)target,
5065 (GLsizei)levels,
5066 (GLenum)internalformat,
5067 (GLsizei)width,
5068 (GLsizei)height
5069 );
5070}
5071
5072/* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
5073static void
5074android_glTexStorage3D__IIIIII
5075 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
5076 glTexStorage3D(
5077 (GLenum)target,
5078 (GLsizei)levels,
5079 (GLenum)internalformat,
5080 (GLsizei)width,
5081 (GLsizei)height,
5082 (GLsizei)depth
5083 );
5084}
5085
5086/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5087static void
5088android_glGetInternalformativ__IIII_3II
5089 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
5090 jint _exception = 0;
5091 const char * _exceptionType = NULL;
5092 const char * _exceptionMessage = NULL;
5093 GLint *params_base = (GLint *) 0;
5094 jint _remaining;
5095 GLint *params = (GLint *) 0;
5096
5097 if (!params_ref) {
5098 _exception = 1;
5099 _exceptionType = "java/lang/IllegalArgumentException";
5100 _exceptionMessage = "params == null";
5101 goto exit;
5102 }
5103 if (offset < 0) {
5104 _exception = 1;
5105 _exceptionType = "java/lang/IllegalArgumentException";
5106 _exceptionMessage = "offset < 0";
5107 goto exit;
5108 }
5109 _remaining = _env->GetArrayLength(params_ref) - offset;
5110 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005111 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005112 params = params_base + offset;
5113
5114 glGetInternalformativ(
5115 (GLenum)target,
5116 (GLenum)internalformat,
5117 (GLenum)pname,
5118 (GLsizei)bufSize,
5119 (GLint *)params
5120 );
5121
5122exit:
5123 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005124 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005125 _exception ? JNI_ABORT: 0);
5126 }
5127 if (_exception) {
5128 jniThrowException(_env, _exceptionType, _exceptionMessage);
5129 }
5130}
5131
5132/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5133static void
5134android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
5135 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005136 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005137 jint _bufferOffset = (jint) 0;
5138 jint _remaining;
5139 GLint *params = (GLint *) 0;
5140
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005141 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005142 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005143 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005144 params = (GLint *) (_paramsBase + _bufferOffset);
5145 }
5146 glGetInternalformativ(
5147 (GLenum)target,
5148 (GLenum)internalformat,
5149 (GLenum)pname,
5150 (GLsizei)bufSize,
5151 (GLint *)params
5152 );
5153 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005154 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07005155 }
5156}
5157
Pablo Ceballos68981ff2016-02-22 11:50:31 -08005158/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
5159static void
5160android_glReadPixels__IIIIIII
5161 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
5162 glReadPixels(
5163 (GLint)x,
5164 (GLint)y,
5165 (GLsizei)width,
5166 (GLsizei)height,
5167 (GLenum)format,
5168 (GLenum)type,
5169 reinterpret_cast<GLvoid *>(offset)
5170 );
5171}
5172
Jesse Halld830e742013-03-29 11:02:35 -07005173static const char *classPathName = "android/opengl/GLES30";
5174
Daniel Micay76f6a862015-09-19 17:31:01 -04005175static const JNINativeMethod methods[] = {
Jesse Halld830e742013-03-29 11:02:35 -07005176{"_nativeClassInit", "()V", (void*)nativeClassInit },
5177{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
5178{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
5179{"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
5180{"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
5181{"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
5182{"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5183{"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
5184{"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
5185{"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
5186{"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
5187{"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5188{"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
5189{"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
5190{"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
5191{"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
5192{"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
5193{"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
5194{"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
5195{"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
5196{"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
5197{"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
5198{"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
5199{"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
5200{"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
5201{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
5202{"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
5203{"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
5204{"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
5205{"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
5206{"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
5207{"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
5208{"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
5209{"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
5210{"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
5211{"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
5212{"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
5213{"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
5214{"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
5215{"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
5216{"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
5217{"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
5218{"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
5219{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
5220{"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
5221{"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
5222{"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
5223{"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
5224{"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
5225{"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
5226{"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
5227{"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
5228{"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
5229{"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
5230{"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
5231{"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
5232{"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
5233{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
5234{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
5235{"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 },
5236{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
5237{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
5238{"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
5239{"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
5240{"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
5241{"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
5242{"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
5243{"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
5244{"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
5245{"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
5246{"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
5247{"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
5248{"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
5249{"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
5250{"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
5251{"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
5252{"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
5253{"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
5254{"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
5255{"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
5256{"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
5257{"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
5258{"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
5259{"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
5260{"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
5261{"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
5262{"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
5263{"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
5264{"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
5265{"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
5266{"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
5267{"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
5268{"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
5269{"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
5270{"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
5271{"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
5272{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
5273{"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
5274{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
Jesse Halld877efe2013-04-29 15:59:35 -07005275{"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
Jesse Halld830e742013-03-29 11:02:35 -07005276{"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
5277{"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
5278{"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
5279{"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
5280{"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
5281{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
5282{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
5283{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
5284{"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
5285{"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
5286{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
5287{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
5288{"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
5289{"glIsSync", "(J)Z", (void *) android_glIsSync__J },
5290{"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
5291{"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
5292{"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
5293{"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
5294{"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
5295{"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
5296{"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
5297{"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
5298{"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
5299{"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
5300{"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
5301{"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
5302{"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
5303{"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
5304{"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
5305{"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
5306{"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
5307{"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
5308{"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
5309{"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
5310{"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
5311{"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
5312{"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
5313{"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
5314{"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
5315{"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
5316{"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
5317{"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
5318{"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
5319{"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
5320{"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
5321{"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
5322{"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
5323{"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
5324{"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
5325{"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
5326{"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
5327{"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
5328{"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
5329{"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
5330{"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
5331{"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
5332{"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
5333{"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
5334{"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
5335{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
5336{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
5337{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
Pablo Ceballos68981ff2016-02-22 11:50:31 -08005338{"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
Jesse Halld830e742013-03-29 11:02:35 -07005339};
5340
5341int register_android_opengl_jni_GLES30(JNIEnv *_env)
5342{
5343 int err;
5344 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
5345 return err;
5346}