blob: aa917a03043b7bcbf066d3390699247089629866 [file] [log] [blame]
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001/*
2 * Copyright 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// This source file is automatically generated
18
19#pragma GCC diagnostic ignored "-Wunused-variable"
20#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
21#pragma GCC diagnostic ignored "-Wunused-function"
22
23#include <stdint.h>
24#include <GLES3/gl32.h>
25#include <jni.h>
26#include <JNIHelp.h>
27#include <android_runtime/AndroidRuntime.h>
28#include <utils/misc.h>
29#include <assert.h>
30
31static int initialized = 0;
32
33static jclass nioAccessClass;
34static jclass bufferClass;
35static jmethodID getBasePointerID;
36static jmethodID getBaseArrayID;
37static jmethodID getBaseArrayOffsetID;
38static jfieldID positionID;
39static jfieldID limitID;
40static jfieldID elementSizeShiftID;
41
42
43/* special calls implemented in Android's GLES wrapper used to more
44 * efficiently bound-check passed arrays */
45extern "C" {
46#ifdef GL_VERSION_ES_CM_1_1
47GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
48 const GLvoid *ptr, GLsizei count);
49GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
50 const GLvoid *pointer, GLsizei count);
51GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
52 GLsizei stride, const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61#endif
62#ifdef GL_ES_VERSION_2_0
63static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
64 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
65 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
66}
67#endif
68#ifdef GL_ES_VERSION_3_0
69static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
70 GLsizei stride, const GLvoid *pointer, GLsizei count) {
71 glVertexAttribIPointer(indx, size, type, stride, pointer);
72}
73#endif
74}
75
76/* Cache method IDs each time the class is loaded. */
77
78static void
79nativeClassInit(JNIEnv *_env, jclass glImplClass)
80{
81 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
82 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
83
84 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
85 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
86
87 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
88 "getBasePointer", "(Ljava/nio/Buffer;)J");
89 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
90 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
91 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
93
94 positionID = _env->GetFieldID(bufferClass, "position", "I");
95 limitID = _env->GetFieldID(bufferClass, "limit", "I");
96 elementSizeShiftID =
97 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
98}
99
100static void *
101getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
102{
103 jint position;
104 jint limit;
105 jint elementSizeShift;
106 jlong pointer;
107
108 position = _env->GetIntField(buffer, positionID);
109 limit = _env->GetIntField(buffer, limitID);
110 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
111 *remaining = (limit - position) << elementSizeShift;
112 pointer = _env->CallStaticLongMethod(nioAccessClass,
113 getBasePointerID, buffer);
114 if (pointer != 0L) {
115 *array = NULL;
116 return reinterpret_cast<void*>(pointer);
117 }
118
119 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
120 getBaseArrayID, buffer);
121 *offset = _env->CallStaticIntMethod(nioAccessClass,
122 getBaseArrayOffsetID, buffer);
123
124 return NULL;
125}
126
127class ByteArrayGetter {
128public:
129 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
130 return _env->GetByteArrayElements(array, is_copy);
131 }
132};
133class BooleanArrayGetter {
134public:
135 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
136 return _env->GetBooleanArrayElements(array, is_copy);
137 }
138};
139class CharArrayGetter {
140public:
141 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
142 return _env->GetCharArrayElements(array, is_copy);
143 }
144};
145class ShortArrayGetter {
146public:
147 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
148 return _env->GetShortArrayElements(array, is_copy);
149 }
150};
151class IntArrayGetter {
152public:
153 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
154 return _env->GetIntArrayElements(array, is_copy);
155 }
156};
157class LongArrayGetter {
158public:
159 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
160 return _env->GetLongArrayElements(array, is_copy);
161 }
162};
163class FloatArrayGetter {
164public:
165 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
166 return _env->GetFloatArrayElements(array, is_copy);
167 }
168};
169class DoubleArrayGetter {
170public:
171 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
172 return _env->GetDoubleArrayElements(array, is_copy);
173 }
174};
175
176template<typename JTYPEARRAY, typename ARRAYGETTER>
177static void*
178getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
179 return ARRAYGETTER::Get(_env, array, is_copy);
180}
181
182class ByteArrayReleaser {
183public:
184 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
185 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
186 }
187};
188class BooleanArrayReleaser {
189public:
190 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
191 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
192 }
193};
194class CharArrayReleaser {
195public:
196 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
197 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
198 }
199};
200class ShortArrayReleaser {
201public:
202 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
203 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
204 }
205};
206class IntArrayReleaser {
207public:
208 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
209 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
210 }
211};
212class LongArrayReleaser {
213public:
214 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
215 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
216 }
217};
218class FloatArrayReleaser {
219public:
220 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
221 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
222 }
223};
224class DoubleArrayReleaser {
225public:
226 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
227 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
228 }
229};
230
231template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
232static void
233releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
234 ARRAYRELEASER::Release(_env, array, data, commit);
235}
236
237static void
238releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
239{
240 _env->ReleasePrimitiveArrayCritical(array, data,
241 commit ? 0 : JNI_ABORT);
242}
243
244static void *
245getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
246 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
247 if (buf) {
248 jint position = _env->GetIntField(buffer, positionID);
249 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
250 buf += position << elementSizeShift;
251 } else {
252 jniThrowException(_env, "java/lang/IllegalArgumentException",
253 "Must use a native order direct Buffer");
254 }
255 return (void*) buf;
256}
257
258// --------------------------------------------------------------------------
259
260/*
261 * returns the number of values glGet returns for a given pname.
262 *
263 * The code below is written such that pnames requiring only one values
264 * are the default (and are not explicitely tested for). This makes the
265 * checking code much shorter/readable/efficient.
266 *
267 * This means that unknown pnames (e.g.: extensions) will default to 1. If
268 * that unknown pname needs more than 1 value, then the validation check
269 * is incomplete and the app may crash if it passed the wrong number params.
270 */
271static int getNeededCount(GLint pname) {
272 int needed = 1;
273#ifdef GL_ES_VERSION_2_0
274 // GLES 2.x pnames
275 switch (pname) {
276 case GL_ALIASED_LINE_WIDTH_RANGE:
277 case GL_ALIASED_POINT_SIZE_RANGE:
278 needed = 2;
279 break;
280
281 case GL_BLEND_COLOR:
282 case GL_COLOR_CLEAR_VALUE:
283 case GL_COLOR_WRITEMASK:
284 case GL_SCISSOR_BOX:
285 case GL_VIEWPORT:
286 needed = 4;
287 break;
288
289 case GL_COMPRESSED_TEXTURE_FORMATS:
290 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
291 break;
292
293 case GL_SHADER_BINARY_FORMATS:
294 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
295 break;
296 }
297#endif
298
299#ifdef GL_VERSION_ES_CM_1_1
300 // GLES 1.x pnames
301 switch (pname) {
302 case GL_ALIASED_LINE_WIDTH_RANGE:
303 case GL_ALIASED_POINT_SIZE_RANGE:
304 case GL_DEPTH_RANGE:
305 case GL_SMOOTH_LINE_WIDTH_RANGE:
306 case GL_SMOOTH_POINT_SIZE_RANGE:
307 needed = 2;
308 break;
309
310 case GL_CURRENT_NORMAL:
311 case GL_POINT_DISTANCE_ATTENUATION:
312 needed = 3;
313 break;
314
315 case GL_COLOR_CLEAR_VALUE:
316 case GL_COLOR_WRITEMASK:
317 case GL_CURRENT_COLOR:
318 case GL_CURRENT_TEXTURE_COORDS:
319 case GL_FOG_COLOR:
320 case GL_LIGHT_MODEL_AMBIENT:
321 case GL_SCISSOR_BOX:
322 case GL_VIEWPORT:
323 needed = 4;
324 break;
325
326 case GL_MODELVIEW_MATRIX:
327 case GL_PROJECTION_MATRIX:
328 case GL_TEXTURE_MATRIX:
329 needed = 16;
330 break;
331
332 case GL_COMPRESSED_TEXTURE_FORMATS:
333 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
334 break;
335 }
336#endif
337 return needed;
338}
339
340template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
341 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
342static void
343get
344 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
345 jint _exception = 0;
346 const char * _exceptionType;
347 const char * _exceptionMessage;
348 CTYPE *params_base = (CTYPE *) 0;
349 jint _remaining;
350 CTYPE *params = (CTYPE *) 0;
351 int _needed = 0;
352
353 if (!params_ref) {
354 _exception = 1;
355 _exceptionType = "java/lang/IllegalArgumentException";
356 _exceptionMessage = "params == null";
357 goto exit;
358 }
359 if (offset < 0) {
360 _exception = 1;
361 _exceptionType = "java/lang/IllegalArgumentException";
362 _exceptionMessage = "offset < 0";
363 goto exit;
364 }
365 _remaining = _env->GetArrayLength(params_ref) - offset;
366 _needed = getNeededCount(pname);
367 // if we didn't find this pname, we just assume the user passed
368 // an array of the right size -- this might happen with extensions
369 // or if we forget an enum here.
370 if (_remaining < _needed) {
371 _exception = 1;
372 _exceptionType = "java/lang/IllegalArgumentException";
373 _exceptionMessage = "length - offset < needed";
374 goto exit;
375 }
376 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
377 _env, params_ref, (jboolean *)0);
378 params = params_base + offset;
379
380 GET(
381 (GLenum)pname,
382 (CTYPE *)params
383 );
384
385exit:
386 if (params_base) {
387 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
388 _env, params_ref, params_base, !_exception);
389 }
390 if (_exception) {
391 jniThrowException(_env, _exceptionType, _exceptionMessage);
392 }
393}
394
395
396template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
397 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
398static void
399getarray
400 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
401 jint _exception = 0;
402 const char * _exceptionType;
403 const char * _exceptionMessage;
404 JTYPEARRAY _array = (JTYPEARRAY) 0;
405 jint _bufferOffset = (jint) 0;
406 jint _remaining;
407 CTYPE *params = (CTYPE *) 0;
408 int _needed = 0;
409
410 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
411 _remaining /= sizeof(CTYPE); // convert from bytes to item count
412 _needed = getNeededCount(pname);
413 // if we didn't find this pname, we just assume the user passed
414 // an array of the right size -- this might happen with extensions
415 // or if we forget an enum here.
416 if (_needed>0 && _remaining < _needed) {
417 _exception = 1;
418 _exceptionType = "java/lang/IllegalArgumentException";
419 _exceptionMessage = "remaining() < needed";
420 goto exit;
421 }
422 if (params == NULL) {
423 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
424 _env, _array, (jboolean *) 0);
425 params = (CTYPE *) (_paramsBase + _bufferOffset);
426 }
427 GET(
428 (GLenum)pname,
429 (CTYPE *)params
430 );
431
432exit:
433 if (_array) {
434 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
435 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
436 }
437 if (_exception) {
438 jniThrowException(_env, _exceptionType, _exceptionMessage);
439 }
440}
441
442// --------------------------------------------------------------------------
443/* void glBlendBarrier ( void ) */
444static void
445android_glBlendBarrier__
446 (JNIEnv *_env, jobject _this) {
447 glBlendBarrier();
448}
449
450/* void glCopyImageSubData ( GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth ) */
451static void
452android_glCopyImageSubData__IIIIIIIIIIIIIII
453 (JNIEnv *_env, jobject _this, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth) {
454 glCopyImageSubData(
455 (GLuint)srcName,
456 (GLenum)srcTarget,
457 (GLint)srcLevel,
458 (GLint)srcX,
459 (GLint)srcY,
460 (GLint)srcZ,
461 (GLuint)dstName,
462 (GLenum)dstTarget,
463 (GLint)dstLevel,
464 (GLint)dstX,
465 (GLint)dstY,
466 (GLint)dstZ,
467 (GLsizei)srcWidth,
468 (GLsizei)srcHeight,
469 (GLsizei)srcDepth
470 );
471}
472
473/* void glDebugMessageControl ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
474static void
475android_glDebugMessageControl__IIII_3IIZ
476 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jintArray ids_ref, jint offset, jboolean enabled) {
477 jint _exception = 0;
478 const char * _exceptionType = NULL;
479 const char * _exceptionMessage = NULL;
480 GLuint *ids_base = (GLuint *) 0;
481 jint _remaining;
482 GLuint *ids = (GLuint *) 0;
483
484 if (!ids_ref) {
485 _exception = 1;
486 _exceptionType = "java/lang/IllegalArgumentException";
487 _exceptionMessage = "ids == null";
488 goto exit;
489 }
490 if (offset < 0) {
491 _exception = 1;
492 _exceptionType = "java/lang/IllegalArgumentException";
493 _exceptionMessage = "offset < 0";
494 goto exit;
495 }
496 _remaining = _env->GetArrayLength(ids_ref) - offset;
497 if (_remaining < count) {
498 _exception = 1;
499 _exceptionType = "java/lang/IllegalArgumentException";
500 _exceptionMessage = "length - offset < count < needed";
501 goto exit;
502 }
503 ids_base = (GLuint *)
504 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
505 ids = ids_base + offset;
506
507 glDebugMessageControl(
508 (GLenum)source,
509 (GLenum)type,
510 (GLenum)severity,
511 (GLsizei)count,
512 (GLuint *)ids,
513 (GLboolean)enabled
514 );
515
516exit:
517 if (ids_base) {
518 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
519 JNI_ABORT);
520 }
521 if (_exception) {
522 jniThrowException(_env, _exceptionType, _exceptionMessage);
523 }
524}
525
526/* void glDebugMessageControl ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
527static void
528android_glDebugMessageControl__IIIILjava_nio_IntBuffer_2Z
529 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jobject ids_buf, jboolean enabled) {
530 jint _exception = 0;
531 const char * _exceptionType = NULL;
532 const char * _exceptionMessage = NULL;
533 jintArray _array = (jintArray) 0;
534 jint _bufferOffset = (jint) 0;
535 jint _remaining;
536 GLuint *ids = (GLuint *) 0;
537
Romain Guy84cac202016-12-05 12:26:02 -0800538 if (!ids_buf) {
539 _exception = 1;
540 _exceptionType = "java/lang/IllegalArgumentException";
541 _exceptionMessage = "ids == null";
542 goto exit;
543 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -0700544 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
545 if (_remaining < count) {
546 _exception = 1;
547 _exceptionType = "java/lang/IllegalArgumentException";
548 _exceptionMessage = "remaining() < count < needed";
549 goto exit;
550 }
551 if (ids == NULL) {
552 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
553 ids = (GLuint *) (_idsBase + _bufferOffset);
554 }
555 glDebugMessageControl(
556 (GLenum)source,
557 (GLenum)type,
558 (GLenum)severity,
559 (GLsizei)count,
560 (GLuint *)ids,
561 (GLboolean)enabled
562 );
563
564exit:
565 if (_array) {
566 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
567 }
568 if (_exception) {
569 jniThrowException(_env, _exceptionType, _exceptionMessage);
570 }
571}
572
573/* void glDebugMessageInsert ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf ) */
574static void
575android_glDebugMessageInsert__IIIIILjava_lang_String_2
576 (JNIEnv *_env, jobject _this, jint source, jint type, jint id, jint severity, jint length, jstring buf) {
577 jint _exception = 0;
578 const char * _exceptionType = NULL;
579 const char * _exceptionMessage = NULL;
580 const char* _nativebuf = 0;
581
582 if (!buf) {
583 _exception = 1;
584 _exceptionType = "java/lang/IllegalArgumentException";
585 _exceptionMessage = "buf == null";
586 goto exit;
587 }
588 _nativebuf = _env->GetStringUTFChars(buf, 0);
589
590 glDebugMessageInsert(
591 (GLenum)source,
592 (GLenum)type,
593 (GLuint)id,
594 (GLenum)severity,
595 (GLsizei)length,
596 (GLchar *)_nativebuf
597 );
598
599exit:
600 if (_nativebuf) {
601 _env->ReleaseStringUTFChars(buf, _nativebuf);
602 }
603
604 if (_exception) {
605 jniThrowException(_env, _exceptionType, _exceptionMessage);
606 }
607}
608
609/* void glDebugMessageCallback ( GLDEBUGPROC callback, const void *userParam ) */
610static void
611android_glDebugMessageCallback(JNIEnv *_env, jobject _this, jobject callback) {
612 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
613}
614/* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
615static jint
616android_glGetDebugMessageLog__II_3II_3II_3II_3II_3II_3BI
617 (JNIEnv *_env, jobject _this, jint count, jint bufSize, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset, jintArray lengths_ref, jint lengthsOffset, jbyteArray messageLog_ref, jint messageLogOffset) {
618 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
619 return 0;
620}
621
622/* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
623static uint
624android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
625 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref, jobject lengths_ref, jobject messageLog_ref) {
626 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
627 return 0;
628}
629
630/* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
631static jobjectArray
632android_glGetDebugMessageLog__I_3II_3II_3II_3II
633 (JNIEnv *_env, jobject _this, jint count, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset) {
634 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
635 return 0;
636}
637
638/* GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
639static jobjectArray
640android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
641 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref) {
642 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
643 return 0;
644}
645/* void glPushDebugGroup ( GLenum source, GLuint id, GLsizei length, const GLchar *message ) */
646static void
647android_glPushDebugGroup__IIILjava_lang_String_2
648 (JNIEnv *_env, jobject _this, jint source, jint id, jint length, jstring message) {
649 jint _exception = 0;
650 const char * _exceptionType = NULL;
651 const char * _exceptionMessage = NULL;
652 const char* _nativemessage = 0;
653 jsize _stringlen = 0;
654
655 if (!message) {
656 _exception = 1;
657 _exceptionType = "java/lang/IllegalArgumentException";
658 _exceptionMessage = "message == null";
659 goto exit;
660 }
661 _nativemessage = _env->GetStringUTFChars(message, 0);
662 _stringlen = _env->GetStringUTFLength(message);
663 if (length > _stringlen) {
664 _exception = 1;
665 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
666 _exceptionMessage = "length of message is shorter than length argument";
667 goto exit;
668 }
669
670 glPushDebugGroup(
671 (GLenum)source,
672 (GLuint)id,
673 (GLsizei)length,
674 (GLchar *)_nativemessage
675 );
676
677exit:
678 if (_nativemessage) {
679 _env->ReleaseStringUTFChars(message, _nativemessage);
680 }
681
682 if (_exception) {
683 jniThrowException(_env, _exceptionType, _exceptionMessage);
684 }
685}
686
687/* void glPopDebugGroup ( void ) */
688static void
689android_glPopDebugGroup__
690 (JNIEnv *_env, jobject _this) {
691 glPopDebugGroup();
692}
693
694/* void glObjectLabel ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label ) */
695static void
696android_glObjectLabel__IIILjava_lang_String_2
697 (JNIEnv *_env, jobject _this, jint identifier, jint name, jint length, jstring label) {
698 jint _exception = 0;
699 const char * _exceptionType = NULL;
700 const char * _exceptionMessage = NULL;
701 const char* _nativelabel = 0;
702 jsize _stringlen = 0;
703
704 if (label) {
705 _nativelabel = _env->GetStringUTFChars(label, 0);
706 _stringlen = _env->GetStringUTFLength(label);
707 if (length > _stringlen) {
708 _exception = 1;
709 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
710 _exceptionMessage = "length of label is shorter than length argument";
711 goto exit;
712 }
713 }
714
715 glObjectLabel(
716 (GLenum)identifier,
717 (GLuint)name,
718 (GLsizei)length,
719 (GLchar *)_nativelabel
720 );
721
722exit:
723 if (_nativelabel) {
724 _env->ReleaseStringUTFChars(label, _nativelabel);
725 }
726
727 if (_exception) {
728 jniThrowException(_env, _exceptionType, _exceptionMessage);
729 }
730}
731
732/* void glGetObjectLabel ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label ) */
733static jstring
734android_glGetObjectLabel(JNIEnv *_env, jobject _this, jint identifier, jint name) {
735 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
736 return NULL;
737}
738
739/* void glObjectPtrLabel ( const void *ptr, GLsizei length, const GLchar *label ) */
740static void
741android_glObjectPtrLabel(JNIEnv *_env, jobject _this, jlong ptr, jstring label) {
742 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
743}
744
745/* void glGetObjectPtrLabel ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label ) */
746static jstring
747android_glGetObjectPtrLabel(JNIEnv *_env, jobject _this, jlong ptr) {
748 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
749 return NULL;
750}
751
752/* void glGetPointerv ( GLenum pname, void **params ) */
753static jlong
754android_glGetPointerv(JNIEnv *_env, jobject _this, jint pname) {
755 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
756 return NULL;
757}
758
759/* void glEnablei ( GLenum target, GLuint index ) */
760static void
761android_glEnablei__II
762 (JNIEnv *_env, jobject _this, jint target, jint index) {
763 glEnablei(
764 (GLenum)target,
765 (GLuint)index
766 );
767}
768
769/* void glDisablei ( GLenum target, GLuint index ) */
770static void
771android_glDisablei__II
772 (JNIEnv *_env, jobject _this, jint target, jint index) {
773 glDisablei(
774 (GLenum)target,
775 (GLuint)index
776 );
777}
778
779/* void glBlendEquationi ( GLuint buf, GLenum mode ) */
780static void
781android_glBlendEquationi__II
782 (JNIEnv *_env, jobject _this, jint buf, jint mode) {
783 glBlendEquationi(
784 (GLuint)buf,
785 (GLenum)mode
786 );
787}
788
789/* void glBlendEquationSeparatei ( GLuint buf, GLenum modeRGB, GLenum modeAlpha ) */
790static void
791android_glBlendEquationSeparatei__III
792 (JNIEnv *_env, jobject _this, jint buf, jint modeRGB, jint modeAlpha) {
793 glBlendEquationSeparatei(
794 (GLuint)buf,
795 (GLenum)modeRGB,
796 (GLenum)modeAlpha
797 );
798}
799
800/* void glBlendFunci ( GLuint buf, GLenum src, GLenum dst ) */
801static void
802android_glBlendFunci__III
803 (JNIEnv *_env, jobject _this, jint buf, jint src, jint dst) {
804 glBlendFunci(
805 (GLuint)buf,
806 (GLenum)src,
807 (GLenum)dst
808 );
809}
810
811/* void glBlendFuncSeparatei ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */
812static void
813android_glBlendFuncSeparatei__IIIII
814 (JNIEnv *_env, jobject _this, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
815 glBlendFuncSeparatei(
816 (GLuint)buf,
817 (GLenum)srcRGB,
818 (GLenum)dstRGB,
819 (GLenum)srcAlpha,
820 (GLenum)dstAlpha
821 );
822}
823
824/* void glColorMaski ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) */
825static void
826android_glColorMaski__IZZZZ
827 (JNIEnv *_env, jobject _this, jint index, jboolean r, jboolean g, jboolean b, jboolean a) {
828 glColorMaski(
829 (GLuint)index,
830 (GLboolean)r,
831 (GLboolean)g,
832 (GLboolean)b,
833 (GLboolean)a
834 );
835}
836
837/* GLboolean glIsEnabledi ( GLenum target, GLuint index ) */
838static jboolean
839android_glIsEnabledi__II
840 (JNIEnv *_env, jobject _this, jint target, jint index) {
841 GLboolean _returnValue;
842 _returnValue = glIsEnabledi(
843 (GLenum)target,
844 (GLuint)index
845 );
846 return (jboolean)_returnValue;
847}
848
849/* void glDrawElementsBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex ) */
850static void
851android_glDrawElementsBaseVertex__IIILjava_nio_Buffer_2I
852 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint basevertex) {
853 jint _exception = 0;
854 const char * _exceptionType = NULL;
855 const char * _exceptionMessage = NULL;
856 jarray _array = (jarray) 0;
857 jint _bufferOffset = (jint) 0;
858 jint _remaining;
859 void *indices = (void *) 0;
860
Romain Guy84cac202016-12-05 12:26:02 -0800861 if (!indices_buf) {
862 _exception = 1;
863 _exceptionType = "java/lang/IllegalArgumentException";
864 _exceptionMessage = "indices == null";
865 goto exit;
866 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -0700867 indices = (void *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
868 if (_remaining < count-basevertex) {
869 _exception = 1;
870 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
871 _exceptionMessage = "remaining() < count-basevertex < needed";
872 goto exit;
873 }
874 if (indices == NULL) {
875 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
876 indices = (void *) (_indicesBase + _bufferOffset);
877 }
878 glDrawElementsBaseVertex(
879 (GLenum)mode,
880 (GLsizei)count,
881 (GLenum)type,
882 (void *)indices,
883 (GLint)basevertex
884 );
885
886exit:
887 if (_array) {
888 releasePointer(_env, _array, indices, JNI_FALSE);
889 }
890 if (_exception) {
891 jniThrowException(_env, _exceptionType, _exceptionMessage);
892 }
893}
894
895/* void glDrawRangeElementsBaseVertex ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex ) */
896static void
897android_glDrawRangeElementsBaseVertex__IIIIILjava_nio_Buffer_2I
898 (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf, jint basevertex) {
899 jint _exception = 0;
900 const char * _exceptionType = NULL;
901 const char * _exceptionMessage = NULL;
902 jarray _array = (jarray) 0;
903 jint _bufferOffset = (jint) 0;
904 jint _remaining;
905 void *indices = (void *) 0;
906
Romain Guy84cac202016-12-05 12:26:02 -0800907 if (!indices_buf) {
908 _exception = 1;
909 _exceptionType = "java/lang/IllegalArgumentException";
910 _exceptionMessage = "indices == null";
911 goto exit;
912 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -0700913 indices = (void *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
914 if (_remaining < count-basevertex) {
915 _exception = 1;
916 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
917 _exceptionMessage = "remaining() < count-basevertex < needed";
918 goto exit;
919 }
920 if (indices == NULL) {
921 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
922 indices = (void *) (_indicesBase + _bufferOffset);
923 }
924 glDrawRangeElementsBaseVertex(
925 (GLenum)mode,
926 (GLuint)start,
927 (GLuint)end,
928 (GLsizei)count,
929 (GLenum)type,
930 (void *)indices,
931 (GLint)basevertex
932 );
933
934exit:
935 if (_array) {
936 releasePointer(_env, _array, indices, JNI_FALSE);
937 }
938 if (_exception) {
939 jniThrowException(_env, _exceptionType, _exceptionMessage);
940 }
941}
942
943/* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
944static void
945android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II
946 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount, jint basevertex) {
947 jint _exception = 0;
948 const char * _exceptionType = NULL;
949 const char * _exceptionMessage = NULL;
950 jarray _array = (jarray) 0;
951 jint _bufferOffset = (jint) 0;
952 jint _remaining;
953 void *indices = (void *) 0;
954
955 indices = (void *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
956 if (_remaining < count-basevertex) {
957 _exception = 1;
958 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
959 _exceptionMessage = "remaining() < count-basevertex < needed";
960 goto exit;
961 }
962 if (indices == NULL) {
963 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
964 indices = (void *) (_indicesBase + _bufferOffset);
965 }
966 glDrawElementsInstancedBaseVertex(
967 (GLenum)mode,
968 (GLsizei)count,
969 (GLenum)type,
970 (void *)indices,
971 (GLsizei)instanceCount,
972 (GLint) basevertex
973 );
974
975exit:
976 if (_array) {
977 releasePointer(_env, _array, indices, JNI_FALSE);
978 }
979}
980
981/* void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instanceCount, GLint basevertex ) */
982static void
983android_glDrawElementsInstancedBaseVertex__IIIIII
984 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount, jint basevertex) {
985 glDrawElementsInstancedBaseVertex(
986 (GLenum)mode,
987 (GLsizei)count,
988 (GLenum)type,
989 (void *)static_cast<uintptr_t>(indicesOffset),
990 (GLsizei)instanceCount,
991 (GLint)basevertex
992 );
993}
994/* void glFramebufferTexture ( GLenum target, GLenum attachment, GLuint texture, GLint level ) */
995static void
996android_glFramebufferTexture__IIII
997 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level) {
998 glFramebufferTexture(
999 (GLenum)target,
1000 (GLenum)attachment,
1001 (GLuint)texture,
1002 (GLint)level
1003 );
1004}
1005
1006/* void glPrimitiveBoundingBox ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW ) */
1007static void
1008android_glPrimitiveBoundingBox__FFFFFFFF
1009 (JNIEnv *_env, jobject _this, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) {
1010 glPrimitiveBoundingBox(
1011 (GLfloat)minX,
1012 (GLfloat)minY,
1013 (GLfloat)minZ,
1014 (GLfloat)minW,
1015 (GLfloat)maxX,
1016 (GLfloat)maxY,
1017 (GLfloat)maxZ,
1018 (GLfloat)maxW
1019 );
1020}
1021
1022/* GLenum glGetGraphicsResetStatus ( void ) */
1023static jint
1024android_glGetGraphicsResetStatus__
1025 (JNIEnv *_env, jobject _this) {
1026 GLenum _returnValue;
1027 _returnValue = glGetGraphicsResetStatus();
1028 return (jint)_returnValue;
1029}
1030
1031/* void glReadnPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data ) */
1032static void
1033android_glReadnPixels__IIIIIIILjava_nio_Buffer_2
1034 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint bufSize, jobject data_buf) {
1035 jint _exception = 0;
1036 const char * _exceptionType = NULL;
1037 const char * _exceptionMessage = NULL;
1038 jarray _array = (jarray) 0;
1039 jint _bufferOffset = (jint) 0;
1040 jint _remaining;
1041 void *data = (void *) 0;
1042
Romain Guy84cac202016-12-05 12:26:02 -08001043 if (!data_buf) {
1044 _exception = 1;
1045 _exceptionType = "java/lang/IllegalArgumentException";
1046 _exceptionMessage = "data == null";
1047 goto exit;
1048 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001049 data = (void *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1050 if (_remaining < bufSize) {
1051 _exception = 1;
1052 _exceptionType = "java/lang/IllegalArgumentException";
1053 _exceptionMessage = "remaining() < bufSize < needed";
1054 goto exit;
1055 }
1056 if (data == NULL) {
1057 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1058 data = (void *) (_dataBase + _bufferOffset);
1059 }
1060 glReadnPixels(
1061 (GLint)x,
1062 (GLint)y,
1063 (GLsizei)width,
1064 (GLsizei)height,
1065 (GLenum)format,
1066 (GLenum)type,
1067 (GLsizei)bufSize,
1068 (void *)data
1069 );
1070
1071exit:
1072 if (_array) {
1073 releasePointer(_env, _array, data, _exception ? JNI_FALSE : JNI_TRUE);
1074 }
1075 if (_exception) {
1076 jniThrowException(_env, _exceptionType, _exceptionMessage);
1077 }
1078}
1079
1080/* void glGetnUniformfv ( GLuint program, GLint location, GLsizei bufSize, GLfloat *params ) */
1081static void
1082android_glGetnUniformfv__III_3FI
1083 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jfloatArray params_ref, jint offset) {
1084 jint _exception = 0;
1085 const char * _exceptionType = NULL;
1086 const char * _exceptionMessage = NULL;
1087 GLfloat *params_base = (GLfloat *) 0;
1088 jint _remaining;
1089 GLfloat *params = (GLfloat *) 0;
1090
1091 if (!params_ref) {
1092 _exception = 1;
1093 _exceptionType = "java/lang/IllegalArgumentException";
1094 _exceptionMessage = "params == null";
1095 goto exit;
1096 }
1097 if (offset < 0) {
1098 _exception = 1;
1099 _exceptionType = "java/lang/IllegalArgumentException";
1100 _exceptionMessage = "offset < 0";
1101 goto exit;
1102 }
1103 _remaining = _env->GetArrayLength(params_ref) - offset;
1104 if (_remaining < bufSize) {
1105 _exception = 1;
1106 _exceptionType = "java/lang/IllegalArgumentException";
1107 _exceptionMessage = "length - offset < bufSize < needed";
1108 goto exit;
1109 }
1110 params_base = (GLfloat *)
1111 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1112 params = params_base + offset;
1113
1114 glGetnUniformfv(
1115 (GLuint)program,
1116 (GLint)location,
1117 (GLsizei)bufSize,
1118 (GLfloat *)params
1119 );
1120
1121exit:
1122 if (params_base) {
1123 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1124 _exception ? JNI_ABORT: 0);
1125 }
1126 if (_exception) {
1127 jniThrowException(_env, _exceptionType, _exceptionMessage);
1128 }
1129}
1130
1131/* void glGetnUniformfv ( GLuint program, GLint location, GLsizei bufSize, GLfloat *params ) */
1132static void
1133android_glGetnUniformfv__IIILjava_nio_FloatBuffer_2
1134 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
1135 jint _exception = 0;
1136 const char * _exceptionType = NULL;
1137 const char * _exceptionMessage = NULL;
1138 jfloatArray _array = (jfloatArray) 0;
1139 jint _bufferOffset = (jint) 0;
1140 jint _remaining;
1141 GLfloat *params = (GLfloat *) 0;
1142
Romain Guy84cac202016-12-05 12:26:02 -08001143 if (!params_buf) {
1144 _exception = 1;
1145 _exceptionType = "java/lang/IllegalArgumentException";
1146 _exceptionMessage = "params == null";
1147 goto exit;
1148 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001149 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1150 if (_remaining < bufSize) {
1151 _exception = 1;
1152 _exceptionType = "java/lang/IllegalArgumentException";
1153 _exceptionMessage = "remaining() < bufSize < needed";
1154 goto exit;
1155 }
1156 if (params == NULL) {
1157 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1158 params = (GLfloat *) (_paramsBase + _bufferOffset);
1159 }
1160 glGetnUniformfv(
1161 (GLuint)program,
1162 (GLint)location,
1163 (GLsizei)bufSize,
1164 (GLfloat *)params
1165 );
1166
1167exit:
1168 if (_array) {
1169 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
1170 }
1171 if (_exception) {
1172 jniThrowException(_env, _exceptionType, _exceptionMessage);
1173 }
1174}
1175
1176/* void glGetnUniformiv ( GLuint program, GLint location, GLsizei bufSize, GLint *params ) */
1177static void
1178android_glGetnUniformiv__III_3II
1179 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jintArray params_ref, jint offset) {
1180 jint _exception = 0;
1181 const char * _exceptionType = NULL;
1182 const char * _exceptionMessage = NULL;
1183 GLint *params_base = (GLint *) 0;
1184 jint _remaining;
1185 GLint *params = (GLint *) 0;
1186
1187 if (!params_ref) {
1188 _exception = 1;
1189 _exceptionType = "java/lang/IllegalArgumentException";
1190 _exceptionMessage = "params == null";
1191 goto exit;
1192 }
1193 if (offset < 0) {
1194 _exception = 1;
1195 _exceptionType = "java/lang/IllegalArgumentException";
1196 _exceptionMessage = "offset < 0";
1197 goto exit;
1198 }
1199 _remaining = _env->GetArrayLength(params_ref) - offset;
1200 if (_remaining < bufSize) {
1201 _exception = 1;
1202 _exceptionType = "java/lang/IllegalArgumentException";
1203 _exceptionMessage = "length - offset < bufSize < needed";
1204 goto exit;
1205 }
1206 params_base = (GLint *)
1207 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1208 params = params_base + offset;
1209
1210 glGetnUniformiv(
1211 (GLuint)program,
1212 (GLint)location,
1213 (GLsizei)bufSize,
1214 (GLint *)params
1215 );
1216
1217exit:
1218 if (params_base) {
1219 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1220 _exception ? JNI_ABORT: 0);
1221 }
1222 if (_exception) {
1223 jniThrowException(_env, _exceptionType, _exceptionMessage);
1224 }
1225}
1226
1227/* void glGetnUniformiv ( GLuint program, GLint location, GLsizei bufSize, GLint *params ) */
1228static void
1229android_glGetnUniformiv__IIILjava_nio_IntBuffer_2
1230 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
1231 jint _exception = 0;
1232 const char * _exceptionType = NULL;
1233 const char * _exceptionMessage = NULL;
1234 jintArray _array = (jintArray) 0;
1235 jint _bufferOffset = (jint) 0;
1236 jint _remaining;
1237 GLint *params = (GLint *) 0;
1238
Romain Guy84cac202016-12-05 12:26:02 -08001239 if (!params_buf) {
1240 _exception = 1;
1241 _exceptionType = "java/lang/IllegalArgumentException";
1242 _exceptionMessage = "params == null";
1243 goto exit;
1244 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001245 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1246 if (_remaining < bufSize) {
1247 _exception = 1;
1248 _exceptionType = "java/lang/IllegalArgumentException";
1249 _exceptionMessage = "remaining() < bufSize < needed";
1250 goto exit;
1251 }
1252 if (params == NULL) {
1253 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1254 params = (GLint *) (_paramsBase + _bufferOffset);
1255 }
1256 glGetnUniformiv(
1257 (GLuint)program,
1258 (GLint)location,
1259 (GLsizei)bufSize,
1260 (GLint *)params
1261 );
1262
1263exit:
1264 if (_array) {
1265 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1266 }
1267 if (_exception) {
1268 jniThrowException(_env, _exceptionType, _exceptionMessage);
1269 }
1270}
1271
1272/* void glGetnUniformuiv ( GLuint program, GLint location, GLsizei bufSize, GLuint *params ) */
1273static void
1274android_glGetnUniformuiv__III_3II
1275 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jintArray params_ref, jint offset) {
1276 jint _exception = 0;
1277 const char * _exceptionType = NULL;
1278 const char * _exceptionMessage = NULL;
1279 GLuint *params_base = (GLuint *) 0;
1280 jint _remaining;
1281 GLuint *params = (GLuint *) 0;
1282
1283 if (!params_ref) {
1284 _exception = 1;
1285 _exceptionType = "java/lang/IllegalArgumentException";
1286 _exceptionMessage = "params == null";
1287 goto exit;
1288 }
1289 if (offset < 0) {
1290 _exception = 1;
1291 _exceptionType = "java/lang/IllegalArgumentException";
1292 _exceptionMessage = "offset < 0";
1293 goto exit;
1294 }
1295 _remaining = _env->GetArrayLength(params_ref) - offset;
1296 if (_remaining < bufSize) {
1297 _exception = 1;
1298 _exceptionType = "java/lang/IllegalArgumentException";
1299 _exceptionMessage = "length - offset < bufSize < needed";
1300 goto exit;
1301 }
1302 params_base = (GLuint *)
1303 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1304 params = params_base + offset;
1305
1306 glGetnUniformuiv(
1307 (GLuint)program,
1308 (GLint)location,
1309 (GLsizei)bufSize,
1310 (GLuint *)params
1311 );
1312
1313exit:
1314 if (params_base) {
1315 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1316 _exception ? JNI_ABORT: 0);
1317 }
1318 if (_exception) {
1319 jniThrowException(_env, _exceptionType, _exceptionMessage);
1320 }
1321}
1322
1323/* void glGetnUniformuiv ( GLuint program, GLint location, GLsizei bufSize, GLuint *params ) */
1324static void
1325android_glGetnUniformuiv__IIILjava_nio_IntBuffer_2
1326 (JNIEnv *_env, jobject _this, jint program, jint location, jint bufSize, jobject params_buf) {
1327 jint _exception = 0;
1328 const char * _exceptionType = NULL;
1329 const char * _exceptionMessage = NULL;
1330 jintArray _array = (jintArray) 0;
1331 jint _bufferOffset = (jint) 0;
1332 jint _remaining;
1333 GLuint *params = (GLuint *) 0;
1334
Romain Guy84cac202016-12-05 12:26:02 -08001335 if (!params_buf) {
1336 _exception = 1;
1337 _exceptionType = "java/lang/IllegalArgumentException";
1338 _exceptionMessage = "params == null";
1339 goto exit;
1340 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001341 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1342 if (_remaining < bufSize) {
1343 _exception = 1;
1344 _exceptionType = "java/lang/IllegalArgumentException";
1345 _exceptionMessage = "remaining() < bufSize < needed";
1346 goto exit;
1347 }
1348 if (params == NULL) {
1349 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1350 params = (GLuint *) (_paramsBase + _bufferOffset);
1351 }
1352 glGetnUniformuiv(
1353 (GLuint)program,
1354 (GLint)location,
1355 (GLsizei)bufSize,
1356 (GLuint *)params
1357 );
1358
1359exit:
1360 if (_array) {
1361 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1362 }
1363 if (_exception) {
1364 jniThrowException(_env, _exceptionType, _exceptionMessage);
1365 }
1366}
1367
1368/* void glMinSampleShading ( GLfloat value ) */
1369static void
1370android_glMinSampleShading__F
1371 (JNIEnv *_env, jobject _this, jfloat value) {
1372 glMinSampleShading(
1373 (GLfloat)value
1374 );
1375}
1376
1377/* void glPatchParameteri ( GLenum pname, GLint value ) */
1378static void
1379android_glPatchParameteri__II
1380 (JNIEnv *_env, jobject _this, jint pname, jint value) {
1381 glPatchParameteri(
1382 (GLenum)pname,
1383 (GLint)value
1384 );
1385}
1386
1387/* void glTexParameterIiv ( GLenum target, GLenum pname, const GLint *params ) */
1388static void
1389android_glTexParameterIiv__II_3II
1390 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1391 jint _exception = 0;
1392 const char * _exceptionType = NULL;
1393 const char * _exceptionMessage = NULL;
1394 GLint *params_base = (GLint *) 0;
1395 jint _remaining;
1396 GLint *params = (GLint *) 0;
1397
1398 if (!params_ref) {
1399 _exception = 1;
1400 _exceptionType = "java/lang/IllegalArgumentException";
1401 _exceptionMessage = "params == null";
1402 goto exit;
1403 }
1404 if (offset < 0) {
1405 _exception = 1;
1406 _exceptionType = "java/lang/IllegalArgumentException";
1407 _exceptionMessage = "offset < 0";
1408 goto exit;
1409 }
1410 _remaining = _env->GetArrayLength(params_ref) - offset;
1411 params_base = (GLint *)
1412 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1413 params = params_base + offset;
1414
1415 glTexParameterIiv(
1416 (GLenum)target,
1417 (GLenum)pname,
1418 (GLint *)params
1419 );
1420
1421exit:
1422 if (params_base) {
1423 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1424 JNI_ABORT);
1425 }
1426 if (_exception) {
1427 jniThrowException(_env, _exceptionType, _exceptionMessage);
1428 }
1429}
1430
1431/* void glTexParameterIiv ( GLenum target, GLenum pname, const GLint *params ) */
1432static void
1433android_glTexParameterIiv__IILjava_nio_IntBuffer_2
1434 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001435 jint _exception = 0;
1436 const char * _exceptionType = NULL;
1437 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001438 jintArray _array = (jintArray) 0;
1439 jint _bufferOffset = (jint) 0;
1440 jint _remaining;
1441 GLint *params = (GLint *) 0;
1442
Romain Guy84cac202016-12-05 12:26:02 -08001443 if (!params_buf) {
1444 _exception = 1;
1445 _exceptionType = "java/lang/IllegalArgumentException";
1446 _exceptionMessage = "params == null";
1447 goto exit;
1448 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001449 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1450 if (params == NULL) {
1451 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1452 params = (GLint *) (_paramsBase + _bufferOffset);
1453 }
1454 glTexParameterIiv(
1455 (GLenum)target,
1456 (GLenum)pname,
1457 (GLint *)params
1458 );
Romain Guy84cac202016-12-05 12:26:02 -08001459
1460exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001461 if (_array) {
1462 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1463 }
Romain Guy84cac202016-12-05 12:26:02 -08001464 if (_exception) {
1465 jniThrowException(_env, _exceptionType, _exceptionMessage);
1466 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001467}
1468
1469/* void glTexParameterIuiv ( GLenum target, GLenum pname, const GLuint *params ) */
1470static void
1471android_glTexParameterIuiv__II_3II
1472 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1473 jint _exception = 0;
1474 const char * _exceptionType = NULL;
1475 const char * _exceptionMessage = NULL;
1476 GLuint *params_base = (GLuint *) 0;
1477 jint _remaining;
1478 GLuint *params = (GLuint *) 0;
1479
1480 if (!params_ref) {
1481 _exception = 1;
1482 _exceptionType = "java/lang/IllegalArgumentException";
1483 _exceptionMessage = "params == null";
1484 goto exit;
1485 }
1486 if (offset < 0) {
1487 _exception = 1;
1488 _exceptionType = "java/lang/IllegalArgumentException";
1489 _exceptionMessage = "offset < 0";
1490 goto exit;
1491 }
1492 _remaining = _env->GetArrayLength(params_ref) - offset;
1493 params_base = (GLuint *)
1494 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1495 params = params_base + offset;
1496
1497 glTexParameterIuiv(
1498 (GLenum)target,
1499 (GLenum)pname,
1500 (GLuint *)params
1501 );
1502
1503exit:
1504 if (params_base) {
1505 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1506 JNI_ABORT);
1507 }
1508 if (_exception) {
1509 jniThrowException(_env, _exceptionType, _exceptionMessage);
1510 }
1511}
1512
1513/* void glTexParameterIuiv ( GLenum target, GLenum pname, const GLuint *params ) */
1514static void
1515android_glTexParameterIuiv__IILjava_nio_IntBuffer_2
1516 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001517 jint _exception = 0;
1518 const char * _exceptionType = NULL;
1519 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001520 jintArray _array = (jintArray) 0;
1521 jint _bufferOffset = (jint) 0;
1522 jint _remaining;
1523 GLuint *params = (GLuint *) 0;
1524
Romain Guy84cac202016-12-05 12:26:02 -08001525 if (!params_buf) {
1526 _exception = 1;
1527 _exceptionType = "java/lang/IllegalArgumentException";
1528 _exceptionMessage = "params == null";
1529 goto exit;
1530 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001531 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1532 if (params == NULL) {
1533 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1534 params = (GLuint *) (_paramsBase + _bufferOffset);
1535 }
1536 glTexParameterIuiv(
1537 (GLenum)target,
1538 (GLenum)pname,
1539 (GLuint *)params
1540 );
Romain Guy84cac202016-12-05 12:26:02 -08001541
1542exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001543 if (_array) {
1544 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1545 }
Romain Guy84cac202016-12-05 12:26:02 -08001546 if (_exception) {
1547 jniThrowException(_env, _exceptionType, _exceptionMessage);
1548 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001549}
1550
1551/* void glGetTexParameterIiv ( GLenum target, GLenum pname, GLint *params ) */
1552static void
1553android_glGetTexParameterIiv__II_3II
1554 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1555 jint _exception = 0;
1556 const char * _exceptionType = NULL;
1557 const char * _exceptionMessage = NULL;
1558 GLint *params_base = (GLint *) 0;
1559 jint _remaining;
1560 GLint *params = (GLint *) 0;
1561
1562 if (!params_ref) {
1563 _exception = 1;
1564 _exceptionType = "java/lang/IllegalArgumentException";
1565 _exceptionMessage = "params == null";
1566 goto exit;
1567 }
1568 if (offset < 0) {
1569 _exception = 1;
1570 _exceptionType = "java/lang/IllegalArgumentException";
1571 _exceptionMessage = "offset < 0";
1572 goto exit;
1573 }
1574 _remaining = _env->GetArrayLength(params_ref) - offset;
1575 params_base = (GLint *)
1576 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1577 params = params_base + offset;
1578
1579 glGetTexParameterIiv(
1580 (GLenum)target,
1581 (GLenum)pname,
1582 (GLint *)params
1583 );
1584
1585exit:
1586 if (params_base) {
1587 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1588 _exception ? JNI_ABORT: 0);
1589 }
1590 if (_exception) {
1591 jniThrowException(_env, _exceptionType, _exceptionMessage);
1592 }
1593}
1594
1595/* void glGetTexParameterIiv ( GLenum target, GLenum pname, GLint *params ) */
1596static void
1597android_glGetTexParameterIiv__IILjava_nio_IntBuffer_2
1598 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001599 jint _exception = 0;
1600 const char * _exceptionType = NULL;
1601 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001602 jintArray _array = (jintArray) 0;
1603 jint _bufferOffset = (jint) 0;
1604 jint _remaining;
1605 GLint *params = (GLint *) 0;
1606
Romain Guy84cac202016-12-05 12:26:02 -08001607 if (!params_buf) {
1608 _exception = 1;
1609 _exceptionType = "java/lang/IllegalArgumentException";
1610 _exceptionMessage = "params == null";
1611 goto exit;
1612 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001613 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1614 if (params == NULL) {
1615 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1616 params = (GLint *) (_paramsBase + _bufferOffset);
1617 }
1618 glGetTexParameterIiv(
1619 (GLenum)target,
1620 (GLenum)pname,
1621 (GLint *)params
1622 );
Romain Guy84cac202016-12-05 12:26:02 -08001623
1624exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001625 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001626 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1627 }
1628 if (_exception) {
1629 jniThrowException(_env, _exceptionType, _exceptionMessage);
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001630 }
1631}
1632
1633/* void glGetTexParameterIuiv ( GLenum target, GLenum pname, GLuint *params ) */
1634static void
1635android_glGetTexParameterIuiv__II_3II
1636 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1637 jint _exception = 0;
1638 const char * _exceptionType = NULL;
1639 const char * _exceptionMessage = NULL;
1640 GLuint *params_base = (GLuint *) 0;
1641 jint _remaining;
1642 GLuint *params = (GLuint *) 0;
1643
1644 if (!params_ref) {
1645 _exception = 1;
1646 _exceptionType = "java/lang/IllegalArgumentException";
1647 _exceptionMessage = "params == null";
1648 goto exit;
1649 }
1650 if (offset < 0) {
1651 _exception = 1;
1652 _exceptionType = "java/lang/IllegalArgumentException";
1653 _exceptionMessage = "offset < 0";
1654 goto exit;
1655 }
1656 _remaining = _env->GetArrayLength(params_ref) - offset;
1657 params_base = (GLuint *)
1658 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1659 params = params_base + offset;
1660
1661 glGetTexParameterIuiv(
1662 (GLenum)target,
1663 (GLenum)pname,
1664 (GLuint *)params
1665 );
1666
1667exit:
1668 if (params_base) {
1669 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1670 _exception ? JNI_ABORT: 0);
1671 }
1672 if (_exception) {
1673 jniThrowException(_env, _exceptionType, _exceptionMessage);
1674 }
1675}
1676
1677/* void glGetTexParameterIuiv ( GLenum target, GLenum pname, GLuint *params ) */
1678static void
1679android_glGetTexParameterIuiv__IILjava_nio_IntBuffer_2
1680 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001681 jint _exception = 0;
1682 const char * _exceptionType = NULL;
1683 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001684 jintArray _array = (jintArray) 0;
1685 jint _bufferOffset = (jint) 0;
1686 jint _remaining;
1687 GLuint *params = (GLuint *) 0;
1688
Romain Guy84cac202016-12-05 12:26:02 -08001689 if (!params_buf) {
1690 _exception = 1;
1691 _exceptionType = "java/lang/IllegalArgumentException";
1692 _exceptionMessage = "params == null";
1693 goto exit;
1694 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001695 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1696 if (params == NULL) {
1697 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1698 params = (GLuint *) (_paramsBase + _bufferOffset);
1699 }
1700 glGetTexParameterIuiv(
1701 (GLenum)target,
1702 (GLenum)pname,
1703 (GLuint *)params
1704 );
Romain Guy84cac202016-12-05 12:26:02 -08001705
1706exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001707 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001708 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1709 }
1710 if (_exception) {
1711 jniThrowException(_env, _exceptionType, _exceptionMessage);
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001712 }
1713}
1714
1715/* void glSamplerParameterIiv ( GLuint sampler, GLenum pname, const GLint *param ) */
1716static void
1717android_glSamplerParameterIiv__II_3II
1718 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1719 jint _exception = 0;
1720 const char * _exceptionType = NULL;
1721 const char * _exceptionMessage = NULL;
1722 GLint *param_base = (GLint *) 0;
1723 jint _remaining;
1724 GLint *param = (GLint *) 0;
1725
1726 if (!param_ref) {
1727 _exception = 1;
1728 _exceptionType = "java/lang/IllegalArgumentException";
1729 _exceptionMessage = "param == null";
1730 goto exit;
1731 }
1732 if (offset < 0) {
1733 _exception = 1;
1734 _exceptionType = "java/lang/IllegalArgumentException";
1735 _exceptionMessage = "offset < 0";
1736 goto exit;
1737 }
1738 _remaining = _env->GetArrayLength(param_ref) - offset;
1739 param_base = (GLint *)
1740 _env->GetIntArrayElements(param_ref, (jboolean *)0);
1741 param = param_base + offset;
1742
1743 glSamplerParameterIiv(
1744 (GLuint)sampler,
1745 (GLenum)pname,
1746 (GLint *)param
1747 );
1748
1749exit:
1750 if (param_base) {
1751 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
1752 JNI_ABORT);
1753 }
1754 if (_exception) {
1755 jniThrowException(_env, _exceptionType, _exceptionMessage);
1756 }
1757}
1758
1759/* void glSamplerParameterIiv ( GLuint sampler, GLenum pname, const GLint *param ) */
1760static void
1761android_glSamplerParameterIiv__IILjava_nio_IntBuffer_2
1762 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001763 jint _exception = 0;
1764 const char * _exceptionType = NULL;
1765 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001766 jintArray _array = (jintArray) 0;
1767 jint _bufferOffset = (jint) 0;
1768 jint _remaining;
1769 GLint *param = (GLint *) 0;
1770
Romain Guy84cac202016-12-05 12:26:02 -08001771 if (!param_buf) {
1772 _exception = 1;
1773 _exceptionType = "java/lang/IllegalArgumentException";
1774 _exceptionMessage = "param == null";
1775 goto exit;
1776 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001777 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1778 if (param == NULL) {
1779 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1780 param = (GLint *) (_paramBase + _bufferOffset);
1781 }
1782 glSamplerParameterIiv(
1783 (GLuint)sampler,
1784 (GLenum)pname,
1785 (GLint *)param
1786 );
Romain Guy84cac202016-12-05 12:26:02 -08001787
1788exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001789 if (_array) {
1790 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
1791 }
Romain Guy84cac202016-12-05 12:26:02 -08001792 if (_exception) {
1793 jniThrowException(_env, _exceptionType, _exceptionMessage);
1794 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001795}
1796
1797/* void glSamplerParameterIuiv ( GLuint sampler, GLenum pname, const GLuint *param ) */
1798static void
1799android_glSamplerParameterIuiv__II_3II
1800 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1801 jint _exception = 0;
1802 const char * _exceptionType = NULL;
1803 const char * _exceptionMessage = NULL;
1804 GLuint *param_base = (GLuint *) 0;
1805 jint _remaining;
1806 GLuint *param = (GLuint *) 0;
1807
1808 if (!param_ref) {
1809 _exception = 1;
1810 _exceptionType = "java/lang/IllegalArgumentException";
1811 _exceptionMessage = "param == null";
1812 goto exit;
1813 }
1814 if (offset < 0) {
1815 _exception = 1;
1816 _exceptionType = "java/lang/IllegalArgumentException";
1817 _exceptionMessage = "offset < 0";
1818 goto exit;
1819 }
1820 _remaining = _env->GetArrayLength(param_ref) - offset;
1821 param_base = (GLuint *)
1822 _env->GetIntArrayElements(param_ref, (jboolean *)0);
1823 param = param_base + offset;
1824
1825 glSamplerParameterIuiv(
1826 (GLuint)sampler,
1827 (GLenum)pname,
1828 (GLuint *)param
1829 );
1830
1831exit:
1832 if (param_base) {
1833 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
1834 JNI_ABORT);
1835 }
1836 if (_exception) {
1837 jniThrowException(_env, _exceptionType, _exceptionMessage);
1838 }
1839}
1840
1841/* void glSamplerParameterIuiv ( GLuint sampler, GLenum pname, const GLuint *param ) */
1842static void
1843android_glSamplerParameterIuiv__IILjava_nio_IntBuffer_2
1844 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001845 jint _exception = 0;
1846 const char * _exceptionType = NULL;
1847 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001848 jintArray _array = (jintArray) 0;
1849 jint _bufferOffset = (jint) 0;
1850 jint _remaining;
1851 GLuint *param = (GLuint *) 0;
1852
Romain Guy84cac202016-12-05 12:26:02 -08001853 if (!param_buf) {
1854 _exception = 1;
1855 _exceptionType = "java/lang/IllegalArgumentException";
1856 _exceptionMessage = "param == null";
1857 goto exit;
1858 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001859 param = (GLuint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1860 if (param == NULL) {
1861 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1862 param = (GLuint *) (_paramBase + _bufferOffset);
1863 }
1864 glSamplerParameterIuiv(
1865 (GLuint)sampler,
1866 (GLenum)pname,
1867 (GLuint *)param
1868 );
Romain Guy84cac202016-12-05 12:26:02 -08001869
1870exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001871 if (_array) {
1872 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
1873 }
Romain Guy84cac202016-12-05 12:26:02 -08001874 if (_exception) {
1875 jniThrowException(_env, _exceptionType, _exceptionMessage);
1876 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001877}
1878
1879/* void glGetSamplerParameterIiv ( GLuint sampler, GLenum pname, GLint *params ) */
1880static void
1881android_glGetSamplerParameterIiv__II_3II
1882 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1883 jint _exception = 0;
1884 const char * _exceptionType = NULL;
1885 const char * _exceptionMessage = NULL;
1886 GLint *params_base = (GLint *) 0;
1887 jint _remaining;
1888 GLint *params = (GLint *) 0;
1889
1890 if (!params_ref) {
1891 _exception = 1;
1892 _exceptionType = "java/lang/IllegalArgumentException";
1893 _exceptionMessage = "params == null";
1894 goto exit;
1895 }
1896 if (offset < 0) {
1897 _exception = 1;
1898 _exceptionType = "java/lang/IllegalArgumentException";
1899 _exceptionMessage = "offset < 0";
1900 goto exit;
1901 }
1902 _remaining = _env->GetArrayLength(params_ref) - offset;
1903 params_base = (GLint *)
1904 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1905 params = params_base + offset;
1906
1907 glGetSamplerParameterIiv(
1908 (GLuint)sampler,
1909 (GLenum)pname,
1910 (GLint *)params
1911 );
1912
1913exit:
1914 if (params_base) {
1915 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1916 _exception ? JNI_ABORT: 0);
1917 }
1918 if (_exception) {
1919 jniThrowException(_env, _exceptionType, _exceptionMessage);
1920 }
1921}
1922
1923/* void glGetSamplerParameterIiv ( GLuint sampler, GLenum pname, GLint *params ) */
1924static void
1925android_glGetSamplerParameterIiv__IILjava_nio_IntBuffer_2
1926 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001927 jint _exception = 0;
1928 const char * _exceptionType = NULL;
1929 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001930 jintArray _array = (jintArray) 0;
1931 jint _bufferOffset = (jint) 0;
1932 jint _remaining;
1933 GLint *params = (GLint *) 0;
1934
Romain Guy84cac202016-12-05 12:26:02 -08001935 if (!params_buf) {
1936 _exception = 1;
1937 _exceptionType = "java/lang/IllegalArgumentException";
1938 _exceptionMessage = "params == null";
1939 goto exit;
1940 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001941 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1942 if (params == NULL) {
1943 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1944 params = (GLint *) (_paramsBase + _bufferOffset);
1945 }
1946 glGetSamplerParameterIiv(
1947 (GLuint)sampler,
1948 (GLenum)pname,
1949 (GLint *)params
1950 );
Romain Guy84cac202016-12-05 12:26:02 -08001951
1952exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001953 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001954 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1955 }
1956 if (_exception) {
1957 jniThrowException(_env, _exceptionType, _exceptionMessage);
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07001958 }
1959}
1960
1961/* void glGetSamplerParameterIuiv ( GLuint sampler, GLenum pname, GLuint *params ) */
1962static void
1963android_glGetSamplerParameterIuiv__II_3II
1964 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1965 jint _exception = 0;
1966 const char * _exceptionType = NULL;
1967 const char * _exceptionMessage = NULL;
1968 GLuint *params_base = (GLuint *) 0;
1969 jint _remaining;
1970 GLuint *params = (GLuint *) 0;
1971
1972 if (!params_ref) {
1973 _exception = 1;
1974 _exceptionType = "java/lang/IllegalArgumentException";
1975 _exceptionMessage = "params == null";
1976 goto exit;
1977 }
1978 if (offset < 0) {
1979 _exception = 1;
1980 _exceptionType = "java/lang/IllegalArgumentException";
1981 _exceptionMessage = "offset < 0";
1982 goto exit;
1983 }
1984 _remaining = _env->GetArrayLength(params_ref) - offset;
1985 params_base = (GLuint *)
1986 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1987 params = params_base + offset;
1988
1989 glGetSamplerParameterIuiv(
1990 (GLuint)sampler,
1991 (GLenum)pname,
1992 (GLuint *)params
1993 );
1994
1995exit:
1996 if (params_base) {
1997 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1998 _exception ? JNI_ABORT: 0);
1999 }
2000 if (_exception) {
2001 jniThrowException(_env, _exceptionType, _exceptionMessage);
2002 }
2003}
2004
2005/* void glGetSamplerParameterIuiv ( GLuint sampler, GLenum pname, GLuint *params ) */
2006static void
2007android_glGetSamplerParameterIuiv__IILjava_nio_IntBuffer_2
2008 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002009 jint _exception = 0;
2010 const char * _exceptionType = NULL;
2011 const char * _exceptionMessage = NULL;
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07002012 jintArray _array = (jintArray) 0;
2013 jint _bufferOffset = (jint) 0;
2014 jint _remaining;
2015 GLuint *params = (GLuint *) 0;
2016
Romain Guy84cac202016-12-05 12:26:02 -08002017 if (!params_buf) {
2018 _exception = 1;
2019 _exceptionType = "java/lang/IllegalArgumentException";
2020 _exceptionMessage = "params == null";
2021 goto exit;
2022 }
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07002023 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2024 if (params == NULL) {
2025 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2026 params = (GLuint *) (_paramsBase + _bufferOffset);
2027 }
2028 glGetSamplerParameterIuiv(
2029 (GLuint)sampler,
2030 (GLenum)pname,
2031 (GLuint *)params
2032 );
Romain Guy84cac202016-12-05 12:26:02 -08002033
2034exit:
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07002035 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002036 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2037 }
2038 if (_exception) {
2039 jniThrowException(_env, _exceptionType, _exceptionMessage);
Pablo Ceballos38c1a7e2015-10-30 10:34:30 -07002040 }
2041}
2042
2043/* void glTexBuffer ( GLenum target, GLenum internalformat, GLuint buffer ) */
2044static void
2045android_glTexBuffer__III
2046 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer) {
2047 glTexBuffer(
2048 (GLenum)target,
2049 (GLenum)internalformat,
2050 (GLuint)buffer
2051 );
2052}
2053
2054/* void glTexBufferRange ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
2055static void
2056android_glTexBufferRange__IIIII
2057 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer, jint offset, jint size) {
2058 glTexBufferRange(
2059 (GLenum)target,
2060 (GLenum)internalformat,
2061 (GLuint)buffer,
2062 (GLintptr)offset,
2063 (GLsizeiptr)size
2064 );
2065}
2066
2067/* void glTexStorage3DMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations ) */
2068static void
2069android_glTexStorage3DMultisample__IIIIIIZ
2070 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) {
2071 glTexStorage3DMultisample(
2072 (GLenum)target,
2073 (GLsizei)samples,
2074 (GLenum)internalformat,
2075 (GLsizei)width,
2076 (GLsizei)height,
2077 (GLsizei)depth,
2078 (GLboolean)fixedsamplelocations
2079 );
2080}
2081
2082static const char *classPathName = "android/opengl/GLES32";
2083
2084static const JNINativeMethod methods[] = {
2085{"_nativeClassInit", "()V", (void*)nativeClassInit },
2086{"glBlendBarrier", "()V", (void *) android_glBlendBarrier__ },
2087{"glCopyImageSubData", "(IIIIIIIIIIIIIII)V", (void *) android_glCopyImageSubData__IIIIIIIIIIIIIII },
2088{"glDebugMessageControl", "(IIII[IIZ)V", (void *) android_glDebugMessageControl__IIII_3IIZ },
2089{"glDebugMessageControl", "(IIIILjava/nio/IntBuffer;Z)V", (void *) android_glDebugMessageControl__IIIILjava_nio_IntBuffer_2Z },
2090{"glDebugMessageInsert", "(IIIIILjava/lang/String;)V", (void *) android_glDebugMessageInsert__IIIIILjava_lang_String_2 },
2091{"glDebugMessageCallback", "(Landroid/opengl/GLES32$DebugProc;)V", (void *) android_glDebugMessageCallback },
2092{"glGetDebugMessageLog", "(II[II[II[II[II[II[BI)I", (void *) android_glGetDebugMessageLog__II_3II_3II_3II_3II_3II_3BI },
2093{"glGetDebugMessageLog", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)I", (void *) android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
2094{"glGetDebugMessageLog", "(I[II[II[II[II)[Ljava/lang/String;", (void *) android_glGetDebugMessageLog__I_3II_3II_3II_3II },
2095{"glGetDebugMessageLog", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)[Ljava/lang/String;", (void *) android_glGetDebugMessageLog__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
2096{"glPushDebugGroup", "(IIILjava/lang/String;)V", (void *) android_glPushDebugGroup__IIILjava_lang_String_2 },
2097{"glPopDebugGroup", "()V", (void *) android_glPopDebugGroup__ },
2098{"glObjectLabel", "(IIILjava/lang/String;)V", (void *) android_glObjectLabel__IIILjava_lang_String_2 },
2099{"glGetObjectLabel", "(II)Ljava/lang/String;", (void *) android_glGetObjectLabel },
2100{"glObjectPtrLabel", "(JLjava/lang/String;)V", (void *) android_glObjectPtrLabel },
2101{"glGetObjectPtrLabel", "(J)Ljava/lang/String;", (void *) android_glGetObjectPtrLabel },
2102{"glGetPointerv", "(I)J", (void *) android_glGetPointerv },
2103{"glEnablei", "(II)V", (void *) android_glEnablei__II },
2104{"glDisablei", "(II)V", (void *) android_glDisablei__II },
2105{"glBlendEquationi", "(II)V", (void *) android_glBlendEquationi__II },
2106{"glBlendEquationSeparatei", "(III)V", (void *) android_glBlendEquationSeparatei__III },
2107{"glBlendFunci", "(III)V", (void *) android_glBlendFunci__III },
2108{"glBlendFuncSeparatei", "(IIIII)V", (void *) android_glBlendFuncSeparatei__IIIII },
2109{"glColorMaski", "(IZZZZ)V", (void *) android_glColorMaski__IZZZZ },
2110{"glIsEnabledi", "(II)Z", (void *) android_glIsEnabledi__II },
2111{"glDrawElementsBaseVertex", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsBaseVertex__IIILjava_nio_Buffer_2I },
2112{"glDrawRangeElementsBaseVertex", "(IIIIILjava/nio/Buffer;I)V", (void *) android_glDrawRangeElementsBaseVertex__IIIIILjava_nio_Buffer_2I },
2113{"glDrawElementsInstancedBaseVertex", "(IIILjava/nio/Buffer;II)V", (void *) android_glDrawElementsInstancedBaseVertex__IIILjava_nio_Buffer_2II },
2114{"glDrawElementsInstancedBaseVertex", "(IIIIII)V", (void *) android_glDrawElementsInstancedBaseVertex__IIIIII },
2115{"glFramebufferTexture", "(IIII)V", (void *) android_glFramebufferTexture__IIII },
2116{"glPrimitiveBoundingBox", "(FFFFFFFF)V", (void *) android_glPrimitiveBoundingBox__FFFFFFFF },
2117{"glGetGraphicsResetStatus", "()I", (void *) android_glGetGraphicsResetStatus__ },
2118{"glReadnPixels", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glReadnPixels__IIIIIIILjava_nio_Buffer_2 },
2119{"glGetnUniformfv", "(III[FI)V", (void *) android_glGetnUniformfv__III_3FI },
2120{"glGetnUniformfv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glGetnUniformfv__IIILjava_nio_FloatBuffer_2 },
2121{"glGetnUniformiv", "(III[II)V", (void *) android_glGetnUniformiv__III_3II },
2122{"glGetnUniformiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetnUniformiv__IIILjava_nio_IntBuffer_2 },
2123{"glGetnUniformuiv", "(III[II)V", (void *) android_glGetnUniformuiv__III_3II },
2124{"glGetnUniformuiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetnUniformuiv__IIILjava_nio_IntBuffer_2 },
2125{"glMinSampleShading", "(F)V", (void *) android_glMinSampleShading__F },
2126{"glPatchParameteri", "(II)V", (void *) android_glPatchParameteri__II },
2127{"glTexParameterIiv", "(II[II)V", (void *) android_glTexParameterIiv__II_3II },
2128{"glTexParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIiv__IILjava_nio_IntBuffer_2 },
2129{"glTexParameterIuiv", "(II[II)V", (void *) android_glTexParameterIuiv__II_3II },
2130{"glTexParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIuiv__IILjava_nio_IntBuffer_2 },
2131{"glGetTexParameterIiv", "(II[II)V", (void *) android_glGetTexParameterIiv__II_3II },
2132{"glGetTexParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIiv__IILjava_nio_IntBuffer_2 },
2133{"glGetTexParameterIuiv", "(II[II)V", (void *) android_glGetTexParameterIuiv__II_3II },
2134{"glGetTexParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIuiv__IILjava_nio_IntBuffer_2 },
2135{"glSamplerParameterIiv", "(II[II)V", (void *) android_glSamplerParameterIiv__II_3II },
2136{"glSamplerParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIiv__IILjava_nio_IntBuffer_2 },
2137{"glSamplerParameterIuiv", "(II[II)V", (void *) android_glSamplerParameterIuiv__II_3II },
2138{"glSamplerParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIuiv__IILjava_nio_IntBuffer_2 },
2139{"glGetSamplerParameterIiv", "(II[II)V", (void *) android_glGetSamplerParameterIiv__II_3II },
2140{"glGetSamplerParameterIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIiv__IILjava_nio_IntBuffer_2 },
2141{"glGetSamplerParameterIuiv", "(II[II)V", (void *) android_glGetSamplerParameterIuiv__II_3II },
2142{"glGetSamplerParameterIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIuiv__IILjava_nio_IntBuffer_2 },
2143{"glTexBuffer", "(III)V", (void *) android_glTexBuffer__III },
2144{"glTexBufferRange", "(IIIII)V", (void *) android_glTexBufferRange__IIIII },
2145{"glTexStorage3DMultisample", "(IIIIIIZ)V", (void *) android_glTexStorage3DMultisample__IIIIIIZ },
2146};
2147
2148int register_android_opengl_jni_GLES32(JNIEnv *_env)
2149{
2150 int err;
2151 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
2152 return err;
2153}