blob: 783baef2952ad1d1ceb2f519ee864232dc2f00f3 [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) {
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002015 jniThrowException(_env, "java/lang/UnsupportedOperationException", "deprecated");
2016}
2017
2018/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2019static void
2020android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
2021 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jobject name_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002022 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002023 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002024 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002025 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002026 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002027 jint _typeBufferOffset = (jint) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002028 jbyteArray _nameArray = (jbyteArray)0;
2029 jint _nameBufferOffset = (jint)0;
Jesse Halld830e742013-03-29 11:02:35 -07002030 jint _lengthRemaining;
2031 GLsizei *length = (GLsizei *) 0;
2032 jint _sizeRemaining;
2033 GLint *size = (GLint *) 0;
2034 jint _typeRemaining;
2035 GLenum *type = (GLenum *) 0;
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002036 jint _nameRemaining;
2037 GLchar* name = (GLchar*)0;
2038
Jesse Halld830e742013-03-29 11:02:35 -07002039
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002040 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
2041 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2042 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002043 name = (GLchar*)getPointer(_env, name_buf, (jarray*)&_nameArray, &_nameRemaining, &_nameBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002044 if (length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002045 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002046 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
2047 }
2048 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002049 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002050 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2051 }
2052 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002053 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002054 type = (GLenum *) (_typeBase + _typeBufferOffset);
2055 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002056 if (name == NULL) {
2057 char* _nameBase = (char *)_env->GetByteArrayElements(_nameArray, (jboolean*)0);
2058 name = (GLchar *) (_nameBase + _nameBufferOffset);
2059 }
Jesse Halld830e742013-03-29 11:02:35 -07002060 glGetTransformFeedbackVarying(
2061 (GLuint)program,
2062 (GLuint)index,
2063 (GLsizei)bufsize,
2064 (GLsizei *)length,
2065 (GLint *)size,
2066 (GLenum *)type,
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002067 (GLchar*)name
Jesse Halld830e742013-03-29 11:02:35 -07002068 );
2069 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002070 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002071 }
2072 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002073 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002074 }
2075 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002076 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002077 }
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08002078 if (_nameArray) {
2079 releaseArrayPointer<jbyteArray, jbyte*, ByteArrayReleaser>(_env, _nameArray, (jbyte*)name, JNI_TRUE);
2080 }
Jesse Halld830e742013-03-29 11:02:35 -07002081}
2082
2083/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2084static jstring
2085android_glGetTransformFeedbackVarying1
2086 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
2087 jint _exception = 0;
2088 const char * _exceptionType;
2089 const char * _exceptionMessage;
2090 GLint *size_base = (GLint *) 0;
2091 jint _sizeRemaining;
2092 GLint *size = (GLint *) 0;
2093 GLenum *type_base = (GLenum *) 0;
2094 jint _typeRemaining;
2095 GLenum *type = (GLenum *) 0;
2096
2097 jstring result = 0;
2098
2099 GLint len = 0;
2100 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2101 if (!len) {
2102 return _env->NewStringUTF("");
2103 }
2104 char* buf = (char*) malloc(len);
2105
2106 if (buf == NULL) {
2107 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2108 return NULL;
2109 }
2110 if (!size_ref) {
2111 _exception = 1;
2112 _exceptionType = "java/lang/IllegalArgumentException";
2113 _exceptionMessage = "size == null";
2114 goto exit;
2115 }
2116 if (sizeOffset < 0) {
2117 _exception = 1;
2118 _exceptionType = "java/lang/IllegalArgumentException";
2119 _exceptionMessage = "sizeOffset < 0";
2120 goto exit;
2121 }
2122 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
2123 size_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002124 _env->GetIntArrayElements(size_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002125 size = size_base + sizeOffset;
2126
2127 if (!type_ref) {
2128 _exception = 1;
2129 _exceptionType = "java/lang/IllegalArgumentException";
2130 _exceptionMessage = "type == null";
2131 goto exit;
2132 }
2133 if (typeOffset < 0) {
2134 _exception = 1;
2135 _exceptionType = "java/lang/IllegalArgumentException";
2136 _exceptionMessage = "typeOffset < 0";
2137 goto exit;
2138 }
2139 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
2140 type_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002141 _env->GetIntArrayElements(type_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002142 type = type_base + typeOffset;
2143
2144 glGetTransformFeedbackVarying(
2145 (GLuint)program,
2146 (GLuint)index,
2147 (GLsizei)len,
2148 NULL,
2149 (GLint *)size,
2150 (GLenum *)type,
2151 (char *)buf
2152 );
2153exit:
2154 if (type_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002155 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
Jesse Halld830e742013-03-29 11:02:35 -07002156 _exception ? JNI_ABORT: 0);
2157 }
2158 if (size_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002159 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
Jesse Halld830e742013-03-29 11:02:35 -07002160 _exception ? JNI_ABORT: 0);
2161 }
2162 if (_exception != 1) {
2163 result = _env->NewStringUTF(buf);
2164 }
2165 if (buf) {
2166 free(buf);
2167 }
2168 if (_exception) {
2169 jniThrowException(_env, _exceptionType, _exceptionMessage);
2170 }
2171 if (result == 0) {
2172 result = _env->NewStringUTF("");
2173 }
2174
2175 return result;
2176}
2177
2178/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
2179static jstring
2180android_glGetTransformFeedbackVarying2
2181 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002182 jintArray _sizeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002183 jint _sizeBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002184 jintArray _typeArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002185 jint _typeBufferOffset = (jint) 0;
2186 jint _lengthRemaining;
2187 GLsizei *length = (GLsizei *) 0;
2188 jint _sizeRemaining;
2189 GLint *size = (GLint *) 0;
2190 jint _typeRemaining;
2191 GLenum *type = (GLenum *) 0;
2192
2193 jstring result = 0;
2194
2195 GLint len = 0;
2196 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
2197 if (!len) {
2198 return _env->NewStringUTF("");
2199 }
2200 char* buf = (char*) malloc(len);
2201
2202 if (buf == NULL) {
2203 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
2204 return NULL;
2205 }
2206
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002207 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
2208 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002209 if (size == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002210 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002211 size = (GLint *) (_sizeBase + _sizeBufferOffset);
2212 }
2213 if (type == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002214 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002215 type = (GLenum *) (_typeBase + _typeBufferOffset);
2216 }
2217 glGetTransformFeedbackVarying(
2218 (GLuint)program,
2219 (GLuint)index,
2220 (GLsizei)len,
2221 NULL,
2222 (GLint *)size,
2223 (GLenum *)type,
2224 (char *)buf
2225 );
2226
2227 if (_typeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002228 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002229 }
2230 if (_sizeArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002231 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07002232 }
2233 result = _env->NewStringUTF(buf);
2234 if (buf) {
2235 free(buf);
2236 }
2237 return result;
2238}
2239/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2240static void
2241android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
2242 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2243 jarray _array = (jarray) 0;
2244 jint _bufferOffset = (jint) 0;
2245 jint _remaining;
2246 GLvoid *pointer = (GLvoid *) 0;
2247
2248 if (pointer_buf) {
2249 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2250 if ( ! pointer ) {
2251 return;
2252 }
2253 }
2254 glVertexAttribIPointerBounds(
2255 (GLuint)index,
2256 (GLint)size,
2257 (GLenum)type,
2258 (GLsizei)stride,
2259 (GLvoid *)pointer,
2260 (GLsizei)remaining
2261 );
2262}
2263
2264/* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
2265static void
2266android_glVertexAttribIPointer__IIIII
2267 (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
2268 glVertexAttribIPointer(
2269 (GLuint)index,
2270 (GLint)size,
2271 (GLenum)type,
2272 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00002273 reinterpret_cast<GLvoid *>(offset)
Jesse Halld830e742013-03-29 11:02:35 -07002274 );
2275}
2276
2277/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2278static void
2279android_glGetVertexAttribIiv__II_3II
2280 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2281 jint _exception = 0;
2282 const char * _exceptionType = NULL;
2283 const char * _exceptionMessage = NULL;
2284 GLint *params_base = (GLint *) 0;
2285 jint _remaining;
2286 GLint *params = (GLint *) 0;
2287
2288 if (!params_ref) {
2289 _exception = 1;
2290 _exceptionType = "java/lang/IllegalArgumentException";
2291 _exceptionMessage = "params == null";
2292 goto exit;
2293 }
2294 if (offset < 0) {
2295 _exception = 1;
2296 _exceptionType = "java/lang/IllegalArgumentException";
2297 _exceptionMessage = "offset < 0";
2298 goto exit;
2299 }
2300 _remaining = _env->GetArrayLength(params_ref) - offset;
2301 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002302 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002303 params = params_base + offset;
2304
2305 glGetVertexAttribIiv(
2306 (GLuint)index,
2307 (GLenum)pname,
2308 (GLint *)params
2309 );
2310
2311exit:
2312 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002313 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002314 _exception ? JNI_ABORT: 0);
2315 }
2316 if (_exception) {
2317 jniThrowException(_env, _exceptionType, _exceptionMessage);
2318 }
2319}
2320
2321/* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
2322static void
2323android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
2324 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002325 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002326 jint _bufferOffset = (jint) 0;
2327 jint _remaining;
2328 GLint *params = (GLint *) 0;
2329
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002330 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002331 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002332 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002333 params = (GLint *) (_paramsBase + _bufferOffset);
2334 }
2335 glGetVertexAttribIiv(
2336 (GLuint)index,
2337 (GLenum)pname,
2338 (GLint *)params
2339 );
2340 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002341 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002342 }
2343}
2344
2345/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2346static void
2347android_glGetVertexAttribIuiv__II_3II
2348 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
2349 jint _exception = 0;
2350 const char * _exceptionType = NULL;
2351 const char * _exceptionMessage = NULL;
2352 GLuint *params_base = (GLuint *) 0;
2353 jint _remaining;
2354 GLuint *params = (GLuint *) 0;
2355
2356 if (!params_ref) {
2357 _exception = 1;
2358 _exceptionType = "java/lang/IllegalArgumentException";
2359 _exceptionMessage = "params == null";
2360 goto exit;
2361 }
2362 if (offset < 0) {
2363 _exception = 1;
2364 _exceptionType = "java/lang/IllegalArgumentException";
2365 _exceptionMessage = "offset < 0";
2366 goto exit;
2367 }
2368 _remaining = _env->GetArrayLength(params_ref) - offset;
2369 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002370 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002371 params = params_base + offset;
2372
2373 glGetVertexAttribIuiv(
2374 (GLuint)index,
2375 (GLenum)pname,
2376 (GLuint *)params
2377 );
2378
2379exit:
2380 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002381 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002382 _exception ? JNI_ABORT: 0);
2383 }
2384 if (_exception) {
2385 jniThrowException(_env, _exceptionType, _exceptionMessage);
2386 }
2387}
2388
2389/* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
2390static void
2391android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
2392 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002393 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002394 jint _bufferOffset = (jint) 0;
2395 jint _remaining;
2396 GLuint *params = (GLuint *) 0;
2397
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002398 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002399 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002400 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002401 params = (GLuint *) (_paramsBase + _bufferOffset);
2402 }
2403 glGetVertexAttribIuiv(
2404 (GLuint)index,
2405 (GLenum)pname,
2406 (GLuint *)params
2407 );
2408 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002409 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002410 }
2411}
2412
2413/* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
2414static void
2415android_glVertexAttribI4i__IIIII
2416 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2417 glVertexAttribI4i(
2418 (GLuint)index,
2419 (GLint)x,
2420 (GLint)y,
2421 (GLint)z,
2422 (GLint)w
2423 );
2424}
2425
2426/* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
2427static void
2428android_glVertexAttribI4ui__IIIII
2429 (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
2430 glVertexAttribI4ui(
2431 (GLuint)index,
2432 (GLuint)x,
2433 (GLuint)y,
2434 (GLuint)z,
2435 (GLuint)w
2436 );
2437}
2438
2439/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2440static void
2441android_glVertexAttribI4iv__I_3II
2442 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2443 jint _exception = 0;
2444 const char * _exceptionType = NULL;
2445 const char * _exceptionMessage = NULL;
2446 GLint *v_base = (GLint *) 0;
2447 jint _remaining;
2448 GLint *v = (GLint *) 0;
2449
2450 if (!v_ref) {
2451 _exception = 1;
2452 _exceptionType = "java/lang/IllegalArgumentException";
2453 _exceptionMessage = "v == null";
2454 goto exit;
2455 }
2456 if (offset < 0) {
2457 _exception = 1;
2458 _exceptionType = "java/lang/IllegalArgumentException";
2459 _exceptionMessage = "offset < 0";
2460 goto exit;
2461 }
2462 _remaining = _env->GetArrayLength(v_ref) - offset;
2463 v_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002464 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002465 v = v_base + offset;
2466
2467 glVertexAttribI4iv(
2468 (GLuint)index,
2469 (GLint *)v
2470 );
2471
2472exit:
2473 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002474 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002475 JNI_ABORT);
2476 }
2477 if (_exception) {
2478 jniThrowException(_env, _exceptionType, _exceptionMessage);
2479 }
2480}
2481
2482/* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
2483static void
2484android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
2485 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002486 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002487 jint _bufferOffset = (jint) 0;
2488 jint _remaining;
2489 GLint *v = (GLint *) 0;
2490
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002491 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002492 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002493 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002494 v = (GLint *) (_vBase + _bufferOffset);
2495 }
2496 glVertexAttribI4iv(
2497 (GLuint)index,
2498 (GLint *)v
2499 );
2500 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002501 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002502 }
2503}
2504
2505/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2506static void
2507android_glVertexAttribI4uiv__I_3II
2508 (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
2509 jint _exception = 0;
2510 const char * _exceptionType = NULL;
2511 const char * _exceptionMessage = NULL;
2512 GLuint *v_base = (GLuint *) 0;
2513 jint _remaining;
2514 GLuint *v = (GLuint *) 0;
2515
2516 if (!v_ref) {
2517 _exception = 1;
2518 _exceptionType = "java/lang/IllegalArgumentException";
2519 _exceptionMessage = "v == null";
2520 goto exit;
2521 }
2522 if (offset < 0) {
2523 _exception = 1;
2524 _exceptionType = "java/lang/IllegalArgumentException";
2525 _exceptionMessage = "offset < 0";
2526 goto exit;
2527 }
2528 _remaining = _env->GetArrayLength(v_ref) - offset;
2529 v_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002530 _env->GetIntArrayElements(v_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002531 v = v_base + offset;
2532
2533 glVertexAttribI4uiv(
2534 (GLuint)index,
2535 (GLuint *)v
2536 );
2537
2538exit:
2539 if (v_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002540 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
Jesse Halld830e742013-03-29 11:02:35 -07002541 JNI_ABORT);
2542 }
2543 if (_exception) {
2544 jniThrowException(_env, _exceptionType, _exceptionMessage);
2545 }
2546}
2547
2548/* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
2549static void
2550android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
2551 (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002552 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002553 jint _bufferOffset = (jint) 0;
2554 jint _remaining;
2555 GLuint *v = (GLuint *) 0;
2556
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002557 v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002558 if (v == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002559 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002560 v = (GLuint *) (_vBase + _bufferOffset);
2561 }
2562 glVertexAttribI4uiv(
2563 (GLuint)index,
2564 (GLuint *)v
2565 );
2566 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002567 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002568 }
2569}
2570
2571/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2572static void
2573android_glGetUniformuiv__II_3II
2574 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
2575 jint _exception = 0;
2576 const char * _exceptionType = NULL;
2577 const char * _exceptionMessage = NULL;
2578 GLuint *params_base = (GLuint *) 0;
2579 jint _remaining;
2580 GLuint *params = (GLuint *) 0;
2581
2582 if (!params_ref) {
2583 _exception = 1;
2584 _exceptionType = "java/lang/IllegalArgumentException";
2585 _exceptionMessage = "params == null";
2586 goto exit;
2587 }
2588 if (offset < 0) {
2589 _exception = 1;
2590 _exceptionType = "java/lang/IllegalArgumentException";
2591 _exceptionMessage = "offset < 0";
2592 goto exit;
2593 }
2594 _remaining = _env->GetArrayLength(params_ref) - offset;
2595 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002596 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002597 params = params_base + offset;
2598
2599 glGetUniformuiv(
2600 (GLuint)program,
2601 (GLint)location,
2602 (GLuint *)params
2603 );
2604
2605exit:
2606 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002607 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07002608 _exception ? JNI_ABORT: 0);
2609 }
2610 if (_exception) {
2611 jniThrowException(_env, _exceptionType, _exceptionMessage);
2612 }
2613}
2614
2615/* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
2616static void
2617android_glGetUniformuiv__IILjava_nio_IntBuffer_2
2618 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002619 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002620 jint _bufferOffset = (jint) 0;
2621 jint _remaining;
2622 GLuint *params = (GLuint *) 0;
2623
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002624 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002625 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002626 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002627 params = (GLuint *) (_paramsBase + _bufferOffset);
2628 }
2629 glGetUniformuiv(
2630 (GLuint)program,
2631 (GLint)location,
2632 (GLuint *)params
2633 );
2634 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002635 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07002636 }
2637}
2638
2639/* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
2640static jint
2641android_glGetFragDataLocation__ILjava_lang_String_2
2642 (JNIEnv *_env, jobject _this, jint program, jstring name) {
2643 jint _exception = 0;
2644 const char * _exceptionType = NULL;
2645 const char * _exceptionMessage = NULL;
2646 GLint _returnValue = 0;
2647 const char* _nativename = 0;
2648
2649 if (!name) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07002650 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07002651 _exceptionType = "java/lang/IllegalArgumentException";
2652 _exceptionMessage = "name == null";
2653 goto exit;
2654 }
2655 _nativename = _env->GetStringUTFChars(name, 0);
2656
2657 _returnValue = glGetFragDataLocation(
2658 (GLuint)program,
2659 (GLchar *)_nativename
2660 );
2661
2662exit:
2663 if (_nativename) {
2664 _env->ReleaseStringUTFChars(name, _nativename);
2665 }
2666
2667 if (_exception) {
2668 jniThrowException(_env, _exceptionType, _exceptionMessage);
2669 }
2670 return (jint)_returnValue;
2671}
2672
2673/* void glUniform1ui ( GLint location, GLuint v0 ) */
2674static void
2675android_glUniform1ui__II
2676 (JNIEnv *_env, jobject _this, jint location, jint v0) {
2677 glUniform1ui(
2678 (GLint)location,
2679 (GLuint)v0
2680 );
2681}
2682
2683/* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
2684static void
2685android_glUniform2ui__III
2686 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
2687 glUniform2ui(
2688 (GLint)location,
2689 (GLuint)v0,
2690 (GLuint)v1
2691 );
2692}
2693
2694/* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
2695static void
2696android_glUniform3ui__IIII
2697 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
2698 glUniform3ui(
2699 (GLint)location,
2700 (GLuint)v0,
2701 (GLuint)v1,
2702 (GLuint)v2
2703 );
2704}
2705
2706/* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
2707static void
2708android_glUniform4ui__IIIII
2709 (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
2710 glUniform4ui(
2711 (GLint)location,
2712 (GLuint)v0,
2713 (GLuint)v1,
2714 (GLuint)v2,
2715 (GLuint)v3
2716 );
2717}
2718
2719/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
2720static void
2721android_glUniform1uiv__II_3II
2722 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2723 jint _exception = 0;
2724 const char * _exceptionType = NULL;
2725 const char * _exceptionMessage = NULL;
2726 GLuint *value_base = (GLuint *) 0;
2727 jint _remaining;
2728 GLuint *value = (GLuint *) 0;
2729
2730 if (!value_ref) {
2731 _exception = 1;
2732 _exceptionType = "java/lang/IllegalArgumentException";
2733 _exceptionMessage = "value == null";
2734 goto exit;
2735 }
2736 if (offset < 0) {
2737 _exception = 1;
2738 _exceptionType = "java/lang/IllegalArgumentException";
2739 _exceptionMessage = "offset < 0";
2740 goto exit;
2741 }
2742 _remaining = _env->GetArrayLength(value_ref) - offset;
2743 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002744 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002745 value = value_base + offset;
2746
2747 glUniform1uiv(
2748 (GLint)location,
2749 (GLsizei)count,
2750 (GLuint *)value
2751 );
2752
2753exit:
2754 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002755 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002756 JNI_ABORT);
2757 }
2758 if (_exception) {
2759 jniThrowException(_env, _exceptionType, _exceptionMessage);
2760 }
2761}
2762
2763/* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
2764static void
2765android_glUniform1uiv__IILjava_nio_IntBuffer_2
2766 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002767 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002768 jint _bufferOffset = (jint) 0;
2769 jint _remaining;
2770 GLuint *value = (GLuint *) 0;
2771
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002772 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002773 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002774 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002775 value = (GLuint *) (_valueBase + _bufferOffset);
2776 }
2777 glUniform1uiv(
2778 (GLint)location,
2779 (GLsizei)count,
2780 (GLuint *)value
2781 );
2782 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002783 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002784 }
2785}
2786
2787/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
2788static void
2789android_glUniform2uiv__II_3II
2790 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2791 jint _exception = 0;
2792 const char * _exceptionType = NULL;
2793 const char * _exceptionMessage = NULL;
2794 GLuint *value_base = (GLuint *) 0;
2795 jint _remaining;
2796 GLuint *value = (GLuint *) 0;
2797
2798 if (!value_ref) {
2799 _exception = 1;
2800 _exceptionType = "java/lang/IllegalArgumentException";
2801 _exceptionMessage = "value == null";
2802 goto exit;
2803 }
2804 if (offset < 0) {
2805 _exception = 1;
2806 _exceptionType = "java/lang/IllegalArgumentException";
2807 _exceptionMessage = "offset < 0";
2808 goto exit;
2809 }
2810 _remaining = _env->GetArrayLength(value_ref) - offset;
2811 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002812 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002813 value = value_base + offset;
2814
2815 glUniform2uiv(
2816 (GLint)location,
2817 (GLsizei)count,
2818 (GLuint *)value
2819 );
2820
2821exit:
2822 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002823 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002824 JNI_ABORT);
2825 }
2826 if (_exception) {
2827 jniThrowException(_env, _exceptionType, _exceptionMessage);
2828 }
2829}
2830
2831/* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
2832static void
2833android_glUniform2uiv__IILjava_nio_IntBuffer_2
2834 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002835 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002836 jint _bufferOffset = (jint) 0;
2837 jint _remaining;
2838 GLuint *value = (GLuint *) 0;
2839
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002840 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002841 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002842 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002843 value = (GLuint *) (_valueBase + _bufferOffset);
2844 }
2845 glUniform2uiv(
2846 (GLint)location,
2847 (GLsizei)count,
2848 (GLuint *)value
2849 );
2850 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002851 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002852 }
2853}
2854
2855/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
2856static void
2857android_glUniform3uiv__II_3II
2858 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2859 jint _exception = 0;
2860 const char * _exceptionType = NULL;
2861 const char * _exceptionMessage = NULL;
2862 GLuint *value_base = (GLuint *) 0;
2863 jint _remaining;
2864 GLuint *value = (GLuint *) 0;
2865
2866 if (!value_ref) {
2867 _exception = 1;
2868 _exceptionType = "java/lang/IllegalArgumentException";
2869 _exceptionMessage = "value == null";
2870 goto exit;
2871 }
2872 if (offset < 0) {
2873 _exception = 1;
2874 _exceptionType = "java/lang/IllegalArgumentException";
2875 _exceptionMessage = "offset < 0";
2876 goto exit;
2877 }
2878 _remaining = _env->GetArrayLength(value_ref) - offset;
2879 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002880 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002881 value = value_base + offset;
2882
2883 glUniform3uiv(
2884 (GLint)location,
2885 (GLsizei)count,
2886 (GLuint *)value
2887 );
2888
2889exit:
2890 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002891 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002892 JNI_ABORT);
2893 }
2894 if (_exception) {
2895 jniThrowException(_env, _exceptionType, _exceptionMessage);
2896 }
2897}
2898
2899/* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
2900static void
2901android_glUniform3uiv__IILjava_nio_IntBuffer_2
2902 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002903 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002904 jint _bufferOffset = (jint) 0;
2905 jint _remaining;
2906 GLuint *value = (GLuint *) 0;
2907
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002908 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002909 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002910 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002911 value = (GLuint *) (_valueBase + _bufferOffset);
2912 }
2913 glUniform3uiv(
2914 (GLint)location,
2915 (GLsizei)count,
2916 (GLuint *)value
2917 );
2918 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002919 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002920 }
2921}
2922
2923/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
2924static void
2925android_glUniform4uiv__II_3II
2926 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
2927 jint _exception = 0;
2928 const char * _exceptionType = NULL;
2929 const char * _exceptionMessage = NULL;
2930 GLuint *value_base = (GLuint *) 0;
2931 jint _remaining;
2932 GLuint *value = (GLuint *) 0;
2933
2934 if (!value_ref) {
2935 _exception = 1;
2936 _exceptionType = "java/lang/IllegalArgumentException";
2937 _exceptionMessage = "value == null";
2938 goto exit;
2939 }
2940 if (offset < 0) {
2941 _exception = 1;
2942 _exceptionType = "java/lang/IllegalArgumentException";
2943 _exceptionMessage = "offset < 0";
2944 goto exit;
2945 }
2946 _remaining = _env->GetArrayLength(value_ref) - offset;
2947 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002948 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07002949 value = value_base + offset;
2950
2951 glUniform4uiv(
2952 (GLint)location,
2953 (GLsizei)count,
2954 (GLuint *)value
2955 );
2956
2957exit:
2958 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002959 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07002960 JNI_ABORT);
2961 }
2962 if (_exception) {
2963 jniThrowException(_env, _exceptionType, _exceptionMessage);
2964 }
2965}
2966
2967/* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
2968static void
2969android_glUniform4uiv__IILjava_nio_IntBuffer_2
2970 (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002971 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07002972 jint _bufferOffset = (jint) 0;
2973 jint _remaining;
2974 GLuint *value = (GLuint *) 0;
2975
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002976 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07002977 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002978 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07002979 value = (GLuint *) (_valueBase + _bufferOffset);
2980 }
2981 glUniform4uiv(
2982 (GLint)location,
2983 (GLsizei)count,
2984 (GLuint *)value
2985 );
2986 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002987 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07002988 }
2989}
2990
2991/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
2992static void
2993android_glClearBufferiv__II_3II
2994 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
2995 jint _exception = 0;
2996 const char * _exceptionType = NULL;
2997 const char * _exceptionMessage = NULL;
2998 GLint *value_base = (GLint *) 0;
2999 jint _remaining;
3000 GLint *value = (GLint *) 0;
3001
3002 if (!value_ref) {
3003 _exception = 1;
3004 _exceptionType = "java/lang/IllegalArgumentException";
3005 _exceptionMessage = "value == null";
3006 goto exit;
3007 }
3008 if (offset < 0) {
3009 _exception = 1;
3010 _exceptionType = "java/lang/IllegalArgumentException";
3011 _exceptionMessage = "offset < 0";
3012 goto exit;
3013 }
3014 _remaining = _env->GetArrayLength(value_ref) - offset;
3015 value_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003016 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003017 value = value_base + offset;
3018
3019 glClearBufferiv(
3020 (GLenum)buffer,
3021 (GLint)drawbuffer,
3022 (GLint *)value
3023 );
3024
3025exit:
3026 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003027 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003028 JNI_ABORT);
3029 }
3030 if (_exception) {
3031 jniThrowException(_env, _exceptionType, _exceptionMessage);
3032 }
3033}
3034
3035/* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
3036static void
3037android_glClearBufferiv__IILjava_nio_IntBuffer_2
3038 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003039 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003040 jint _bufferOffset = (jint) 0;
3041 jint _remaining;
3042 GLint *value = (GLint *) 0;
3043
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003044 value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003045 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003046 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003047 value = (GLint *) (_valueBase + _bufferOffset);
3048 }
3049 glClearBufferiv(
3050 (GLenum)buffer,
3051 (GLint)drawbuffer,
3052 (GLint *)value
3053 );
3054 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003055 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003056 }
3057}
3058
3059/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3060static void
3061android_glClearBufferuiv__II_3II
3062 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
3063 jint _exception = 0;
3064 const char * _exceptionType = NULL;
3065 const char * _exceptionMessage = NULL;
3066 GLuint *value_base = (GLuint *) 0;
3067 jint _remaining;
3068 GLuint *value = (GLuint *) 0;
3069
3070 if (!value_ref) {
3071 _exception = 1;
3072 _exceptionType = "java/lang/IllegalArgumentException";
3073 _exceptionMessage = "value == null";
3074 goto exit;
3075 }
3076 if (offset < 0) {
3077 _exception = 1;
3078 _exceptionType = "java/lang/IllegalArgumentException";
3079 _exceptionMessage = "offset < 0";
3080 goto exit;
3081 }
3082 _remaining = _env->GetArrayLength(value_ref) - offset;
3083 value_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003084 _env->GetIntArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003085 value = value_base + offset;
3086
3087 glClearBufferuiv(
3088 (GLenum)buffer,
3089 (GLint)drawbuffer,
3090 (GLuint *)value
3091 );
3092
3093exit:
3094 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003095 _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003096 JNI_ABORT);
3097 }
3098 if (_exception) {
3099 jniThrowException(_env, _exceptionType, _exceptionMessage);
3100 }
3101}
3102
3103/* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
3104static void
3105android_glClearBufferuiv__IILjava_nio_IntBuffer_2
3106 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003107 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003108 jint _bufferOffset = (jint) 0;
3109 jint _remaining;
3110 GLuint *value = (GLuint *) 0;
3111
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003112 value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003113 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003114 char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003115 value = (GLuint *) (_valueBase + _bufferOffset);
3116 }
3117 glClearBufferuiv(
3118 (GLenum)buffer,
3119 (GLint)drawbuffer,
3120 (GLuint *)value
3121 );
3122 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003123 _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003124 }
3125}
3126
3127/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3128static void
3129android_glClearBufferfv__II_3FI
3130 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
3131 jint _exception = 0;
3132 const char * _exceptionType = NULL;
3133 const char * _exceptionMessage = NULL;
3134 GLfloat *value_base = (GLfloat *) 0;
3135 jint _remaining;
3136 GLfloat *value = (GLfloat *) 0;
3137
3138 if (!value_ref) {
3139 _exception = 1;
3140 _exceptionType = "java/lang/IllegalArgumentException";
3141 _exceptionMessage = "value == null";
3142 goto exit;
3143 }
3144 if (offset < 0) {
3145 _exception = 1;
3146 _exceptionType = "java/lang/IllegalArgumentException";
3147 _exceptionMessage = "offset < 0";
3148 goto exit;
3149 }
3150 _remaining = _env->GetArrayLength(value_ref) - offset;
3151 value_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003152 _env->GetFloatArrayElements(value_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003153 value = value_base + offset;
3154
3155 glClearBufferfv(
3156 (GLenum)buffer,
3157 (GLint)drawbuffer,
3158 (GLfloat *)value
3159 );
3160
3161exit:
3162 if (value_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003163 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
Jesse Halld830e742013-03-29 11:02:35 -07003164 JNI_ABORT);
3165 }
3166 if (_exception) {
3167 jniThrowException(_env, _exceptionType, _exceptionMessage);
3168 }
3169}
3170
3171/* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
3172static void
3173android_glClearBufferfv__IILjava_nio_FloatBuffer_2
3174 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003175 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003176 jint _bufferOffset = (jint) 0;
3177 jint _remaining;
3178 GLfloat *value = (GLfloat *) 0;
3179
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003180 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003181 if (value == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003182 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003183 value = (GLfloat *) (_valueBase + _bufferOffset);
3184 }
3185 glClearBufferfv(
3186 (GLenum)buffer,
3187 (GLint)drawbuffer,
3188 (GLfloat *)value
3189 );
3190 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003191 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003192 }
3193}
3194
3195/* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
3196static void
3197android_glClearBufferfi__IIFI
3198 (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
3199 glClearBufferfi(
3200 (GLenum)buffer,
3201 (GLint)drawbuffer,
3202 (GLfloat)depth,
3203 (GLint)stencil
3204 );
3205}
3206
3207/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
3208static jstring
3209android_glGetStringi__II
3210 (JNIEnv *_env, jobject _this, jint name, jint index) {
3211 const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
3212 return _env->NewStringUTF((const char*)_chars);
3213}
3214
3215/* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
3216static void
3217android_glCopyBufferSubData__IIIII
3218 (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
3219 glCopyBufferSubData(
3220 (GLenum)readTarget,
3221 (GLenum)writeTarget,
3222 (GLintptr)readOffset,
3223 (GLintptr)writeOffset,
3224 (GLsizeiptr)size
3225 );
3226}
3227
3228/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3229static
3230void
3231android_glGetUniformIndices_array
3232 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
3233 jint _exception = 0;
3234 const char* _exceptionType = NULL;
3235 const char* _exceptionMessage = NULL;
3236 jint _count = 0;
3237 jint _i;
3238 const char** _names = NULL;
3239 GLuint* _indices_base = NULL;
3240 GLuint* _indices = NULL;
3241
3242 if (!uniformNames_ref) {
3243 _exception = 1;
3244 _exceptionType = "java/lang/IllegalArgumentException";
3245 _exceptionMessage = "uniformNames == null";
3246 goto exit;
3247 }
3248 _count = _env->GetArrayLength(uniformNames_ref);
3249 _names = (const char**)calloc(_count, sizeof(const char*));
3250 for (_i = 0; _i < _count; _i++) {
3251 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3252 if (!_name) {
3253 _exception = 1;
3254 _exceptionType = "java/lang/IllegalArgumentException";
3255 _exceptionMessage = "null uniformNames element";
3256 goto exit;
3257 }
3258 _names[_i] = _env->GetStringUTFChars(_name, 0);
3259 }
3260
3261 if (!uniformIndices_ref) {
3262 _exception = 1;
3263 _exceptionType = "java/lang/IllegalArgumentException";
3264 _exceptionMessage = "uniformIndices == null";
3265 goto exit;
3266 }
3267 if (uniformIndicesOffset < 0) {
3268 _exception = 1;
3269 _exceptionType = "java/lang/IllegalArgumentException";
3270 _exceptionMessage = "uniformIndicesOffset < 0";
3271 goto exit;
3272 }
3273 if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
3274 _exception = 1;
3275 _exceptionType = "java/lang/IllegalArgumentException";
3276 _exceptionMessage = "not enough space in uniformIndices";
3277 goto exit;
3278 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003279 _indices_base = (GLuint*)_env->GetIntArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003280 uniformIndices_ref, 0);
3281 _indices = _indices_base + uniformIndicesOffset;
3282
3283 glGetUniformIndices(program, _count, _names, _indices);
3284
3285exit:
3286 if (_indices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003287 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
3288 _exception ? JNI_ABORT : 0);
Jesse Halld830e742013-03-29 11:02:35 -07003289 }
3290 for (_i = _count - 1; _i >= 0; _i--) {
3291 if (_names[_i]) {
3292 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3293 if (_name) {
3294 _env->ReleaseStringUTFChars(_name, _names[_i]);
3295 }
3296 }
3297 }
3298 free(_names);
3299 if (_exception) {
3300 jniThrowException(_env, _exceptionType, _exceptionMessage);
3301 }
3302}
3303
3304/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
3305static
3306void
3307android_glGetUniformIndices_buffer
3308 (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
3309 jint _exception = 0;
3310 const char* _exceptionType = NULL;
3311 const char* _exceptionMessage = NULL;
3312 jint _count = 0;
3313 jint _i;
3314 const char** _names = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003315 jintArray _uniformIndicesArray = (jintArray)0;
Jesse Halld830e742013-03-29 11:02:35 -07003316 jint _uniformIndicesRemaining;
3317 jint _uniformIndicesOffset = 0;
3318 GLuint* _indices = NULL;
3319 char* _indicesBase = NULL;
3320
3321 if (!uniformNames_ref) {
3322 _exception = 1;
3323 _exceptionType = "java/lang/IllegalArgumentException";
3324 _exceptionMessage = "uniformNames == null";
3325 goto exit;
3326 }
3327 if (!uniformIndices_buf) {
3328 _exception = 1;
3329 _exceptionType = "java/lang/IllegalArgumentException";
3330 _exceptionMessage = "uniformIndices == null";
3331 goto exit;
3332 }
3333
3334 _count = _env->GetArrayLength(uniformNames_ref);
3335 _names = (const char**)calloc(_count, sizeof(const char*));
3336 for (_i = 0; _i < _count; _i++) {
3337 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3338 if (!_name) {
3339 _exception = 1;
3340 _exceptionType = "java/lang/IllegalArgumentException";
3341 _exceptionMessage = "null uniformNames element";
3342 goto exit;
3343 }
3344 _names[_i] = _env->GetStringUTFChars(_name, 0);
3345 }
3346
3347 _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003348 (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
Jesse Halld830e742013-03-29 11:02:35 -07003349 &_uniformIndicesOffset);
3350 if (!_indices) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003351 _indicesBase = (char*)_env->GetIntArrayElements(
3352 _uniformIndicesArray, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003353 _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
3354 }
3355 if (_uniformIndicesRemaining < _count) {
3356 _exception = 1;
3357 _exceptionType = "java/lang/IllegalArgumentException";
3358 _exceptionMessage = "not enough space in uniformIndices";
3359 goto exit;
3360 }
3361
3362 glGetUniformIndices(program, _count, _names, _indices);
3363
3364exit:
3365 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003366 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
3367 _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
Jesse Halld830e742013-03-29 11:02:35 -07003368 }
3369 for (_i = _count - 1; _i >= 0; _i--) {
3370 if (_names[_i]) {
3371 jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
3372 if (_name) {
3373 _env->ReleaseStringUTFChars(_name, _names[_i]);
3374 }
3375 }
3376 }
3377 free(_names);
3378 if (_exception) {
3379 jniThrowException(_env, _exceptionType, _exceptionMessage);
3380 }
3381}
Jesse Halld830e742013-03-29 11:02:35 -07003382/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3383static void
3384android_glGetActiveUniformsiv__II_3III_3II
3385 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
3386 jint _exception = 0;
3387 const char * _exceptionType = NULL;
3388 const char * _exceptionMessage = NULL;
3389 GLuint *uniformIndices_base = (GLuint *) 0;
3390 jint _uniformIndicesRemaining;
3391 GLuint *uniformIndices = (GLuint *) 0;
3392 GLint *params_base = (GLint *) 0;
3393 jint _paramsRemaining;
3394 GLint *params = (GLint *) 0;
3395
3396 if (!uniformIndices_ref) {
3397 _exception = 1;
3398 _exceptionType = "java/lang/IllegalArgumentException";
3399 _exceptionMessage = "uniformIndices == null";
3400 goto exit;
3401 }
3402 if (uniformIndicesOffset < 0) {
3403 _exception = 1;
3404 _exceptionType = "java/lang/IllegalArgumentException";
3405 _exceptionMessage = "uniformIndicesOffset < 0";
3406 goto exit;
3407 }
3408 _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
3409 uniformIndices_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003410 _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003411 uniformIndices = uniformIndices_base + uniformIndicesOffset;
3412
3413 if (!params_ref) {
3414 _exception = 1;
3415 _exceptionType = "java/lang/IllegalArgumentException";
3416 _exceptionMessage = "params == null";
3417 goto exit;
3418 }
3419 if (paramsOffset < 0) {
3420 _exception = 1;
3421 _exceptionType = "java/lang/IllegalArgumentException";
3422 _exceptionMessage = "paramsOffset < 0";
3423 goto exit;
3424 }
3425 _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
3426 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003427 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003428 params = params_base + paramsOffset;
3429
3430 glGetActiveUniformsiv(
3431 (GLuint)program,
3432 (GLsizei)uniformCount,
3433 (GLuint *)uniformIndices,
3434 (GLenum)pname,
3435 (GLint *)params
3436 );
3437
3438exit:
3439 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003440 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003441 _exception ? JNI_ABORT: 0);
3442 }
3443 if (uniformIndices_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003444 _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
Jesse Halld830e742013-03-29 11:02:35 -07003445 JNI_ABORT);
3446 }
3447 if (_exception) {
3448 jniThrowException(_env, _exceptionType, _exceptionMessage);
3449 }
3450}
3451
3452/* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
3453static void
3454android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
3455 (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003456 jintArray _uniformIndicesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003457 jint _uniformIndicesBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003458 jintArray _paramsArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003459 jint _paramsBufferOffset = (jint) 0;
3460 jint _uniformIndicesRemaining;
3461 GLuint *uniformIndices = (GLuint *) 0;
3462 jint _paramsRemaining;
3463 GLint *params = (GLint *) 0;
3464
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003465 uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
3466 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003467 if (uniformIndices == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003468 char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003469 uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
3470 }
3471 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003472 char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003473 params = (GLint *) (_paramsBase + _paramsBufferOffset);
3474 }
3475 glGetActiveUniformsiv(
3476 (GLuint)program,
3477 (GLsizei)uniformCount,
3478 (GLuint *)uniformIndices,
3479 (GLenum)pname,
3480 (GLint *)params
3481 );
3482 if (_paramsArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003483 _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003484 }
3485 if (_uniformIndicesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003486 _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07003487 }
3488}
3489
3490/* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
3491static jint
3492android_glGetUniformBlockIndex__ILjava_lang_String_2
3493 (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
3494 jint _exception = 0;
3495 const char * _exceptionType = NULL;
3496 const char * _exceptionMessage = NULL;
3497 GLuint _returnValue = 0;
3498 const char* _nativeuniformBlockName = 0;
3499
3500 if (!uniformBlockName) {
Elliott Hughes428d3fc2013-09-24 17:15:41 -07003501 _exception = 1;
Jesse Halld830e742013-03-29 11:02:35 -07003502 _exceptionType = "java/lang/IllegalArgumentException";
3503 _exceptionMessage = "uniformBlockName == null";
3504 goto exit;
3505 }
3506 _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
3507
3508 _returnValue = glGetUniformBlockIndex(
3509 (GLuint)program,
3510 (GLchar *)_nativeuniformBlockName
3511 );
3512
3513exit:
3514 if (_nativeuniformBlockName) {
3515 _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
3516 }
3517
3518 if (_exception) {
3519 jniThrowException(_env, _exceptionType, _exceptionMessage);
3520 }
3521 return (jint)_returnValue;
3522}
3523
3524/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3525static void
3526android_glGetActiveUniformBlockiv__III_3II
3527 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
3528 jint _exception = 0;
3529 const char * _exceptionType = NULL;
3530 const char * _exceptionMessage = NULL;
3531 GLint *params_base = (GLint *) 0;
3532 jint _remaining;
3533 GLint *params = (GLint *) 0;
3534
3535 if (!params_ref) {
3536 _exception = 1;
3537 _exceptionType = "java/lang/IllegalArgumentException";
3538 _exceptionMessage = "params == null";
3539 goto exit;
3540 }
3541 if (offset < 0) {
3542 _exception = 1;
3543 _exceptionType = "java/lang/IllegalArgumentException";
3544 _exceptionMessage = "offset < 0";
3545 goto exit;
3546 }
3547 _remaining = _env->GetArrayLength(params_ref) - offset;
3548 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003549 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003550 params = params_base + offset;
3551
3552 glGetActiveUniformBlockiv(
3553 (GLuint)program,
3554 (GLuint)uniformBlockIndex,
3555 (GLenum)pname,
3556 (GLint *)params
3557 );
3558
3559exit:
3560 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003561 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003562 _exception ? JNI_ABORT: 0);
3563 }
3564 if (_exception) {
3565 jniThrowException(_env, _exceptionType, _exceptionMessage);
3566 }
3567}
3568
3569/* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
3570static void
3571android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
3572 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003573 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003574 jint _bufferOffset = (jint) 0;
3575 jint _remaining;
3576 GLint *params = (GLint *) 0;
3577
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003578 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003579 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003580 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003581 params = (GLint *) (_paramsBase + _bufferOffset);
3582 }
3583 glGetActiveUniformBlockiv(
3584 (GLuint)program,
3585 (GLuint)uniformBlockIndex,
3586 (GLenum)pname,
3587 (GLint *)params
3588 );
3589 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003590 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003591 }
3592}
3593
3594/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3595static void
3596android_glGetActiveUniformBlockName_III_3II_3BI
3597 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
3598 jint _exception = 0;
3599 const char* _exceptionType;
3600 const char* _exceptionMessage;
3601 GLsizei* _length_base = (GLsizei*)0;
3602 jint _lengthRemaining;
3603 GLsizei* _length = (GLsizei*)0;
3604 GLchar* _name_base = (GLchar*)0;
3605 jint _nameRemaining;
3606 GLchar* _name = (GLchar*)0;
3607
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003608 if (length_ref) {
3609 if (lengthOffset < 0) {
3610 _exception = 1;
3611 _exceptionType = "java/lang/IllegalArgumentException";
3612 _exceptionMessage = "lengthOffset < 0";
3613 goto exit;
3614 }
3615 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
3616 _length_base = (GLsizei*)_env->GetIntArrayElements(
3617 length_ref, (jboolean*)0);
3618 _length = _length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07003619 }
Jesse Halld830e742013-03-29 11:02:35 -07003620
3621 if (!name_ref) {
3622 _exception = 1;
3623 _exceptionType = "java/lang/IllegalArgumentException";
3624 _exceptionMessage = "uniformBlockName == null";
3625 goto exit;
3626 }
3627 if (nameOffset < 0) {
3628 _exception = 1;
3629 _exceptionType = "java/lang/IllegalArgumentException";
3630 _exceptionMessage = "uniformBlockNameOffset < 0";
3631 goto exit;
3632 }
3633 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003634 _name_base = (GLchar*)_env->GetByteArrayElements(
Jesse Halld830e742013-03-29 11:02:35 -07003635 name_ref, (jboolean*)0);
3636 _name = _name_base + nameOffset;
3637
3638 glGetActiveUniformBlockName(
3639 (GLuint)program,
3640 (GLuint)uniformBlockIndex,
3641 (GLsizei)bufSize,
3642 (GLsizei*)_length,
3643 (GLchar*)_name
3644 );
3645
3646exit:
3647 if (_name_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003648 _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
Jesse Halld830e742013-03-29 11:02:35 -07003649 _exception ? JNI_ABORT: 0);
3650 }
3651 if (_length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003652 _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
Jesse Halld830e742013-03-29 11:02:35 -07003653 _exception ? JNI_ABORT: 0);
3654 }
3655 if (_exception) {
3656 jniThrowException(_env, _exceptionType, _exceptionMessage);
3657 }
3658}
3659
3660/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3661static void
3662android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
3663 (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
3664 jint _exception = 0;
3665 const char* _exceptionType;
3666 const char* _exceptionMessage;
3667 jarray _lengthArray = (jarray)0;
3668 jint _lengthBufferOffset = (jint)0;
3669 GLsizei* _length = (GLsizei*)0;
3670 jint _lengthRemaining;
3671 jarray _nameArray = (jarray)0;
3672 jint _nameBufferOffset = (jint)0;
3673 GLchar* _name = (GLchar*)0;
3674 jint _nameRemaining;
3675
3676 _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
3677 if (_length == NULL) {
3678 GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
3679 _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
3680 }
3681
3682 _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
3683 if (_name == NULL) {
3684 GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
3685 _name = (GLchar*)(_nameBase + _nameBufferOffset);
3686 }
3687
3688 glGetActiveUniformBlockName(
3689 (GLuint)program,
3690 (GLuint)uniformBlockIndex,
3691 (GLsizei)_nameRemaining,
3692 _length, _name
3693 );
3694 if (_nameArray) {
3695 releasePointer(_env, _nameArray, _name, JNI_TRUE);
3696 }
3697 if (_lengthArray) {
3698 releasePointer(_env, _lengthArray, _length, JNI_TRUE);
3699 }
3700}
3701
3702/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
3703static jstring
3704android_glGetActiveUniformBlockName_II
3705 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
3706 GLint len = 0;
3707 glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
3708 GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
3709 GLchar* name = (GLchar*)malloc(len);
3710 glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
3711 len, NULL, name);
3712 jstring result = _env->NewStringUTF(name);
3713 free(name);
3714 return result;
3715}
Jesse Halld830e742013-03-29 11:02:35 -07003716/* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
3717static void
3718android_glUniformBlockBinding__III
3719 (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
3720 glUniformBlockBinding(
3721 (GLuint)program,
3722 (GLuint)uniformBlockIndex,
3723 (GLuint)uniformBlockBinding
3724 );
3725}
3726
3727/* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
3728static void
3729android_glDrawArraysInstanced__IIII
3730 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
3731 glDrawArraysInstanced(
3732 (GLenum)mode,
3733 (GLint)first,
3734 (GLsizei)count,
3735 (GLsizei)instanceCount
3736 );
3737}
3738
3739/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
3740static void
3741android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
3742 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
3743 jarray _array = (jarray) 0;
3744 jint _bufferOffset = (jint) 0;
3745 jint _remaining;
3746 GLvoid *indices = (GLvoid *) 0;
3747
3748 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
3749 if (indices == NULL) {
3750 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3751 indices = (GLvoid *) (_indicesBase + _bufferOffset);
3752 }
3753 glDrawElementsInstanced(
3754 (GLenum)mode,
3755 (GLsizei)count,
3756 (GLenum)type,
3757 (GLvoid *)indices,
3758 (GLsizei)instanceCount
3759 );
3760 if (_array) {
3761 releasePointer(_env, _array, indices, JNI_FALSE);
3762 }
3763}
3764
3765/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
3766static void
3767android_glDrawElementsInstanced__IIIII
3768 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
3769 glDrawElementsInstanced(
3770 (GLenum)mode,
3771 (GLsizei)count,
3772 (GLenum)type,
Dan Albert10caf032015-02-23 10:41:10 -08003773 (GLvoid *)static_cast<uintptr_t>(indicesOffset),
Jesse Halld830e742013-03-29 11:02:35 -07003774 (GLsizei)instanceCount
3775 );
3776}
Jesse Halld830e742013-03-29 11:02:35 -07003777/* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
3778static jlong
3779android_glFenceSync__II
3780 (JNIEnv *_env, jobject _this, jint condition, jint flags) {
3781 GLsync _returnValue;
3782 _returnValue = glFenceSync(
3783 (GLenum)condition,
3784 (GLbitfield)flags
3785 );
3786 return (jlong)_returnValue;
3787}
3788
3789/* GLboolean glIsSync ( GLsync sync ) */
3790static jboolean
3791android_glIsSync__J
3792 (JNIEnv *_env, jobject _this, jlong sync) {
3793 GLboolean _returnValue;
3794 _returnValue = glIsSync(
3795 (GLsync)sync
3796 );
3797 return (jboolean)_returnValue;
3798}
3799
3800/* void glDeleteSync ( GLsync sync ) */
3801static void
3802android_glDeleteSync__J
3803 (JNIEnv *_env, jobject _this, jlong sync) {
3804 glDeleteSync(
3805 (GLsync)sync
3806 );
3807}
3808
3809/* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
3810static jint
3811android_glClientWaitSync__JIJ
3812 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
3813 GLenum _returnValue;
3814 _returnValue = glClientWaitSync(
3815 (GLsync)sync,
3816 (GLbitfield)flags,
3817 (GLuint64)timeout
3818 );
3819 return (jint)_returnValue;
3820}
3821
3822/* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
3823static void
3824android_glWaitSync__JIJ
3825 (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
3826 glWaitSync(
3827 (GLsync)sync,
3828 (GLbitfield)flags,
3829 (GLuint64)timeout
3830 );
3831}
3832
3833/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
3834static void
3835android_glGetInteger64v__I_3JI
3836 (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
3837 jint _exception = 0;
3838 const char * _exceptionType = NULL;
3839 const char * _exceptionMessage = NULL;
3840 GLint64 *params_base = (GLint64 *) 0;
3841 jint _remaining;
3842 GLint64 *params = (GLint64 *) 0;
3843
3844 if (!params_ref) {
3845 _exception = 1;
3846 _exceptionType = "java/lang/IllegalArgumentException";
3847 _exceptionMessage = "params == null";
3848 goto exit;
3849 }
3850 if (offset < 0) {
3851 _exception = 1;
3852 _exceptionType = "java/lang/IllegalArgumentException";
3853 _exceptionMessage = "offset < 0";
3854 goto exit;
3855 }
3856 _remaining = _env->GetArrayLength(params_ref) - offset;
3857 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003858 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003859 params = params_base + offset;
3860
3861 glGetInteger64v(
3862 (GLenum)pname,
3863 (GLint64 *)params
3864 );
3865
3866exit:
3867 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003868 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07003869 _exception ? JNI_ABORT: 0);
3870 }
3871 if (_exception) {
3872 jniThrowException(_env, _exceptionType, _exceptionMessage);
3873 }
3874}
3875
3876/* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
3877static void
3878android_glGetInteger64v__ILjava_nio_LongBuffer_2
3879 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003880 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003881 jint _bufferOffset = (jint) 0;
3882 jint _remaining;
3883 GLint64 *params = (GLint64 *) 0;
3884
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003885 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07003886 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003887 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003888 params = (GLint64 *) (_paramsBase + _bufferOffset);
3889 }
3890 glGetInteger64v(
3891 (GLenum)pname,
3892 (GLint64 *)params
3893 );
3894 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003895 _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003896 }
3897}
3898
3899/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
3900static void
3901android_glGetSynciv__JII_3II_3II
3902 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
3903 jint _exception = 0;
3904 const char * _exceptionType = NULL;
3905 const char * _exceptionMessage = NULL;
3906 GLsizei *length_base = (GLsizei *) 0;
3907 jint _lengthRemaining;
3908 GLsizei *length = (GLsizei *) 0;
3909 GLint *values_base = (GLint *) 0;
3910 jint _valuesRemaining;
3911 GLint *values = (GLint *) 0;
3912
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003913 if (length_ref) {
3914 if (lengthOffset < 0) {
3915 _exception = 1;
3916 _exceptionType = "java/lang/IllegalArgumentException";
3917 _exceptionMessage = "lengthOffset < 0";
3918 goto exit;
3919 }
3920 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
3921 length_base = (GLsizei *)
3922 _env->GetIntArrayElements(length_ref, (jboolean *)0);
3923 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07003924 }
Jesse Halld830e742013-03-29 11:02:35 -07003925
3926 if (!values_ref) {
3927 _exception = 1;
3928 _exceptionType = "java/lang/IllegalArgumentException";
3929 _exceptionMessage = "values == null";
3930 goto exit;
3931 }
3932 if (valuesOffset < 0) {
3933 _exception = 1;
3934 _exceptionType = "java/lang/IllegalArgumentException";
3935 _exceptionMessage = "valuesOffset < 0";
3936 goto exit;
3937 }
3938 _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
3939 values_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003940 _env->GetIntArrayElements(values_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07003941 values = values_base + valuesOffset;
3942
3943 glGetSynciv(
3944 (GLsync)sync,
3945 (GLenum)pname,
3946 (GLsizei)bufSize,
3947 (GLsizei *)length,
3948 (GLint *)values
3949 );
3950
3951exit:
3952 if (values_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003953 _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
Jesse Halld830e742013-03-29 11:02:35 -07003954 _exception ? JNI_ABORT: 0);
3955 }
3956 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003957 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07003958 _exception ? JNI_ABORT: 0);
3959 }
3960 if (_exception) {
3961 jniThrowException(_env, _exceptionType, _exceptionMessage);
3962 }
3963}
3964
3965/* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
3966static void
3967android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
3968 (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003969 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003970 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003971 jintArray _valuesArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07003972 jint _valuesBufferOffset = (jint) 0;
3973 jint _lengthRemaining;
3974 GLsizei *length = (GLsizei *) 0;
3975 jint _valuesRemaining;
3976 GLint *values = (GLint *) 0;
3977
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003978 if (length_buf) {
3979 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
3980 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003981 values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07003982 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003983 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003984 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
3985 }
3986 if (values == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003987 char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07003988 values = (GLint *) (_valuesBase + _valuesBufferOffset);
3989 }
3990 glGetSynciv(
3991 (GLsync)sync,
3992 (GLenum)pname,
3993 (GLsizei)bufSize,
3994 (GLsizei *)length,
3995 (GLint *)values
3996 );
3997 if (_valuesArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003998 _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, 0);
Jesse Halld830e742013-03-29 11:02:35 -07003999 }
4000 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004001 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004002 }
4003}
4004
4005/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4006static void
4007android_glGetInteger64i_v__II_3JI
4008 (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
4009 jint _exception = 0;
4010 const char * _exceptionType = NULL;
4011 const char * _exceptionMessage = NULL;
4012 GLint64 *data_base = (GLint64 *) 0;
4013 jint _remaining;
4014 GLint64 *data = (GLint64 *) 0;
4015
4016 if (!data_ref) {
4017 _exception = 1;
4018 _exceptionType = "java/lang/IllegalArgumentException";
4019 _exceptionMessage = "data == null";
4020 goto exit;
4021 }
4022 if (offset < 0) {
4023 _exception = 1;
4024 _exceptionType = "java/lang/IllegalArgumentException";
4025 _exceptionMessage = "offset < 0";
4026 goto exit;
4027 }
4028 _remaining = _env->GetArrayLength(data_ref) - offset;
4029 data_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004030 _env->GetLongArrayElements(data_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004031 data = data_base + offset;
4032
4033 glGetInteger64i_v(
4034 (GLenum)target,
4035 (GLuint)index,
4036 (GLint64 *)data
4037 );
4038
4039exit:
4040 if (data_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004041 _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
Jesse Halld830e742013-03-29 11:02:35 -07004042 _exception ? JNI_ABORT: 0);
4043 }
4044 if (_exception) {
4045 jniThrowException(_env, _exceptionType, _exceptionMessage);
4046 }
4047}
4048
4049/* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
4050static void
4051android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
4052 (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004053 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004054 jint _bufferOffset = (jint) 0;
4055 jint _remaining;
4056 GLint64 *data = (GLint64 *) 0;
4057
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004058 data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004059 if (data == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004060 char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004061 data = (GLint64 *) (_dataBase + _bufferOffset);
4062 }
4063 glGetInteger64i_v(
4064 (GLenum)target,
4065 (GLuint)index,
4066 (GLint64 *)data
4067 );
4068 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004069 _env->ReleaseLongArrayElements(_array, (jlong*)data, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004070 }
4071}
4072
4073/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4074static void
4075android_glGetBufferParameteri64v__II_3JI
4076 (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
4077 jint _exception = 0;
4078 const char * _exceptionType = NULL;
4079 const char * _exceptionMessage = NULL;
4080 GLint64 *params_base = (GLint64 *) 0;
4081 jint _remaining;
4082 GLint64 *params = (GLint64 *) 0;
4083
4084 if (!params_ref) {
4085 _exception = 1;
4086 _exceptionType = "java/lang/IllegalArgumentException";
4087 _exceptionMessage = "params == null";
4088 goto exit;
4089 }
4090 if (offset < 0) {
4091 _exception = 1;
4092 _exceptionType = "java/lang/IllegalArgumentException";
4093 _exceptionMessage = "offset < 0";
4094 goto exit;
4095 }
4096 _remaining = _env->GetArrayLength(params_ref) - offset;
4097 params_base = (GLint64 *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004098 _env->GetLongArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004099 params = params_base + offset;
4100
4101 glGetBufferParameteri64v(
4102 (GLenum)target,
4103 (GLenum)pname,
4104 (GLint64 *)params
4105 );
4106
4107exit:
4108 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004109 _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004110 _exception ? JNI_ABORT: 0);
4111 }
4112 if (_exception) {
4113 jniThrowException(_env, _exceptionType, _exceptionMessage);
4114 }
4115}
4116
4117/* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
4118static void
4119android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
4120 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004121 jlongArray _array = (jlongArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004122 jint _bufferOffset = (jint) 0;
4123 jint _remaining;
4124 GLint64 *params = (GLint64 *) 0;
4125
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004126 params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004127 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004128 char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004129 params = (GLint64 *) (_paramsBase + _bufferOffset);
4130 }
4131 glGetBufferParameteri64v(
4132 (GLenum)target,
4133 (GLenum)pname,
4134 (GLint64 *)params
4135 );
4136 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004137 _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004138 }
4139}
4140
4141/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4142static void
4143android_glGenSamplers__I_3II
4144 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4145 jint _exception = 0;
4146 const char * _exceptionType = NULL;
4147 const char * _exceptionMessage = NULL;
4148 GLuint *samplers_base = (GLuint *) 0;
4149 jint _remaining;
4150 GLuint *samplers = (GLuint *) 0;
4151
4152 if (!samplers_ref) {
4153 _exception = 1;
4154 _exceptionType = "java/lang/IllegalArgumentException";
4155 _exceptionMessage = "samplers == null";
4156 goto exit;
4157 }
4158 if (offset < 0) {
4159 _exception = 1;
4160 _exceptionType = "java/lang/IllegalArgumentException";
4161 _exceptionMessage = "offset < 0";
4162 goto exit;
4163 }
4164 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4165 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004166 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004167 samplers = samplers_base + offset;
4168
4169 glGenSamplers(
4170 (GLsizei)count,
4171 (GLuint *)samplers
4172 );
4173
4174exit:
4175 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004176 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004177 _exception ? JNI_ABORT: 0);
4178 }
4179 if (_exception) {
4180 jniThrowException(_env, _exceptionType, _exceptionMessage);
4181 }
4182}
4183
4184/* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
4185static void
4186android_glGenSamplers__ILjava_nio_IntBuffer_2
4187 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004188 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004189 jint _bufferOffset = (jint) 0;
4190 jint _remaining;
4191 GLuint *samplers = (GLuint *) 0;
4192
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004193 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004194 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004195 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004196 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4197 }
4198 glGenSamplers(
4199 (GLsizei)count,
4200 (GLuint *)samplers
4201 );
4202 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004203 _env->ReleaseIntArrayElements(_array, (jint*)samplers, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004204 }
4205}
4206
4207/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4208static void
4209android_glDeleteSamplers__I_3II
4210 (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
4211 jint _exception = 0;
4212 const char * _exceptionType = NULL;
4213 const char * _exceptionMessage = NULL;
4214 GLuint *samplers_base = (GLuint *) 0;
4215 jint _remaining;
4216 GLuint *samplers = (GLuint *) 0;
4217
4218 if (!samplers_ref) {
4219 _exception = 1;
4220 _exceptionType = "java/lang/IllegalArgumentException";
4221 _exceptionMessage = "samplers == null";
4222 goto exit;
4223 }
4224 if (offset < 0) {
4225 _exception = 1;
4226 _exceptionType = "java/lang/IllegalArgumentException";
4227 _exceptionMessage = "offset < 0";
4228 goto exit;
4229 }
4230 _remaining = _env->GetArrayLength(samplers_ref) - offset;
4231 samplers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004232 _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004233 samplers = samplers_base + offset;
4234
4235 glDeleteSamplers(
4236 (GLsizei)count,
4237 (GLuint *)samplers
4238 );
4239
4240exit:
4241 if (samplers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004242 _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
Jesse Halld830e742013-03-29 11:02:35 -07004243 JNI_ABORT);
4244 }
4245 if (_exception) {
4246 jniThrowException(_env, _exceptionType, _exceptionMessage);
4247 }
4248}
4249
4250/* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
4251static void
4252android_glDeleteSamplers__ILjava_nio_IntBuffer_2
4253 (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004254 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004255 jint _bufferOffset = (jint) 0;
4256 jint _remaining;
4257 GLuint *samplers = (GLuint *) 0;
4258
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004259 samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004260 if (samplers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004261 char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004262 samplers = (GLuint *) (_samplersBase + _bufferOffset);
4263 }
4264 glDeleteSamplers(
4265 (GLsizei)count,
4266 (GLuint *)samplers
4267 );
4268 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004269 _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004270 }
4271}
4272
4273/* GLboolean glIsSampler ( GLuint sampler ) */
4274static jboolean
4275android_glIsSampler__I
4276 (JNIEnv *_env, jobject _this, jint sampler) {
4277 GLboolean _returnValue;
4278 _returnValue = glIsSampler(
4279 (GLuint)sampler
4280 );
4281 return (jboolean)_returnValue;
4282}
4283
4284/* void glBindSampler ( GLuint unit, GLuint sampler ) */
4285static void
4286android_glBindSampler__II
4287 (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
4288 glBindSampler(
4289 (GLuint)unit,
4290 (GLuint)sampler
4291 );
4292}
4293
4294/* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
4295static void
4296android_glSamplerParameteri__III
4297 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
4298 glSamplerParameteri(
4299 (GLuint)sampler,
4300 (GLenum)pname,
4301 (GLint)param
4302 );
4303}
4304
4305/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4306static void
4307android_glSamplerParameteriv__II_3II
4308 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
4309 jint _exception = 0;
4310 const char * _exceptionType = NULL;
4311 const char * _exceptionMessage = NULL;
4312 GLint *param_base = (GLint *) 0;
4313 jint _remaining;
4314 GLint *param = (GLint *) 0;
4315
4316 if (!param_ref) {
4317 _exception = 1;
4318 _exceptionType = "java/lang/IllegalArgumentException";
4319 _exceptionMessage = "param == null";
4320 goto exit;
4321 }
4322 if (offset < 0) {
4323 _exception = 1;
4324 _exceptionType = "java/lang/IllegalArgumentException";
4325 _exceptionMessage = "offset < 0";
4326 goto exit;
4327 }
4328 _remaining = _env->GetArrayLength(param_ref) - offset;
4329 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004330 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004331 param = param_base + offset;
4332
4333 glSamplerParameteriv(
4334 (GLuint)sampler,
4335 (GLenum)pname,
4336 (GLint *)param
4337 );
4338
4339exit:
4340 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004341 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004342 JNI_ABORT);
4343 }
4344 if (_exception) {
4345 jniThrowException(_env, _exceptionType, _exceptionMessage);
4346 }
4347}
4348
4349/* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
4350static void
4351android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
4352 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004353 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004354 jint _bufferOffset = (jint) 0;
4355 jint _remaining;
4356 GLint *param = (GLint *) 0;
4357
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004358 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004359 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004360 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004361 param = (GLint *) (_paramBase + _bufferOffset);
4362 }
4363 glSamplerParameteriv(
4364 (GLuint)sampler,
4365 (GLenum)pname,
4366 (GLint *)param
4367 );
4368 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004369 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004370 }
4371}
4372
4373/* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
4374static void
4375android_glSamplerParameterf__IIF
4376 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
4377 glSamplerParameterf(
4378 (GLuint)sampler,
4379 (GLenum)pname,
4380 (GLfloat)param
4381 );
4382}
4383
4384/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4385static void
4386android_glSamplerParameterfv__II_3FI
4387 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
4388 jint _exception = 0;
4389 const char * _exceptionType = NULL;
4390 const char * _exceptionMessage = NULL;
4391 GLfloat *param_base = (GLfloat *) 0;
4392 jint _remaining;
4393 GLfloat *param = (GLfloat *) 0;
4394
4395 if (!param_ref) {
4396 _exception = 1;
4397 _exceptionType = "java/lang/IllegalArgumentException";
4398 _exceptionMessage = "param == null";
4399 goto exit;
4400 }
4401 if (offset < 0) {
4402 _exception = 1;
4403 _exceptionType = "java/lang/IllegalArgumentException";
4404 _exceptionMessage = "offset < 0";
4405 goto exit;
4406 }
4407 _remaining = _env->GetArrayLength(param_ref) - offset;
4408 param_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004409 _env->GetFloatArrayElements(param_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004410 param = param_base + offset;
4411
4412 glSamplerParameterfv(
4413 (GLuint)sampler,
4414 (GLenum)pname,
4415 (GLfloat *)param
4416 );
4417
4418exit:
4419 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004420 _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
Jesse Halld830e742013-03-29 11:02:35 -07004421 JNI_ABORT);
4422 }
4423 if (_exception) {
4424 jniThrowException(_env, _exceptionType, _exceptionMessage);
4425 }
4426}
4427
4428/* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
4429static void
4430android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
4431 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004432 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004433 jint _bufferOffset = (jint) 0;
4434 jint _remaining;
4435 GLfloat *param = (GLfloat *) 0;
4436
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004437 param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004438 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004439 char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004440 param = (GLfloat *) (_paramBase + _bufferOffset);
4441 }
4442 glSamplerParameterfv(
4443 (GLuint)sampler,
4444 (GLenum)pname,
4445 (GLfloat *)param
4446 );
4447 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004448 _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004449 }
4450}
4451
4452/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
4453static void
4454android_glGetSamplerParameteriv__II_3II
4455 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
4456 jint _exception = 0;
4457 const char * _exceptionType = NULL;
4458 const char * _exceptionMessage = NULL;
4459 GLint *params_base = (GLint *) 0;
4460 jint _remaining;
4461 GLint *params = (GLint *) 0;
4462
4463 if (!params_ref) {
4464 _exception = 1;
4465 _exceptionType = "java/lang/IllegalArgumentException";
4466 _exceptionMessage = "params == null";
4467 goto exit;
4468 }
4469 if (offset < 0) {
4470 _exception = 1;
4471 _exceptionType = "java/lang/IllegalArgumentException";
4472 _exceptionMessage = "offset < 0";
4473 goto exit;
4474 }
4475 _remaining = _env->GetArrayLength(params_ref) - offset;
4476 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004477 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004478 params = params_base + offset;
4479
4480 glGetSamplerParameteriv(
4481 (GLuint)sampler,
4482 (GLenum)pname,
4483 (GLint *)params
4484 );
4485
4486exit:
4487 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004488 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004489 _exception ? JNI_ABORT: 0);
4490 }
4491 if (_exception) {
4492 jniThrowException(_env, _exceptionType, _exceptionMessage);
4493 }
4494}
4495
4496/* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
4497static void
4498android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
4499 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004500 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004501 jint _bufferOffset = (jint) 0;
4502 jint _remaining;
4503 GLint *params = (GLint *) 0;
4504
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004505 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004506 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004507 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004508 params = (GLint *) (_paramsBase + _bufferOffset);
4509 }
4510 glGetSamplerParameteriv(
4511 (GLuint)sampler,
4512 (GLenum)pname,
4513 (GLint *)params
4514 );
4515 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004516 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004517 }
4518}
4519
4520/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
4521static void
4522android_glGetSamplerParameterfv__II_3FI
4523 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
4524 jint _exception = 0;
4525 const char * _exceptionType = NULL;
4526 const char * _exceptionMessage = NULL;
4527 GLfloat *params_base = (GLfloat *) 0;
4528 jint _remaining;
4529 GLfloat *params = (GLfloat *) 0;
4530
4531 if (!params_ref) {
4532 _exception = 1;
4533 _exceptionType = "java/lang/IllegalArgumentException";
4534 _exceptionMessage = "params == null";
4535 goto exit;
4536 }
4537 if (offset < 0) {
4538 _exception = 1;
4539 _exceptionType = "java/lang/IllegalArgumentException";
4540 _exceptionMessage = "offset < 0";
4541 goto exit;
4542 }
4543 _remaining = _env->GetArrayLength(params_ref) - offset;
4544 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004545 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004546 params = params_base + offset;
4547
4548 glGetSamplerParameterfv(
4549 (GLuint)sampler,
4550 (GLenum)pname,
4551 (GLfloat *)params
4552 );
4553
4554exit:
4555 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004556 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07004557 _exception ? JNI_ABORT: 0);
4558 }
4559 if (_exception) {
4560 jniThrowException(_env, _exceptionType, _exceptionMessage);
4561 }
4562}
4563
4564/* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
4565static void
4566android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
4567 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004568 jfloatArray _array = (jfloatArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004569 jint _bufferOffset = (jint) 0;
4570 jint _remaining;
4571 GLfloat *params = (GLfloat *) 0;
4572
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004573 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004574 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004575 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004576 params = (GLfloat *) (_paramsBase + _bufferOffset);
4577 }
4578 glGetSamplerParameterfv(
4579 (GLuint)sampler,
4580 (GLenum)pname,
4581 (GLfloat *)params
4582 );
4583 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004584 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004585 }
4586}
4587
4588/* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
4589static void
4590android_glVertexAttribDivisor__II
4591 (JNIEnv *_env, jobject _this, jint index, jint divisor) {
4592 glVertexAttribDivisor(
4593 (GLuint)index,
4594 (GLuint)divisor
4595 );
4596}
4597
4598/* void glBindTransformFeedback ( GLenum target, GLuint id ) */
4599static void
4600android_glBindTransformFeedback__II
4601 (JNIEnv *_env, jobject _this, jint target, jint id) {
4602 glBindTransformFeedback(
4603 (GLenum)target,
4604 (GLuint)id
4605 );
4606}
4607
4608/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
4609static void
4610android_glDeleteTransformFeedbacks__I_3II
4611 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
4612 jint _exception = 0;
4613 const char * _exceptionType = NULL;
4614 const char * _exceptionMessage = NULL;
4615 GLuint *ids_base = (GLuint *) 0;
4616 jint _remaining;
4617 GLuint *ids = (GLuint *) 0;
4618
4619 if (!ids_ref) {
4620 _exception = 1;
4621 _exceptionType = "java/lang/IllegalArgumentException";
4622 _exceptionMessage = "ids == null";
4623 goto exit;
4624 }
4625 if (offset < 0) {
4626 _exception = 1;
4627 _exceptionType = "java/lang/IllegalArgumentException";
4628 _exceptionMessage = "offset < 0";
4629 goto exit;
4630 }
4631 _remaining = _env->GetArrayLength(ids_ref) - offset;
4632 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004633 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004634 ids = ids_base + offset;
4635
4636 glDeleteTransformFeedbacks(
4637 (GLsizei)n,
4638 (GLuint *)ids
4639 );
4640
4641exit:
4642 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004643 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07004644 JNI_ABORT);
4645 }
4646 if (_exception) {
4647 jniThrowException(_env, _exceptionType, _exceptionMessage);
4648 }
4649}
4650
4651/* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
4652static void
4653android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
4654 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004655 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004656 jint _bufferOffset = (jint) 0;
4657 jint _remaining;
4658 GLuint *ids = (GLuint *) 0;
4659
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004660 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004661 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004662 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004663 ids = (GLuint *) (_idsBase + _bufferOffset);
4664 }
4665 glDeleteTransformFeedbacks(
4666 (GLsizei)n,
4667 (GLuint *)ids
4668 );
4669 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004670 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004671 }
4672}
4673
4674/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
4675static void
4676android_glGenTransformFeedbacks__I_3II
4677 (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
4678 jint _exception = 0;
4679 const char * _exceptionType = NULL;
4680 const char * _exceptionMessage = NULL;
4681 GLuint *ids_base = (GLuint *) 0;
4682 jint _remaining;
4683 GLuint *ids = (GLuint *) 0;
4684
4685 if (!ids_ref) {
4686 _exception = 1;
4687 _exceptionType = "java/lang/IllegalArgumentException";
4688 _exceptionMessage = "ids == null";
4689 goto exit;
4690 }
4691 if (offset < 0) {
4692 _exception = 1;
4693 _exceptionType = "java/lang/IllegalArgumentException";
4694 _exceptionMessage = "offset < 0";
4695 goto exit;
4696 }
4697 _remaining = _env->GetArrayLength(ids_ref) - offset;
4698 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004699 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004700 ids = ids_base + offset;
4701
4702 glGenTransformFeedbacks(
4703 (GLsizei)n,
4704 (GLuint *)ids
4705 );
4706
4707exit:
4708 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004709 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Halld830e742013-03-29 11:02:35 -07004710 _exception ? JNI_ABORT: 0);
4711 }
4712 if (_exception) {
4713 jniThrowException(_env, _exceptionType, _exceptionMessage);
4714 }
4715}
4716
4717/* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
4718static void
4719android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
4720 (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004721 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004722 jint _bufferOffset = (jint) 0;
4723 jint _remaining;
4724 GLuint *ids = (GLuint *) 0;
4725
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004726 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004727 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004728 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004729 ids = (GLuint *) (_idsBase + _bufferOffset);
4730 }
4731 glGenTransformFeedbacks(
4732 (GLsizei)n,
4733 (GLuint *)ids
4734 );
4735 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004736 _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004737 }
4738}
4739
4740/* GLboolean glIsTransformFeedback ( GLuint id ) */
4741static jboolean
4742android_glIsTransformFeedback__I
4743 (JNIEnv *_env, jobject _this, jint id) {
4744 GLboolean _returnValue;
4745 _returnValue = glIsTransformFeedback(
4746 (GLuint)id
4747 );
4748 return (jboolean)_returnValue;
4749}
4750
4751/* void glPauseTransformFeedback ( void ) */
4752static void
4753android_glPauseTransformFeedback__
4754 (JNIEnv *_env, jobject _this) {
4755 glPauseTransformFeedback();
4756}
4757
4758/* void glResumeTransformFeedback ( void ) */
4759static void
4760android_glResumeTransformFeedback__
4761 (JNIEnv *_env, jobject _this) {
4762 glResumeTransformFeedback();
4763}
4764
4765/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
4766static void
4767android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
4768 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
4769 jint _exception = 0;
4770 const char * _exceptionType = NULL;
4771 const char * _exceptionMessage = NULL;
4772 jarray _array = (jarray) 0;
4773 jint _bufferOffset = (jint) 0;
4774 GLsizei *length_base = (GLsizei *) 0;
4775 jint _lengthRemaining;
4776 GLsizei *length = (GLsizei *) 0;
4777 GLenum *binaryFormat_base = (GLenum *) 0;
4778 jint _binaryFormatRemaining;
4779 GLenum *binaryFormat = (GLenum *) 0;
4780 jint _binaryRemaining;
4781 GLvoid *binary = (GLvoid *) 0;
4782
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004783 if (length_ref) {
4784 if (lengthOffset < 0) {
4785 _exception = 1;
4786 _exceptionType = "java/lang/IllegalArgumentException";
4787 _exceptionMessage = "lengthOffset < 0";
4788 goto exit;
4789 }
4790 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
4791 length_base = (GLsizei *)
4792 _env->GetIntArrayElements(length_ref, (jboolean *)0);
4793 length = length_base + lengthOffset;
Jesse Halld830e742013-03-29 11:02:35 -07004794 }
Jesse Halld830e742013-03-29 11:02:35 -07004795
4796 if (!binaryFormat_ref) {
4797 _exception = 1;
4798 _exceptionType = "java/lang/IllegalArgumentException";
4799 _exceptionMessage = "binaryFormat == null";
4800 goto exit;
4801 }
4802 if (binaryFormatOffset < 0) {
4803 _exception = 1;
4804 _exceptionType = "java/lang/IllegalArgumentException";
4805 _exceptionMessage = "binaryFormatOffset < 0";
4806 goto exit;
4807 }
4808 _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
4809 binaryFormat_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004810 _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004811 binaryFormat = binaryFormat_base + binaryFormatOffset;
4812
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004813 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004814 if (binary == NULL) {
4815 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4816 binary = (GLvoid *) (_binaryBase + _bufferOffset);
4817 }
4818 glGetProgramBinary(
4819 (GLuint)program,
4820 (GLsizei)bufSize,
4821 (GLsizei *)length,
4822 (GLenum *)binaryFormat,
4823 (GLvoid *)binary
4824 );
4825
4826exit:
4827 if (_array) {
4828 releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
4829 }
4830 if (binaryFormat_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004831 _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
Jesse Halld830e742013-03-29 11:02:35 -07004832 _exception ? JNI_ABORT: 0);
4833 }
4834 if (length_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004835 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
Jesse Halld830e742013-03-29 11:02:35 -07004836 _exception ? JNI_ABORT: 0);
4837 }
4838 if (_exception) {
4839 jniThrowException(_env, _exceptionType, _exceptionMessage);
4840 }
4841}
4842
4843/* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
4844static void
4845android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
4846 (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004847 jintArray _lengthArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004848 jint _lengthBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004849 jintArray _binaryFormatArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004850 jint _binaryFormatBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004851 jintArray _binaryArray = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004852 jint _binaryBufferOffset = (jint) 0;
4853 jint _lengthRemaining;
4854 GLsizei *length = (GLsizei *) 0;
4855 jint _binaryFormatRemaining;
4856 GLenum *binaryFormat = (GLenum *) 0;
4857 jint _binaryRemaining;
4858 GLvoid *binary = (GLvoid *) 0;
4859
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004860 if (length_buf) {
4861 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
4862 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004863 binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
4864 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
Pablo Ceballos6aff9062015-10-01 18:35:39 -07004865 if (length_buf && length == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004866 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004867 length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
4868 }
4869 if (binaryFormat == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004870 char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004871 binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
4872 }
4873 if (binary == NULL) {
4874 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
4875 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
4876 }
4877 glGetProgramBinary(
4878 (GLuint)program,
4879 (GLsizei)bufSize,
4880 (GLsizei *)length,
4881 (GLenum *)binaryFormat,
4882 (GLvoid *)binary
4883 );
4884 if (_binaryArray) {
4885 releasePointer(_env, _binaryArray, binary, JNI_TRUE);
4886 }
4887 if (_binaryFormatArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004888 _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004889 }
4890 if (_lengthArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004891 _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
Jesse Halld830e742013-03-29 11:02:35 -07004892 }
4893}
4894
4895/* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
4896static void
4897android_glProgramBinary__IILjava_nio_Buffer_2I
4898 (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
4899 jarray _array = (jarray) 0;
4900 jint _bufferOffset = (jint) 0;
4901 jint _remaining;
4902 GLvoid *binary = (GLvoid *) 0;
4903
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004904 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004905 if (binary == NULL) {
4906 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4907 binary = (GLvoid *) (_binaryBase + _bufferOffset);
4908 }
4909 glProgramBinary(
4910 (GLuint)program,
4911 (GLenum)binaryFormat,
4912 (GLvoid *)binary,
4913 (GLsizei)length
4914 );
4915 if (_array) {
4916 releasePointer(_env, _array, binary, JNI_FALSE);
4917 }
4918}
4919
4920/* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
4921static void
4922android_glProgramParameteri__III
4923 (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
4924 glProgramParameteri(
4925 (GLuint)program,
4926 (GLenum)pname,
4927 (GLint)value
4928 );
4929}
4930
4931/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
4932static void
4933android_glInvalidateFramebuffer__II_3II
4934 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
4935 jint _exception = 0;
4936 const char * _exceptionType = NULL;
4937 const char * _exceptionMessage = NULL;
4938 GLenum *attachments_base = (GLenum *) 0;
4939 jint _remaining;
4940 GLenum *attachments = (GLenum *) 0;
4941
4942 if (!attachments_ref) {
4943 _exception = 1;
4944 _exceptionType = "java/lang/IllegalArgumentException";
4945 _exceptionMessage = "attachments == null";
4946 goto exit;
4947 }
4948 if (offset < 0) {
4949 _exception = 1;
4950 _exceptionType = "java/lang/IllegalArgumentException";
4951 _exceptionMessage = "offset < 0";
4952 goto exit;
4953 }
4954 _remaining = _env->GetArrayLength(attachments_ref) - offset;
4955 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004956 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07004957 attachments = attachments_base + offset;
4958
4959 glInvalidateFramebuffer(
4960 (GLenum)target,
4961 (GLsizei)numAttachments,
4962 (GLenum *)attachments
4963 );
4964
4965exit:
4966 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004967 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07004968 JNI_ABORT);
4969 }
4970 if (_exception) {
4971 jniThrowException(_env, _exceptionType, _exceptionMessage);
4972 }
4973}
4974
4975/* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
4976static void
4977android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
4978 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004979 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07004980 jint _bufferOffset = (jint) 0;
4981 jint _remaining;
4982 GLenum *attachments = (GLenum *) 0;
4983
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004984 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07004985 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004986 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07004987 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
4988 }
4989 glInvalidateFramebuffer(
4990 (GLenum)target,
4991 (GLsizei)numAttachments,
4992 (GLenum *)attachments
4993 );
4994 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004995 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07004996 }
4997}
4998
4999/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5000static void
5001android_glInvalidateSubFramebuffer__II_3IIIIII
5002 (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
5003 jint _exception = 0;
5004 const char * _exceptionType = NULL;
5005 const char * _exceptionMessage = NULL;
5006 GLenum *attachments_base = (GLenum *) 0;
5007 jint _remaining;
5008 GLenum *attachments = (GLenum *) 0;
5009
5010 if (!attachments_ref) {
5011 _exception = 1;
5012 _exceptionType = "java/lang/IllegalArgumentException";
5013 _exceptionMessage = "attachments == null";
5014 goto exit;
5015 }
5016 if (offset < 0) {
5017 _exception = 1;
5018 _exceptionType = "java/lang/IllegalArgumentException";
5019 _exceptionMessage = "offset < 0";
5020 goto exit;
5021 }
5022 _remaining = _env->GetArrayLength(attachments_ref) - offset;
5023 attachments_base = (GLenum *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005024 _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005025 attachments = attachments_base + offset;
5026
5027 glInvalidateSubFramebuffer(
5028 (GLenum)target,
5029 (GLsizei)numAttachments,
5030 (GLenum *)attachments,
5031 (GLint)x,
5032 (GLint)y,
5033 (GLsizei)width,
5034 (GLsizei)height
5035 );
5036
5037exit:
5038 if (attachments_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005039 _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
Jesse Halld830e742013-03-29 11:02:35 -07005040 JNI_ABORT);
5041 }
5042 if (_exception) {
5043 jniThrowException(_env, _exceptionType, _exceptionMessage);
5044 }
5045}
5046
5047/* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
5048static void
5049android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
5050 (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 -07005051 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005052 jint _bufferOffset = (jint) 0;
5053 jint _remaining;
5054 GLenum *attachments = (GLenum *) 0;
5055
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005056 attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005057 if (attachments == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005058 char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005059 attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
5060 }
5061 glInvalidateSubFramebuffer(
5062 (GLenum)target,
5063 (GLsizei)numAttachments,
5064 (GLenum *)attachments,
5065 (GLint)x,
5066 (GLint)y,
5067 (GLsizei)width,
5068 (GLsizei)height
5069 );
5070 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005071 _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
Jesse Halld830e742013-03-29 11:02:35 -07005072 }
5073}
5074
5075/* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
5076static void
5077android_glTexStorage2D__IIIII
5078 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
5079 glTexStorage2D(
5080 (GLenum)target,
5081 (GLsizei)levels,
5082 (GLenum)internalformat,
5083 (GLsizei)width,
5084 (GLsizei)height
5085 );
5086}
5087
5088/* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
5089static void
5090android_glTexStorage3D__IIIIII
5091 (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
5092 glTexStorage3D(
5093 (GLenum)target,
5094 (GLsizei)levels,
5095 (GLenum)internalformat,
5096 (GLsizei)width,
5097 (GLsizei)height,
5098 (GLsizei)depth
5099 );
5100}
5101
5102/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5103static void
5104android_glGetInternalformativ__IIII_3II
5105 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
5106 jint _exception = 0;
5107 const char * _exceptionType = NULL;
5108 const char * _exceptionMessage = NULL;
5109 GLint *params_base = (GLint *) 0;
5110 jint _remaining;
5111 GLint *params = (GLint *) 0;
5112
5113 if (!params_ref) {
5114 _exception = 1;
5115 _exceptionType = "java/lang/IllegalArgumentException";
5116 _exceptionMessage = "params == null";
5117 goto exit;
5118 }
5119 if (offset < 0) {
5120 _exception = 1;
5121 _exceptionType = "java/lang/IllegalArgumentException";
5122 _exceptionMessage = "offset < 0";
5123 goto exit;
5124 }
5125 _remaining = _env->GetArrayLength(params_ref) - offset;
5126 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005127 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Halld830e742013-03-29 11:02:35 -07005128 params = params_base + offset;
5129
5130 glGetInternalformativ(
5131 (GLenum)target,
5132 (GLenum)internalformat,
5133 (GLenum)pname,
5134 (GLsizei)bufSize,
5135 (GLint *)params
5136 );
5137
5138exit:
5139 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005140 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Halld830e742013-03-29 11:02:35 -07005141 _exception ? JNI_ABORT: 0);
5142 }
5143 if (_exception) {
5144 jniThrowException(_env, _exceptionType, _exceptionMessage);
5145 }
5146}
5147
5148/* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
5149static void
5150android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
5151 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005152 jintArray _array = (jintArray) 0;
Jesse Halld830e742013-03-29 11:02:35 -07005153 jint _bufferOffset = (jint) 0;
5154 jint _remaining;
5155 GLint *params = (GLint *) 0;
5156
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005157 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Halld830e742013-03-29 11:02:35 -07005158 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005159 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Halld830e742013-03-29 11:02:35 -07005160 params = (GLint *) (_paramsBase + _bufferOffset);
5161 }
5162 glGetInternalformativ(
5163 (GLenum)target,
5164 (GLenum)internalformat,
5165 (GLenum)pname,
5166 (GLsizei)bufSize,
5167 (GLint *)params
5168 );
5169 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005170 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jesse Halld830e742013-03-29 11:02:35 -07005171 }
5172}
5173
5174static const char *classPathName = "android/opengl/GLES30";
5175
Daniel Micay76f6a862015-09-19 17:31:01 -04005176static const JNINativeMethod methods[] = {
Jesse Halld830e742013-03-29 11:02:35 -07005177{"_nativeClassInit", "()V", (void*)nativeClassInit },
5178{"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
5179{"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
5180{"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
5181{"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
5182{"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
5183{"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5184{"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
5185{"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
5186{"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
5187{"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
5188{"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
5189{"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
5190{"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
5191{"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
5192{"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
5193{"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
5194{"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
5195{"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
5196{"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
5197{"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
5198{"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
5199{"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
5200{"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
5201{"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
5202{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
5203{"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
5204{"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
5205{"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
5206{"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
5207{"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
5208{"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
5209{"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
5210{"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
5211{"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
5212{"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
5213{"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
5214{"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
5215{"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
5216{"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
5217{"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
5218{"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
5219{"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
5220{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
5221{"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
5222{"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
5223{"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
5224{"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
5225{"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
5226{"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
5227{"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
5228{"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
5229{"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
5230{"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
5231{"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
5232{"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
5233{"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
5234{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
5235{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
5236{"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
Pablo Ceballos59fb43e2016-01-29 15:43:00 -08005237{"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
Jesse Halld830e742013-03-29 11:02:35 -07005238{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
5239{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
5240{"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
5241{"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
5242{"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
5243{"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
5244{"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
5245{"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
5246{"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
5247{"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
5248{"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
5249{"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
5250{"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
5251{"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
5252{"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
5253{"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
5254{"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
5255{"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
5256{"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
5257{"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
5258{"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
5259{"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
5260{"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
5261{"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
5262{"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
5263{"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
5264{"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
5265{"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
5266{"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
5267{"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
5268{"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
5269{"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
5270{"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
5271{"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
5272{"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
5273{"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
5274{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
5275{"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
5276{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
Jesse Halld877efe2013-04-29 15:59:35 -07005277{"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
Jesse Halld830e742013-03-29 11:02:35 -07005278{"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
5279{"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
5280{"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
5281{"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
5282{"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
5283{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
5284{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
5285{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
5286{"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
5287{"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
5288{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
5289{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
5290{"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
5291{"glIsSync", "(J)Z", (void *) android_glIsSync__J },
5292{"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
5293{"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
5294{"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
5295{"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
5296{"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
5297{"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
5298{"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
5299{"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
5300{"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
5301{"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
5302{"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
5303{"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
5304{"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
5305{"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
5306{"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
5307{"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
5308{"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
5309{"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
5310{"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
5311{"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
5312{"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
5313{"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
5314{"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
5315{"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
5316{"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
5317{"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
5318{"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
5319{"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
5320{"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
5321{"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
5322{"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
5323{"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
5324{"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
5325{"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
5326{"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
5327{"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
5328{"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
5329{"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
5330{"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
5331{"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
5332{"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
5333{"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
5334{"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
5335{"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
5336{"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
5337{"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
5338{"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
5339{"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
5340};
5341
5342int register_android_opengl_jni_GLES30(JNIEnv *_env)
5343{
5344 int err;
5345 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
5346 return err;
5347}