1 /*
2 **
3 ** Copyright 2009, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17
18 // This source file is automatically generated
19
20 #pragma GCC diagnostic ignored "-Wunused-variable"
21 #pragma GCC diagnostic ignored "-Wunused-function"
22
23 #include <GLES/gl.h>
24 #include <GLES/glext.h>
25
26 #include <jni.h>
27 #include <nativehelper/JNIHelp.h>
28 #include <android_runtime/AndroidRuntime.h>
29 #include <utils/misc.h>
30 #include <assert.h>
31
32
33 /* special calls implemented in Android's GLES wrapper used to more
34 * efficiently bound-check passed arrays */
35 extern "C" {
36 #ifdef GL_VERSION_ES_CM_1_1
37 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
38 const GLvoid *ptr, GLsizei count);
39 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
40 const GLvoid *pointer, GLsizei count);
41 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
42 GLsizei stride, const GLvoid *pointer, GLsizei count);
43 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
44 GLsizei stride, const GLvoid *pointer, GLsizei count);
45 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
46 GLsizei stride, const GLvoid *pointer, GLsizei count);
47 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
48 GLsizei stride, const GLvoid *pointer, GLsizei count);
49 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
50 GLsizei stride, const GLvoid *pointer, GLsizei count);
51 #endif
52 #ifdef GL_ES_VERSION_2_0
glVertexAttribPointerBounds(GLuint indx,GLint size,GLenum type,GLboolean normalized,GLsizei stride,const GLvoid * pointer,GLsizei count)53 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
54 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
55 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
56 }
57 #endif
58 #ifdef GL_ES_VERSION_3_0
glVertexAttribIPointerBounds(GLuint indx,GLint size,GLenum type,GLsizei stride,const GLvoid * pointer,GLsizei count)59 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count) {
61 glVertexAttribIPointer(indx, size, type, stride, pointer);
62 }
63 #endif
64 }
65
66 static void
nativeClassInit(JNIEnv * _env,jclass glImplClass)67 nativeClassInit(JNIEnv *_env, jclass glImplClass)
68 {
69 }
70
71 static void *
getPointer(JNIEnv * _env,jobject buffer,jarray * array,jint * remaining,jint * offset)72 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
73 {
74 jint position;
75 jint limit;
76 jint elementSizeShift;
77 jlong pointer;
78
79 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
80 *remaining = (limit - position) << elementSizeShift;
81 if (pointer != 0L) {
82 *array = nullptr;
83 pointer += position << elementSizeShift;
84 return reinterpret_cast<void*>(pointer);
85 }
86
87 *array = jniGetNioBufferBaseArray(_env, buffer);
88 *offset = jniGetNioBufferBaseArrayOffset(_env, buffer);
89 return nullptr;
90 }
91
92 class ByteArrayGetter {
93 public:
Get(JNIEnv * _env,jbyteArray array,jboolean * is_copy)94 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
95 return _env->GetByteArrayElements(array, is_copy);
96 }
97 };
98 class BooleanArrayGetter {
99 public:
Get(JNIEnv * _env,jbooleanArray array,jboolean * is_copy)100 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
101 return _env->GetBooleanArrayElements(array, is_copy);
102 }
103 };
104 class CharArrayGetter {
105 public:
Get(JNIEnv * _env,jcharArray array,jboolean * is_copy)106 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
107 return _env->GetCharArrayElements(array, is_copy);
108 }
109 };
110 class ShortArrayGetter {
111 public:
Get(JNIEnv * _env,jshortArray array,jboolean * is_copy)112 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
113 return _env->GetShortArrayElements(array, is_copy);
114 }
115 };
116 class IntArrayGetter {
117 public:
Get(JNIEnv * _env,jintArray array,jboolean * is_copy)118 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
119 return _env->GetIntArrayElements(array, is_copy);
120 }
121 };
122 class LongArrayGetter {
123 public:
Get(JNIEnv * _env,jlongArray array,jboolean * is_copy)124 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
125 return _env->GetLongArrayElements(array, is_copy);
126 }
127 };
128 class FloatArrayGetter {
129 public:
Get(JNIEnv * _env,jfloatArray array,jboolean * is_copy)130 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
131 return _env->GetFloatArrayElements(array, is_copy);
132 }
133 };
134 class DoubleArrayGetter {
135 public:
Get(JNIEnv * _env,jdoubleArray array,jboolean * is_copy)136 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
137 return _env->GetDoubleArrayElements(array, is_copy);
138 }
139 };
140
141 template<typename JTYPEARRAY, typename ARRAYGETTER>
142 static void*
getArrayPointer(JNIEnv * _env,JTYPEARRAY array,jboolean * is_copy)143 getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
144 return ARRAYGETTER::Get(_env, array, is_copy);
145 }
146
147 class ByteArrayReleaser {
148 public:
Release(JNIEnv * _env,jbyteArray array,jbyte * data,jboolean commit)149 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
150 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
151 }
152 };
153 class BooleanArrayReleaser {
154 public:
Release(JNIEnv * _env,jbooleanArray array,jboolean * data,jboolean commit)155 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
156 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
157 }
158 };
159 class CharArrayReleaser {
160 public:
Release(JNIEnv * _env,jcharArray array,jchar * data,jboolean commit)161 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
162 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
163 }
164 };
165 class ShortArrayReleaser {
166 public:
Release(JNIEnv * _env,jshortArray array,jshort * data,jboolean commit)167 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
168 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
169 }
170 };
171 class IntArrayReleaser {
172 public:
Release(JNIEnv * _env,jintArray array,jint * data,jboolean commit)173 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
174 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
175 }
176 };
177 class LongArrayReleaser {
178 public:
Release(JNIEnv * _env,jlongArray array,jlong * data,jboolean commit)179 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
180 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
181 }
182 };
183 class FloatArrayReleaser {
184 public:
Release(JNIEnv * _env,jfloatArray array,jfloat * data,jboolean commit)185 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
186 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
187 }
188 };
189 class DoubleArrayReleaser {
190 public:
Release(JNIEnv * _env,jdoubleArray array,jdouble * data,jboolean commit)191 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
192 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
193 }
194 };
195
196 template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
197 static void
releaseArrayPointer(JNIEnv * _env,JTYPEARRAY array,NTYPEARRAY data,jboolean commit)198 releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
199 ARRAYRELEASER::Release(_env, array, data, commit);
200 }
201
202 static void
releasePointer(JNIEnv * _env,jarray array,void * data,jboolean commit)203 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
204 {
205 _env->ReleasePrimitiveArrayCritical(array, data,
206 commit ? 0 : JNI_ABORT);
207 }
208
209 static void *
getDirectBufferPointer(JNIEnv * _env,jobject buffer)210 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
211 jint position;
212 jint limit;
213 jint elementSizeShift;
214 jlong pointer;
215 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
216 if (pointer == 0) {
217 jniThrowException(_env, "java/lang/IllegalArgumentException",
218 "Must use a native order direct Buffer");
219 return nullptr;
220 }
221 pointer += position << elementSizeShift;
222 return reinterpret_cast<void*>(pointer);
223 }
224
225 // --------------------------------------------------------------------------
226
227 /*
228 * returns the number of values glGet returns for a given pname.
229 *
230 * The code below is written such that pnames requiring only one values
231 * are the default (and are not explicitely tested for). This makes the
232 * checking code much shorter/readable/efficient.
233 *
234 * This means that unknown pnames (e.g.: extensions) will default to 1. If
235 * that unknown pname needs more than 1 value, then the validation check
236 * is incomplete and the app may crash if it passed the wrong number params.
237 */
getNeededCount(GLint pname)238 static int getNeededCount(GLint pname) {
239 int needed = 1;
240 #ifdef GL_ES_VERSION_3_0
241 // GLES 3.x pnames
242 switch (pname) {
243 case GL_MAX_VIEWPORT_DIMS:
244 needed = 2;
245 break;
246
247 case GL_PROGRAM_BINARY_FORMATS:
248 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
249 break;
250 }
251 #endif
252
253 #ifdef GL_ES_VERSION_2_0
254 // GLES 2.x pnames
255 switch (pname) {
256 case GL_ALIASED_LINE_WIDTH_RANGE:
257 case GL_ALIASED_POINT_SIZE_RANGE:
258 needed = 2;
259 break;
260
261 case GL_BLEND_COLOR:
262 case GL_COLOR_CLEAR_VALUE:
263 case GL_COLOR_WRITEMASK:
264 case GL_SCISSOR_BOX:
265 case GL_VIEWPORT:
266 needed = 4;
267 break;
268
269 case GL_COMPRESSED_TEXTURE_FORMATS:
270 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
271 break;
272
273 case GL_SHADER_BINARY_FORMATS:
274 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
275 break;
276 }
277 #endif
278
279 #ifdef GL_VERSION_ES_CM_1_1
280 // GLES 1.x pnames
281 switch (pname) {
282 case GL_ALIASED_LINE_WIDTH_RANGE:
283 case GL_ALIASED_POINT_SIZE_RANGE:
284 case GL_DEPTH_RANGE:
285 case GL_SMOOTH_LINE_WIDTH_RANGE:
286 case GL_SMOOTH_POINT_SIZE_RANGE:
287 needed = 2;
288 break;
289
290 case GL_CURRENT_NORMAL:
291 case GL_POINT_DISTANCE_ATTENUATION:
292 needed = 3;
293 break;
294
295 case GL_COLOR_CLEAR_VALUE:
296 case GL_COLOR_WRITEMASK:
297 case GL_CURRENT_COLOR:
298 case GL_CURRENT_TEXTURE_COORDS:
299 case GL_FOG_COLOR:
300 case GL_LIGHT_MODEL_AMBIENT:
301 case GL_SCISSOR_BOX:
302 case GL_VIEWPORT:
303 needed = 4;
304 break;
305
306 case GL_MODELVIEW_MATRIX:
307 case GL_PROJECTION_MATRIX:
308 case GL_TEXTURE_MATRIX:
309 needed = 16;
310 break;
311
312 case GL_COMPRESSED_TEXTURE_FORMATS:
313 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
314 break;
315 }
316 #endif
317 return needed;
318 }
319
320 template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
321 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
322 static void
get(JNIEnv * _env,jobject _this,jint pname,JTYPEARRAY params_ref,jint offset)323 get
324 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
325 jint _exception = 0;
326 const char * _exceptionType;
327 const char * _exceptionMessage;
328 CTYPE *params_base = (CTYPE *) 0;
329 jint _remaining;
330 CTYPE *params = (CTYPE *) 0;
331 int _needed = 0;
332
333 if (!params_ref) {
334 _exception = 1;
335 _exceptionType = "java/lang/IllegalArgumentException";
336 _exceptionMessage = "params == null";
337 goto exit;
338 }
339 if (offset < 0) {
340 _exception = 1;
341 _exceptionType = "java/lang/IllegalArgumentException";
342 _exceptionMessage = "offset < 0";
343 goto exit;
344 }
345 _remaining = _env->GetArrayLength(params_ref) - offset;
346 _needed = getNeededCount(pname);
347 // if we didn't find this pname, we just assume the user passed
348 // an array of the right size -- this might happen with extensions
349 // or if we forget an enum here.
350 if (_remaining < _needed) {
351 _exception = 1;
352 _exceptionType = "java/lang/IllegalArgumentException";
353 _exceptionMessage = "length - offset < needed";
354 goto exit;
355 }
356 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
357 _env, params_ref, (jboolean *)0);
358 params = params_base + offset;
359
360 GET(
361 (GLenum)pname,
362 (CTYPE *)params
363 );
364
365 exit:
366 if (params_base) {
367 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
368 _env, params_ref, params_base, !_exception);
369 }
370 if (_exception) {
371 jniThrowException(_env, _exceptionType, _exceptionMessage);
372 }
373 }
374
375
376 template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
377 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
378 static void
getarray(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)379 getarray
380 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
381 jint _exception = 0;
382 const char * _exceptionType;
383 const char * _exceptionMessage;
384 JTYPEARRAY _array = (JTYPEARRAY) 0;
385 jint _bufferOffset = (jint) 0;
386 jint _remaining;
387 CTYPE *params = (CTYPE *) 0;
388 int _needed = 0;
389
390 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
391 _remaining /= sizeof(CTYPE); // convert from bytes to item count
392 _needed = getNeededCount(pname);
393 // if we didn't find this pname, we just assume the user passed
394 // an array of the right size -- this might happen with extensions
395 // or if we forget an enum here.
396 if (_needed>0 && _remaining < _needed) {
397 _exception = 1;
398 _exceptionType = "java/lang/IllegalArgumentException";
399 _exceptionMessage = "remaining() < needed";
400 goto exit;
401 }
402 if (params == NULL) {
403 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
404 _env, _array, (jboolean *) 0);
405 params = (CTYPE *) (_paramsBase + _bufferOffset);
406 }
407 GET(
408 (GLenum)pname,
409 (CTYPE *)params
410 );
411
412 exit:
413 if (_array) {
414 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
415 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
416 }
417 if (_exception) {
418 jniThrowException(_env, _exceptionType, _exceptionMessage);
419 }
420 }
421
422 // --------------------------------------------------------------------------
423 /* void glBindBuffer ( GLenum target, GLuint buffer ) */
424 static void
android_glBindBuffer__II(JNIEnv * _env,jobject _this,jint target,jint buffer)425 android_glBindBuffer__II
426 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
427 glBindBuffer(
428 (GLenum)target,
429 (GLuint)buffer
430 );
431 }
432
433 /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
434 static void
android_glBufferData__IILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint target,jint size,jobject data_buf,jint usage)435 android_glBufferData__IILjava_nio_Buffer_2I
436 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
437 jint _exception = 0;
438 const char * _exceptionType = NULL;
439 const char * _exceptionMessage = NULL;
440 jarray _array = (jarray) 0;
441 jint _bufferOffset = (jint) 0;
442 jint _remaining;
443 GLvoid *data = (GLvoid *) 0;
444
445 if (data_buf) {
446 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
447 if (_remaining < size) {
448 _exception = 1;
449 _exceptionType = "java/lang/IllegalArgumentException";
450 _exceptionMessage = "remaining() < size < needed";
451 goto exit;
452 }
453 }
454 if (data_buf && data == NULL) {
455 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
456 data = (GLvoid *) (_dataBase + _bufferOffset);
457 }
458 glBufferData(
459 (GLenum)target,
460 (GLsizeiptr)size,
461 (GLvoid *)data,
462 (GLenum)usage
463 );
464
465 exit:
466 if (_array) {
467 releasePointer(_env, _array, data, JNI_FALSE);
468 }
469 if (_exception) {
470 jniThrowException(_env, _exceptionType, _exceptionMessage);
471 }
472 }
473
474 /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
475 static void
android_glBufferSubData__IIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint target,jint offset,jint size,jobject data_buf)476 android_glBufferSubData__IIILjava_nio_Buffer_2
477 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
478 jint _exception = 0;
479 const char * _exceptionType = NULL;
480 const char * _exceptionMessage = NULL;
481 jarray _array = (jarray) 0;
482 jint _bufferOffset = (jint) 0;
483 jint _remaining;
484 GLvoid *data = (GLvoid *) 0;
485
486 if (!data_buf) {
487 _exception = 1;
488 _exceptionType = "java/lang/IllegalArgumentException";
489 _exceptionMessage = "data == null";
490 goto exit;
491 }
492 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
493 if (_remaining < size) {
494 _exception = 1;
495 _exceptionType = "java/lang/IllegalArgumentException";
496 _exceptionMessage = "remaining() < size < needed";
497 goto exit;
498 }
499 if (data == NULL) {
500 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
501 data = (GLvoid *) (_dataBase + _bufferOffset);
502 }
503 glBufferSubData(
504 (GLenum)target,
505 (GLintptr)offset,
506 (GLsizeiptr)size,
507 (GLvoid *)data
508 );
509
510 exit:
511 if (_array) {
512 releasePointer(_env, _array, data, JNI_FALSE);
513 }
514 if (_exception) {
515 jniThrowException(_env, _exceptionType, _exceptionMessage);
516 }
517 }
518
519 /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
520 static void
android_glClipPlanef__I_3FI(JNIEnv * _env,jobject _this,jint plane,jfloatArray equation_ref,jint offset)521 android_glClipPlanef__I_3FI
522 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
523 jint _exception = 0;
524 const char * _exceptionType = NULL;
525 const char * _exceptionMessage = NULL;
526 GLfloat *equation_base = (GLfloat *) 0;
527 jint _remaining;
528 GLfloat *equation = (GLfloat *) 0;
529
530 if (!equation_ref) {
531 _exception = 1;
532 _exceptionType = "java/lang/IllegalArgumentException";
533 _exceptionMessage = "equation == null";
534 goto exit;
535 }
536 if (offset < 0) {
537 _exception = 1;
538 _exceptionType = "java/lang/IllegalArgumentException";
539 _exceptionMessage = "offset < 0";
540 goto exit;
541 }
542 _remaining = _env->GetArrayLength(equation_ref) - offset;
543 equation_base = (GLfloat *)
544 _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
545 equation = equation_base + offset;
546
547 glClipPlanef(
548 (GLenum)plane,
549 (GLfloat *)equation
550 );
551
552 exit:
553 if (equation_base) {
554 _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
555 JNI_ABORT);
556 }
557 if (_exception) {
558 jniThrowException(_env, _exceptionType, _exceptionMessage);
559 }
560 }
561
562 /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
563 static void
android_glClipPlanef__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint plane,jobject equation_buf)564 android_glClipPlanef__ILjava_nio_FloatBuffer_2
565 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
566 jint _exception = 0;
567 const char * _exceptionType = NULL;
568 const char * _exceptionMessage = NULL;
569 jfloatArray _array = (jfloatArray) 0;
570 jint _bufferOffset = (jint) 0;
571 jint _remaining;
572 GLfloat *equation = (GLfloat *) 0;
573
574 if (!equation_buf) {
575 _exception = 1;
576 _exceptionType = "java/lang/IllegalArgumentException";
577 _exceptionMessage = "equation == null";
578 goto exit;
579 }
580 equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
581 if (equation == NULL) {
582 char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
583 equation = (GLfloat *) (_equationBase + _bufferOffset);
584 }
585 glClipPlanef(
586 (GLenum)plane,
587 (GLfloat *)equation
588 );
589
590 exit:
591 if (_array) {
592 _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
593 }
594 if (_exception) {
595 jniThrowException(_env, _exceptionType, _exceptionMessage);
596 }
597 }
598
599 /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
600 static void
android_glClipPlanex__I_3II(JNIEnv * _env,jobject _this,jint plane,jintArray equation_ref,jint offset)601 android_glClipPlanex__I_3II
602 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
603 jint _exception = 0;
604 const char * _exceptionType = NULL;
605 const char * _exceptionMessage = NULL;
606 GLfixed *equation_base = (GLfixed *) 0;
607 jint _remaining;
608 GLfixed *equation = (GLfixed *) 0;
609
610 if (!equation_ref) {
611 _exception = 1;
612 _exceptionType = "java/lang/IllegalArgumentException";
613 _exceptionMessage = "equation == null";
614 goto exit;
615 }
616 if (offset < 0) {
617 _exception = 1;
618 _exceptionType = "java/lang/IllegalArgumentException";
619 _exceptionMessage = "offset < 0";
620 goto exit;
621 }
622 _remaining = _env->GetArrayLength(equation_ref) - offset;
623 equation_base = (GLfixed *)
624 _env->GetIntArrayElements(equation_ref, (jboolean *)0);
625 equation = equation_base + offset;
626
627 glClipPlanex(
628 (GLenum)plane,
629 (GLfixed *)equation
630 );
631
632 exit:
633 if (equation_base) {
634 _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
635 JNI_ABORT);
636 }
637 if (_exception) {
638 jniThrowException(_env, _exceptionType, _exceptionMessage);
639 }
640 }
641
642 /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
643 static void
android_glClipPlanex__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint plane,jobject equation_buf)644 android_glClipPlanex__ILjava_nio_IntBuffer_2
645 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
646 jint _exception = 0;
647 const char * _exceptionType = NULL;
648 const char * _exceptionMessage = NULL;
649 jintArray _array = (jintArray) 0;
650 jint _bufferOffset = (jint) 0;
651 jint _remaining;
652 GLfixed *equation = (GLfixed *) 0;
653
654 if (!equation_buf) {
655 _exception = 1;
656 _exceptionType = "java/lang/IllegalArgumentException";
657 _exceptionMessage = "equation == null";
658 goto exit;
659 }
660 equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
661 if (equation == NULL) {
662 char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
663 equation = (GLfixed *) (_equationBase + _bufferOffset);
664 }
665 glClipPlanex(
666 (GLenum)plane,
667 (GLfixed *)equation
668 );
669
670 exit:
671 if (_array) {
672 _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
673 }
674 if (_exception) {
675 jniThrowException(_env, _exceptionType, _exceptionMessage);
676 }
677 }
678
679 /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
680 static void
android_glColor4ub__BBBB(JNIEnv * _env,jobject _this,jbyte red,jbyte green,jbyte blue,jbyte alpha)681 android_glColor4ub__BBBB
682 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
683 glColor4ub(
684 (GLubyte)red,
685 (GLubyte)green,
686 (GLubyte)blue,
687 (GLubyte)alpha
688 );
689 }
690
691 /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
692 static void
android_glColorPointer__IIII(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jint offset)693 android_glColorPointer__IIII
694 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
695 glColorPointer(
696 (GLint)size,
697 (GLenum)type,
698 (GLsizei)stride,
699 reinterpret_cast<GLvoid *>(offset)
700 );
701 }
702
703 /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
704 static void
android_glDeleteBuffers__I_3II(JNIEnv * _env,jobject _this,jint n,jintArray buffers_ref,jint offset)705 android_glDeleteBuffers__I_3II
706 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
707 jint _exception = 0;
708 const char * _exceptionType = NULL;
709 const char * _exceptionMessage = NULL;
710 GLuint *buffers_base = (GLuint *) 0;
711 jint _remaining;
712 GLuint *buffers = (GLuint *) 0;
713
714 if (!buffers_ref) {
715 _exception = 1;
716 _exceptionType = "java/lang/IllegalArgumentException";
717 _exceptionMessage = "buffers == null";
718 goto exit;
719 }
720 if (offset < 0) {
721 _exception = 1;
722 _exceptionType = "java/lang/IllegalArgumentException";
723 _exceptionMessage = "offset < 0";
724 goto exit;
725 }
726 _remaining = _env->GetArrayLength(buffers_ref) - offset;
727 if (_remaining < n) {
728 _exception = 1;
729 _exceptionType = "java/lang/IllegalArgumentException";
730 _exceptionMessage = "length - offset < n < needed";
731 goto exit;
732 }
733 buffers_base = (GLuint *)
734 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
735 buffers = buffers_base + offset;
736
737 glDeleteBuffers(
738 (GLsizei)n,
739 (GLuint *)buffers
740 );
741
742 exit:
743 if (buffers_base) {
744 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
745 JNI_ABORT);
746 }
747 if (_exception) {
748 jniThrowException(_env, _exceptionType, _exceptionMessage);
749 }
750 }
751
752 /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
753 static void
android_glDeleteBuffers__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint n,jobject buffers_buf)754 android_glDeleteBuffers__ILjava_nio_IntBuffer_2
755 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
756 jint _exception = 0;
757 const char * _exceptionType = NULL;
758 const char * _exceptionMessage = NULL;
759 jintArray _array = (jintArray) 0;
760 jint _bufferOffset = (jint) 0;
761 jint _remaining;
762 GLuint *buffers = (GLuint *) 0;
763
764 if (!buffers_buf) {
765 _exception = 1;
766 _exceptionType = "java/lang/IllegalArgumentException";
767 _exceptionMessage = "buffers == null";
768 goto exit;
769 }
770 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
771 if (_remaining < n) {
772 _exception = 1;
773 _exceptionType = "java/lang/IllegalArgumentException";
774 _exceptionMessage = "remaining() < n < needed";
775 goto exit;
776 }
777 if (buffers == NULL) {
778 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
779 buffers = (GLuint *) (_buffersBase + _bufferOffset);
780 }
781 glDeleteBuffers(
782 (GLsizei)n,
783 (GLuint *)buffers
784 );
785
786 exit:
787 if (_array) {
788 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
789 }
790 if (_exception) {
791 jniThrowException(_env, _exceptionType, _exceptionMessage);
792 }
793 }
794
795 /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
796 static void
android_glDrawElements__IIII(JNIEnv * _env,jobject _this,jint mode,jint count,jint type,jint offset)797 android_glDrawElements__IIII
798 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
799 jint _exception = 0;
800 const char * _exceptionType = NULL;
801 const char * _exceptionMessage = NULL;
802 glDrawElements(
803 (GLenum)mode,
804 (GLsizei)count,
805 (GLenum)type,
806 reinterpret_cast<GLvoid *>(offset)
807 );
808 if (_exception) {
809 jniThrowException(_env, _exceptionType, _exceptionMessage);
810 }
811 }
812
813 /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
814 static void
android_glGenBuffers__I_3II(JNIEnv * _env,jobject _this,jint n,jintArray buffers_ref,jint offset)815 android_glGenBuffers__I_3II
816 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
817 jint _exception = 0;
818 const char * _exceptionType = NULL;
819 const char * _exceptionMessage = NULL;
820 GLuint *buffers_base = (GLuint *) 0;
821 jint _remaining;
822 GLuint *buffers = (GLuint *) 0;
823
824 if (!buffers_ref) {
825 _exception = 1;
826 _exceptionType = "java/lang/IllegalArgumentException";
827 _exceptionMessage = "buffers == null";
828 goto exit;
829 }
830 if (offset < 0) {
831 _exception = 1;
832 _exceptionType = "java/lang/IllegalArgumentException";
833 _exceptionMessage = "offset < 0";
834 goto exit;
835 }
836 _remaining = _env->GetArrayLength(buffers_ref) - offset;
837 if (_remaining < n) {
838 _exception = 1;
839 _exceptionType = "java/lang/IllegalArgumentException";
840 _exceptionMessage = "length - offset < n < needed";
841 goto exit;
842 }
843 buffers_base = (GLuint *)
844 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
845 buffers = buffers_base + offset;
846
847 glGenBuffers(
848 (GLsizei)n,
849 (GLuint *)buffers
850 );
851
852 exit:
853 if (buffers_base) {
854 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
855 _exception ? JNI_ABORT: 0);
856 }
857 if (_exception) {
858 jniThrowException(_env, _exceptionType, _exceptionMessage);
859 }
860 }
861
862 /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
863 static void
android_glGenBuffers__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint n,jobject buffers_buf)864 android_glGenBuffers__ILjava_nio_IntBuffer_2
865 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
866 jint _exception = 0;
867 const char * _exceptionType = NULL;
868 const char * _exceptionMessage = NULL;
869 jintArray _array = (jintArray) 0;
870 jint _bufferOffset = (jint) 0;
871 jint _remaining;
872 GLuint *buffers = (GLuint *) 0;
873
874 if (!buffers_buf) {
875 _exception = 1;
876 _exceptionType = "java/lang/IllegalArgumentException";
877 _exceptionMessage = "buffers == null";
878 goto exit;
879 }
880 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
881 if (_remaining < n) {
882 _exception = 1;
883 _exceptionType = "java/lang/IllegalArgumentException";
884 _exceptionMessage = "remaining() < n < needed";
885 goto exit;
886 }
887 if (buffers == NULL) {
888 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
889 buffers = (GLuint *) (_buffersBase + _bufferOffset);
890 }
891 glGenBuffers(
892 (GLsizei)n,
893 (GLuint *)buffers
894 );
895
896 exit:
897 if (_array) {
898 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
899 }
900 if (_exception) {
901 jniThrowException(_env, _exceptionType, _exceptionMessage);
902 }
903 }
904
905 /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
906 static void
android_glGetBooleanv__I_3ZI(JNIEnv * _env,jobject _this,jint pname,jbooleanArray params_ref,jint offset)907 android_glGetBooleanv__I_3ZI
908 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
909 get<jbooleanArray, BooleanArrayGetter, jboolean*, BooleanArrayReleaser, GLboolean, glGetBooleanv>(
910 _env, _this, pname, params_ref, offset);
911 }
912
913 /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
914 static void
android_glGetBooleanv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)915 android_glGetBooleanv__ILjava_nio_IntBuffer_2
916 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
917 getarray<GLboolean, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetBooleanv>(
918 _env, _this, pname, params_buf);
919 }
920 /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
921 static void
android_glGetBufferParameteriv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)922 android_glGetBufferParameteriv__II_3II
923 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
924 jint _exception = 0;
925 const char * _exceptionType = NULL;
926 const char * _exceptionMessage = NULL;
927 GLint *params_base = (GLint *) 0;
928 jint _remaining;
929 GLint *params = (GLint *) 0;
930
931 if (!params_ref) {
932 _exception = 1;
933 _exceptionType = "java/lang/IllegalArgumentException";
934 _exceptionMessage = "params == null";
935 goto exit;
936 }
937 if (offset < 0) {
938 _exception = 1;
939 _exceptionType = "java/lang/IllegalArgumentException";
940 _exceptionMessage = "offset < 0";
941 goto exit;
942 }
943 _remaining = _env->GetArrayLength(params_ref) - offset;
944 if (_remaining < 1) {
945 _exception = 1;
946 _exceptionType = "java/lang/IllegalArgumentException";
947 _exceptionMessage = "length - offset < 1 < needed";
948 goto exit;
949 }
950 params_base = (GLint *)
951 _env->GetIntArrayElements(params_ref, (jboolean *)0);
952 params = params_base + offset;
953
954 glGetBufferParameteriv(
955 (GLenum)target,
956 (GLenum)pname,
957 (GLint *)params
958 );
959
960 exit:
961 if (params_base) {
962 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
963 _exception ? JNI_ABORT: 0);
964 }
965 if (_exception) {
966 jniThrowException(_env, _exceptionType, _exceptionMessage);
967 }
968 }
969
970 /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
971 static void
android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)972 android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
973 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
974 jint _exception = 0;
975 const char * _exceptionType = NULL;
976 const char * _exceptionMessage = NULL;
977 jintArray _array = (jintArray) 0;
978 jint _bufferOffset = (jint) 0;
979 jint _remaining;
980 GLint *params = (GLint *) 0;
981
982 if (!params_buf) {
983 _exception = 1;
984 _exceptionType = "java/lang/IllegalArgumentException";
985 _exceptionMessage = "params == null";
986 goto exit;
987 }
988 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
989 if (_remaining < 1) {
990 _exception = 1;
991 _exceptionType = "java/lang/IllegalArgumentException";
992 _exceptionMessage = "remaining() < 1 < needed";
993 goto exit;
994 }
995 if (params == NULL) {
996 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
997 params = (GLint *) (_paramsBase + _bufferOffset);
998 }
999 glGetBufferParameteriv(
1000 (GLenum)target,
1001 (GLenum)pname,
1002 (GLint *)params
1003 );
1004
1005 exit:
1006 if (_array) {
1007 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1008 }
1009 if (_exception) {
1010 jniThrowException(_env, _exceptionType, _exceptionMessage);
1011 }
1012 }
1013
1014 /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
1015 static void
android_glGetClipPlanef__I_3FI(JNIEnv * _env,jobject _this,jint pname,jfloatArray eqn_ref,jint offset)1016 android_glGetClipPlanef__I_3FI
1017 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
1018 jint _exception = 0;
1019 const char * _exceptionType = NULL;
1020 const char * _exceptionMessage = NULL;
1021 GLfloat *eqn_base = (GLfloat *) 0;
1022 jint _remaining;
1023 GLfloat *eqn = (GLfloat *) 0;
1024
1025 if (!eqn_ref) {
1026 _exception = 1;
1027 _exceptionType = "java/lang/IllegalArgumentException";
1028 _exceptionMessage = "eqn == null";
1029 goto exit;
1030 }
1031 if (offset < 0) {
1032 _exception = 1;
1033 _exceptionType = "java/lang/IllegalArgumentException";
1034 _exceptionMessage = "offset < 0";
1035 goto exit;
1036 }
1037 _remaining = _env->GetArrayLength(eqn_ref) - offset;
1038 if (_remaining < 4) {
1039 _exception = 1;
1040 _exceptionType = "java/lang/IllegalArgumentException";
1041 _exceptionMessage = "length - offset < 4 < needed";
1042 goto exit;
1043 }
1044 eqn_base = (GLfloat *)
1045 _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
1046 eqn = eqn_base + offset;
1047
1048 glGetClipPlanef(
1049 (GLenum)pname,
1050 (GLfloat *)eqn
1051 );
1052
1053 exit:
1054 if (eqn_base) {
1055 _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
1056 _exception ? JNI_ABORT: 0);
1057 }
1058 if (_exception) {
1059 jniThrowException(_env, _exceptionType, _exceptionMessage);
1060 }
1061 }
1062
1063 /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
1064 static void
android_glGetClipPlanef__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject eqn_buf)1065 android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
1066 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
1067 jint _exception = 0;
1068 const char * _exceptionType = NULL;
1069 const char * _exceptionMessage = NULL;
1070 jfloatArray _array = (jfloatArray) 0;
1071 jint _bufferOffset = (jint) 0;
1072 jint _remaining;
1073 GLfloat *eqn = (GLfloat *) 0;
1074
1075 if (!eqn_buf) {
1076 _exception = 1;
1077 _exceptionType = "java/lang/IllegalArgumentException";
1078 _exceptionMessage = "eqn == null";
1079 goto exit;
1080 }
1081 eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1082 if (_remaining < 4) {
1083 _exception = 1;
1084 _exceptionType = "java/lang/IllegalArgumentException";
1085 _exceptionMessage = "remaining() < 4 < needed";
1086 goto exit;
1087 }
1088 if (eqn == NULL) {
1089 char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1090 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
1091 }
1092 glGetClipPlanef(
1093 (GLenum)pname,
1094 (GLfloat *)eqn
1095 );
1096
1097 exit:
1098 if (_array) {
1099 _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0);
1100 }
1101 if (_exception) {
1102 jniThrowException(_env, _exceptionType, _exceptionMessage);
1103 }
1104 }
1105
1106 /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
1107 static void
android_glGetClipPlanex__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray eqn_ref,jint offset)1108 android_glGetClipPlanex__I_3II
1109 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
1110 jint _exception = 0;
1111 const char * _exceptionType = NULL;
1112 const char * _exceptionMessage = NULL;
1113 GLfixed *eqn_base = (GLfixed *) 0;
1114 jint _remaining;
1115 GLfixed *eqn = (GLfixed *) 0;
1116
1117 if (!eqn_ref) {
1118 _exception = 1;
1119 _exceptionType = "java/lang/IllegalArgumentException";
1120 _exceptionMessage = "eqn == null";
1121 goto exit;
1122 }
1123 if (offset < 0) {
1124 _exception = 1;
1125 _exceptionType = "java/lang/IllegalArgumentException";
1126 _exceptionMessage = "offset < 0";
1127 goto exit;
1128 }
1129 _remaining = _env->GetArrayLength(eqn_ref) - offset;
1130 if (_remaining < 4) {
1131 _exception = 1;
1132 _exceptionType = "java/lang/IllegalArgumentException";
1133 _exceptionMessage = "length - offset < 4 < needed";
1134 goto exit;
1135 }
1136 eqn_base = (GLfixed *)
1137 _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
1138 eqn = eqn_base + offset;
1139
1140 glGetClipPlanex(
1141 (GLenum)pname,
1142 (GLfixed *)eqn
1143 );
1144
1145 exit:
1146 if (eqn_base) {
1147 _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
1148 _exception ? JNI_ABORT: 0);
1149 }
1150 if (_exception) {
1151 jniThrowException(_env, _exceptionType, _exceptionMessage);
1152 }
1153 }
1154
1155 /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
1156 static void
android_glGetClipPlanex__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject eqn_buf)1157 android_glGetClipPlanex__ILjava_nio_IntBuffer_2
1158 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
1159 jint _exception = 0;
1160 const char * _exceptionType = NULL;
1161 const char * _exceptionMessage = NULL;
1162 jintArray _array = (jintArray) 0;
1163 jint _bufferOffset = (jint) 0;
1164 jint _remaining;
1165 GLfixed *eqn = (GLfixed *) 0;
1166
1167 if (!eqn_buf) {
1168 _exception = 1;
1169 _exceptionType = "java/lang/IllegalArgumentException";
1170 _exceptionMessage = "eqn == null";
1171 goto exit;
1172 }
1173 eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1174 if (_remaining < 4) {
1175 _exception = 1;
1176 _exceptionType = "java/lang/IllegalArgumentException";
1177 _exceptionMessage = "remaining() < 4 < needed";
1178 goto exit;
1179 }
1180 if (eqn == NULL) {
1181 char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1182 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
1183 }
1184 glGetClipPlanex(
1185 (GLenum)pname,
1186 (GLfixed *)eqn
1187 );
1188
1189 exit:
1190 if (_array) {
1191 _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0);
1192 }
1193 if (_exception) {
1194 jniThrowException(_env, _exceptionType, _exceptionMessage);
1195 }
1196 }
1197
1198 /* void glGetFixedv ( GLenum pname, GLfixed *params ) */
1199 static void
android_glGetFixedv__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray params_ref,jint offset)1200 android_glGetFixedv__I_3II
1201 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1202 jint _exception = 0;
1203 const char * _exceptionType = NULL;
1204 const char * _exceptionMessage = NULL;
1205 GLfixed *params_base = (GLfixed *) 0;
1206 jint _remaining;
1207 GLfixed *params = (GLfixed *) 0;
1208
1209 if (!params_ref) {
1210 _exception = 1;
1211 _exceptionType = "java/lang/IllegalArgumentException";
1212 _exceptionMessage = "params == null";
1213 goto exit;
1214 }
1215 if (offset < 0) {
1216 _exception = 1;
1217 _exceptionType = "java/lang/IllegalArgumentException";
1218 _exceptionMessage = "offset < 0";
1219 goto exit;
1220 }
1221 _remaining = _env->GetArrayLength(params_ref) - offset;
1222 params_base = (GLfixed *)
1223 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1224 params = params_base + offset;
1225
1226 glGetFixedv(
1227 (GLenum)pname,
1228 (GLfixed *)params
1229 );
1230
1231 exit:
1232 if (params_base) {
1233 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1234 _exception ? JNI_ABORT: 0);
1235 }
1236 if (_exception) {
1237 jniThrowException(_env, _exceptionType, _exceptionMessage);
1238 }
1239 }
1240
1241 /* void glGetFixedv ( GLenum pname, GLfixed *params ) */
1242 static void
android_glGetFixedv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1243 android_glGetFixedv__ILjava_nio_IntBuffer_2
1244 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1245 jint _exception = 0;
1246 const char * _exceptionType = NULL;
1247 const char * _exceptionMessage = NULL;
1248 jintArray _array = (jintArray) 0;
1249 jint _bufferOffset = (jint) 0;
1250 jint _remaining;
1251 GLfixed *params = (GLfixed *) 0;
1252
1253 if (!params_buf) {
1254 _exception = 1;
1255 _exceptionType = "java/lang/IllegalArgumentException";
1256 _exceptionMessage = "params == null";
1257 goto exit;
1258 }
1259 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1260 if (params == NULL) {
1261 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1262 params = (GLfixed *) (_paramsBase + _bufferOffset);
1263 }
1264 glGetFixedv(
1265 (GLenum)pname,
1266 (GLfixed *)params
1267 );
1268
1269 exit:
1270 if (_array) {
1271 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1272 }
1273 if (_exception) {
1274 jniThrowException(_env, _exceptionType, _exceptionMessage);
1275 }
1276 }
1277
1278 /* void glGetFloatv ( GLenum pname, GLfloat *params ) */
1279 static void
android_glGetFloatv__I_3FI(JNIEnv * _env,jobject _this,jint pname,jfloatArray params_ref,jint offset)1280 android_glGetFloatv__I_3FI
1281 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
1282 get<jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, GLfloat, glGetFloatv>(
1283 _env, _this, pname, params_ref, offset);
1284 }
1285
1286 /* void glGetFloatv ( GLenum pname, GLfloat *params ) */
1287 static void
android_glGetFloatv__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1288 android_glGetFloatv__ILjava_nio_FloatBuffer_2
1289 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1290 getarray<GLfloat, jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, glGetFloatv>(
1291 _env, _this, pname, params_buf);
1292 }
1293 /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
1294 static void
android_glGetLightfv__II_3FI(JNIEnv * _env,jobject _this,jint light,jint pname,jfloatArray params_ref,jint offset)1295 android_glGetLightfv__II_3FI
1296 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
1297 jint _exception = 0;
1298 const char * _exceptionType = NULL;
1299 const char * _exceptionMessage = NULL;
1300 GLfloat *params_base = (GLfloat *) 0;
1301 jint _remaining;
1302 GLfloat *params = (GLfloat *) 0;
1303
1304 if (!params_ref) {
1305 _exception = 1;
1306 _exceptionType = "java/lang/IllegalArgumentException";
1307 _exceptionMessage = "params == null";
1308 goto exit;
1309 }
1310 if (offset < 0) {
1311 _exception = 1;
1312 _exceptionType = "java/lang/IllegalArgumentException";
1313 _exceptionMessage = "offset < 0";
1314 goto exit;
1315 }
1316 _remaining = _env->GetArrayLength(params_ref) - offset;
1317 int _needed;
1318 switch (pname) {
1319 #if defined(GL_SPOT_DIRECTION)
1320 case GL_SPOT_DIRECTION:
1321 #endif // defined(GL_SPOT_DIRECTION)
1322 _needed = 3;
1323 break;
1324 #if defined(GL_AMBIENT)
1325 case GL_AMBIENT:
1326 #endif // defined(GL_AMBIENT)
1327 #if defined(GL_DIFFUSE)
1328 case GL_DIFFUSE:
1329 #endif // defined(GL_DIFFUSE)
1330 #if defined(GL_SPECULAR)
1331 case GL_SPECULAR:
1332 #endif // defined(GL_SPECULAR)
1333 #if defined(GL_EMISSION)
1334 case GL_EMISSION:
1335 #endif // defined(GL_EMISSION)
1336 _needed = 4;
1337 break;
1338 default:
1339 _needed = 1;
1340 break;
1341 }
1342 if (_remaining < _needed) {
1343 _exception = 1;
1344 _exceptionType = "java/lang/IllegalArgumentException";
1345 _exceptionMessage = "length - offset < needed";
1346 goto exit;
1347 }
1348 params_base = (GLfloat *)
1349 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1350 params = params_base + offset;
1351
1352 glGetLightfv(
1353 (GLenum)light,
1354 (GLenum)pname,
1355 (GLfloat *)params
1356 );
1357
1358 exit:
1359 if (params_base) {
1360 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1361 _exception ? JNI_ABORT: 0);
1362 }
1363 if (_exception) {
1364 jniThrowException(_env, _exceptionType, _exceptionMessage);
1365 }
1366 }
1367
1368 /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
1369 static void
android_glGetLightfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint light,jint pname,jobject params_buf)1370 android_glGetLightfv__IILjava_nio_FloatBuffer_2
1371 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1372 jint _exception = 0;
1373 const char * _exceptionType = NULL;
1374 const char * _exceptionMessage = NULL;
1375 jfloatArray _array = (jfloatArray) 0;
1376 jint _bufferOffset = (jint) 0;
1377 jint _remaining;
1378 GLfloat *params = (GLfloat *) 0;
1379
1380 if (!params_buf) {
1381 _exception = 1;
1382 _exceptionType = "java/lang/IllegalArgumentException";
1383 _exceptionMessage = "params == null";
1384 goto exit;
1385 }
1386 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1387 int _needed;
1388 switch (pname) {
1389 #if defined(GL_SPOT_DIRECTION)
1390 case GL_SPOT_DIRECTION:
1391 #endif // defined(GL_SPOT_DIRECTION)
1392 _needed = 3;
1393 break;
1394 #if defined(GL_AMBIENT)
1395 case GL_AMBIENT:
1396 #endif // defined(GL_AMBIENT)
1397 #if defined(GL_DIFFUSE)
1398 case GL_DIFFUSE:
1399 #endif // defined(GL_DIFFUSE)
1400 #if defined(GL_SPECULAR)
1401 case GL_SPECULAR:
1402 #endif // defined(GL_SPECULAR)
1403 #if defined(GL_EMISSION)
1404 case GL_EMISSION:
1405 #endif // defined(GL_EMISSION)
1406 _needed = 4;
1407 break;
1408 default:
1409 _needed = 1;
1410 break;
1411 }
1412 if (_remaining < _needed) {
1413 _exception = 1;
1414 _exceptionType = "java/lang/IllegalArgumentException";
1415 _exceptionMessage = "remaining() < needed";
1416 goto exit;
1417 }
1418 if (params == NULL) {
1419 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1420 params = (GLfloat *) (_paramsBase + _bufferOffset);
1421 }
1422 glGetLightfv(
1423 (GLenum)light,
1424 (GLenum)pname,
1425 (GLfloat *)params
1426 );
1427
1428 exit:
1429 if (_array) {
1430 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
1431 }
1432 if (_exception) {
1433 jniThrowException(_env, _exceptionType, _exceptionMessage);
1434 }
1435 }
1436
1437 /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
1438 static void
android_glGetLightxv__II_3II(JNIEnv * _env,jobject _this,jint light,jint pname,jintArray params_ref,jint offset)1439 android_glGetLightxv__II_3II
1440 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
1441 jint _exception = 0;
1442 const char * _exceptionType = NULL;
1443 const char * _exceptionMessage = NULL;
1444 GLfixed *params_base = (GLfixed *) 0;
1445 jint _remaining;
1446 GLfixed *params = (GLfixed *) 0;
1447
1448 if (!params_ref) {
1449 _exception = 1;
1450 _exceptionType = "java/lang/IllegalArgumentException";
1451 _exceptionMessage = "params == null";
1452 goto exit;
1453 }
1454 if (offset < 0) {
1455 _exception = 1;
1456 _exceptionType = "java/lang/IllegalArgumentException";
1457 _exceptionMessage = "offset < 0";
1458 goto exit;
1459 }
1460 _remaining = _env->GetArrayLength(params_ref) - offset;
1461 int _needed;
1462 switch (pname) {
1463 #if defined(GL_SPOT_DIRECTION)
1464 case GL_SPOT_DIRECTION:
1465 #endif // defined(GL_SPOT_DIRECTION)
1466 _needed = 3;
1467 break;
1468 #if defined(GL_AMBIENT)
1469 case GL_AMBIENT:
1470 #endif // defined(GL_AMBIENT)
1471 #if defined(GL_DIFFUSE)
1472 case GL_DIFFUSE:
1473 #endif // defined(GL_DIFFUSE)
1474 #if defined(GL_SPECULAR)
1475 case GL_SPECULAR:
1476 #endif // defined(GL_SPECULAR)
1477 #if defined(GL_EMISSION)
1478 case GL_EMISSION:
1479 #endif // defined(GL_EMISSION)
1480 _needed = 4;
1481 break;
1482 default:
1483 _needed = 1;
1484 break;
1485 }
1486 if (_remaining < _needed) {
1487 _exception = 1;
1488 _exceptionType = "java/lang/IllegalArgumentException";
1489 _exceptionMessage = "length - offset < needed";
1490 goto exit;
1491 }
1492 params_base = (GLfixed *)
1493 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1494 params = params_base + offset;
1495
1496 glGetLightxv(
1497 (GLenum)light,
1498 (GLenum)pname,
1499 (GLfixed *)params
1500 );
1501
1502 exit:
1503 if (params_base) {
1504 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1505 _exception ? JNI_ABORT: 0);
1506 }
1507 if (_exception) {
1508 jniThrowException(_env, _exceptionType, _exceptionMessage);
1509 }
1510 }
1511
1512 /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
1513 static void
android_glGetLightxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint light,jint pname,jobject params_buf)1514 android_glGetLightxv__IILjava_nio_IntBuffer_2
1515 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1516 jint _exception = 0;
1517 const char * _exceptionType = NULL;
1518 const char * _exceptionMessage = NULL;
1519 jintArray _array = (jintArray) 0;
1520 jint _bufferOffset = (jint) 0;
1521 jint _remaining;
1522 GLfixed *params = (GLfixed *) 0;
1523
1524 if (!params_buf) {
1525 _exception = 1;
1526 _exceptionType = "java/lang/IllegalArgumentException";
1527 _exceptionMessage = "params == null";
1528 goto exit;
1529 }
1530 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1531 int _needed;
1532 switch (pname) {
1533 #if defined(GL_SPOT_DIRECTION)
1534 case GL_SPOT_DIRECTION:
1535 #endif // defined(GL_SPOT_DIRECTION)
1536 _needed = 3;
1537 break;
1538 #if defined(GL_AMBIENT)
1539 case GL_AMBIENT:
1540 #endif // defined(GL_AMBIENT)
1541 #if defined(GL_DIFFUSE)
1542 case GL_DIFFUSE:
1543 #endif // defined(GL_DIFFUSE)
1544 #if defined(GL_SPECULAR)
1545 case GL_SPECULAR:
1546 #endif // defined(GL_SPECULAR)
1547 #if defined(GL_EMISSION)
1548 case GL_EMISSION:
1549 #endif // defined(GL_EMISSION)
1550 _needed = 4;
1551 break;
1552 default:
1553 _needed = 1;
1554 break;
1555 }
1556 if (_remaining < _needed) {
1557 _exception = 1;
1558 _exceptionType = "java/lang/IllegalArgumentException";
1559 _exceptionMessage = "remaining() < needed";
1560 goto exit;
1561 }
1562 if (params == NULL) {
1563 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1564 params = (GLfixed *) (_paramsBase + _bufferOffset);
1565 }
1566 glGetLightxv(
1567 (GLenum)light,
1568 (GLenum)pname,
1569 (GLfixed *)params
1570 );
1571
1572 exit:
1573 if (_array) {
1574 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1575 }
1576 if (_exception) {
1577 jniThrowException(_env, _exceptionType, _exceptionMessage);
1578 }
1579 }
1580
1581 /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
1582 static void
android_glGetMaterialfv__II_3FI(JNIEnv * _env,jobject _this,jint face,jint pname,jfloatArray params_ref,jint offset)1583 android_glGetMaterialfv__II_3FI
1584 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
1585 jint _exception = 0;
1586 const char * _exceptionType = NULL;
1587 const char * _exceptionMessage = NULL;
1588 GLfloat *params_base = (GLfloat *) 0;
1589 jint _remaining;
1590 GLfloat *params = (GLfloat *) 0;
1591
1592 if (!params_ref) {
1593 _exception = 1;
1594 _exceptionType = "java/lang/IllegalArgumentException";
1595 _exceptionMessage = "params == null";
1596 goto exit;
1597 }
1598 if (offset < 0) {
1599 _exception = 1;
1600 _exceptionType = "java/lang/IllegalArgumentException";
1601 _exceptionMessage = "offset < 0";
1602 goto exit;
1603 }
1604 _remaining = _env->GetArrayLength(params_ref) - offset;
1605 int _needed;
1606 switch (pname) {
1607 #if defined(GL_AMBIENT)
1608 case GL_AMBIENT:
1609 #endif // defined(GL_AMBIENT)
1610 #if defined(GL_DIFFUSE)
1611 case GL_DIFFUSE:
1612 #endif // defined(GL_DIFFUSE)
1613 #if defined(GL_SPECULAR)
1614 case GL_SPECULAR:
1615 #endif // defined(GL_SPECULAR)
1616 #if defined(GL_EMISSION)
1617 case GL_EMISSION:
1618 #endif // defined(GL_EMISSION)
1619 #if defined(GL_AMBIENT_AND_DIFFUSE)
1620 case GL_AMBIENT_AND_DIFFUSE:
1621 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
1622 _needed = 4;
1623 break;
1624 default:
1625 _needed = 1;
1626 break;
1627 }
1628 if (_remaining < _needed) {
1629 _exception = 1;
1630 _exceptionType = "java/lang/IllegalArgumentException";
1631 _exceptionMessage = "length - offset < needed";
1632 goto exit;
1633 }
1634 params_base = (GLfloat *)
1635 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1636 params = params_base + offset;
1637
1638 glGetMaterialfv(
1639 (GLenum)face,
1640 (GLenum)pname,
1641 (GLfloat *)params
1642 );
1643
1644 exit:
1645 if (params_base) {
1646 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1647 _exception ? JNI_ABORT: 0);
1648 }
1649 if (_exception) {
1650 jniThrowException(_env, _exceptionType, _exceptionMessage);
1651 }
1652 }
1653
1654 /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
1655 static void
android_glGetMaterialfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint face,jint pname,jobject params_buf)1656 android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
1657 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
1658 jint _exception = 0;
1659 const char * _exceptionType = NULL;
1660 const char * _exceptionMessage = NULL;
1661 jfloatArray _array = (jfloatArray) 0;
1662 jint _bufferOffset = (jint) 0;
1663 jint _remaining;
1664 GLfloat *params = (GLfloat *) 0;
1665
1666 if (!params_buf) {
1667 _exception = 1;
1668 _exceptionType = "java/lang/IllegalArgumentException";
1669 _exceptionMessage = "params == null";
1670 goto exit;
1671 }
1672 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1673 int _needed;
1674 switch (pname) {
1675 #if defined(GL_AMBIENT)
1676 case GL_AMBIENT:
1677 #endif // defined(GL_AMBIENT)
1678 #if defined(GL_DIFFUSE)
1679 case GL_DIFFUSE:
1680 #endif // defined(GL_DIFFUSE)
1681 #if defined(GL_SPECULAR)
1682 case GL_SPECULAR:
1683 #endif // defined(GL_SPECULAR)
1684 #if defined(GL_EMISSION)
1685 case GL_EMISSION:
1686 #endif // defined(GL_EMISSION)
1687 #if defined(GL_AMBIENT_AND_DIFFUSE)
1688 case GL_AMBIENT_AND_DIFFUSE:
1689 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
1690 _needed = 4;
1691 break;
1692 default:
1693 _needed = 1;
1694 break;
1695 }
1696 if (_remaining < _needed) {
1697 _exception = 1;
1698 _exceptionType = "java/lang/IllegalArgumentException";
1699 _exceptionMessage = "remaining() < needed";
1700 goto exit;
1701 }
1702 if (params == NULL) {
1703 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1704 params = (GLfloat *) (_paramsBase + _bufferOffset);
1705 }
1706 glGetMaterialfv(
1707 (GLenum)face,
1708 (GLenum)pname,
1709 (GLfloat *)params
1710 );
1711
1712 exit:
1713 if (_array) {
1714 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
1715 }
1716 if (_exception) {
1717 jniThrowException(_env, _exceptionType, _exceptionMessage);
1718 }
1719 }
1720
1721 /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
1722 static void
android_glGetMaterialxv__II_3II(JNIEnv * _env,jobject _this,jint face,jint pname,jintArray params_ref,jint offset)1723 android_glGetMaterialxv__II_3II
1724 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
1725 jint _exception = 0;
1726 const char * _exceptionType = NULL;
1727 const char * _exceptionMessage = NULL;
1728 GLfixed *params_base = (GLfixed *) 0;
1729 jint _remaining;
1730 GLfixed *params = (GLfixed *) 0;
1731
1732 if (!params_ref) {
1733 _exception = 1;
1734 _exceptionType = "java/lang/IllegalArgumentException";
1735 _exceptionMessage = "params == null";
1736 goto exit;
1737 }
1738 if (offset < 0) {
1739 _exception = 1;
1740 _exceptionType = "java/lang/IllegalArgumentException";
1741 _exceptionMessage = "offset < 0";
1742 goto exit;
1743 }
1744 _remaining = _env->GetArrayLength(params_ref) - offset;
1745 int _needed;
1746 switch (pname) {
1747 #if defined(GL_AMBIENT)
1748 case GL_AMBIENT:
1749 #endif // defined(GL_AMBIENT)
1750 #if defined(GL_DIFFUSE)
1751 case GL_DIFFUSE:
1752 #endif // defined(GL_DIFFUSE)
1753 #if defined(GL_SPECULAR)
1754 case GL_SPECULAR:
1755 #endif // defined(GL_SPECULAR)
1756 #if defined(GL_EMISSION)
1757 case GL_EMISSION:
1758 #endif // defined(GL_EMISSION)
1759 #if defined(GL_AMBIENT_AND_DIFFUSE)
1760 case GL_AMBIENT_AND_DIFFUSE:
1761 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
1762 _needed = 4;
1763 break;
1764 default:
1765 _needed = 1;
1766 break;
1767 }
1768 if (_remaining < _needed) {
1769 _exception = 1;
1770 _exceptionType = "java/lang/IllegalArgumentException";
1771 _exceptionMessage = "length - offset < needed";
1772 goto exit;
1773 }
1774 params_base = (GLfixed *)
1775 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1776 params = params_base + offset;
1777
1778 glGetMaterialxv(
1779 (GLenum)face,
1780 (GLenum)pname,
1781 (GLfixed *)params
1782 );
1783
1784 exit:
1785 if (params_base) {
1786 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1787 _exception ? JNI_ABORT: 0);
1788 }
1789 if (_exception) {
1790 jniThrowException(_env, _exceptionType, _exceptionMessage);
1791 }
1792 }
1793
1794 /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
1795 static void
android_glGetMaterialxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint face,jint pname,jobject params_buf)1796 android_glGetMaterialxv__IILjava_nio_IntBuffer_2
1797 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
1798 jint _exception = 0;
1799 const char * _exceptionType = NULL;
1800 const char * _exceptionMessage = NULL;
1801 jintArray _array = (jintArray) 0;
1802 jint _bufferOffset = (jint) 0;
1803 jint _remaining;
1804 GLfixed *params = (GLfixed *) 0;
1805
1806 if (!params_buf) {
1807 _exception = 1;
1808 _exceptionType = "java/lang/IllegalArgumentException";
1809 _exceptionMessage = "params == null";
1810 goto exit;
1811 }
1812 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1813 int _needed;
1814 switch (pname) {
1815 #if defined(GL_AMBIENT)
1816 case GL_AMBIENT:
1817 #endif // defined(GL_AMBIENT)
1818 #if defined(GL_DIFFUSE)
1819 case GL_DIFFUSE:
1820 #endif // defined(GL_DIFFUSE)
1821 #if defined(GL_SPECULAR)
1822 case GL_SPECULAR:
1823 #endif // defined(GL_SPECULAR)
1824 #if defined(GL_EMISSION)
1825 case GL_EMISSION:
1826 #endif // defined(GL_EMISSION)
1827 #if defined(GL_AMBIENT_AND_DIFFUSE)
1828 case GL_AMBIENT_AND_DIFFUSE:
1829 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
1830 _needed = 4;
1831 break;
1832 default:
1833 _needed = 1;
1834 break;
1835 }
1836 if (_remaining < _needed) {
1837 _exception = 1;
1838 _exceptionType = "java/lang/IllegalArgumentException";
1839 _exceptionMessage = "remaining() < needed";
1840 goto exit;
1841 }
1842 if (params == NULL) {
1843 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1844 params = (GLfixed *) (_paramsBase + _bufferOffset);
1845 }
1846 glGetMaterialxv(
1847 (GLenum)face,
1848 (GLenum)pname,
1849 (GLfixed *)params
1850 );
1851
1852 exit:
1853 if (_array) {
1854 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
1855 }
1856 if (_exception) {
1857 jniThrowException(_env, _exceptionType, _exceptionMessage);
1858 }
1859 }
1860
1861 /* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */
1862 static void
android_glGetTexEnvfv__II_3FI(JNIEnv * _env,jobject _this,jint env,jint pname,jfloatArray params_ref,jint offset)1863 android_glGetTexEnvfv__II_3FI
1864 (JNIEnv *_env, jobject _this, jint env, jint pname, jfloatArray params_ref, jint offset) {
1865 jint _exception = 0;
1866 const char * _exceptionType = NULL;
1867 const char * _exceptionMessage = NULL;
1868 GLfloat *params_base = (GLfloat *) 0;
1869 jint _remaining;
1870 GLfloat *params = (GLfloat *) 0;
1871
1872 if (!params_ref) {
1873 _exception = 1;
1874 _exceptionType = "java/lang/IllegalArgumentException";
1875 _exceptionMessage = "params == null";
1876 goto exit;
1877 }
1878 if (offset < 0) {
1879 _exception = 1;
1880 _exceptionType = "java/lang/IllegalArgumentException";
1881 _exceptionMessage = "offset < 0";
1882 goto exit;
1883 }
1884 _remaining = _env->GetArrayLength(params_ref) - offset;
1885 int _needed;
1886 switch (pname) {
1887 #if defined(GL_TEXTURE_ENV_COLOR)
1888 case GL_TEXTURE_ENV_COLOR:
1889 #endif // defined(GL_TEXTURE_ENV_COLOR)
1890 _needed = 4;
1891 break;
1892 default:
1893 _needed = 1;
1894 break;
1895 }
1896 if (_remaining < _needed) {
1897 _exception = 1;
1898 _exceptionType = "java/lang/IllegalArgumentException";
1899 _exceptionMessage = "length - offset < needed";
1900 goto exit;
1901 }
1902 params_base = (GLfloat *)
1903 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1904 params = params_base + offset;
1905
1906 glGetTexEnvfv(
1907 (GLenum)env,
1908 (GLenum)pname,
1909 (GLfloat *)params
1910 );
1911
1912 exit:
1913 if (params_base) {
1914 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1915 _exception ? JNI_ABORT: 0);
1916 }
1917 if (_exception) {
1918 jniThrowException(_env, _exceptionType, _exceptionMessage);
1919 }
1920 }
1921
1922 /* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */
1923 static void
android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint env,jint pname,jobject params_buf)1924 android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2
1925 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
1926 jint _exception = 0;
1927 const char * _exceptionType = NULL;
1928 const char * _exceptionMessage = NULL;
1929 jfloatArray _array = (jfloatArray) 0;
1930 jint _bufferOffset = (jint) 0;
1931 jint _remaining;
1932 GLfloat *params = (GLfloat *) 0;
1933
1934 if (!params_buf) {
1935 _exception = 1;
1936 _exceptionType = "java/lang/IllegalArgumentException";
1937 _exceptionMessage = "params == null";
1938 goto exit;
1939 }
1940 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1941 int _needed;
1942 switch (pname) {
1943 #if defined(GL_TEXTURE_ENV_COLOR)
1944 case GL_TEXTURE_ENV_COLOR:
1945 #endif // defined(GL_TEXTURE_ENV_COLOR)
1946 _needed = 4;
1947 break;
1948 default:
1949 _needed = 1;
1950 break;
1951 }
1952 if (_remaining < _needed) {
1953 _exception = 1;
1954 _exceptionType = "java/lang/IllegalArgumentException";
1955 _exceptionMessage = "remaining() < needed";
1956 goto exit;
1957 }
1958 if (params == NULL) {
1959 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1960 params = (GLfloat *) (_paramsBase + _bufferOffset);
1961 }
1962 glGetTexEnvfv(
1963 (GLenum)env,
1964 (GLenum)pname,
1965 (GLfloat *)params
1966 );
1967
1968 exit:
1969 if (_array) {
1970 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
1971 }
1972 if (_exception) {
1973 jniThrowException(_env, _exceptionType, _exceptionMessage);
1974 }
1975 }
1976
1977 /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
1978 static void
android_glGetTexEnviv__II_3II(JNIEnv * _env,jobject _this,jint env,jint pname,jintArray params_ref,jint offset)1979 android_glGetTexEnviv__II_3II
1980 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
1981 jint _exception = 0;
1982 const char * _exceptionType = NULL;
1983 const char * _exceptionMessage = NULL;
1984 GLint *params_base = (GLint *) 0;
1985 jint _remaining;
1986 GLint *params = (GLint *) 0;
1987
1988 if (!params_ref) {
1989 _exception = 1;
1990 _exceptionType = "java/lang/IllegalArgumentException";
1991 _exceptionMessage = "params == null";
1992 goto exit;
1993 }
1994 if (offset < 0) {
1995 _exception = 1;
1996 _exceptionType = "java/lang/IllegalArgumentException";
1997 _exceptionMessage = "offset < 0";
1998 goto exit;
1999 }
2000 _remaining = _env->GetArrayLength(params_ref) - offset;
2001 int _needed;
2002 switch (pname) {
2003 #if defined(GL_TEXTURE_ENV_COLOR)
2004 case GL_TEXTURE_ENV_COLOR:
2005 #endif // defined(GL_TEXTURE_ENV_COLOR)
2006 _needed = 4;
2007 break;
2008 default:
2009 _needed = 1;
2010 break;
2011 }
2012 if (_remaining < _needed) {
2013 _exception = 1;
2014 _exceptionType = "java/lang/IllegalArgumentException";
2015 _exceptionMessage = "length - offset < needed";
2016 goto exit;
2017 }
2018 params_base = (GLint *)
2019 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2020 params = params_base + offset;
2021
2022 glGetTexEnviv(
2023 (GLenum)env,
2024 (GLenum)pname,
2025 (GLint *)params
2026 );
2027
2028 exit:
2029 if (params_base) {
2030 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2031 _exception ? JNI_ABORT: 0);
2032 }
2033 if (_exception) {
2034 jniThrowException(_env, _exceptionType, _exceptionMessage);
2035 }
2036 }
2037
2038 /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
2039 static void
android_glGetTexEnviv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint env,jint pname,jobject params_buf)2040 android_glGetTexEnviv__IILjava_nio_IntBuffer_2
2041 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
2042 jint _exception = 0;
2043 const char * _exceptionType = NULL;
2044 const char * _exceptionMessage = NULL;
2045 jintArray _array = (jintArray) 0;
2046 jint _bufferOffset = (jint) 0;
2047 jint _remaining;
2048 GLint *params = (GLint *) 0;
2049
2050 if (!params_buf) {
2051 _exception = 1;
2052 _exceptionType = "java/lang/IllegalArgumentException";
2053 _exceptionMessage = "params == null";
2054 goto exit;
2055 }
2056 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2057 int _needed;
2058 switch (pname) {
2059 #if defined(GL_TEXTURE_ENV_COLOR)
2060 case GL_TEXTURE_ENV_COLOR:
2061 #endif // defined(GL_TEXTURE_ENV_COLOR)
2062 _needed = 4;
2063 break;
2064 default:
2065 _needed = 1;
2066 break;
2067 }
2068 if (_remaining < _needed) {
2069 _exception = 1;
2070 _exceptionType = "java/lang/IllegalArgumentException";
2071 _exceptionMessage = "remaining() < needed";
2072 goto exit;
2073 }
2074 if (params == NULL) {
2075 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2076 params = (GLint *) (_paramsBase + _bufferOffset);
2077 }
2078 glGetTexEnviv(
2079 (GLenum)env,
2080 (GLenum)pname,
2081 (GLint *)params
2082 );
2083
2084 exit:
2085 if (_array) {
2086 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2087 }
2088 if (_exception) {
2089 jniThrowException(_env, _exceptionType, _exceptionMessage);
2090 }
2091 }
2092
2093 /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
2094 static void
android_glGetTexEnvxv__II_3II(JNIEnv * _env,jobject _this,jint env,jint pname,jintArray params_ref,jint offset)2095 android_glGetTexEnvxv__II_3II
2096 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
2097 jint _exception = 0;
2098 const char * _exceptionType = NULL;
2099 const char * _exceptionMessage = NULL;
2100 GLfixed *params_base = (GLfixed *) 0;
2101 jint _remaining;
2102 GLfixed *params = (GLfixed *) 0;
2103
2104 if (!params_ref) {
2105 _exception = 1;
2106 _exceptionType = "java/lang/IllegalArgumentException";
2107 _exceptionMessage = "params == null";
2108 goto exit;
2109 }
2110 if (offset < 0) {
2111 _exception = 1;
2112 _exceptionType = "java/lang/IllegalArgumentException";
2113 _exceptionMessage = "offset < 0";
2114 goto exit;
2115 }
2116 _remaining = _env->GetArrayLength(params_ref) - offset;
2117 int _needed;
2118 switch (pname) {
2119 #if defined(GL_TEXTURE_ENV_COLOR)
2120 case GL_TEXTURE_ENV_COLOR:
2121 #endif // defined(GL_TEXTURE_ENV_COLOR)
2122 _needed = 4;
2123 break;
2124 default:
2125 _needed = 1;
2126 break;
2127 }
2128 if (_remaining < _needed) {
2129 _exception = 1;
2130 _exceptionType = "java/lang/IllegalArgumentException";
2131 _exceptionMessage = "length - offset < needed";
2132 goto exit;
2133 }
2134 params_base = (GLfixed *)
2135 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2136 params = params_base + offset;
2137
2138 glGetTexEnvxv(
2139 (GLenum)env,
2140 (GLenum)pname,
2141 (GLfixed *)params
2142 );
2143
2144 exit:
2145 if (params_base) {
2146 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2147 _exception ? JNI_ABORT: 0);
2148 }
2149 if (_exception) {
2150 jniThrowException(_env, _exceptionType, _exceptionMessage);
2151 }
2152 }
2153
2154 /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
2155 static void
android_glGetTexEnvxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint env,jint pname,jobject params_buf)2156 android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
2157 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
2158 jint _exception = 0;
2159 const char * _exceptionType = NULL;
2160 const char * _exceptionMessage = NULL;
2161 jintArray _array = (jintArray) 0;
2162 jint _bufferOffset = (jint) 0;
2163 jint _remaining;
2164 GLfixed *params = (GLfixed *) 0;
2165
2166 if (!params_buf) {
2167 _exception = 1;
2168 _exceptionType = "java/lang/IllegalArgumentException";
2169 _exceptionMessage = "params == null";
2170 goto exit;
2171 }
2172 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2173 int _needed;
2174 switch (pname) {
2175 #if defined(GL_TEXTURE_ENV_COLOR)
2176 case GL_TEXTURE_ENV_COLOR:
2177 #endif // defined(GL_TEXTURE_ENV_COLOR)
2178 _needed = 4;
2179 break;
2180 default:
2181 _needed = 1;
2182 break;
2183 }
2184 if (_remaining < _needed) {
2185 _exception = 1;
2186 _exceptionType = "java/lang/IllegalArgumentException";
2187 _exceptionMessage = "remaining() < needed";
2188 goto exit;
2189 }
2190 if (params == NULL) {
2191 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2192 params = (GLfixed *) (_paramsBase + _bufferOffset);
2193 }
2194 glGetTexEnvxv(
2195 (GLenum)env,
2196 (GLenum)pname,
2197 (GLfixed *)params
2198 );
2199
2200 exit:
2201 if (_array) {
2202 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2203 }
2204 if (_exception) {
2205 jniThrowException(_env, _exceptionType, _exceptionMessage);
2206 }
2207 }
2208
2209 /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
2210 static void
android_glGetTexParameterfv__II_3FI(JNIEnv * _env,jobject _this,jint target,jint pname,jfloatArray params_ref,jint offset)2211 android_glGetTexParameterfv__II_3FI
2212 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2213 jint _exception = 0;
2214 const char * _exceptionType = NULL;
2215 const char * _exceptionMessage = NULL;
2216 GLfloat *params_base = (GLfloat *) 0;
2217 jint _remaining;
2218 GLfloat *params = (GLfloat *) 0;
2219
2220 if (!params_ref) {
2221 _exception = 1;
2222 _exceptionType = "java/lang/IllegalArgumentException";
2223 _exceptionMessage = "params == null";
2224 goto exit;
2225 }
2226 if (offset < 0) {
2227 _exception = 1;
2228 _exceptionType = "java/lang/IllegalArgumentException";
2229 _exceptionMessage = "offset < 0";
2230 goto exit;
2231 }
2232 _remaining = _env->GetArrayLength(params_ref) - offset;
2233 if (_remaining < 1) {
2234 _exception = 1;
2235 _exceptionType = "java/lang/IllegalArgumentException";
2236 _exceptionMessage = "length - offset < 1 < needed";
2237 goto exit;
2238 }
2239 params_base = (GLfloat *)
2240 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2241 params = params_base + offset;
2242
2243 glGetTexParameterfv(
2244 (GLenum)target,
2245 (GLenum)pname,
2246 (GLfloat *)params
2247 );
2248
2249 exit:
2250 if (params_base) {
2251 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2252 _exception ? JNI_ABORT: 0);
2253 }
2254 if (_exception) {
2255 jniThrowException(_env, _exceptionType, _exceptionMessage);
2256 }
2257 }
2258
2259 /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
2260 static void
android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)2261 android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
2262 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2263 jint _exception = 0;
2264 const char * _exceptionType = NULL;
2265 const char * _exceptionMessage = NULL;
2266 jfloatArray _array = (jfloatArray) 0;
2267 jint _bufferOffset = (jint) 0;
2268 jint _remaining;
2269 GLfloat *params = (GLfloat *) 0;
2270
2271 if (!params_buf) {
2272 _exception = 1;
2273 _exceptionType = "java/lang/IllegalArgumentException";
2274 _exceptionMessage = "params == null";
2275 goto exit;
2276 }
2277 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2278 if (_remaining < 1) {
2279 _exception = 1;
2280 _exceptionType = "java/lang/IllegalArgumentException";
2281 _exceptionMessage = "remaining() < 1 < needed";
2282 goto exit;
2283 }
2284 if (params == NULL) {
2285 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2286 params = (GLfloat *) (_paramsBase + _bufferOffset);
2287 }
2288 glGetTexParameterfv(
2289 (GLenum)target,
2290 (GLenum)pname,
2291 (GLfloat *)params
2292 );
2293
2294 exit:
2295 if (_array) {
2296 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
2297 }
2298 if (_exception) {
2299 jniThrowException(_env, _exceptionType, _exceptionMessage);
2300 }
2301 }
2302
2303 /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
2304 static void
android_glGetTexParameteriv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)2305 android_glGetTexParameteriv__II_3II
2306 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2307 jint _exception = 0;
2308 const char * _exceptionType = NULL;
2309 const char * _exceptionMessage = NULL;
2310 GLint *params_base = (GLint *) 0;
2311 jint _remaining;
2312 GLint *params = (GLint *) 0;
2313
2314 if (!params_ref) {
2315 _exception = 1;
2316 _exceptionType = "java/lang/IllegalArgumentException";
2317 _exceptionMessage = "params == null";
2318 goto exit;
2319 }
2320 if (offset < 0) {
2321 _exception = 1;
2322 _exceptionType = "java/lang/IllegalArgumentException";
2323 _exceptionMessage = "offset < 0";
2324 goto exit;
2325 }
2326 _remaining = _env->GetArrayLength(params_ref) - offset;
2327 if (_remaining < 1) {
2328 _exception = 1;
2329 _exceptionType = "java/lang/IllegalArgumentException";
2330 _exceptionMessage = "length - offset < 1 < needed";
2331 goto exit;
2332 }
2333 params_base = (GLint *)
2334 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2335 params = params_base + offset;
2336
2337 glGetTexParameteriv(
2338 (GLenum)target,
2339 (GLenum)pname,
2340 (GLint *)params
2341 );
2342
2343 exit:
2344 if (params_base) {
2345 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2346 _exception ? JNI_ABORT: 0);
2347 }
2348 if (_exception) {
2349 jniThrowException(_env, _exceptionType, _exceptionMessage);
2350 }
2351 }
2352
2353 /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
2354 static void
android_glGetTexParameteriv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)2355 android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
2356 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2357 jint _exception = 0;
2358 const char * _exceptionType = NULL;
2359 const char * _exceptionMessage = NULL;
2360 jintArray _array = (jintArray) 0;
2361 jint _bufferOffset = (jint) 0;
2362 jint _remaining;
2363 GLint *params = (GLint *) 0;
2364
2365 if (!params_buf) {
2366 _exception = 1;
2367 _exceptionType = "java/lang/IllegalArgumentException";
2368 _exceptionMessage = "params == null";
2369 goto exit;
2370 }
2371 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2372 if (_remaining < 1) {
2373 _exception = 1;
2374 _exceptionType = "java/lang/IllegalArgumentException";
2375 _exceptionMessage = "remaining() < 1 < needed";
2376 goto exit;
2377 }
2378 if (params == NULL) {
2379 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2380 params = (GLint *) (_paramsBase + _bufferOffset);
2381 }
2382 glGetTexParameteriv(
2383 (GLenum)target,
2384 (GLenum)pname,
2385 (GLint *)params
2386 );
2387
2388 exit:
2389 if (_array) {
2390 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2391 }
2392 if (_exception) {
2393 jniThrowException(_env, _exceptionType, _exceptionMessage);
2394 }
2395 }
2396
2397 /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
2398 static void
android_glGetTexParameterxv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)2399 android_glGetTexParameterxv__II_3II
2400 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2401 jint _exception = 0;
2402 const char * _exceptionType = NULL;
2403 const char * _exceptionMessage = NULL;
2404 GLfixed *params_base = (GLfixed *) 0;
2405 jint _remaining;
2406 GLfixed *params = (GLfixed *) 0;
2407
2408 if (!params_ref) {
2409 _exception = 1;
2410 _exceptionType = "java/lang/IllegalArgumentException";
2411 _exceptionMessage = "params == null";
2412 goto exit;
2413 }
2414 if (offset < 0) {
2415 _exception = 1;
2416 _exceptionType = "java/lang/IllegalArgumentException";
2417 _exceptionMessage = "offset < 0";
2418 goto exit;
2419 }
2420 _remaining = _env->GetArrayLength(params_ref) - offset;
2421 if (_remaining < 1) {
2422 _exception = 1;
2423 _exceptionType = "java/lang/IllegalArgumentException";
2424 _exceptionMessage = "length - offset < 1 < needed";
2425 goto exit;
2426 }
2427 params_base = (GLfixed *)
2428 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2429 params = params_base + offset;
2430
2431 glGetTexParameterxv(
2432 (GLenum)target,
2433 (GLenum)pname,
2434 (GLfixed *)params
2435 );
2436
2437 exit:
2438 if (params_base) {
2439 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2440 _exception ? JNI_ABORT: 0);
2441 }
2442 if (_exception) {
2443 jniThrowException(_env, _exceptionType, _exceptionMessage);
2444 }
2445 }
2446
2447 /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
2448 static void
android_glGetTexParameterxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)2449 android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
2450 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2451 jint _exception = 0;
2452 const char * _exceptionType = NULL;
2453 const char * _exceptionMessage = NULL;
2454 jintArray _array = (jintArray) 0;
2455 jint _bufferOffset = (jint) 0;
2456 jint _remaining;
2457 GLfixed *params = (GLfixed *) 0;
2458
2459 if (!params_buf) {
2460 _exception = 1;
2461 _exceptionType = "java/lang/IllegalArgumentException";
2462 _exceptionMessage = "params == null";
2463 goto exit;
2464 }
2465 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2466 if (_remaining < 1) {
2467 _exception = 1;
2468 _exceptionType = "java/lang/IllegalArgumentException";
2469 _exceptionMessage = "remaining() < 1 < needed";
2470 goto exit;
2471 }
2472 if (params == NULL) {
2473 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2474 params = (GLfixed *) (_paramsBase + _bufferOffset);
2475 }
2476 glGetTexParameterxv(
2477 (GLenum)target,
2478 (GLenum)pname,
2479 (GLfixed *)params
2480 );
2481
2482 exit:
2483 if (_array) {
2484 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
2485 }
2486 if (_exception) {
2487 jniThrowException(_env, _exceptionType, _exceptionMessage);
2488 }
2489 }
2490
2491 /* GLboolean glIsBuffer ( GLuint buffer ) */
2492 static jboolean
android_glIsBuffer__I(JNIEnv * _env,jobject _this,jint buffer)2493 android_glIsBuffer__I
2494 (JNIEnv *_env, jobject _this, jint buffer) {
2495 GLboolean _returnValue;
2496 _returnValue = glIsBuffer(
2497 (GLuint)buffer
2498 );
2499 return (jboolean)_returnValue;
2500 }
2501
2502 /* GLboolean glIsEnabled ( GLenum cap ) */
2503 static jboolean
android_glIsEnabled__I(JNIEnv * _env,jobject _this,jint cap)2504 android_glIsEnabled__I
2505 (JNIEnv *_env, jobject _this, jint cap) {
2506 GLboolean _returnValue;
2507 _returnValue = glIsEnabled(
2508 (GLenum)cap
2509 );
2510 return (jboolean)_returnValue;
2511 }
2512
2513 /* GLboolean glIsTexture ( GLuint texture ) */
2514 static jboolean
android_glIsTexture__I(JNIEnv * _env,jobject _this,jint texture)2515 android_glIsTexture__I
2516 (JNIEnv *_env, jobject _this, jint texture) {
2517 GLboolean _returnValue;
2518 _returnValue = glIsTexture(
2519 (GLuint)texture
2520 );
2521 return (jboolean)_returnValue;
2522 }
2523
2524 /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
2525 static void
android_glNormalPointer__III(JNIEnv * _env,jobject _this,jint type,jint stride,jint offset)2526 android_glNormalPointer__III
2527 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
2528 glNormalPointer(
2529 (GLenum)type,
2530 (GLsizei)stride,
2531 reinterpret_cast<GLvoid *>(offset)
2532 );
2533 }
2534
2535 /* void glPointParameterf ( GLenum pname, GLfloat param ) */
2536 static void
android_glPointParameterf__IF(JNIEnv * _env,jobject _this,jint pname,jfloat param)2537 android_glPointParameterf__IF
2538 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
2539 glPointParameterf(
2540 (GLenum)pname,
2541 (GLfloat)param
2542 );
2543 }
2544
2545 /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
2546 static void
android_glPointParameterfv__I_3FI(JNIEnv * _env,jobject _this,jint pname,jfloatArray params_ref,jint offset)2547 android_glPointParameterfv__I_3FI
2548 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
2549 jint _exception = 0;
2550 const char * _exceptionType = NULL;
2551 const char * _exceptionMessage = NULL;
2552 GLfloat *params_base = (GLfloat *) 0;
2553 jint _remaining;
2554 GLfloat *params = (GLfloat *) 0;
2555
2556 if (!params_ref) {
2557 _exception = 1;
2558 _exceptionType = "java/lang/IllegalArgumentException";
2559 _exceptionMessage = "params == null";
2560 goto exit;
2561 }
2562 if (offset < 0) {
2563 _exception = 1;
2564 _exceptionType = "java/lang/IllegalArgumentException";
2565 _exceptionMessage = "offset < 0";
2566 goto exit;
2567 }
2568 _remaining = _env->GetArrayLength(params_ref) - offset;
2569 if (_remaining < 1) {
2570 _exception = 1;
2571 _exceptionType = "java/lang/IllegalArgumentException";
2572 _exceptionMessage = "length - offset < 1 < needed";
2573 goto exit;
2574 }
2575 params_base = (GLfloat *)
2576 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2577 params = params_base + offset;
2578
2579 glPointParameterfv(
2580 (GLenum)pname,
2581 (GLfloat *)params
2582 );
2583
2584 exit:
2585 if (params_base) {
2586 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2587 JNI_ABORT);
2588 }
2589 if (_exception) {
2590 jniThrowException(_env, _exceptionType, _exceptionMessage);
2591 }
2592 }
2593
2594 /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
2595 static void
android_glPointParameterfv__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)2596 android_glPointParameterfv__ILjava_nio_FloatBuffer_2
2597 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2598 jint _exception = 0;
2599 const char * _exceptionType = NULL;
2600 const char * _exceptionMessage = NULL;
2601 jfloatArray _array = (jfloatArray) 0;
2602 jint _bufferOffset = (jint) 0;
2603 jint _remaining;
2604 GLfloat *params = (GLfloat *) 0;
2605
2606 if (!params_buf) {
2607 _exception = 1;
2608 _exceptionType = "java/lang/IllegalArgumentException";
2609 _exceptionMessage = "params == null";
2610 goto exit;
2611 }
2612 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2613 if (_remaining < 1) {
2614 _exception = 1;
2615 _exceptionType = "java/lang/IllegalArgumentException";
2616 _exceptionMessage = "remaining() < 1 < needed";
2617 goto exit;
2618 }
2619 if (params == NULL) {
2620 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2621 params = (GLfloat *) (_paramsBase + _bufferOffset);
2622 }
2623 glPointParameterfv(
2624 (GLenum)pname,
2625 (GLfloat *)params
2626 );
2627
2628 exit:
2629 if (_array) {
2630 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2631 }
2632 if (_exception) {
2633 jniThrowException(_env, _exceptionType, _exceptionMessage);
2634 }
2635 }
2636
2637 /* void glPointParameterx ( GLenum pname, GLfixed param ) */
2638 static void
android_glPointParameterx__II(JNIEnv * _env,jobject _this,jint pname,jint param)2639 android_glPointParameterx__II
2640 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2641 glPointParameterx(
2642 (GLenum)pname,
2643 (GLfixed)param
2644 );
2645 }
2646
2647 /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
2648 static void
android_glPointParameterxv__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray params_ref,jint offset)2649 android_glPointParameterxv__I_3II
2650 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
2651 jint _exception = 0;
2652 const char * _exceptionType = NULL;
2653 const char * _exceptionMessage = NULL;
2654 GLfixed *params_base = (GLfixed *) 0;
2655 jint _remaining;
2656 GLfixed *params = (GLfixed *) 0;
2657
2658 if (!params_ref) {
2659 _exception = 1;
2660 _exceptionType = "java/lang/IllegalArgumentException";
2661 _exceptionMessage = "params == null";
2662 goto exit;
2663 }
2664 if (offset < 0) {
2665 _exception = 1;
2666 _exceptionType = "java/lang/IllegalArgumentException";
2667 _exceptionMessage = "offset < 0";
2668 goto exit;
2669 }
2670 _remaining = _env->GetArrayLength(params_ref) - offset;
2671 if (_remaining < 1) {
2672 _exception = 1;
2673 _exceptionType = "java/lang/IllegalArgumentException";
2674 _exceptionMessage = "length - offset < 1 < needed";
2675 goto exit;
2676 }
2677 params_base = (GLfixed *)
2678 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2679 params = params_base + offset;
2680
2681 glPointParameterxv(
2682 (GLenum)pname,
2683 (GLfixed *)params
2684 );
2685
2686 exit:
2687 if (params_base) {
2688 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2689 JNI_ABORT);
2690 }
2691 if (_exception) {
2692 jniThrowException(_env, _exceptionType, _exceptionMessage);
2693 }
2694 }
2695
2696 /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
2697 static void
android_glPointParameterxv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)2698 android_glPointParameterxv__ILjava_nio_IntBuffer_2
2699 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2700 jint _exception = 0;
2701 const char * _exceptionType = NULL;
2702 const char * _exceptionMessage = NULL;
2703 jintArray _array = (jintArray) 0;
2704 jint _bufferOffset = (jint) 0;
2705 jint _remaining;
2706 GLfixed *params = (GLfixed *) 0;
2707
2708 if (!params_buf) {
2709 _exception = 1;
2710 _exceptionType = "java/lang/IllegalArgumentException";
2711 _exceptionMessage = "params == null";
2712 goto exit;
2713 }
2714 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2715 if (_remaining < 1) {
2716 _exception = 1;
2717 _exceptionType = "java/lang/IllegalArgumentException";
2718 _exceptionMessage = "remaining() < 1 < needed";
2719 goto exit;
2720 }
2721 if (params == NULL) {
2722 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2723 params = (GLfixed *) (_paramsBase + _bufferOffset);
2724 }
2725 glPointParameterxv(
2726 (GLenum)pname,
2727 (GLfixed *)params
2728 );
2729
2730 exit:
2731 if (_array) {
2732 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2733 }
2734 if (_exception) {
2735 jniThrowException(_env, _exceptionType, _exceptionMessage);
2736 }
2737 }
2738
2739 /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2740 static void
android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint type,jint stride,jobject pointer_buf,jint remaining)2741 android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
2742 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2743 jint _exception = 0;
2744 const char * _exceptionType = NULL;
2745 const char * _exceptionMessage = NULL;
2746 jarray _array = (jarray) 0;
2747 jint _bufferOffset = (jint) 0;
2748 jint _remaining;
2749 GLvoid *pointer = (GLvoid *) 0;
2750
2751 if (pointer_buf) {
2752 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2753 if ( ! pointer ) {
2754 return;
2755 }
2756 }
2757 glPointSizePointerOESBounds(
2758 (GLenum)type,
2759 (GLsizei)stride,
2760 (GLvoid *)pointer,
2761 (GLsizei)remaining
2762 );
2763 if (_exception) {
2764 jniThrowException(_env, _exceptionType, _exceptionMessage);
2765 }
2766 }
2767
2768 /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
2769 static void
android_glTexCoordPointer__IIII(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jint offset)2770 android_glTexCoordPointer__IIII
2771 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
2772 glTexCoordPointer(
2773 (GLint)size,
2774 (GLenum)type,
2775 (GLsizei)stride,
2776 reinterpret_cast<GLvoid *>(offset)
2777 );
2778 }
2779
2780 /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
2781 static void
android_glTexEnvi__III(JNIEnv * _env,jobject _this,jint target,jint pname,jint param)2782 android_glTexEnvi__III
2783 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2784 glTexEnvi(
2785 (GLenum)target,
2786 (GLenum)pname,
2787 (GLint)param
2788 );
2789 }
2790
2791 /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
2792 static void
android_glTexEnviv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)2793 android_glTexEnviv__II_3II
2794 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2795 jint _exception = 0;
2796 const char * _exceptionType = NULL;
2797 const char * _exceptionMessage = NULL;
2798 GLint *params_base = (GLint *) 0;
2799 jint _remaining;
2800 GLint *params = (GLint *) 0;
2801
2802 if (!params_ref) {
2803 _exception = 1;
2804 _exceptionType = "java/lang/IllegalArgumentException";
2805 _exceptionMessage = "params == null";
2806 goto exit;
2807 }
2808 if (offset < 0) {
2809 _exception = 1;
2810 _exceptionType = "java/lang/IllegalArgumentException";
2811 _exceptionMessage = "offset < 0";
2812 goto exit;
2813 }
2814 _remaining = _env->GetArrayLength(params_ref) - offset;
2815 int _needed;
2816 switch (pname) {
2817 #if defined(GL_TEXTURE_ENV_COLOR)
2818 case GL_TEXTURE_ENV_COLOR:
2819 #endif // defined(GL_TEXTURE_ENV_COLOR)
2820 _needed = 4;
2821 break;
2822 default:
2823 _needed = 1;
2824 break;
2825 }
2826 if (_remaining < _needed) {
2827 _exception = 1;
2828 _exceptionType = "java/lang/IllegalArgumentException";
2829 _exceptionMessage = "length - offset < needed";
2830 goto exit;
2831 }
2832 params_base = (GLint *)
2833 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2834 params = params_base + offset;
2835
2836 glTexEnviv(
2837 (GLenum)target,
2838 (GLenum)pname,
2839 (GLint *)params
2840 );
2841
2842 exit:
2843 if (params_base) {
2844 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2845 JNI_ABORT);
2846 }
2847 if (_exception) {
2848 jniThrowException(_env, _exceptionType, _exceptionMessage);
2849 }
2850 }
2851
2852 /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
2853 static void
android_glTexEnviv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)2854 android_glTexEnviv__IILjava_nio_IntBuffer_2
2855 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2856 jint _exception = 0;
2857 const char * _exceptionType = NULL;
2858 const char * _exceptionMessage = NULL;
2859 jintArray _array = (jintArray) 0;
2860 jint _bufferOffset = (jint) 0;
2861 jint _remaining;
2862 GLint *params = (GLint *) 0;
2863
2864 if (!params_buf) {
2865 _exception = 1;
2866 _exceptionType = "java/lang/IllegalArgumentException";
2867 _exceptionMessage = "params == null";
2868 goto exit;
2869 }
2870 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2871 int _needed;
2872 switch (pname) {
2873 #if defined(GL_TEXTURE_ENV_COLOR)
2874 case GL_TEXTURE_ENV_COLOR:
2875 #endif // defined(GL_TEXTURE_ENV_COLOR)
2876 _needed = 4;
2877 break;
2878 default:
2879 _needed = 1;
2880 break;
2881 }
2882 if (_remaining < _needed) {
2883 _exception = 1;
2884 _exceptionType = "java/lang/IllegalArgumentException";
2885 _exceptionMessage = "remaining() < needed";
2886 goto exit;
2887 }
2888 if (params == NULL) {
2889 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2890 params = (GLint *) (_paramsBase + _bufferOffset);
2891 }
2892 glTexEnviv(
2893 (GLenum)target,
2894 (GLenum)pname,
2895 (GLint *)params
2896 );
2897
2898 exit:
2899 if (_array) {
2900 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2901 }
2902 if (_exception) {
2903 jniThrowException(_env, _exceptionType, _exceptionMessage);
2904 }
2905 }
2906
2907 /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2908 static void
android_glTexParameterfv__II_3FI(JNIEnv * _env,jobject _this,jint target,jint pname,jfloatArray params_ref,jint offset)2909 android_glTexParameterfv__II_3FI
2910 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2911 jint _exception = 0;
2912 const char * _exceptionType = NULL;
2913 const char * _exceptionMessage = NULL;
2914 GLfloat *params_base = (GLfloat *) 0;
2915 jint _remaining;
2916 GLfloat *params = (GLfloat *) 0;
2917
2918 if (!params_ref) {
2919 _exception = 1;
2920 _exceptionType = "java/lang/IllegalArgumentException";
2921 _exceptionMessage = "params == null";
2922 goto exit;
2923 }
2924 if (offset < 0) {
2925 _exception = 1;
2926 _exceptionType = "java/lang/IllegalArgumentException";
2927 _exceptionMessage = "offset < 0";
2928 goto exit;
2929 }
2930 _remaining = _env->GetArrayLength(params_ref) - offset;
2931 if (_remaining < 1) {
2932 _exception = 1;
2933 _exceptionType = "java/lang/IllegalArgumentException";
2934 _exceptionMessage = "length - offset < 1 < needed";
2935 goto exit;
2936 }
2937 params_base = (GLfloat *)
2938 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2939 params = params_base + offset;
2940
2941 glTexParameterfv(
2942 (GLenum)target,
2943 (GLenum)pname,
2944 (GLfloat *)params
2945 );
2946
2947 exit:
2948 if (params_base) {
2949 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2950 JNI_ABORT);
2951 }
2952 if (_exception) {
2953 jniThrowException(_env, _exceptionType, _exceptionMessage);
2954 }
2955 }
2956
2957 /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2958 static void
android_glTexParameterfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)2959 android_glTexParameterfv__IILjava_nio_FloatBuffer_2
2960 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2961 jint _exception = 0;
2962 const char * _exceptionType = NULL;
2963 const char * _exceptionMessage = NULL;
2964 jfloatArray _array = (jfloatArray) 0;
2965 jint _bufferOffset = (jint) 0;
2966 jint _remaining;
2967 GLfloat *params = (GLfloat *) 0;
2968
2969 if (!params_buf) {
2970 _exception = 1;
2971 _exceptionType = "java/lang/IllegalArgumentException";
2972 _exceptionMessage = "params == null";
2973 goto exit;
2974 }
2975 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2976 if (_remaining < 1) {
2977 _exception = 1;
2978 _exceptionType = "java/lang/IllegalArgumentException";
2979 _exceptionMessage = "remaining() < 1 < needed";
2980 goto exit;
2981 }
2982 if (params == NULL) {
2983 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2984 params = (GLfloat *) (_paramsBase + _bufferOffset);
2985 }
2986 glTexParameterfv(
2987 (GLenum)target,
2988 (GLenum)pname,
2989 (GLfloat *)params
2990 );
2991
2992 exit:
2993 if (_array) {
2994 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2995 }
2996 if (_exception) {
2997 jniThrowException(_env, _exceptionType, _exceptionMessage);
2998 }
2999 }
3000
3001 /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
3002 static void
android_glTexParameteri__III(JNIEnv * _env,jobject _this,jint target,jint pname,jint param)3003 android_glTexParameteri__III
3004 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3005 glTexParameteri(
3006 (GLenum)target,
3007 (GLenum)pname,
3008 (GLint)param
3009 );
3010 }
3011
3012 /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
3013 static void
android_glTexParameteriv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)3014 android_glTexParameteriv__II_3II
3015 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
3016 jint _exception = 0;
3017 const char * _exceptionType = NULL;
3018 const char * _exceptionMessage = NULL;
3019 GLint *params_base = (GLint *) 0;
3020 jint _remaining;
3021 GLint *params = (GLint *) 0;
3022
3023 if (!params_ref) {
3024 _exception = 1;
3025 _exceptionType = "java/lang/IllegalArgumentException";
3026 _exceptionMessage = "params == null";
3027 goto exit;
3028 }
3029 if (offset < 0) {
3030 _exception = 1;
3031 _exceptionType = "java/lang/IllegalArgumentException";
3032 _exceptionMessage = "offset < 0";
3033 goto exit;
3034 }
3035 _remaining = _env->GetArrayLength(params_ref) - offset;
3036 if (_remaining < 1) {
3037 _exception = 1;
3038 _exceptionType = "java/lang/IllegalArgumentException";
3039 _exceptionMessage = "length - offset < 1 < needed";
3040 goto exit;
3041 }
3042 params_base = (GLint *)
3043 _env->GetIntArrayElements(params_ref, (jboolean *)0);
3044 params = params_base + offset;
3045
3046 glTexParameteriv(
3047 (GLenum)target,
3048 (GLenum)pname,
3049 (GLint *)params
3050 );
3051
3052 exit:
3053 if (params_base) {
3054 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3055 JNI_ABORT);
3056 }
3057 if (_exception) {
3058 jniThrowException(_env, _exceptionType, _exceptionMessage);
3059 }
3060 }
3061
3062 /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
3063 static void
android_glTexParameteriv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)3064 android_glTexParameteriv__IILjava_nio_IntBuffer_2
3065 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3066 jint _exception = 0;
3067 const char * _exceptionType = NULL;
3068 const char * _exceptionMessage = NULL;
3069 jintArray _array = (jintArray) 0;
3070 jint _bufferOffset = (jint) 0;
3071 jint _remaining;
3072 GLint *params = (GLint *) 0;
3073
3074 if (!params_buf) {
3075 _exception = 1;
3076 _exceptionType = "java/lang/IllegalArgumentException";
3077 _exceptionMessage = "params == null";
3078 goto exit;
3079 }
3080 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3081 if (_remaining < 1) {
3082 _exception = 1;
3083 _exceptionType = "java/lang/IllegalArgumentException";
3084 _exceptionMessage = "remaining() < 1 < needed";
3085 goto exit;
3086 }
3087 if (params == NULL) {
3088 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3089 params = (GLint *) (_paramsBase + _bufferOffset);
3090 }
3091 glTexParameteriv(
3092 (GLenum)target,
3093 (GLenum)pname,
3094 (GLint *)params
3095 );
3096
3097 exit:
3098 if (_array) {
3099 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3100 }
3101 if (_exception) {
3102 jniThrowException(_env, _exceptionType, _exceptionMessage);
3103 }
3104 }
3105
3106 /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3107 static void
android_glTexParameterxv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)3108 android_glTexParameterxv__II_3II
3109 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
3110 jint _exception = 0;
3111 const char * _exceptionType = NULL;
3112 const char * _exceptionMessage = NULL;
3113 GLfixed *params_base = (GLfixed *) 0;
3114 jint _remaining;
3115 GLfixed *params = (GLfixed *) 0;
3116
3117 if (!params_ref) {
3118 _exception = 1;
3119 _exceptionType = "java/lang/IllegalArgumentException";
3120 _exceptionMessage = "params == null";
3121 goto exit;
3122 }
3123 if (offset < 0) {
3124 _exception = 1;
3125 _exceptionType = "java/lang/IllegalArgumentException";
3126 _exceptionMessage = "offset < 0";
3127 goto exit;
3128 }
3129 _remaining = _env->GetArrayLength(params_ref) - offset;
3130 if (_remaining < 1) {
3131 _exception = 1;
3132 _exceptionType = "java/lang/IllegalArgumentException";
3133 _exceptionMessage = "length - offset < 1 < needed";
3134 goto exit;
3135 }
3136 params_base = (GLfixed *)
3137 _env->GetIntArrayElements(params_ref, (jboolean *)0);
3138 params = params_base + offset;
3139
3140 glTexParameterxv(
3141 (GLenum)target,
3142 (GLenum)pname,
3143 (GLfixed *)params
3144 );
3145
3146 exit:
3147 if (params_base) {
3148 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3149 JNI_ABORT);
3150 }
3151 if (_exception) {
3152 jniThrowException(_env, _exceptionType, _exceptionMessage);
3153 }
3154 }
3155
3156 /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3157 static void
android_glTexParameterxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)3158 android_glTexParameterxv__IILjava_nio_IntBuffer_2
3159 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3160 jint _exception = 0;
3161 const char * _exceptionType = NULL;
3162 const char * _exceptionMessage = NULL;
3163 jintArray _array = (jintArray) 0;
3164 jint _bufferOffset = (jint) 0;
3165 jint _remaining;
3166 GLfixed *params = (GLfixed *) 0;
3167
3168 if (!params_buf) {
3169 _exception = 1;
3170 _exceptionType = "java/lang/IllegalArgumentException";
3171 _exceptionMessage = "params == null";
3172 goto exit;
3173 }
3174 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3175 if (_remaining < 1) {
3176 _exception = 1;
3177 _exceptionType = "java/lang/IllegalArgumentException";
3178 _exceptionMessage = "remaining() < 1 < needed";
3179 goto exit;
3180 }
3181 if (params == NULL) {
3182 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3183 params = (GLfixed *) (_paramsBase + _bufferOffset);
3184 }
3185 glTexParameterxv(
3186 (GLenum)target,
3187 (GLenum)pname,
3188 (GLfixed *)params
3189 );
3190
3191 exit:
3192 if (_array) {
3193 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3194 }
3195 if (_exception) {
3196 jniThrowException(_env, _exceptionType, _exceptionMessage);
3197 }
3198 }
3199
3200 /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
3201 static void
android_glVertexPointer__IIII(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jint offset)3202 android_glVertexPointer__IIII
3203 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
3204 glVertexPointer(
3205 (GLint)size,
3206 (GLenum)type,
3207 (GLsizei)stride,
3208 reinterpret_cast<GLvoid *>(offset)
3209 );
3210 }
3211
3212 static const char *classPathName = "android/opengl/GLES11";
3213
3214 static const JNINativeMethod methods[] = {
3215 {"_nativeClassInit", "()V", (void*)nativeClassInit },
3216 {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
3217 {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
3218 {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
3219 {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
3220 {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
3221 {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
3222 {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
3223 {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
3224 {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
3225 {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
3226 {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
3227 {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
3228 {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
3229 {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
3230 {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
3231 {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
3232 {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
3233 {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
3234 {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
3235 {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
3236 {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
3237 {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
3238 {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
3239 {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
3240 {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
3241 {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
3242 {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
3243 {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
3244 {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
3245 {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
3246 {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
3247 {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
3248 {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
3249 {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
3250 {"glGetTexEnvfv", "(II[FI)V", (void *) android_glGetTexEnvfv__II_3FI },
3251 {"glGetTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 },
3252 {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
3253 {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
3254 {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
3255 {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
3256 {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
3257 {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
3258 {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
3259 {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
3260 {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
3261 {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
3262 {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
3263 {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
3264 {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
3265 {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
3266 {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
3267 {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
3268 {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
3269 {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
3270 {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
3271 {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
3272 {"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
3273 {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
3274 {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
3275 {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
3276 {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
3277 {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
3278 {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
3279 {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
3280 {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
3281 {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
3282 {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
3283 {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
3284 {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
3285 };
3286
register_android_opengl_jni_GLES11(JNIEnv * _env)3287 int register_android_opengl_jni_GLES11(JNIEnv *_env)
3288 {
3289 int err;
3290 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3291 return err;
3292 }
3293