blob: 8212eb1e47d2495e43148c26632587f9c446c602 [file] [log] [blame]
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001/*
2 * Copyright 2014 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
Andreas Gampebfe63332014-11-12 14:12:45 -080019#pragma GCC diagnostic ignored "-Wunused-variable"
20#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
21#pragma GCC diagnostic ignored "-Wunused-function"
22
Jesse Hall7ab63ac2014-05-19 15:13:41 -070023#include <GLES3/gl31.h>
24#include <GLES2/gl2ext.h>
25
Jesse Hall9626f822014-05-19 20:57:49 -070026#include <jni.h>
27#include <JNIHelp.h>
Jesse Hall7ab63ac2014-05-19 15:13:41 -070028#include <android_runtime/AndroidRuntime.h>
29#include <utils/misc.h>
30#include <assert.h>
31
32static int initialized = 0;
33
34static jclass nioAccessClass;
35static jclass bufferClass;
36static jmethodID getBasePointerID;
37static jmethodID getBaseArrayID;
38static jmethodID getBaseArrayOffsetID;
39static jfieldID positionID;
40static jfieldID limitID;
41static jfieldID elementSizeShiftID;
42
43
44/* special calls implemented in Android's GLES wrapper used to more
45 * efficiently bound-check passed arrays */
46extern "C" {
47#ifdef GL_VERSION_ES_CM_1_1
48GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
49 const GLvoid *ptr, GLsizei count);
50GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
51 const GLvoid *pointer, GLsizei count);
52GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
53 GLsizei stride, const GLvoid *pointer, GLsizei count);
54GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
55 GLsizei stride, const GLvoid *pointer, GLsizei count);
56GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
57 GLsizei stride, const GLvoid *pointer, GLsizei count);
58GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
59 GLsizei stride, const GLvoid *pointer, GLsizei count);
60GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
61 GLsizei stride, const GLvoid *pointer, GLsizei count);
62#endif
63#ifdef GL_ES_VERSION_2_0
64static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
65 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
66 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
67}
68#endif
69#ifdef GL_ES_VERSION_3_0
70static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
71 GLsizei stride, const GLvoid *pointer, GLsizei count) {
72 glVertexAttribIPointer(indx, size, type, stride, pointer);
73}
74#endif
75}
76
77/* Cache method IDs each time the class is loaded. */
78
79static void
80nativeClassInit(JNIEnv *_env, jclass glImplClass)
81{
82 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
83 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
84
85 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
86 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
87
88 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
89 "getBasePointer", "(Ljava/nio/Buffer;)J");
90 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
91 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
92 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
93 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
94
95 positionID = _env->GetFieldID(bufferClass, "position", "I");
96 limitID = _env->GetFieldID(bufferClass, "limit", "I");
97 elementSizeShiftID =
98 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
99}
100
101static void *
102getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
103{
104 jint position;
105 jint limit;
106 jint elementSizeShift;
107 jlong pointer;
108
109 position = _env->GetIntField(buffer, positionID);
110 limit = _env->GetIntField(buffer, limitID);
111 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
112 *remaining = (limit - position) << elementSizeShift;
113 pointer = _env->CallStaticLongMethod(nioAccessClass,
114 getBasePointerID, buffer);
115 if (pointer != 0L) {
116 *array = NULL;
117 return reinterpret_cast<void*>(pointer);
118 }
119
120 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
121 getBaseArrayID, buffer);
122 *offset = _env->CallStaticIntMethod(nioAccessClass,
123 getBaseArrayOffsetID, buffer);
124
125 return NULL;
126}
127
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700128class ByteArrayGetter {
129public:
130 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
131 return _env->GetByteArrayElements(array, is_copy);
132 }
133};
134class BooleanArrayGetter {
135public:
136 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
137 return _env->GetBooleanArrayElements(array, is_copy);
138 }
139};
140class CharArrayGetter {
141public:
142 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
143 return _env->GetCharArrayElements(array, is_copy);
144 }
145};
146class ShortArrayGetter {
147public:
148 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
149 return _env->GetShortArrayElements(array, is_copy);
150 }
151};
152class IntArrayGetter {
153public:
154 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
155 return _env->GetIntArrayElements(array, is_copy);
156 }
157};
158class LongArrayGetter {
159public:
160 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
161 return _env->GetLongArrayElements(array, is_copy);
162 }
163};
164class FloatArrayGetter {
165public:
166 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
167 return _env->GetFloatArrayElements(array, is_copy);
168 }
169};
170class DoubleArrayGetter {
171public:
172 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
173 return _env->GetDoubleArrayElements(array, is_copy);
174 }
175};
176
177template<typename JTYPEARRAY, typename ARRAYGETTER>
178static void*
179getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
180 return ARRAYGETTER::Get(_env, array, is_copy);
181}
182
183class ByteArrayReleaser {
184public:
185 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
186 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
187 }
188};
189class BooleanArrayReleaser {
190public:
191 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
192 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
193 }
194};
195class CharArrayReleaser {
196public:
197 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
198 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
199 }
200};
201class ShortArrayReleaser {
202public:
203 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
204 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
205 }
206};
207class IntArrayReleaser {
208public:
209 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
210 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
211 }
212};
213class LongArrayReleaser {
214public:
215 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
216 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
217 }
218};
219class FloatArrayReleaser {
220public:
221 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
222 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
223 }
224};
225class DoubleArrayReleaser {
226public:
227 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
228 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
229 }
230};
231
232template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
233static void
234releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
235 ARRAYRELEASER::Release(_env, array, data, commit);
236}
237
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700238static void
239releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
240{
241 _env->ReleasePrimitiveArrayCritical(array, data,
242 commit ? 0 : JNI_ABORT);
243}
244
245static void *
246getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
247 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
248 if (buf) {
249 jint position = _env->GetIntField(buffer, positionID);
250 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
251 buf += position << elementSizeShift;
252 } else {
253 jniThrowException(_env, "java/lang/IllegalArgumentException",
254 "Must use a native order direct Buffer");
255 }
256 return (void*) buf;
257}
258
259// --------------------------------------------------------------------------
260
261/*
262 * returns the number of values glGet returns for a given pname.
263 *
264 * The code below is written such that pnames requiring only one values
265 * are the default (and are not explicitely tested for). This makes the
266 * checking code much shorter/readable/efficient.
267 *
268 * This means that unknown pnames (e.g.: extensions) will default to 1. If
269 * that unknown pname needs more than 1 value, then the validation check
270 * is incomplete and the app may crash if it passed the wrong number params.
271 */
272static int getNeededCount(GLint pname) {
273 int needed = 1;
Romain Guydc43a6c2017-02-17 19:54:25 -0800274#ifdef GL_ES_VERSION_3_0
275 // GLES 3.x pnames
276 switch (pname) {
277 case GL_MAX_VIEWPORT_DIMS:
278 needed = 2;
279 break;
280
281 case GL_PROGRAM_BINARY_FORMATS:
282 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
283 break;
284 }
285#endif
286
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700287#ifdef GL_ES_VERSION_2_0
288 // GLES 2.x pnames
289 switch (pname) {
290 case GL_ALIASED_LINE_WIDTH_RANGE:
291 case GL_ALIASED_POINT_SIZE_RANGE:
292 needed = 2;
293 break;
294
295 case GL_BLEND_COLOR:
296 case GL_COLOR_CLEAR_VALUE:
297 case GL_COLOR_WRITEMASK:
298 case GL_SCISSOR_BOX:
299 case GL_VIEWPORT:
300 needed = 4;
301 break;
302
303 case GL_COMPRESSED_TEXTURE_FORMATS:
304 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
305 break;
306
307 case GL_SHADER_BINARY_FORMATS:
308 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
309 break;
310 }
311#endif
312
313#ifdef GL_VERSION_ES_CM_1_1
314 // GLES 1.x pnames
315 switch (pname) {
316 case GL_ALIASED_LINE_WIDTH_RANGE:
317 case GL_ALIASED_POINT_SIZE_RANGE:
318 case GL_DEPTH_RANGE:
319 case GL_SMOOTH_LINE_WIDTH_RANGE:
320 case GL_SMOOTH_POINT_SIZE_RANGE:
321 needed = 2;
322 break;
323
324 case GL_CURRENT_NORMAL:
325 case GL_POINT_DISTANCE_ATTENUATION:
326 needed = 3;
327 break;
328
329 case GL_COLOR_CLEAR_VALUE:
330 case GL_COLOR_WRITEMASK:
331 case GL_CURRENT_COLOR:
332 case GL_CURRENT_TEXTURE_COORDS:
333 case GL_FOG_COLOR:
334 case GL_LIGHT_MODEL_AMBIENT:
335 case GL_SCISSOR_BOX:
336 case GL_VIEWPORT:
337 needed = 4;
338 break;
339
340 case GL_MODELVIEW_MATRIX:
341 case GL_PROJECTION_MATRIX:
342 case GL_TEXTURE_MATRIX:
343 needed = 16;
344 break;
345
346 case GL_COMPRESSED_TEXTURE_FORMATS:
347 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
348 break;
349 }
350#endif
351 return needed;
352}
353
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700354template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
355 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700356static void
357get
358 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
359 jint _exception = 0;
360 const char * _exceptionType;
361 const char * _exceptionMessage;
362 CTYPE *params_base = (CTYPE *) 0;
363 jint _remaining;
364 CTYPE *params = (CTYPE *) 0;
365 int _needed = 0;
366
367 if (!params_ref) {
368 _exception = 1;
369 _exceptionType = "java/lang/IllegalArgumentException";
370 _exceptionMessage = "params == null";
371 goto exit;
372 }
373 if (offset < 0) {
374 _exception = 1;
375 _exceptionType = "java/lang/IllegalArgumentException";
376 _exceptionMessage = "offset < 0";
377 goto exit;
378 }
379 _remaining = _env->GetArrayLength(params_ref) - offset;
380 _needed = getNeededCount(pname);
381 // if we didn't find this pname, we just assume the user passed
382 // an array of the right size -- this might happen with extensions
383 // or if we forget an enum here.
384 if (_remaining < _needed) {
385 _exception = 1;
386 _exceptionType = "java/lang/IllegalArgumentException";
387 _exceptionMessage = "length - offset < needed";
388 goto exit;
389 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700390 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
391 _env, params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700392 params = params_base + offset;
393
394 GET(
395 (GLenum)pname,
396 (CTYPE *)params
397 );
398
399exit:
400 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700401 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
402 _env, params_ref, params_base, !_exception);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700403 }
404 if (_exception) {
405 jniThrowException(_env, _exceptionType, _exceptionMessage);
406 }
407}
408
409
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700410template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
411 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700412static void
413getarray
414 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
415 jint _exception = 0;
416 const char * _exceptionType;
417 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700418 JTYPEARRAY _array = (JTYPEARRAY) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700419 jint _bufferOffset = (jint) 0;
420 jint _remaining;
421 CTYPE *params = (CTYPE *) 0;
422 int _needed = 0;
423
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700424 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700425 _remaining /= sizeof(CTYPE); // convert from bytes to item count
426 _needed = getNeededCount(pname);
427 // if we didn't find this pname, we just assume the user passed
428 // an array of the right size -- this might happen with extensions
429 // or if we forget an enum here.
430 if (_needed>0 && _remaining < _needed) {
431 _exception = 1;
432 _exceptionType = "java/lang/IllegalArgumentException";
433 _exceptionMessage = "remaining() < needed";
434 goto exit;
435 }
436 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700437 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
438 _env, _array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700439 params = (CTYPE *) (_paramsBase + _bufferOffset);
440 }
441 GET(
442 (GLenum)pname,
443 (CTYPE *)params
444 );
445
446exit:
447 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700448 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
449 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700450 }
451 if (_exception) {
452 jniThrowException(_env, _exceptionType, _exceptionMessage);
453 }
454}
455
456// --------------------------------------------------------------------------
457/* void glBlendBarrierKHR ( void ) */
458static void
459android_glBlendBarrierKHR__
460 (JNIEnv *_env, jobject _this) {
461 glBlendBarrierKHR();
462}
463
464/* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
465static void
466android_glDebugMessageControlKHR__IIII_3IIZ
467 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jintArray ids_ref, jint offset, jboolean enabled) {
468 jint _exception = 0;
469 const char * _exceptionType = NULL;
470 const char * _exceptionMessage = NULL;
471 GLuint *ids_base = (GLuint *) 0;
472 jint _remaining;
473 GLuint *ids = (GLuint *) 0;
474
475 if (!ids_ref) {
476 _exception = 1;
477 _exceptionType = "java/lang/IllegalArgumentException";
478 _exceptionMessage = "ids == null";
479 goto exit;
480 }
481 if (offset < 0) {
482 _exception = 1;
483 _exceptionType = "java/lang/IllegalArgumentException";
484 _exceptionMessage = "offset < 0";
485 goto exit;
486 }
487 _remaining = _env->GetArrayLength(ids_ref) - offset;
488 ids_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700489 _env->GetIntArrayElements(ids_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700490 ids = ids_base + offset;
491
492 glDebugMessageControlKHR(
493 (GLenum)source,
494 (GLenum)type,
495 (GLenum)severity,
496 (GLsizei)count,
497 (GLuint *)ids,
498 (GLboolean)enabled
499 );
500
501exit:
502 if (ids_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700503 _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700504 JNI_ABORT);
505 }
506 if (_exception) {
507 jniThrowException(_env, _exceptionType, _exceptionMessage);
508 }
509}
510
511/* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
512static void
513android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z
514 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jobject ids_buf, jboolean enabled) {
Romain Guy84cac202016-12-05 12:26:02 -0800515 jint _exception = 0;
516 const char * _exceptionType = NULL;
517 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700518 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700519 jint _bufferOffset = (jint) 0;
520 jint _remaining;
521 GLuint *ids = (GLuint *) 0;
522
Romain Guy84cac202016-12-05 12:26:02 -0800523 if (!ids_buf) {
524 _exception = 1;
525 _exceptionType = "java/lang/IllegalArgumentException";
526 _exceptionMessage = "ids == null";
527 goto exit;
528 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700529 ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700530 if (ids == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700531 char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700532 ids = (GLuint *) (_idsBase + _bufferOffset);
533 }
534 glDebugMessageControlKHR(
535 (GLenum)source,
536 (GLenum)type,
537 (GLenum)severity,
538 (GLsizei)count,
539 (GLuint *)ids,
540 (GLboolean)enabled
541 );
Romain Guy84cac202016-12-05 12:26:02 -0800542
543exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700544 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700545 _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700546 }
Romain Guy84cac202016-12-05 12:26:02 -0800547 if (_exception) {
548 jniThrowException(_env, _exceptionType, _exceptionMessage);
549 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700550}
551
552/* void glDebugMessageInsertKHR ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf ) */
553static void
554android_glDebugMessageInsertKHR__IIIILjava_lang_String_2
555 (JNIEnv *_env, jobject _this, jint source, jint type, jint id, jint severity, jstring buf) {
556 jint _exception = 0;
557 const char * _exceptionType = NULL;
558 const char * _exceptionMessage = NULL;
559 const char* _nativebuf = 0;
560 jint _length = 0;
561
562 if (!buf) {
563 _exception = 1;
564 _exceptionType = "java/lang/IllegalArgumentException";
565 _exceptionMessage = "buf == null";
566 goto exit;
567 }
568 _nativebuf = _env->GetStringUTFChars(buf, 0);
569 _length = _env->GetStringUTFLength(buf);
570
571 glDebugMessageInsertKHR(
572 (GLenum)source,
573 (GLenum)type,
574 (GLuint)id,
575 (GLenum)severity,
576 (GLsizei)_length,
577 (GLchar *)_nativebuf
578 );
579
580exit:
581 if (_nativebuf) {
582 _env->ReleaseStringUTFChars(buf, _nativebuf);
583 }
584
585 if (_exception) {
586 jniThrowException(_env, _exceptionType, _exceptionMessage);
587 }
588}
589
590/* void glDebugMessageCallbackKHR ( GLDEBUGPROCKHR callback, const void *userParam ) */
591static void
592android_glDebugMessageCallbackKHR(JNIEnv *_env, jobject _this, jobject callback) {
593 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
594}
595/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
596static jint
597android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI
598 (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) {
599 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
600 return 0;
601}
602
603/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
604static uint
605android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
606 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref, jobject lengths_ref, jobject messageLog_ref) {
607 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
608 return 0;
609}
610
611/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
612static jobjectArray
613android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II
614 (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) {
615 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
616 return 0;
617}
618
619/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
620static jobjectArray
621android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
622 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref) {
623 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
624 return 0;
625}
626/* void glPushDebugGroupKHR ( GLenum source, GLuint id, GLsizei length, const GLchar *message ) */
627static void
628android_glPushDebugGroupKHR__IIILjava_lang_String_2
629 (JNIEnv *_env, jobject _this, jint source, jint id, jint length, jstring message) {
630 jint _exception = 0;
631 const char * _exceptionType = NULL;
632 const char * _exceptionMessage = NULL;
633 const char* _nativemessage = 0;
634
635 if (!message) {
636 _exception = 1;
637 _exceptionType = "java/lang/IllegalArgumentException";
638 _exceptionMessage = "message == null";
639 goto exit;
640 }
641 _nativemessage = _env->GetStringUTFChars(message, 0);
642
643 glPushDebugGroupKHR(
644 (GLenum)source,
645 (GLuint)id,
646 (GLsizei)length,
647 (GLchar *)_nativemessage
648 );
649
650exit:
651 if (_nativemessage) {
652 _env->ReleaseStringUTFChars(message, _nativemessage);
653 }
654
655 if (_exception) {
656 jniThrowException(_env, _exceptionType, _exceptionMessage);
657 }
658}
659
660/* void glPopDebugGroupKHR ( void ) */
661static void
662android_glPopDebugGroupKHR__
663 (JNIEnv *_env, jobject _this) {
664 glPopDebugGroupKHR();
665}
666
667/* void glObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label ) */
668static void
669android_glObjectLabelKHR__IIILjava_lang_String_2
670 (JNIEnv *_env, jobject _this, jint identifier, jint name, jint length, jstring label) {
671 jint _exception = 0;
672 const char * _exceptionType = NULL;
673 const char * _exceptionMessage = NULL;
674 const char* _nativelabel = 0;
675
Pablo Ceballos6aff9062015-10-01 18:35:39 -0700676 if (label) {
677 _nativelabel = _env->GetStringUTFChars(label, 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700678 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700679
680 glObjectLabelKHR(
681 (GLenum)identifier,
682 (GLuint)name,
683 (GLsizei)length,
684 (GLchar *)_nativelabel
685 );
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700686 if (_nativelabel) {
687 _env->ReleaseStringUTFChars(label, _nativelabel);
688 }
689
690 if (_exception) {
691 jniThrowException(_env, _exceptionType, _exceptionMessage);
692 }
693}
694
695/* void glGetObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label ) */
696static jstring
697android_glGetObjectLabelKHR(JNIEnv *_env, jobject _this, jint identifier, jint name) {
698 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
699 return NULL;
700}
701
702/* void glObjectPtrLabelKHR ( const void *ptr, GLsizei length, const GLchar *label ) */
703static void
704android_glObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr, jstring label) {
705 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
706}
707
708/* void glGetObjectPtrLabelKHR ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label ) */
709static jstring
710android_glGetObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr) {
711 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
712 return NULL;
713}
714
715/* void glGetPointervKHR ( GLenum pname, void **params ) */
716static jobject
717android_glGetDebugMessageCallbackKHR(JNIEnv *_env, jobject _this) {
718 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
719 return NULL;
720}
721
722/* void glMinSampleShadingOES ( GLfloat value ) */
723static void
724android_glMinSampleShadingOES__F
725 (JNIEnv *_env, jobject _this, jfloat value) {
726 glMinSampleShadingOES(
727 (GLfloat)value
728 );
729}
730
731/* void glTexStorage3DMultisampleOES ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations ) */
732static void
733android_glTexStorage3DMultisampleOES__IIIIIIZ
734 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) {
735 glTexStorage3DMultisampleOES(
736 (GLenum)target,
737 (GLsizei)samples,
738 (GLenum)internalformat,
739 (GLsizei)width,
740 (GLsizei)height,
741 (GLsizei)depth,
742 (GLboolean)fixedsamplelocations
743 );
744}
745
746/* void glCopyImageSubDataEXT ( 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 ) */
747static void
748android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII
749 (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) {
750 glCopyImageSubDataEXT(
751 (GLuint)srcName,
752 (GLenum)srcTarget,
753 (GLint)srcLevel,
754 (GLint)srcX,
755 (GLint)srcY,
756 (GLint)srcZ,
757 (GLuint)dstName,
758 (GLenum)dstTarget,
759 (GLint)dstLevel,
760 (GLint)dstX,
761 (GLint)dstY,
762 (GLint)dstZ,
763 (GLsizei)srcWidth,
764 (GLsizei)srcHeight,
765 (GLsizei)srcDepth
766 );
767}
768
769/* void glEnableiEXT ( GLenum target, GLuint index ) */
770static void
771android_glEnableiEXT__II
772 (JNIEnv *_env, jobject _this, jint target, jint index) {
773 glEnableiEXT(
774 (GLenum)target,
775 (GLuint)index
776 );
777}
778
779/* void glDisableiEXT ( GLenum target, GLuint index ) */
780static void
781android_glDisableiEXT__II
782 (JNIEnv *_env, jobject _this, jint target, jint index) {
783 glDisableiEXT(
784 (GLenum)target,
785 (GLuint)index
786 );
787}
788
789/* void glBlendEquationiEXT ( GLuint buf, GLenum mode ) */
790static void
791android_glBlendEquationiEXT__II
792 (JNIEnv *_env, jobject _this, jint buf, jint mode) {
793 glBlendEquationiEXT(
794 (GLuint)buf,
795 (GLenum)mode
796 );
797}
798
799/* void glBlendEquationSeparateiEXT ( GLuint buf, GLenum modeRGB, GLenum modeAlpha ) */
800static void
801android_glBlendEquationSeparateiEXT__III
802 (JNIEnv *_env, jobject _this, jint buf, jint modeRGB, jint modeAlpha) {
803 glBlendEquationSeparateiEXT(
804 (GLuint)buf,
805 (GLenum)modeRGB,
806 (GLenum)modeAlpha
807 );
808}
809
810/* void glBlendFunciEXT ( GLuint buf, GLenum src, GLenum dst ) */
811static void
812android_glBlendFunciEXT__III
813 (JNIEnv *_env, jobject _this, jint buf, jint src, jint dst) {
814 glBlendFunciEXT(
815 (GLuint)buf,
816 (GLenum)src,
817 (GLenum)dst
818 );
819}
820
821/* void glBlendFuncSeparateiEXT ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */
822static void
823android_glBlendFuncSeparateiEXT__IIIII
824 (JNIEnv *_env, jobject _this, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
825 glBlendFuncSeparateiEXT(
826 (GLuint)buf,
827 (GLenum)srcRGB,
828 (GLenum)dstRGB,
829 (GLenum)srcAlpha,
830 (GLenum)dstAlpha
831 );
832}
833
834/* void glColorMaskiEXT ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) */
835static void
836android_glColorMaskiEXT__IZZZZ
837 (JNIEnv *_env, jobject _this, jint index, jboolean r, jboolean g, jboolean b, jboolean a) {
838 glColorMaskiEXT(
839 (GLuint)index,
840 (GLboolean)r,
841 (GLboolean)g,
842 (GLboolean)b,
843 (GLboolean)a
844 );
845}
846
847/* GLboolean glIsEnablediEXT ( GLenum target, GLuint index ) */
848static jboolean
849android_glIsEnablediEXT__II
850 (JNIEnv *_env, jobject _this, jint target, jint index) {
851 GLboolean _returnValue;
852 _returnValue = glIsEnablediEXT(
853 (GLenum)target,
854 (GLuint)index
855 );
856 return (jboolean)_returnValue;
857}
858
859/* void glFramebufferTextureEXT ( GLenum target, GLenum attachment, GLuint texture, GLint level ) */
860static void
861android_glFramebufferTextureEXT__IIII
862 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level) {
863 glFramebufferTextureEXT(
864 (GLenum)target,
865 (GLenum)attachment,
866 (GLuint)texture,
867 (GLint)level
868 );
869}
870
871/* void glPrimitiveBoundingBoxEXT ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW ) */
872static void
873android_glPrimitiveBoundingBoxEXT__FFFFFFFF
874 (JNIEnv *_env, jobject _this, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) {
875 glPrimitiveBoundingBoxEXT(
876 (GLfloat)minX,
877 (GLfloat)minY,
878 (GLfloat)minZ,
879 (GLfloat)minW,
880 (GLfloat)maxX,
881 (GLfloat)maxY,
882 (GLfloat)maxZ,
883 (GLfloat)maxW
884 );
885}
886
887/* void glPatchParameteriEXT ( GLenum pname, GLint value ) */
888static void
889android_glPatchParameteriEXT__II
890 (JNIEnv *_env, jobject _this, jint pname, jint value) {
891 glPatchParameteriEXT(
892 (GLenum)pname,
893 (GLint)value
894 );
895}
896
897/* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */
898static void
899android_glTexParameterIivEXT__II_3II
900 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
901 jint _exception = 0;
902 const char * _exceptionType = NULL;
903 const char * _exceptionMessage = NULL;
904 GLint *params_base = (GLint *) 0;
905 jint _remaining;
906 GLint *params = (GLint *) 0;
907
908 if (!params_ref) {
909 _exception = 1;
910 _exceptionType = "java/lang/IllegalArgumentException";
911 _exceptionMessage = "params == null";
912 goto exit;
913 }
914 if (offset < 0) {
915 _exception = 1;
916 _exceptionType = "java/lang/IllegalArgumentException";
917 _exceptionMessage = "offset < 0";
918 goto exit;
919 }
920 _remaining = _env->GetArrayLength(params_ref) - offset;
921 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700922 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700923 params = params_base + offset;
924
925 glTexParameterIivEXT(
926 (GLenum)target,
927 (GLenum)pname,
928 (GLint *)params
929 );
930
931exit:
932 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700933 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700934 JNI_ABORT);
935 }
936 if (_exception) {
937 jniThrowException(_env, _exceptionType, _exceptionMessage);
938 }
939}
940
941/* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */
942static void
943android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2
944 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800945 jint _exception = 0;
946 const char * _exceptionType = NULL;
947 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700948 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700949 jint _bufferOffset = (jint) 0;
950 jint _remaining;
951 GLint *params = (GLint *) 0;
952
Romain Guy84cac202016-12-05 12:26:02 -0800953 if (!params_buf) {
954 _exception = 1;
955 _exceptionType = "java/lang/IllegalArgumentException";
956 _exceptionMessage = "params == null";
957 goto exit;
958 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700959 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700960 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700961 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700962 params = (GLint *) (_paramsBase + _bufferOffset);
963 }
964 glTexParameterIivEXT(
965 (GLenum)target,
966 (GLenum)pname,
967 (GLint *)params
968 );
Romain Guy84cac202016-12-05 12:26:02 -0800969
970exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700971 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700972 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700973 }
Romain Guy84cac202016-12-05 12:26:02 -0800974 if (_exception) {
975 jniThrowException(_env, _exceptionType, _exceptionMessage);
976 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -0700977}
978
979/* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */
980static void
981android_glTexParameterIuivEXT__II_3II
982 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
983 jint _exception = 0;
984 const char * _exceptionType = NULL;
985 const char * _exceptionMessage = NULL;
986 GLuint *params_base = (GLuint *) 0;
987 jint _remaining;
988 GLuint *params = (GLuint *) 0;
989
990 if (!params_ref) {
991 _exception = 1;
992 _exceptionType = "java/lang/IllegalArgumentException";
993 _exceptionMessage = "params == null";
994 goto exit;
995 }
996 if (offset < 0) {
997 _exception = 1;
998 _exceptionType = "java/lang/IllegalArgumentException";
999 _exceptionMessage = "offset < 0";
1000 goto exit;
1001 }
1002 _remaining = _env->GetArrayLength(params_ref) - offset;
1003 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001004 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001005 params = params_base + offset;
1006
1007 glTexParameterIuivEXT(
1008 (GLenum)target,
1009 (GLenum)pname,
1010 (GLuint *)params
1011 );
1012
1013exit:
1014 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001015 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001016 JNI_ABORT);
1017 }
1018 if (_exception) {
1019 jniThrowException(_env, _exceptionType, _exceptionMessage);
1020 }
1021}
1022
1023/* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */
1024static void
1025android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2
1026 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001027 jint _exception = 0;
1028 const char * _exceptionType = NULL;
1029 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001030 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001031 jint _bufferOffset = (jint) 0;
1032 jint _remaining;
1033 GLuint *params = (GLuint *) 0;
1034
Romain Guy84cac202016-12-05 12:26:02 -08001035 if (!params_buf) {
1036 _exception = 1;
1037 _exceptionType = "java/lang/IllegalArgumentException";
1038 _exceptionMessage = "params == null";
1039 goto exit;
1040 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001041 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001042 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001043 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001044 params = (GLuint *) (_paramsBase + _bufferOffset);
1045 }
1046 glTexParameterIuivEXT(
1047 (GLenum)target,
1048 (GLenum)pname,
1049 (GLuint *)params
1050 );
Romain Guy84cac202016-12-05 12:26:02 -08001051
1052exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001053 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001054 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001055 }
Romain Guy84cac202016-12-05 12:26:02 -08001056 if (_exception) {
1057 jniThrowException(_env, _exceptionType, _exceptionMessage);
1058 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001059}
1060
1061/* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */
1062static void
1063android_glGetTexParameterIivEXT__II_3II
1064 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1065 jint _exception = 0;
1066 const char * _exceptionType = NULL;
1067 const char * _exceptionMessage = NULL;
1068 GLint *params_base = (GLint *) 0;
1069 jint _remaining;
1070 GLint *params = (GLint *) 0;
1071
1072 if (!params_ref) {
1073 _exception = 1;
1074 _exceptionType = "java/lang/IllegalArgumentException";
1075 _exceptionMessage = "params == null";
1076 goto exit;
1077 }
1078 if (offset < 0) {
1079 _exception = 1;
1080 _exceptionType = "java/lang/IllegalArgumentException";
1081 _exceptionMessage = "offset < 0";
1082 goto exit;
1083 }
1084 _remaining = _env->GetArrayLength(params_ref) - offset;
1085 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001086 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001087 params = params_base + offset;
1088
1089 glGetTexParameterIivEXT(
1090 (GLenum)target,
1091 (GLenum)pname,
1092 (GLint *)params
1093 );
1094
1095exit:
1096 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001097 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001098 _exception ? JNI_ABORT: 0);
1099 }
1100 if (_exception) {
1101 jniThrowException(_env, _exceptionType, _exceptionMessage);
1102 }
1103}
1104
1105/* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */
1106static void
1107android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2
1108 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001109 jint _exception = 0;
1110 const char * _exceptionType = NULL;
1111 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001112 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001113 jint _bufferOffset = (jint) 0;
1114 jint _remaining;
1115 GLint *params = (GLint *) 0;
1116
Romain Guy84cac202016-12-05 12:26:02 -08001117 if (!params_buf) {
1118 _exception = 1;
1119 _exceptionType = "java/lang/IllegalArgumentException";
1120 _exceptionMessage = "params == null";
1121 goto exit;
1122 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001123 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001124 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001125 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001126 params = (GLint *) (_paramsBase + _bufferOffset);
1127 }
1128 glGetTexParameterIivEXT(
1129 (GLenum)target,
1130 (GLenum)pname,
1131 (GLint *)params
1132 );
Romain Guy84cac202016-12-05 12:26:02 -08001133
1134exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001135 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001136 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1137 }
1138 if (_exception) {
1139 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001140 }
1141}
1142
1143/* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */
1144static void
1145android_glGetTexParameterIuivEXT__II_3II
1146 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1147 jint _exception = 0;
1148 const char * _exceptionType = NULL;
1149 const char * _exceptionMessage = NULL;
1150 GLuint *params_base = (GLuint *) 0;
1151 jint _remaining;
1152 GLuint *params = (GLuint *) 0;
1153
1154 if (!params_ref) {
1155 _exception = 1;
1156 _exceptionType = "java/lang/IllegalArgumentException";
1157 _exceptionMessage = "params == null";
1158 goto exit;
1159 }
1160 if (offset < 0) {
1161 _exception = 1;
1162 _exceptionType = "java/lang/IllegalArgumentException";
1163 _exceptionMessage = "offset < 0";
1164 goto exit;
1165 }
1166 _remaining = _env->GetArrayLength(params_ref) - offset;
1167 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001168 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001169 params = params_base + offset;
1170
1171 glGetTexParameterIuivEXT(
1172 (GLenum)target,
1173 (GLenum)pname,
1174 (GLuint *)params
1175 );
1176
1177exit:
1178 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001179 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001180 _exception ? JNI_ABORT: 0);
1181 }
1182 if (_exception) {
1183 jniThrowException(_env, _exceptionType, _exceptionMessage);
1184 }
1185}
1186
1187/* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */
1188static void
1189android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2
1190 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001191 jint _exception = 0;
1192 const char * _exceptionType = NULL;
1193 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001194 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001195 jint _bufferOffset = (jint) 0;
1196 jint _remaining;
1197 GLuint *params = (GLuint *) 0;
1198
Romain Guy84cac202016-12-05 12:26:02 -08001199 if (!params_buf) {
1200 _exception = 1;
1201 _exceptionType = "java/lang/IllegalArgumentException";
1202 _exceptionMessage = "params == null";
1203 goto exit;
1204 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001205 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001206 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001207 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001208 params = (GLuint *) (_paramsBase + _bufferOffset);
1209 }
1210 glGetTexParameterIuivEXT(
1211 (GLenum)target,
1212 (GLenum)pname,
1213 (GLuint *)params
1214 );
Romain Guy84cac202016-12-05 12:26:02 -08001215
1216exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001217 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001218 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1219 }
1220 if (_exception) {
1221 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001222 }
1223}
1224
1225/* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */
1226static void
1227android_glSamplerParameterIivEXT__II_3II
1228 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1229 jint _exception = 0;
1230 const char * _exceptionType = NULL;
1231 const char * _exceptionMessage = NULL;
1232 GLint *param_base = (GLint *) 0;
1233 jint _remaining;
1234 GLint *param = (GLint *) 0;
1235
1236 if (!param_ref) {
1237 _exception = 1;
1238 _exceptionType = "java/lang/IllegalArgumentException";
1239 _exceptionMessage = "param == null";
1240 goto exit;
1241 }
1242 if (offset < 0) {
1243 _exception = 1;
1244 _exceptionType = "java/lang/IllegalArgumentException";
1245 _exceptionMessage = "offset < 0";
1246 goto exit;
1247 }
1248 _remaining = _env->GetArrayLength(param_ref) - offset;
1249 param_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001250 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001251 param = param_base + offset;
1252
1253 glSamplerParameterIivEXT(
1254 (GLuint)sampler,
1255 (GLenum)pname,
1256 (GLint *)param
1257 );
1258
1259exit:
1260 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001261 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001262 JNI_ABORT);
1263 }
1264 if (_exception) {
1265 jniThrowException(_env, _exceptionType, _exceptionMessage);
1266 }
1267}
1268
1269/* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */
1270static void
1271android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2
1272 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001273 jint _exception = 0;
1274 const char * _exceptionType = NULL;
1275 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001276 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001277 jint _bufferOffset = (jint) 0;
1278 jint _remaining;
1279 GLint *param = (GLint *) 0;
1280
Romain Guy84cac202016-12-05 12:26:02 -08001281 if (!param_buf) {
1282 _exception = 1;
1283 _exceptionType = "java/lang/IllegalArgumentException";
1284 _exceptionMessage = "param == null";
1285 goto exit;
1286 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001287 param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001288 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001289 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001290 param = (GLint *) (_paramBase + _bufferOffset);
1291 }
1292 glSamplerParameterIivEXT(
1293 (GLuint)sampler,
1294 (GLenum)pname,
1295 (GLint *)param
1296 );
Romain Guy84cac202016-12-05 12:26:02 -08001297
1298exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001299 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001300 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001301 }
Romain Guy84cac202016-12-05 12:26:02 -08001302 if (_exception) {
1303 jniThrowException(_env, _exceptionType, _exceptionMessage);
1304 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001305}
1306
1307/* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */
1308static void
1309android_glSamplerParameterIuivEXT__II_3II
1310 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1311 jint _exception = 0;
1312 const char * _exceptionType = NULL;
1313 const char * _exceptionMessage = NULL;
1314 GLuint *param_base = (GLuint *) 0;
1315 jint _remaining;
1316 GLuint *param = (GLuint *) 0;
1317
1318 if (!param_ref) {
1319 _exception = 1;
1320 _exceptionType = "java/lang/IllegalArgumentException";
1321 _exceptionMessage = "param == null";
1322 goto exit;
1323 }
1324 if (offset < 0) {
1325 _exception = 1;
1326 _exceptionType = "java/lang/IllegalArgumentException";
1327 _exceptionMessage = "offset < 0";
1328 goto exit;
1329 }
1330 _remaining = _env->GetArrayLength(param_ref) - offset;
1331 param_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001332 _env->GetIntArrayElements(param_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001333 param = param_base + offset;
1334
1335 glSamplerParameterIuivEXT(
1336 (GLuint)sampler,
1337 (GLenum)pname,
1338 (GLuint *)param
1339 );
1340
1341exit:
1342 if (param_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001343 _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001344 JNI_ABORT);
1345 }
1346 if (_exception) {
1347 jniThrowException(_env, _exceptionType, _exceptionMessage);
1348 }
1349}
1350
1351/* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */
1352static void
1353android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2
1354 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001355 jint _exception = 0;
1356 const char * _exceptionType = NULL;
1357 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001358 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001359 jint _bufferOffset = (jint) 0;
1360 jint _remaining;
1361 GLuint *param = (GLuint *) 0;
1362
Romain Guy84cac202016-12-05 12:26:02 -08001363 if (!param_buf) {
1364 _exception = 1;
1365 _exceptionType = "java/lang/IllegalArgumentException";
1366 _exceptionMessage = "param == null";
1367 goto exit;
1368 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001369 param = (GLuint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001370 if (param == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001371 char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001372 param = (GLuint *) (_paramBase + _bufferOffset);
1373 }
1374 glSamplerParameterIuivEXT(
1375 (GLuint)sampler,
1376 (GLenum)pname,
1377 (GLuint *)param
1378 );
Romain Guy84cac202016-12-05 12:26:02 -08001379
1380exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001381 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001382 _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001383 }
Romain Guy84cac202016-12-05 12:26:02 -08001384 if (_exception) {
1385 jniThrowException(_env, _exceptionType, _exceptionMessage);
1386 }
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001387}
1388
1389/* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */
1390static void
1391android_glGetSamplerParameterIivEXT__II_3II
1392 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1393 jint _exception = 0;
1394 const char * _exceptionType = NULL;
1395 const char * _exceptionMessage = NULL;
1396 GLint *params_base = (GLint *) 0;
1397 jint _remaining;
1398 GLint *params = (GLint *) 0;
1399
1400 if (!params_ref) {
1401 _exception = 1;
1402 _exceptionType = "java/lang/IllegalArgumentException";
1403 _exceptionMessage = "params == null";
1404 goto exit;
1405 }
1406 if (offset < 0) {
1407 _exception = 1;
1408 _exceptionType = "java/lang/IllegalArgumentException";
1409 _exceptionMessage = "offset < 0";
1410 goto exit;
1411 }
1412 _remaining = _env->GetArrayLength(params_ref) - offset;
1413 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001414 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001415 params = params_base + offset;
1416
1417 glGetSamplerParameterIivEXT(
1418 (GLuint)sampler,
1419 (GLenum)pname,
1420 (GLint *)params
1421 );
1422
1423exit:
1424 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001425 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001426 _exception ? JNI_ABORT: 0);
1427 }
1428 if (_exception) {
1429 jniThrowException(_env, _exceptionType, _exceptionMessage);
1430 }
1431}
1432
1433/* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */
1434static void
1435android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2
1436 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001437 jint _exception = 0;
1438 const char * _exceptionType = NULL;
1439 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001440 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001441 jint _bufferOffset = (jint) 0;
1442 jint _remaining;
1443 GLint *params = (GLint *) 0;
1444
Romain Guy84cac202016-12-05 12:26:02 -08001445 if (!params_buf) {
1446 _exception = 1;
1447 _exceptionType = "java/lang/IllegalArgumentException";
1448 _exceptionMessage = "params == null";
1449 goto exit;
1450 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001451 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001452 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001453 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001454 params = (GLint *) (_paramsBase + _bufferOffset);
1455 }
1456 glGetSamplerParameterIivEXT(
1457 (GLuint)sampler,
1458 (GLenum)pname,
1459 (GLint *)params
1460 );
Romain Guy84cac202016-12-05 12:26:02 -08001461
1462exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001463 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001464 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1465 }
1466 if (_exception) {
1467 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001468 }
1469}
1470
1471/* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */
1472static void
1473android_glGetSamplerParameterIuivEXT__II_3II
1474 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1475 jint _exception = 0;
1476 const char * _exceptionType = NULL;
1477 const char * _exceptionMessage = NULL;
1478 GLuint *params_base = (GLuint *) 0;
1479 jint _remaining;
1480 GLuint *params = (GLuint *) 0;
1481
1482 if (!params_ref) {
1483 _exception = 1;
1484 _exceptionType = "java/lang/IllegalArgumentException";
1485 _exceptionMessage = "params == null";
1486 goto exit;
1487 }
1488 if (offset < 0) {
1489 _exception = 1;
1490 _exceptionType = "java/lang/IllegalArgumentException";
1491 _exceptionMessage = "offset < 0";
1492 goto exit;
1493 }
1494 _remaining = _env->GetArrayLength(params_ref) - offset;
1495 params_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001496 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001497 params = params_base + offset;
1498
1499 glGetSamplerParameterIuivEXT(
1500 (GLuint)sampler,
1501 (GLenum)pname,
1502 (GLuint *)params
1503 );
1504
1505exit:
1506 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001507 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001508 _exception ? JNI_ABORT: 0);
1509 }
1510 if (_exception) {
1511 jniThrowException(_env, _exceptionType, _exceptionMessage);
1512 }
1513}
1514
1515/* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */
1516static void
1517android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2
1518 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08001519 jint _exception = 0;
1520 const char * _exceptionType = NULL;
1521 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001522 jintArray _array = (jintArray) 0;
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001523 jint _bufferOffset = (jint) 0;
1524 jint _remaining;
1525 GLuint *params = (GLuint *) 0;
1526
Romain Guy84cac202016-12-05 12:26:02 -08001527 if (!params_buf) {
1528 _exception = 1;
1529 _exceptionType = "java/lang/IllegalArgumentException";
1530 _exceptionMessage = "params == null";
1531 goto exit;
1532 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001533 params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001534 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001535 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001536 params = (GLuint *) (_paramsBase + _bufferOffset);
1537 }
1538 glGetSamplerParameterIuivEXT(
1539 (GLuint)sampler,
1540 (GLenum)pname,
1541 (GLuint *)params
1542 );
Romain Guy84cac202016-12-05 12:26:02 -08001543
1544exit:
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001545 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08001546 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1547 }
1548 if (_exception) {
1549 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001550 }
1551}
1552
1553/* void glTexBufferEXT ( GLenum target, GLenum internalformat, GLuint buffer ) */
1554static void
1555android_glTexBufferEXT__III
1556 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer) {
1557 glTexBufferEXT(
1558 (GLenum)target,
1559 (GLenum)internalformat,
1560 (GLuint)buffer
1561 );
1562}
1563
1564/* void glTexBufferRangeEXT ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
1565static void
1566android_glTexBufferRangeEXT__IIIII
1567 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer, jint offset, jint size) {
1568 glTexBufferRangeEXT(
1569 (GLenum)target,
1570 (GLenum)internalformat,
1571 (GLuint)buffer,
1572 (GLintptr)offset,
1573 (GLsizeiptr)size
1574 );
1575}
1576
1577static const char *classPathName = "android/opengl/GLES31Ext";
1578
Daniel Micay76f6a862015-09-19 17:31:01 -04001579static const JNINativeMethod methods[] = {
Jesse Hall7ab63ac2014-05-19 15:13:41 -07001580{"_nativeClassInit", "()V", (void*)nativeClassInit },
1581{"glBlendBarrierKHR", "()V", (void *) android_glBlendBarrierKHR__ },
1582{"glDebugMessageControlKHR", "(IIII[IIZ)V", (void *) android_glDebugMessageControlKHR__IIII_3IIZ },
1583{"glDebugMessageControlKHR", "(IIIILjava/nio/IntBuffer;Z)V", (void *) android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z },
1584{"glDebugMessageInsertKHR", "(IIIILjava/lang/String;)V", (void *) android_glDebugMessageInsertKHR__IIIILjava_lang_String_2 },
1585{"glDebugMessageCallbackKHR", "(Landroid/opengl/GLES31Ext$DebugProcKHR;)V", (void *) android_glDebugMessageCallbackKHR },
1586{"glGetDebugMessageLogKHR", "(II[II[II[II[II[II[BI)I", (void *) android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI },
1587{"glGetDebugMessageLogKHR", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)I", (void *) android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
1588{"glGetDebugMessageLogKHR", "(I[II[II[II[II)[Ljava/lang/String;", (void *) android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II },
1589{"glGetDebugMessageLogKHR", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)[Ljava/lang/String;", (void *) android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
1590{"glPushDebugGroupKHR", "(IIILjava/lang/String;)V", (void *) android_glPushDebugGroupKHR__IIILjava_lang_String_2 },
1591{"glPopDebugGroupKHR", "()V", (void *) android_glPopDebugGroupKHR__ },
1592{"glObjectLabelKHR", "(IIILjava/lang/String;)V", (void *) android_glObjectLabelKHR__IIILjava_lang_String_2 },
1593{"glGetObjectLabelKHR", "(II)Ljava/lang/String;", (void *) android_glGetObjectLabelKHR },
1594{"glObjectPtrLabelKHR", "(JLjava/lang/String;)V", (void *) android_glObjectPtrLabelKHR },
1595{"glGetObjectPtrLabelKHR", "(J)Ljava/lang/String;", (void *) android_glGetObjectPtrLabelKHR },
1596{"glGetDebugMessageCallbackKHR", "()Landroid/opengl/GLES31Ext$DebugProcKHR;", (void *) android_glGetDebugMessageCallbackKHR },
1597{"glMinSampleShadingOES", "(F)V", (void *) android_glMinSampleShadingOES__F },
1598{"glTexStorage3DMultisampleOES", "(IIIIIIZ)V", (void *) android_glTexStorage3DMultisampleOES__IIIIIIZ },
1599{"glCopyImageSubDataEXT", "(IIIIIIIIIIIIIII)V", (void *) android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII },
1600{"glEnableiEXT", "(II)V", (void *) android_glEnableiEXT__II },
1601{"glDisableiEXT", "(II)V", (void *) android_glDisableiEXT__II },
1602{"glBlendEquationiEXT", "(II)V", (void *) android_glBlendEquationiEXT__II },
1603{"glBlendEquationSeparateiEXT", "(III)V", (void *) android_glBlendEquationSeparateiEXT__III },
1604{"glBlendFunciEXT", "(III)V", (void *) android_glBlendFunciEXT__III },
1605{"glBlendFuncSeparateiEXT", "(IIIII)V", (void *) android_glBlendFuncSeparateiEXT__IIIII },
1606{"glColorMaskiEXT", "(IZZZZ)V", (void *) android_glColorMaskiEXT__IZZZZ },
1607{"glIsEnablediEXT", "(II)Z", (void *) android_glIsEnablediEXT__II },
1608{"glFramebufferTextureEXT", "(IIII)V", (void *) android_glFramebufferTextureEXT__IIII },
1609{"glPrimitiveBoundingBoxEXT", "(FFFFFFFF)V", (void *) android_glPrimitiveBoundingBoxEXT__FFFFFFFF },
1610{"glPatchParameteriEXT", "(II)V", (void *) android_glPatchParameteriEXT__II },
1611{"glTexParameterIivEXT", "(II[II)V", (void *) android_glTexParameterIivEXT__II_3II },
1612{"glTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2 },
1613{"glTexParameterIuivEXT", "(II[II)V", (void *) android_glTexParameterIuivEXT__II_3II },
1614{"glTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1615{"glGetTexParameterIivEXT", "(II[II)V", (void *) android_glGetTexParameterIivEXT__II_3II },
1616{"glGetTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2 },
1617{"glGetTexParameterIuivEXT", "(II[II)V", (void *) android_glGetTexParameterIuivEXT__II_3II },
1618{"glGetTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1619{"glSamplerParameterIivEXT", "(II[II)V", (void *) android_glSamplerParameterIivEXT__II_3II },
1620{"glSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 },
1621{"glSamplerParameterIuivEXT", "(II[II)V", (void *) android_glSamplerParameterIuivEXT__II_3II },
1622{"glSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1623{"glGetSamplerParameterIivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIivEXT__II_3II },
1624{"glGetSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 },
1625{"glGetSamplerParameterIuivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIuivEXT__II_3II },
1626{"glGetSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1627{"glTexBufferEXT", "(III)V", (void *) android_glTexBufferEXT__III },
1628{"glTexBufferRangeEXT", "(IIIII)V", (void *) android_glTexBufferRangeEXT__IIIII },
1629};
1630
1631int register_android_opengl_jni_GLES31Ext(JNIEnv *_env)
1632{
1633 int err;
1634 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
1635 return err;
1636}