blob: 0f71b9f59c1583ee4c01e2827fe0b06e62bc4a6e [file] [log] [blame]
Jack Palevich27f80022009-04-15 19:13:17 -07001/*
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#include <android_runtime/AndroidRuntime.h>
21#include <utils/misc.h>
22
23#include <assert.h>
24#include <GLES/gl.h>
Jack Palevichbe509c92009-05-07 09:52:14 -070025#include <GLES/glext.h>
Jack Palevich27f80022009-04-15 19:13:17 -070026
Jack Palevichbe6eac82009-12-08 15:43:51 +080027/* special calls implemented in Android's GLES wrapper used to more
28 * efficiently bound-check passed arrays */
29extern "C" {
30GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, GLsizei stride,
31 const GLvoid *ptr, GLsizei count);
32}
33
Jack Palevich27f80022009-04-15 19:13:17 -070034static int initialized = 0;
35
36static jclass nioAccessClass;
37static jclass bufferClass;
38static jclass OOMEClass;
39static jclass UOEClass;
40static jclass IAEClass;
41static jclass AIOOBEClass;
42static jmethodID getBasePointerID;
43static jmethodID getBaseArrayID;
44static jmethodID getBaseArrayOffsetID;
45static jfieldID positionID;
46static jfieldID limitID;
47static jfieldID elementSizeShiftID;
48
49/* Cache method IDs each time the class is loaded. */
50
51static void
52nativeClassInitBuffer(JNIEnv *_env)
53{
54 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
55 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
56
57 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
58 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
59
60 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
61 "getBasePointer", "(Ljava/nio/Buffer;)J");
62 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
63 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
64 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
65 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
66
67 positionID = _env->GetFieldID(bufferClass, "position", "I");
68 limitID = _env->GetFieldID(bufferClass, "limit", "I");
69 elementSizeShiftID =
70 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
71}
72
73
74static void
75nativeClassInit(JNIEnv *_env, jclass glImplClass)
76{
77 nativeClassInitBuffer(_env);
78
79 jclass IAEClassLocal =
80 _env->FindClass("java/lang/IllegalArgumentException");
81 jclass OOMEClassLocal =
82 _env->FindClass("java/lang/OutOfMemoryError");
83 jclass UOEClassLocal =
84 _env->FindClass("java/lang/UnsupportedOperationException");
85 jclass AIOOBEClassLocal =
86 _env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
87
88 IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
89 OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
90 UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
91 AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
92}
93
94static void *
95getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
96{
97 jint position;
98 jint limit;
99 jint elementSizeShift;
100 jlong pointer;
101 jint offset;
102 void *data;
103
104 position = _env->GetIntField(buffer, positionID);
105 limit = _env->GetIntField(buffer, limitID);
106 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
107 *remaining = (limit - position) << elementSizeShift;
108 pointer = _env->CallStaticLongMethod(nioAccessClass,
109 getBasePointerID, buffer);
110 if (pointer != 0L) {
111 *array = NULL;
112 return (void *) (jint) pointer;
113 }
114
115 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
116 getBaseArrayID, buffer);
117 offset = _env->CallStaticIntMethod(nioAccessClass,
118 getBaseArrayOffsetID, buffer);
119 data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
120
121 return (void *) ((char *) data + offset);
122}
123
124
125static void
126releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
127{
128 _env->ReleasePrimitiveArrayCritical(array, data,
129 commit ? 0 : JNI_ABORT);
130}
131
Jack Palevichbe6eac82009-12-08 15:43:51 +0800132static void *
133getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
134 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
135 if (buf) {
136 jint position = _env->GetIntField(buffer, positionID);
137 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
138 buf += position << elementSizeShift;
139 } else {
140 _env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
141 }
142 return (void*) buf;
143}
144
Jack Palevich27f80022009-04-15 19:13:17 -0700145// --------------------------------------------------------------------------
146
147/* void glBindBuffer ( GLenum target, GLuint buffer ) */
148static void
149android_glBindBuffer__II
150 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
151 glBindBuffer(
152 (GLenum)target,
153 (GLuint)buffer
154 );
155}
156
157/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
158static void
159android_glBufferData__IILjava_nio_Buffer_2I
160 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
161 jarray _array = (jarray) 0;
162 jint _remaining;
163 GLvoid *data = (GLvoid *) 0;
164
165 if (data_buf) {
166 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
Jack Palevichc620a522009-10-21 11:02:44 -0700167 if (_remaining < size) {
168 _env->ThrowNew(IAEClass, "remaining() < size");
169 goto exit;
170 }
Jack Palevich27f80022009-04-15 19:13:17 -0700171 }
172 glBufferData(
173 (GLenum)target,
174 (GLsizeiptr)size,
175 (GLvoid *)data,
176 (GLenum)usage
177 );
Jack Palevichc620a522009-10-21 11:02:44 -0700178
179exit:
Jack Palevich27f80022009-04-15 19:13:17 -0700180 if (_array) {
181 releasePointer(_env, _array, data, JNI_FALSE);
182 }
183}
184
185/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
186static void
187android_glBufferSubData__IIILjava_nio_Buffer_2
188 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
189 jarray _array = (jarray) 0;
190 jint _remaining;
191 GLvoid *data = (GLvoid *) 0;
192
193 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
Jack Palevichc620a522009-10-21 11:02:44 -0700194 if (_remaining < size) {
195 _env->ThrowNew(IAEClass, "remaining() < size");
196 goto exit;
197 }
Jack Palevich27f80022009-04-15 19:13:17 -0700198 glBufferSubData(
199 (GLenum)target,
200 (GLintptr)offset,
201 (GLsizeiptr)size,
202 (GLvoid *)data
203 );
Jack Palevichc620a522009-10-21 11:02:44 -0700204
205exit:
Jack Palevich27f80022009-04-15 19:13:17 -0700206 if (_array) {
207 releasePointer(_env, _array, data, JNI_FALSE);
208 }
209}
210
211/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
212static void
213android_glClipPlanef__I_3FI
214 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
215 GLfloat *equation_base = (GLfloat *) 0;
216 jint _remaining;
217 GLfloat *equation = (GLfloat *) 0;
218
219 if (!equation_ref) {
220 _env->ThrowNew(IAEClass, "equation == null");
221 goto exit;
222 }
223 if (offset < 0) {
224 _env->ThrowNew(IAEClass, "offset < 0");
225 goto exit;
226 }
227 _remaining = _env->GetArrayLength(equation_ref) - offset;
228 equation_base = (GLfloat *)
229 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0);
230 equation = equation_base + offset;
231
232 glClipPlanef(
233 (GLenum)plane,
234 (GLfloat *)equation
235 );
236
237exit:
238 if (equation_base) {
239 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base,
240 JNI_ABORT);
241 }
242}
243
244/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
245static void
246android_glClipPlanef__ILjava_nio_FloatBuffer_2
247 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
248 jarray _array = (jarray) 0;
249 jint _remaining;
250 GLfloat *equation = (GLfloat *) 0;
251
252 equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining);
253 glClipPlanef(
254 (GLenum)plane,
255 (GLfloat *)equation
256 );
257 if (_array) {
258 releasePointer(_env, _array, equation, JNI_FALSE);
259 }
260}
261
262/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
263static void
264android_glClipPlanex__I_3II
265 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
266 GLfixed *equation_base = (GLfixed *) 0;
267 jint _remaining;
268 GLfixed *equation = (GLfixed *) 0;
269
270 if (!equation_ref) {
271 _env->ThrowNew(IAEClass, "equation == null");
272 goto exit;
273 }
274 if (offset < 0) {
275 _env->ThrowNew(IAEClass, "offset < 0");
276 goto exit;
277 }
278 _remaining = _env->GetArrayLength(equation_ref) - offset;
279 equation_base = (GLfixed *)
280 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0);
281 equation = equation_base + offset;
282
283 glClipPlanex(
284 (GLenum)plane,
285 (GLfixed *)equation
286 );
287
288exit:
289 if (equation_base) {
290 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base,
291 JNI_ABORT);
292 }
293}
294
295/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
296static void
297android_glClipPlanex__ILjava_nio_IntBuffer_2
298 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
299 jarray _array = (jarray) 0;
300 jint _remaining;
301 GLfixed *equation = (GLfixed *) 0;
302
303 equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining);
304 glClipPlanex(
305 (GLenum)plane,
306 (GLfixed *)equation
307 );
308 if (_array) {
309 releasePointer(_env, _array, equation, JNI_FALSE);
310 }
311}
312
313/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
314static void
315android_glColor4ub__BBBB
316 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
317 glColor4ub(
318 (GLubyte)red,
319 (GLubyte)green,
320 (GLubyte)blue,
321 (GLubyte)alpha
322 );
323}
324
325/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
326static void
327android_glColorPointer__IIII
328 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
329 glColorPointer(
330 (GLint)size,
331 (GLenum)type,
332 (GLsizei)stride,
333 (const GLvoid *)offset
334 );
335}
336
337/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
338static void
339android_glDeleteBuffers__I_3II
340 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
341 GLuint *buffers_base = (GLuint *) 0;
342 jint _remaining;
343 GLuint *buffers = (GLuint *) 0;
344
345 if (!buffers_ref) {
346 _env->ThrowNew(IAEClass, "buffers == null");
347 goto exit;
348 }
349 if (offset < 0) {
350 _env->ThrowNew(IAEClass, "offset < 0");
351 goto exit;
352 }
353 _remaining = _env->GetArrayLength(buffers_ref) - offset;
354 if (_remaining < n) {
355 _env->ThrowNew(IAEClass, "length - offset < n");
356 goto exit;
357 }
358 buffers_base = (GLuint *)
359 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
360 buffers = buffers_base + offset;
361
362 glDeleteBuffers(
363 (GLsizei)n,
364 (GLuint *)buffers
365 );
366
367exit:
368 if (buffers_base) {
369 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
370 JNI_ABORT);
371 }
372}
373
374/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
375static void
376android_glDeleteBuffers__ILjava_nio_IntBuffer_2
377 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
378 jarray _array = (jarray) 0;
379 jint _remaining;
380 GLuint *buffers = (GLuint *) 0;
381
382 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
383 if (_remaining < n) {
384 _env->ThrowNew(IAEClass, "remaining() < n");
385 goto exit;
386 }
387 glDeleteBuffers(
388 (GLsizei)n,
389 (GLuint *)buffers
390 );
391
392exit:
393 if (_array) {
394 releasePointer(_env, _array, buffers, JNI_FALSE);
395 }
396}
397
398/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
399static void
400android_glDrawElements__IIII
401 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
402 glDrawElements(
403 (GLenum)mode,
404 (GLsizei)count,
405 (GLenum)type,
406 (const GLvoid *)offset
407 );
408}
409
410/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
411static void
412android_glGenBuffers__I_3II
413 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
414 jint _exception = 0;
415 GLuint *buffers_base = (GLuint *) 0;
416 jint _remaining;
417 GLuint *buffers = (GLuint *) 0;
418
419 if (!buffers_ref) {
420 _exception = 1;
421 _env->ThrowNew(IAEClass, "buffers == null");
422 goto exit;
423 }
424 if (offset < 0) {
425 _exception = 1;
426 _env->ThrowNew(IAEClass, "offset < 0");
427 goto exit;
428 }
429 _remaining = _env->GetArrayLength(buffers_ref) - offset;
430 if (_remaining < n) {
431 _exception = 1;
432 _env->ThrowNew(IAEClass, "length - offset < n");
433 goto exit;
434 }
435 buffers_base = (GLuint *)
436 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
437 buffers = buffers_base + offset;
438
439 glGenBuffers(
440 (GLsizei)n,
441 (GLuint *)buffers
442 );
443
444exit:
445 if (buffers_base) {
446 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
447 _exception ? JNI_ABORT: 0);
448 }
449}
450
451/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
452static void
453android_glGenBuffers__ILjava_nio_IntBuffer_2
454 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
455 jint _exception = 0;
456 jarray _array = (jarray) 0;
457 jint _remaining;
458 GLuint *buffers = (GLuint *) 0;
459
460 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
461 if (_remaining < n) {
462 _exception = 1;
463 _env->ThrowNew(IAEClass, "remaining() < n");
464 goto exit;
465 }
466 glGenBuffers(
467 (GLsizei)n,
468 (GLuint *)buffers
469 );
470
471exit:
472 if (_array) {
473 releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE);
474 }
475}
476
477/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
478static void
479android_glGetBooleanv__I_3ZI
480 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
481 jint _exception = 0;
482 GLboolean *params_base = (GLboolean *) 0;
483 jint _remaining;
484 GLboolean *params = (GLboolean *) 0;
485
486 if (!params_ref) {
487 _exception = 1;
488 _env->ThrowNew(IAEClass, "params == null");
489 goto exit;
490 }
491 if (offset < 0) {
492 _exception = 1;
493 _env->ThrowNew(IAEClass, "offset < 0");
494 goto exit;
495 }
496 _remaining = _env->GetArrayLength(params_ref) - offset;
497 params_base = (GLboolean *)
498 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
499 params = params_base + offset;
500
501 glGetBooleanv(
502 (GLenum)pname,
503 (GLboolean *)params
504 );
505
506exit:
507 if (params_base) {
508 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
509 _exception ? JNI_ABORT: 0);
510 }
511}
512
513/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
514static void
515android_glGetBooleanv__ILjava_nio_IntBuffer_2
516 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
517 jint _exception = 0;
518 jarray _array = (jarray) 0;
519 jint _remaining;
520 GLboolean *params = (GLboolean *) 0;
521
522 params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining);
523 glGetBooleanv(
524 (GLenum)pname,
525 (GLboolean *)params
526 );
527 if (_array) {
528 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
529 }
530}
531
532/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
533static void
534android_glGetBufferParameteriv__II_3II
535 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
536 _env->ThrowNew(UOEClass,
537 "glGetBufferParameteriv");
538}
539
540/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
541static void
542android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
543 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
544 _env->ThrowNew(UOEClass,
545 "glGetBufferParameteriv");
546}
547
548/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
549static void
550android_glGetClipPlanef__I_3FI
551 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
552 jint _exception = 0;
553 GLfloat *eqn_base = (GLfloat *) 0;
554 jint _remaining;
555 GLfloat *eqn = (GLfloat *) 0;
556
557 if (!eqn_ref) {
558 _exception = 1;
559 _env->ThrowNew(IAEClass, "eqn == null");
560 goto exit;
561 }
562 if (offset < 0) {
563 _exception = 1;
564 _env->ThrowNew(IAEClass, "offset < 0");
565 goto exit;
566 }
567 _remaining = _env->GetArrayLength(eqn_ref) - offset;
568 eqn_base = (GLfloat *)
569 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
570 eqn = eqn_base + offset;
571
572 glGetClipPlanef(
573 (GLenum)pname,
574 (GLfloat *)eqn
575 );
576
577exit:
578 if (eqn_base) {
579 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base,
580 _exception ? JNI_ABORT: 0);
581 }
582}
583
584/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
585static void
586android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
587 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
588 jint _exception = 0;
589 jarray _array = (jarray) 0;
590 jint _remaining;
591 GLfloat *eqn = (GLfloat *) 0;
592
593 eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining);
594 glGetClipPlanef(
595 (GLenum)pname,
596 (GLfloat *)eqn
597 );
598 if (_array) {
599 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE);
600 }
601}
602
603/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
604static void
605android_glGetClipPlanex__I_3II
606 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
607 jint _exception = 0;
608 GLfixed *eqn_base = (GLfixed *) 0;
609 jint _remaining;
610 GLfixed *eqn = (GLfixed *) 0;
611
612 if (!eqn_ref) {
613 _exception = 1;
614 _env->ThrowNew(IAEClass, "eqn == null");
615 goto exit;
616 }
617 if (offset < 0) {
618 _exception = 1;
619 _env->ThrowNew(IAEClass, "offset < 0");
620 goto exit;
621 }
622 _remaining = _env->GetArrayLength(eqn_ref) - offset;
623 eqn_base = (GLfixed *)
624 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
625 eqn = eqn_base + offset;
626
627 glGetClipPlanex(
628 (GLenum)pname,
629 (GLfixed *)eqn
630 );
631
632exit:
633 if (eqn_base) {
634 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base,
635 _exception ? JNI_ABORT: 0);
636 }
637}
638
639/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
640static void
641android_glGetClipPlanex__ILjava_nio_IntBuffer_2
642 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
643 jint _exception = 0;
644 jarray _array = (jarray) 0;
645 jint _remaining;
646 GLfixed *eqn = (GLfixed *) 0;
647
648 eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining);
649 glGetClipPlanex(
650 (GLenum)pname,
651 (GLfixed *)eqn
652 );
653 if (_array) {
654 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE);
655 }
656}
657
658/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
659static void
660android_glGetFixedv__I_3II
661 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
662 jint _exception = 0;
663 GLfixed *params_base = (GLfixed *) 0;
664 jint _remaining;
665 GLfixed *params = (GLfixed *) 0;
666
667 if (!params_ref) {
668 _exception = 1;
669 _env->ThrowNew(IAEClass, "params == null");
670 goto exit;
671 }
672 if (offset < 0) {
673 _exception = 1;
674 _env->ThrowNew(IAEClass, "offset < 0");
675 goto exit;
676 }
677 _remaining = _env->GetArrayLength(params_ref) - offset;
678 params_base = (GLfixed *)
679 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
680 params = params_base + offset;
681
682 glGetFixedv(
683 (GLenum)pname,
684 (GLfixed *)params
685 );
686
687exit:
688 if (params_base) {
689 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
690 _exception ? JNI_ABORT: 0);
691 }
692}
693
694/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
695static void
696android_glGetFixedv__ILjava_nio_IntBuffer_2
697 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
698 jint _exception = 0;
699 jarray _array = (jarray) 0;
700 jint _remaining;
701 GLfixed *params = (GLfixed *) 0;
702
703 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
704 glGetFixedv(
705 (GLenum)pname,
706 (GLfixed *)params
707 );
708 if (_array) {
709 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
710 }
711}
712
713/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
714static void
715android_glGetFloatv__I_3FI
716 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
717 jint _exception = 0;
718 GLfloat *params_base = (GLfloat *) 0;
719 jint _remaining;
720 GLfloat *params = (GLfloat *) 0;
721
722 if (!params_ref) {
723 _exception = 1;
724 _env->ThrowNew(IAEClass, "params == null");
725 goto exit;
726 }
727 if (offset < 0) {
728 _exception = 1;
729 _env->ThrowNew(IAEClass, "offset < 0");
730 goto exit;
731 }
732 _remaining = _env->GetArrayLength(params_ref) - offset;
733 params_base = (GLfloat *)
734 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
735 params = params_base + offset;
736
737 glGetFloatv(
738 (GLenum)pname,
739 (GLfloat *)params
740 );
741
742exit:
743 if (params_base) {
744 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
745 _exception ? JNI_ABORT: 0);
746 }
747}
748
749/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
750static void
751android_glGetFloatv__ILjava_nio_FloatBuffer_2
752 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
753 jint _exception = 0;
754 jarray _array = (jarray) 0;
755 jint _remaining;
756 GLfloat *params = (GLfloat *) 0;
757
758 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
759 glGetFloatv(
760 (GLenum)pname,
761 (GLfloat *)params
762 );
763 if (_array) {
764 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
765 }
766}
767
768/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
769static void
770android_glGetLightfv__II_3FI
771 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
772 jint _exception = 0;
773 GLfloat *params_base = (GLfloat *) 0;
774 jint _remaining;
775 GLfloat *params = (GLfloat *) 0;
776
777 if (!params_ref) {
778 _exception = 1;
779 _env->ThrowNew(IAEClass, "params == null");
780 goto exit;
781 }
782 if (offset < 0) {
783 _exception = 1;
784 _env->ThrowNew(IAEClass, "offset < 0");
785 goto exit;
786 }
787 _remaining = _env->GetArrayLength(params_ref) - offset;
788 int _needed;
789 switch (pname) {
790#if defined(GL_SPOT_EXPONENT)
791 case GL_SPOT_EXPONENT:
792#endif // defined(GL_SPOT_EXPONENT)
793#if defined(GL_SPOT_CUTOFF)
794 case GL_SPOT_CUTOFF:
795#endif // defined(GL_SPOT_CUTOFF)
796#if defined(GL_CONSTANT_ATTENUATION)
797 case GL_CONSTANT_ATTENUATION:
798#endif // defined(GL_CONSTANT_ATTENUATION)
799#if defined(GL_LINEAR_ATTENUATION)
800 case GL_LINEAR_ATTENUATION:
801#endif // defined(GL_LINEAR_ATTENUATION)
802#if defined(GL_QUADRATIC_ATTENUATION)
803 case GL_QUADRATIC_ATTENUATION:
804#endif // defined(GL_QUADRATIC_ATTENUATION)
805 _needed = 1;
806 break;
807#if defined(GL_SPOT_DIRECTION)
808 case GL_SPOT_DIRECTION:
809#endif // defined(GL_SPOT_DIRECTION)
810 _needed = 3;
811 break;
812#if defined(GL_AMBIENT)
813 case GL_AMBIENT:
814#endif // defined(GL_AMBIENT)
815#if defined(GL_DIFFUSE)
816 case GL_DIFFUSE:
817#endif // defined(GL_DIFFUSE)
818#if defined(GL_SPECULAR)
819 case GL_SPECULAR:
820#endif // defined(GL_SPECULAR)
821#if defined(GL_EMISSION)
822 case GL_EMISSION:
823#endif // defined(GL_EMISSION)
824 _needed = 4;
825 break;
826 default:
827 _needed = 0;
828 break;
829 }
830 if (_remaining < _needed) {
831 _exception = 1;
832 _env->ThrowNew(IAEClass, "length - offset < needed");
833 goto exit;
834 }
835 params_base = (GLfloat *)
836 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
837 params = params_base + offset;
838
839 glGetLightfv(
840 (GLenum)light,
841 (GLenum)pname,
842 (GLfloat *)params
843 );
844
845exit:
846 if (params_base) {
847 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
848 _exception ? JNI_ABORT: 0);
849 }
850}
851
852/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
853static void
854android_glGetLightfv__IILjava_nio_FloatBuffer_2
855 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
856 jint _exception = 0;
857 jarray _array = (jarray) 0;
858 jint _remaining;
859 GLfloat *params = (GLfloat *) 0;
860
861 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
862 int _needed;
863 switch (pname) {
864#if defined(GL_SPOT_EXPONENT)
865 case GL_SPOT_EXPONENT:
866#endif // defined(GL_SPOT_EXPONENT)
867#if defined(GL_SPOT_CUTOFF)
868 case GL_SPOT_CUTOFF:
869#endif // defined(GL_SPOT_CUTOFF)
870#if defined(GL_CONSTANT_ATTENUATION)
871 case GL_CONSTANT_ATTENUATION:
872#endif // defined(GL_CONSTANT_ATTENUATION)
873#if defined(GL_LINEAR_ATTENUATION)
874 case GL_LINEAR_ATTENUATION:
875#endif // defined(GL_LINEAR_ATTENUATION)
876#if defined(GL_QUADRATIC_ATTENUATION)
877 case GL_QUADRATIC_ATTENUATION:
878#endif // defined(GL_QUADRATIC_ATTENUATION)
879 _needed = 1;
880 break;
881#if defined(GL_SPOT_DIRECTION)
882 case GL_SPOT_DIRECTION:
883#endif // defined(GL_SPOT_DIRECTION)
884 _needed = 3;
885 break;
886#if defined(GL_AMBIENT)
887 case GL_AMBIENT:
888#endif // defined(GL_AMBIENT)
889#if defined(GL_DIFFUSE)
890 case GL_DIFFUSE:
891#endif // defined(GL_DIFFUSE)
892#if defined(GL_SPECULAR)
893 case GL_SPECULAR:
894#endif // defined(GL_SPECULAR)
895#if defined(GL_EMISSION)
896 case GL_EMISSION:
897#endif // defined(GL_EMISSION)
898 _needed = 4;
899 break;
900 default:
901 _needed = 0;
902 break;
903 }
904 if (_remaining < _needed) {
905 _exception = 1;
906 _env->ThrowNew(IAEClass, "remaining() < needed");
907 goto exit;
908 }
909 glGetLightfv(
910 (GLenum)light,
911 (GLenum)pname,
912 (GLfloat *)params
913 );
914
915exit:
916 if (_array) {
917 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
918 }
919}
920
921/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
922static void
923android_glGetLightxv__II_3II
924 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
925 jint _exception = 0;
926 GLfixed *params_base = (GLfixed *) 0;
927 jint _remaining;
928 GLfixed *params = (GLfixed *) 0;
929
930 if (!params_ref) {
931 _exception = 1;
932 _env->ThrowNew(IAEClass, "params == null");
933 goto exit;
934 }
935 if (offset < 0) {
936 _exception = 1;
937 _env->ThrowNew(IAEClass, "offset < 0");
938 goto exit;
939 }
940 _remaining = _env->GetArrayLength(params_ref) - offset;
941 int _needed;
942 switch (pname) {
943#if defined(GL_SPOT_EXPONENT)
944 case GL_SPOT_EXPONENT:
945#endif // defined(GL_SPOT_EXPONENT)
946#if defined(GL_SPOT_CUTOFF)
947 case GL_SPOT_CUTOFF:
948#endif // defined(GL_SPOT_CUTOFF)
949#if defined(GL_CONSTANT_ATTENUATION)
950 case GL_CONSTANT_ATTENUATION:
951#endif // defined(GL_CONSTANT_ATTENUATION)
952#if defined(GL_LINEAR_ATTENUATION)
953 case GL_LINEAR_ATTENUATION:
954#endif // defined(GL_LINEAR_ATTENUATION)
955#if defined(GL_QUADRATIC_ATTENUATION)
956 case GL_QUADRATIC_ATTENUATION:
957#endif // defined(GL_QUADRATIC_ATTENUATION)
958 _needed = 1;
959 break;
960#if defined(GL_SPOT_DIRECTION)
961 case GL_SPOT_DIRECTION:
962#endif // defined(GL_SPOT_DIRECTION)
963 _needed = 3;
964 break;
965#if defined(GL_AMBIENT)
966 case GL_AMBIENT:
967#endif // defined(GL_AMBIENT)
968#if defined(GL_DIFFUSE)
969 case GL_DIFFUSE:
970#endif // defined(GL_DIFFUSE)
971#if defined(GL_SPECULAR)
972 case GL_SPECULAR:
973#endif // defined(GL_SPECULAR)
974#if defined(GL_EMISSION)
975 case GL_EMISSION:
976#endif // defined(GL_EMISSION)
977 _needed = 4;
978 break;
979 default:
980 _needed = 0;
981 break;
982 }
983 if (_remaining < _needed) {
984 _exception = 1;
985 _env->ThrowNew(IAEClass, "length - offset < needed");
986 goto exit;
987 }
988 params_base = (GLfixed *)
989 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
990 params = params_base + offset;
991
992 glGetLightxv(
993 (GLenum)light,
994 (GLenum)pname,
995 (GLfixed *)params
996 );
997
998exit:
999 if (params_base) {
1000 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1001 _exception ? JNI_ABORT: 0);
1002 }
1003}
1004
1005/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
1006static void
1007android_glGetLightxv__IILjava_nio_IntBuffer_2
1008 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1009 jint _exception = 0;
1010 jarray _array = (jarray) 0;
1011 jint _remaining;
1012 GLfixed *params = (GLfixed *) 0;
1013
1014 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
1015 int _needed;
1016 switch (pname) {
1017#if defined(GL_SPOT_EXPONENT)
1018 case GL_SPOT_EXPONENT:
1019#endif // defined(GL_SPOT_EXPONENT)
1020#if defined(GL_SPOT_CUTOFF)
1021 case GL_SPOT_CUTOFF:
1022#endif // defined(GL_SPOT_CUTOFF)
1023#if defined(GL_CONSTANT_ATTENUATION)
1024 case GL_CONSTANT_ATTENUATION:
1025#endif // defined(GL_CONSTANT_ATTENUATION)
1026#if defined(GL_LINEAR_ATTENUATION)
1027 case GL_LINEAR_ATTENUATION:
1028#endif // defined(GL_LINEAR_ATTENUATION)
1029#if defined(GL_QUADRATIC_ATTENUATION)
1030 case GL_QUADRATIC_ATTENUATION:
1031#endif // defined(GL_QUADRATIC_ATTENUATION)
1032 _needed = 1;
1033 break;
1034#if defined(GL_SPOT_DIRECTION)
1035 case GL_SPOT_DIRECTION:
1036#endif // defined(GL_SPOT_DIRECTION)
1037 _needed = 3;
1038 break;
1039#if defined(GL_AMBIENT)
1040 case GL_AMBIENT:
1041#endif // defined(GL_AMBIENT)
1042#if defined(GL_DIFFUSE)
1043 case GL_DIFFUSE:
1044#endif // defined(GL_DIFFUSE)
1045#if defined(GL_SPECULAR)
1046 case GL_SPECULAR:
1047#endif // defined(GL_SPECULAR)
1048#if defined(GL_EMISSION)
1049 case GL_EMISSION:
1050#endif // defined(GL_EMISSION)
1051 _needed = 4;
1052 break;
1053 default:
1054 _needed = 0;
1055 break;
1056 }
1057 if (_remaining < _needed) {
1058 _exception = 1;
1059 _env->ThrowNew(IAEClass, "remaining() < needed");
1060 goto exit;
1061 }
1062 glGetLightxv(
1063 (GLenum)light,
1064 (GLenum)pname,
1065 (GLfixed *)params
1066 );
1067
1068exit:
1069 if (_array) {
1070 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1071 }
1072}
1073
1074/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
1075static void
1076android_glGetMaterialfv__II_3FI
1077 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
1078 jint _exception = 0;
1079 GLfloat *params_base = (GLfloat *) 0;
1080 jint _remaining;
1081 GLfloat *params = (GLfloat *) 0;
1082
1083 if (!params_ref) {
1084 _exception = 1;
1085 _env->ThrowNew(IAEClass, "params == null");
1086 goto exit;
1087 }
1088 if (offset < 0) {
1089 _exception = 1;
1090 _env->ThrowNew(IAEClass, "offset < 0");
1091 goto exit;
1092 }
1093 _remaining = _env->GetArrayLength(params_ref) - offset;
1094 int _needed;
1095 switch (pname) {
1096#if defined(GL_SHININESS)
1097 case GL_SHININESS:
1098#endif // defined(GL_SHININESS)
1099 _needed = 1;
1100 break;
1101#if defined(GL_AMBIENT)
1102 case GL_AMBIENT:
1103#endif // defined(GL_AMBIENT)
1104#if defined(GL_DIFFUSE)
1105 case GL_DIFFUSE:
1106#endif // defined(GL_DIFFUSE)
1107#if defined(GL_SPECULAR)
1108 case GL_SPECULAR:
1109#endif // defined(GL_SPECULAR)
1110#if defined(GL_EMISSION)
1111 case GL_EMISSION:
1112#endif // defined(GL_EMISSION)
1113#if defined(GL_AMBIENT_AND_DIFFUSE)
1114 case GL_AMBIENT_AND_DIFFUSE:
1115#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1116 _needed = 4;
1117 break;
1118 default:
1119 _needed = 0;
1120 break;
1121 }
1122 if (_remaining < _needed) {
1123 _exception = 1;
1124 _env->ThrowNew(IAEClass, "length - offset < needed");
1125 goto exit;
1126 }
1127 params_base = (GLfloat *)
1128 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1129 params = params_base + offset;
1130
1131 glGetMaterialfv(
1132 (GLenum)face,
1133 (GLenum)pname,
1134 (GLfloat *)params
1135 );
1136
1137exit:
1138 if (params_base) {
1139 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1140 _exception ? JNI_ABORT: 0);
1141 }
1142}
1143
1144/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
1145static void
1146android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
1147 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
1148 jint _exception = 0;
1149 jarray _array = (jarray) 0;
1150 jint _remaining;
1151 GLfloat *params = (GLfloat *) 0;
1152
1153 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
1154 int _needed;
1155 switch (pname) {
1156#if defined(GL_SHININESS)
1157 case GL_SHININESS:
1158#endif // defined(GL_SHININESS)
1159 _needed = 1;
1160 break;
1161#if defined(GL_AMBIENT)
1162 case GL_AMBIENT:
1163#endif // defined(GL_AMBIENT)
1164#if defined(GL_DIFFUSE)
1165 case GL_DIFFUSE:
1166#endif // defined(GL_DIFFUSE)
1167#if defined(GL_SPECULAR)
1168 case GL_SPECULAR:
1169#endif // defined(GL_SPECULAR)
1170#if defined(GL_EMISSION)
1171 case GL_EMISSION:
1172#endif // defined(GL_EMISSION)
1173#if defined(GL_AMBIENT_AND_DIFFUSE)
1174 case GL_AMBIENT_AND_DIFFUSE:
1175#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1176 _needed = 4;
1177 break;
1178 default:
1179 _needed = 0;
1180 break;
1181 }
1182 if (_remaining < _needed) {
1183 _exception = 1;
1184 _env->ThrowNew(IAEClass, "remaining() < needed");
1185 goto exit;
1186 }
1187 glGetMaterialfv(
1188 (GLenum)face,
1189 (GLenum)pname,
1190 (GLfloat *)params
1191 );
1192
1193exit:
1194 if (_array) {
1195 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1196 }
1197}
1198
1199/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
1200static void
1201android_glGetMaterialxv__II_3II
1202 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
1203 jint _exception = 0;
1204 GLfixed *params_base = (GLfixed *) 0;
1205 jint _remaining;
1206 GLfixed *params = (GLfixed *) 0;
1207
1208 if (!params_ref) {
1209 _exception = 1;
1210 _env->ThrowNew(IAEClass, "params == null");
1211 goto exit;
1212 }
1213 if (offset < 0) {
1214 _exception = 1;
1215 _env->ThrowNew(IAEClass, "offset < 0");
1216 goto exit;
1217 }
1218 _remaining = _env->GetArrayLength(params_ref) - offset;
1219 int _needed;
1220 switch (pname) {
1221#if defined(GL_SHININESS)
1222 case GL_SHININESS:
1223#endif // defined(GL_SHININESS)
1224 _needed = 1;
1225 break;
1226#if defined(GL_AMBIENT)
1227 case GL_AMBIENT:
1228#endif // defined(GL_AMBIENT)
1229#if defined(GL_DIFFUSE)
1230 case GL_DIFFUSE:
1231#endif // defined(GL_DIFFUSE)
1232#if defined(GL_SPECULAR)
1233 case GL_SPECULAR:
1234#endif // defined(GL_SPECULAR)
1235#if defined(GL_EMISSION)
1236 case GL_EMISSION:
1237#endif // defined(GL_EMISSION)
1238#if defined(GL_AMBIENT_AND_DIFFUSE)
1239 case GL_AMBIENT_AND_DIFFUSE:
1240#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1241 _needed = 4;
1242 break;
1243 default:
1244 _needed = 0;
1245 break;
1246 }
1247 if (_remaining < _needed) {
1248 _exception = 1;
1249 _env->ThrowNew(IAEClass, "length - offset < needed");
1250 goto exit;
1251 }
1252 params_base = (GLfixed *)
1253 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1254 params = params_base + offset;
1255
1256 glGetMaterialxv(
1257 (GLenum)face,
1258 (GLenum)pname,
1259 (GLfixed *)params
1260 );
1261
1262exit:
1263 if (params_base) {
1264 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1265 _exception ? JNI_ABORT: 0);
1266 }
1267}
1268
1269/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
1270static void
1271android_glGetMaterialxv__IILjava_nio_IntBuffer_2
1272 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
1273 jint _exception = 0;
1274 jarray _array = (jarray) 0;
1275 jint _remaining;
1276 GLfixed *params = (GLfixed *) 0;
1277
1278 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
1279 int _needed;
1280 switch (pname) {
1281#if defined(GL_SHININESS)
1282 case GL_SHININESS:
1283#endif // defined(GL_SHININESS)
1284 _needed = 1;
1285 break;
1286#if defined(GL_AMBIENT)
1287 case GL_AMBIENT:
1288#endif // defined(GL_AMBIENT)
1289#if defined(GL_DIFFUSE)
1290 case GL_DIFFUSE:
1291#endif // defined(GL_DIFFUSE)
1292#if defined(GL_SPECULAR)
1293 case GL_SPECULAR:
1294#endif // defined(GL_SPECULAR)
1295#if defined(GL_EMISSION)
1296 case GL_EMISSION:
1297#endif // defined(GL_EMISSION)
1298#if defined(GL_AMBIENT_AND_DIFFUSE)
1299 case GL_AMBIENT_AND_DIFFUSE:
1300#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1301 _needed = 4;
1302 break;
1303 default:
1304 _needed = 0;
1305 break;
1306 }
1307 if (_remaining < _needed) {
1308 _exception = 1;
1309 _env->ThrowNew(IAEClass, "remaining() < needed");
1310 goto exit;
1311 }
1312 glGetMaterialxv(
1313 (GLenum)face,
1314 (GLenum)pname,
1315 (GLfixed *)params
1316 );
1317
1318exit:
1319 if (_array) {
1320 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1321 }
1322}
1323
1324/* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */
1325static void
1326android_glGetTexEnvfv__II_3FI
1327 (JNIEnv *_env, jobject _this, jint env, jint pname, jfloatArray params_ref, jint offset) {
1328 jint _exception = 0;
1329 GLfloat *params_base = (GLfloat *) 0;
1330 jint _remaining;
1331 GLfloat *params = (GLfloat *) 0;
1332
1333 if (!params_ref) {
1334 _exception = 1;
1335 _env->ThrowNew(IAEClass, "params == null");
1336 goto exit;
1337 }
1338 if (offset < 0) {
1339 _exception = 1;
1340 _env->ThrowNew(IAEClass, "offset < 0");
1341 goto exit;
1342 }
1343 _remaining = _env->GetArrayLength(params_ref) - offset;
1344 int _needed;
1345 switch (pname) {
1346#if defined(GL_TEXTURE_ENV_MODE)
1347 case GL_TEXTURE_ENV_MODE:
1348#endif // defined(GL_TEXTURE_ENV_MODE)
1349#if defined(GL_COMBINE_RGB)
1350 case GL_COMBINE_RGB:
1351#endif // defined(GL_COMBINE_RGB)
1352#if defined(GL_COMBINE_ALPHA)
1353 case GL_COMBINE_ALPHA:
1354#endif // defined(GL_COMBINE_ALPHA)
1355 _needed = 1;
1356 break;
1357#if defined(GL_TEXTURE_ENV_COLOR)
1358 case GL_TEXTURE_ENV_COLOR:
1359#endif // defined(GL_TEXTURE_ENV_COLOR)
1360 _needed = 4;
1361 break;
1362 default:
1363 _needed = 0;
1364 break;
1365 }
1366 if (_remaining < _needed) {
1367 _exception = 1;
1368 _env->ThrowNew(IAEClass, "length - offset < needed");
1369 goto exit;
1370 }
1371 params_base = (GLfloat *)
1372 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1373 params = params_base + offset;
1374
1375 glGetTexEnvfv(
1376 (GLenum)env,
1377 (GLenum)pname,
1378 (GLfloat *)params
1379 );
1380
1381exit:
1382 if (params_base) {
1383 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1384 _exception ? JNI_ABORT: 0);
1385 }
1386}
1387
1388/* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */
1389static void
1390android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2
1391 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
1392 jint _exception = 0;
1393 jarray _array = (jarray) 0;
1394 jint _remaining;
1395 GLfloat *params = (GLfloat *) 0;
1396
1397 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
1398 int _needed;
1399 switch (pname) {
1400#if defined(GL_TEXTURE_ENV_MODE)
1401 case GL_TEXTURE_ENV_MODE:
1402#endif // defined(GL_TEXTURE_ENV_MODE)
1403#if defined(GL_COMBINE_RGB)
1404 case GL_COMBINE_RGB:
1405#endif // defined(GL_COMBINE_RGB)
1406#if defined(GL_COMBINE_ALPHA)
1407 case GL_COMBINE_ALPHA:
1408#endif // defined(GL_COMBINE_ALPHA)
1409 _needed = 1;
1410 break;
1411#if defined(GL_TEXTURE_ENV_COLOR)
1412 case GL_TEXTURE_ENV_COLOR:
1413#endif // defined(GL_TEXTURE_ENV_COLOR)
1414 _needed = 4;
1415 break;
1416 default:
1417 _needed = 0;
1418 break;
1419 }
1420 if (_remaining < _needed) {
1421 _exception = 1;
1422 _env->ThrowNew(IAEClass, "remaining() < needed");
1423 goto exit;
1424 }
1425 glGetTexEnvfv(
1426 (GLenum)env,
1427 (GLenum)pname,
1428 (GLfloat *)params
1429 );
1430
1431exit:
1432 if (_array) {
1433 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1434 }
1435}
1436
1437/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
1438static void
1439android_glGetTexEnviv__II_3II
1440 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
1441 jint _exception = 0;
1442 GLint *params_base = (GLint *) 0;
1443 jint _remaining;
1444 GLint *params = (GLint *) 0;
1445
1446 if (!params_ref) {
1447 _exception = 1;
1448 _env->ThrowNew(IAEClass, "params == null");
1449 goto exit;
1450 }
1451 if (offset < 0) {
1452 _exception = 1;
1453 _env->ThrowNew(IAEClass, "offset < 0");
1454 goto exit;
1455 }
1456 _remaining = _env->GetArrayLength(params_ref) - offset;
1457 int _needed;
1458 switch (pname) {
1459#if defined(GL_TEXTURE_ENV_MODE)
1460 case GL_TEXTURE_ENV_MODE:
1461#endif // defined(GL_TEXTURE_ENV_MODE)
1462#if defined(GL_COMBINE_RGB)
1463 case GL_COMBINE_RGB:
1464#endif // defined(GL_COMBINE_RGB)
1465#if defined(GL_COMBINE_ALPHA)
1466 case GL_COMBINE_ALPHA:
1467#endif // defined(GL_COMBINE_ALPHA)
1468 _needed = 1;
1469 break;
1470#if defined(GL_TEXTURE_ENV_COLOR)
1471 case GL_TEXTURE_ENV_COLOR:
1472#endif // defined(GL_TEXTURE_ENV_COLOR)
1473 _needed = 4;
1474 break;
1475 default:
1476 _needed = 0;
1477 break;
1478 }
1479 if (_remaining < _needed) {
1480 _exception = 1;
1481 _env->ThrowNew(IAEClass, "length - offset < needed");
1482 goto exit;
1483 }
1484 params_base = (GLint *)
1485 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1486 params = params_base + offset;
1487
1488 glGetTexEnviv(
1489 (GLenum)env,
1490 (GLenum)pname,
1491 (GLint *)params
1492 );
1493
1494exit:
1495 if (params_base) {
1496 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1497 _exception ? JNI_ABORT: 0);
1498 }
1499}
1500
1501/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
1502static void
1503android_glGetTexEnviv__IILjava_nio_IntBuffer_2
1504 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
1505 jint _exception = 0;
1506 jarray _array = (jarray) 0;
1507 jint _remaining;
1508 GLint *params = (GLint *) 0;
1509
1510 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
1511 int _needed;
1512 switch (pname) {
1513#if defined(GL_TEXTURE_ENV_MODE)
1514 case GL_TEXTURE_ENV_MODE:
1515#endif // defined(GL_TEXTURE_ENV_MODE)
1516#if defined(GL_COMBINE_RGB)
1517 case GL_COMBINE_RGB:
1518#endif // defined(GL_COMBINE_RGB)
1519#if defined(GL_COMBINE_ALPHA)
1520 case GL_COMBINE_ALPHA:
1521#endif // defined(GL_COMBINE_ALPHA)
1522 _needed = 1;
1523 break;
1524#if defined(GL_TEXTURE_ENV_COLOR)
1525 case GL_TEXTURE_ENV_COLOR:
1526#endif // defined(GL_TEXTURE_ENV_COLOR)
1527 _needed = 4;
1528 break;
1529 default:
1530 _needed = 0;
1531 break;
1532 }
1533 if (_remaining < _needed) {
1534 _exception = 1;
1535 _env->ThrowNew(IAEClass, "remaining() < needed");
1536 goto exit;
1537 }
1538 glGetTexEnviv(
1539 (GLenum)env,
1540 (GLenum)pname,
1541 (GLint *)params
1542 );
1543
1544exit:
1545 if (_array) {
1546 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1547 }
1548}
1549
1550/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
1551static void
1552android_glGetTexEnvxv__II_3II
1553 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
1554 jint _exception = 0;
1555 GLfixed *params_base = (GLfixed *) 0;
1556 jint _remaining;
1557 GLfixed *params = (GLfixed *) 0;
1558
1559 if (!params_ref) {
1560 _exception = 1;
1561 _env->ThrowNew(IAEClass, "params == null");
1562 goto exit;
1563 }
1564 if (offset < 0) {
1565 _exception = 1;
1566 _env->ThrowNew(IAEClass, "offset < 0");
1567 goto exit;
1568 }
1569 _remaining = _env->GetArrayLength(params_ref) - offset;
1570 int _needed;
1571 switch (pname) {
1572#if defined(GL_TEXTURE_ENV_MODE)
1573 case GL_TEXTURE_ENV_MODE:
1574#endif // defined(GL_TEXTURE_ENV_MODE)
1575#if defined(GL_COMBINE_RGB)
1576 case GL_COMBINE_RGB:
1577#endif // defined(GL_COMBINE_RGB)
1578#if defined(GL_COMBINE_ALPHA)
1579 case GL_COMBINE_ALPHA:
1580#endif // defined(GL_COMBINE_ALPHA)
1581 _needed = 1;
1582 break;
1583#if defined(GL_TEXTURE_ENV_COLOR)
1584 case GL_TEXTURE_ENV_COLOR:
1585#endif // defined(GL_TEXTURE_ENV_COLOR)
1586 _needed = 4;
1587 break;
1588 default:
1589 _needed = 0;
1590 break;
1591 }
1592 if (_remaining < _needed) {
1593 _exception = 1;
1594 _env->ThrowNew(IAEClass, "length - offset < needed");
1595 goto exit;
1596 }
1597 params_base = (GLfixed *)
1598 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1599 params = params_base + offset;
1600
1601 glGetTexEnvxv(
1602 (GLenum)env,
1603 (GLenum)pname,
1604 (GLfixed *)params
1605 );
1606
1607exit:
1608 if (params_base) {
1609 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1610 _exception ? JNI_ABORT: 0);
1611 }
1612}
1613
1614/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
1615static void
1616android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
1617 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
1618 jint _exception = 0;
1619 jarray _array = (jarray) 0;
1620 jint _remaining;
1621 GLfixed *params = (GLfixed *) 0;
1622
1623 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
1624 int _needed;
1625 switch (pname) {
1626#if defined(GL_TEXTURE_ENV_MODE)
1627 case GL_TEXTURE_ENV_MODE:
1628#endif // defined(GL_TEXTURE_ENV_MODE)
1629#if defined(GL_COMBINE_RGB)
1630 case GL_COMBINE_RGB:
1631#endif // defined(GL_COMBINE_RGB)
1632#if defined(GL_COMBINE_ALPHA)
1633 case GL_COMBINE_ALPHA:
1634#endif // defined(GL_COMBINE_ALPHA)
1635 _needed = 1;
1636 break;
1637#if defined(GL_TEXTURE_ENV_COLOR)
1638 case GL_TEXTURE_ENV_COLOR:
1639#endif // defined(GL_TEXTURE_ENV_COLOR)
1640 _needed = 4;
1641 break;
1642 default:
1643 _needed = 0;
1644 break;
1645 }
1646 if (_remaining < _needed) {
1647 _exception = 1;
1648 _env->ThrowNew(IAEClass, "remaining() < needed");
1649 goto exit;
1650 }
1651 glGetTexEnvxv(
1652 (GLenum)env,
1653 (GLenum)pname,
1654 (GLfixed *)params
1655 );
1656
1657exit:
1658 if (_array) {
1659 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1660 }
1661}
1662
1663/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
1664static void
1665android_glGetTexParameterfv__II_3FI
1666 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
1667 jint _exception = 0;
1668 GLfloat *params_base = (GLfloat *) 0;
1669 jint _remaining;
1670 GLfloat *params = (GLfloat *) 0;
1671
1672 if (!params_ref) {
1673 _exception = 1;
1674 _env->ThrowNew(IAEClass, "params == null");
1675 goto exit;
1676 }
1677 if (offset < 0) {
1678 _exception = 1;
1679 _env->ThrowNew(IAEClass, "offset < 0");
1680 goto exit;
1681 }
1682 _remaining = _env->GetArrayLength(params_ref) - offset;
1683 if (_remaining < 1) {
1684 _exception = 1;
1685 _env->ThrowNew(IAEClass, "length - offset < 1");
1686 goto exit;
1687 }
1688 params_base = (GLfloat *)
1689 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1690 params = params_base + offset;
1691
1692 glGetTexParameterfv(
1693 (GLenum)target,
1694 (GLenum)pname,
1695 (GLfloat *)params
1696 );
1697
1698exit:
1699 if (params_base) {
1700 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1701 _exception ? JNI_ABORT: 0);
1702 }
1703}
1704
1705/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
1706static void
1707android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
1708 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
1709 jint _exception = 0;
1710 jarray _array = (jarray) 0;
1711 jint _remaining;
1712 GLfloat *params = (GLfloat *) 0;
1713
1714 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
1715 if (_remaining < 1) {
1716 _exception = 1;
1717 _env->ThrowNew(IAEClass, "remaining() < 1");
1718 goto exit;
1719 }
1720 glGetTexParameterfv(
1721 (GLenum)target,
1722 (GLenum)pname,
1723 (GLfloat *)params
1724 );
1725
1726exit:
1727 if (_array) {
1728 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1729 }
1730}
1731
1732/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
1733static void
1734android_glGetTexParameteriv__II_3II
1735 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1736 jint _exception = 0;
1737 GLint *params_base = (GLint *) 0;
1738 jint _remaining;
1739 GLint *params = (GLint *) 0;
1740
1741 if (!params_ref) {
1742 _exception = 1;
1743 _env->ThrowNew(IAEClass, "params == null");
1744 goto exit;
1745 }
1746 if (offset < 0) {
1747 _exception = 1;
1748 _env->ThrowNew(IAEClass, "offset < 0");
1749 goto exit;
1750 }
1751 _remaining = _env->GetArrayLength(params_ref) - offset;
1752 if (_remaining < 1) {
1753 _exception = 1;
1754 _env->ThrowNew(IAEClass, "length - offset < 1");
1755 goto exit;
1756 }
1757 params_base = (GLint *)
1758 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1759 params = params_base + offset;
1760
1761 glGetTexParameteriv(
1762 (GLenum)target,
1763 (GLenum)pname,
1764 (GLint *)params
1765 );
1766
1767exit:
1768 if (params_base) {
1769 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1770 _exception ? JNI_ABORT: 0);
1771 }
1772}
1773
1774/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
1775static void
1776android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
1777 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
1778 jint _exception = 0;
1779 jarray _array = (jarray) 0;
1780 jint _remaining;
1781 GLint *params = (GLint *) 0;
1782
1783 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
1784 if (_remaining < 1) {
1785 _exception = 1;
1786 _env->ThrowNew(IAEClass, "remaining() < 1");
1787 goto exit;
1788 }
1789 glGetTexParameteriv(
1790 (GLenum)target,
1791 (GLenum)pname,
1792 (GLint *)params
1793 );
1794
1795exit:
1796 if (_array) {
1797 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1798 }
1799}
1800
1801/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
1802static void
1803android_glGetTexParameterxv__II_3II
1804 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1805 jint _exception = 0;
1806 GLfixed *params_base = (GLfixed *) 0;
1807 jint _remaining;
1808 GLfixed *params = (GLfixed *) 0;
1809
1810 if (!params_ref) {
1811 _exception = 1;
1812 _env->ThrowNew(IAEClass, "params == null");
1813 goto exit;
1814 }
1815 if (offset < 0) {
1816 _exception = 1;
1817 _env->ThrowNew(IAEClass, "offset < 0");
1818 goto exit;
1819 }
1820 _remaining = _env->GetArrayLength(params_ref) - offset;
1821 if (_remaining < 1) {
1822 _exception = 1;
1823 _env->ThrowNew(IAEClass, "length - offset < 1");
1824 goto exit;
1825 }
1826 params_base = (GLfixed *)
1827 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1828 params = params_base + offset;
1829
1830 glGetTexParameterxv(
1831 (GLenum)target,
1832 (GLenum)pname,
1833 (GLfixed *)params
1834 );
1835
1836exit:
1837 if (params_base) {
1838 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1839 _exception ? JNI_ABORT: 0);
1840 }
1841}
1842
1843/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
1844static void
1845android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
1846 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
1847 jint _exception = 0;
1848 jarray _array = (jarray) 0;
1849 jint _remaining;
1850 GLfixed *params = (GLfixed *) 0;
1851
1852 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
1853 if (_remaining < 1) {
1854 _exception = 1;
1855 _env->ThrowNew(IAEClass, "remaining() < 1");
1856 goto exit;
1857 }
1858 glGetTexParameterxv(
1859 (GLenum)target,
1860 (GLenum)pname,
1861 (GLfixed *)params
1862 );
1863
1864exit:
1865 if (_array) {
1866 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1867 }
1868}
1869
1870/* GLboolean glIsBuffer ( GLuint buffer ) */
1871static jboolean
1872android_glIsBuffer__I
1873 (JNIEnv *_env, jobject _this, jint buffer) {
1874 GLboolean _returnValue;
1875 _returnValue = glIsBuffer(
1876 (GLuint)buffer
1877 );
1878 return _returnValue;
1879}
1880
1881/* GLboolean glIsEnabled ( GLenum cap ) */
1882static jboolean
1883android_glIsEnabled__I
1884 (JNIEnv *_env, jobject _this, jint cap) {
1885 GLboolean _returnValue;
1886 _returnValue = glIsEnabled(
1887 (GLenum)cap
1888 );
1889 return _returnValue;
1890}
1891
1892/* GLboolean glIsTexture ( GLuint texture ) */
1893static jboolean
1894android_glIsTexture__I
1895 (JNIEnv *_env, jobject _this, jint texture) {
1896 GLboolean _returnValue;
1897 _returnValue = glIsTexture(
1898 (GLuint)texture
1899 );
1900 return _returnValue;
1901}
1902
1903/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
1904static void
1905android_glNormalPointer__III
1906 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
1907 glNormalPointer(
1908 (GLenum)type,
1909 (GLsizei)stride,
1910 (const GLvoid *)offset
1911 );
1912}
1913
1914/* void glPointParameterf ( GLenum pname, GLfloat param ) */
1915static void
1916android_glPointParameterf__IF
1917 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1918 glPointParameterf(
1919 (GLenum)pname,
1920 (GLfloat)param
1921 );
1922}
1923
1924/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
1925static void
1926android_glPointParameterfv__I_3FI
1927 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
1928 GLfloat *params_base = (GLfloat *) 0;
1929 jint _remaining;
1930 GLfloat *params = (GLfloat *) 0;
1931
1932 if (!params_ref) {
1933 _env->ThrowNew(IAEClass, "params == null");
1934 goto exit;
1935 }
1936 if (offset < 0) {
1937 _env->ThrowNew(IAEClass, "offset < 0");
1938 goto exit;
1939 }
1940 _remaining = _env->GetArrayLength(params_ref) - offset;
1941 if (_remaining < 1) {
1942 _env->ThrowNew(IAEClass, "length - offset < 1");
1943 goto exit;
1944 }
1945 params_base = (GLfloat *)
1946 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1947 params = params_base + offset;
1948
1949 glPointParameterfv(
1950 (GLenum)pname,
1951 (GLfloat *)params
1952 );
1953
1954exit:
1955 if (params_base) {
1956 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1957 JNI_ABORT);
1958 }
1959}
1960
1961/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
1962static void
1963android_glPointParameterfv__ILjava_nio_FloatBuffer_2
1964 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1965 jarray _array = (jarray) 0;
1966 jint _remaining;
1967 GLfloat *params = (GLfloat *) 0;
1968
1969 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
1970 if (_remaining < 1) {
1971 _env->ThrowNew(IAEClass, "remaining() < 1");
1972 goto exit;
1973 }
1974 glPointParameterfv(
1975 (GLenum)pname,
1976 (GLfloat *)params
1977 );
1978
1979exit:
1980 if (_array) {
1981 releasePointer(_env, _array, params, JNI_FALSE);
1982 }
1983}
1984
1985/* void glPointParameterx ( GLenum pname, GLfixed param ) */
1986static void
1987android_glPointParameterx__II
1988 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1989 glPointParameterx(
1990 (GLenum)pname,
1991 (GLfixed)param
1992 );
1993}
1994
1995/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
1996static void
1997android_glPointParameterxv__I_3II
1998 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1999 GLfixed *params_base = (GLfixed *) 0;
2000 jint _remaining;
2001 GLfixed *params = (GLfixed *) 0;
2002
2003 if (!params_ref) {
2004 _env->ThrowNew(IAEClass, "params == null");
2005 goto exit;
2006 }
2007 if (offset < 0) {
2008 _env->ThrowNew(IAEClass, "offset < 0");
2009 goto exit;
2010 }
2011 _remaining = _env->GetArrayLength(params_ref) - offset;
2012 if (_remaining < 1) {
2013 _env->ThrowNew(IAEClass, "length - offset < 1");
2014 goto exit;
2015 }
2016 params_base = (GLfixed *)
2017 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2018 params = params_base + offset;
2019
2020 glPointParameterxv(
2021 (GLenum)pname,
2022 (GLfixed *)params
2023 );
2024
2025exit:
2026 if (params_base) {
2027 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2028 JNI_ABORT);
2029 }
2030}
2031
2032/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
2033static void
2034android_glPointParameterxv__ILjava_nio_IntBuffer_2
2035 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2036 jarray _array = (jarray) 0;
2037 jint _remaining;
2038 GLfixed *params = (GLfixed *) 0;
2039
2040 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
2041 if (_remaining < 1) {
2042 _env->ThrowNew(IAEClass, "remaining() < 1");
2043 goto exit;
2044 }
2045 glPointParameterxv(
2046 (GLenum)pname,
2047 (GLfixed *)params
2048 );
2049
2050exit:
2051 if (_array) {
2052 releasePointer(_env, _array, params, JNI_FALSE);
2053 }
2054}
2055
2056/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2057static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08002058android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
2059 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Jack Palevich27f80022009-04-15 19:13:17 -07002060 jarray _array = (jarray) 0;
2061 jint _remaining;
2062 GLvoid *pointer = (GLvoid *) 0;
2063
Jack Palevichbe6eac82009-12-08 15:43:51 +08002064 if (pointer_buf) {
2065 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2066 if ( ! pointer ) {
2067 return;
2068 }
2069 }
2070 glPointSizePointerOESBounds(
Jack Palevich27f80022009-04-15 19:13:17 -07002071 (GLenum)type,
2072 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08002073 (GLvoid *)pointer,
2074 (GLsizei)remaining
Jack Palevich27f80022009-04-15 19:13:17 -07002075 );
Jack Palevich27f80022009-04-15 19:13:17 -07002076}
2077
2078/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
2079static void
2080android_glTexCoordPointer__IIII
2081 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
2082 glTexCoordPointer(
2083 (GLint)size,
2084 (GLenum)type,
2085 (GLsizei)stride,
2086 (const GLvoid *)offset
2087 );
2088}
2089
2090/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
2091static void
2092android_glTexEnvi__III
2093 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2094 glTexEnvi(
2095 (GLenum)target,
2096 (GLenum)pname,
2097 (GLint)param
2098 );
2099}
2100
2101/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
2102static void
2103android_glTexEnviv__II_3II
2104 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2105 GLint *params_base = (GLint *) 0;
2106 jint _remaining;
2107 GLint *params = (GLint *) 0;
2108
2109 if (!params_ref) {
2110 _env->ThrowNew(IAEClass, "params == null");
2111 goto exit;
2112 }
2113 if (offset < 0) {
2114 _env->ThrowNew(IAEClass, "offset < 0");
2115 goto exit;
2116 }
2117 _remaining = _env->GetArrayLength(params_ref) - offset;
2118 int _needed;
2119 switch (pname) {
2120#if defined(GL_TEXTURE_ENV_MODE)
2121 case GL_TEXTURE_ENV_MODE:
2122#endif // defined(GL_TEXTURE_ENV_MODE)
2123#if defined(GL_COMBINE_RGB)
2124 case GL_COMBINE_RGB:
2125#endif // defined(GL_COMBINE_RGB)
2126#if defined(GL_COMBINE_ALPHA)
2127 case GL_COMBINE_ALPHA:
2128#endif // defined(GL_COMBINE_ALPHA)
2129 _needed = 1;
2130 break;
2131#if defined(GL_TEXTURE_ENV_COLOR)
2132 case GL_TEXTURE_ENV_COLOR:
2133#endif // defined(GL_TEXTURE_ENV_COLOR)
2134 _needed = 4;
2135 break;
2136 default:
2137 _needed = 0;
2138 break;
2139 }
2140 if (_remaining < _needed) {
2141 _env->ThrowNew(IAEClass, "length - offset < needed");
2142 goto exit;
2143 }
2144 params_base = (GLint *)
2145 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2146 params = params_base + offset;
2147
2148 glTexEnviv(
2149 (GLenum)target,
2150 (GLenum)pname,
2151 (GLint *)params
2152 );
2153
2154exit:
2155 if (params_base) {
2156 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2157 JNI_ABORT);
2158 }
2159}
2160
2161/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
2162static void
2163android_glTexEnviv__IILjava_nio_IntBuffer_2
2164 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2165 jarray _array = (jarray) 0;
2166 jint _remaining;
2167 GLint *params = (GLint *) 0;
2168
2169 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2170 int _needed;
2171 switch (pname) {
2172#if defined(GL_TEXTURE_ENV_MODE)
2173 case GL_TEXTURE_ENV_MODE:
2174#endif // defined(GL_TEXTURE_ENV_MODE)
2175#if defined(GL_COMBINE_RGB)
2176 case GL_COMBINE_RGB:
2177#endif // defined(GL_COMBINE_RGB)
2178#if defined(GL_COMBINE_ALPHA)
2179 case GL_COMBINE_ALPHA:
2180#endif // defined(GL_COMBINE_ALPHA)
2181 _needed = 1;
2182 break;
2183#if defined(GL_TEXTURE_ENV_COLOR)
2184 case GL_TEXTURE_ENV_COLOR:
2185#endif // defined(GL_TEXTURE_ENV_COLOR)
2186 _needed = 4;
2187 break;
2188 default:
2189 _needed = 0;
2190 break;
2191 }
2192 if (_remaining < _needed) {
2193 _env->ThrowNew(IAEClass, "remaining() < needed");
2194 goto exit;
2195 }
2196 glTexEnviv(
2197 (GLenum)target,
2198 (GLenum)pname,
2199 (GLint *)params
2200 );
2201
2202exit:
2203 if (_array) {
2204 releasePointer(_env, _array, params, JNI_FALSE);
2205 }
2206}
2207
2208/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2209static void
2210android_glTexParameterfv__II_3FI
2211 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2212 GLfloat *params_base = (GLfloat *) 0;
2213 jint _remaining;
2214 GLfloat *params = (GLfloat *) 0;
2215
2216 if (!params_ref) {
2217 _env->ThrowNew(IAEClass, "params == null");
2218 goto exit;
2219 }
2220 if (offset < 0) {
2221 _env->ThrowNew(IAEClass, "offset < 0");
2222 goto exit;
2223 }
2224 _remaining = _env->GetArrayLength(params_ref) - offset;
2225 if (_remaining < 1) {
2226 _env->ThrowNew(IAEClass, "length - offset < 1");
2227 goto exit;
2228 }
2229 params_base = (GLfloat *)
2230 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2231 params = params_base + offset;
2232
2233 glTexParameterfv(
2234 (GLenum)target,
2235 (GLenum)pname,
2236 (GLfloat *)params
2237 );
2238
2239exit:
2240 if (params_base) {
2241 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2242 JNI_ABORT);
2243 }
2244}
2245
2246/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2247static void
2248android_glTexParameterfv__IILjava_nio_FloatBuffer_2
2249 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2250 jarray _array = (jarray) 0;
2251 jint _remaining;
2252 GLfloat *params = (GLfloat *) 0;
2253
2254 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
2255 if (_remaining < 1) {
2256 _env->ThrowNew(IAEClass, "remaining() < 1");
2257 goto exit;
2258 }
2259 glTexParameterfv(
2260 (GLenum)target,
2261 (GLenum)pname,
2262 (GLfloat *)params
2263 );
2264
2265exit:
2266 if (_array) {
2267 releasePointer(_env, _array, params, JNI_FALSE);
2268 }
2269}
2270
2271/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
2272static void
2273android_glTexParameteri__III
2274 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2275 glTexParameteri(
2276 (GLenum)target,
2277 (GLenum)pname,
2278 (GLint)param
2279 );
2280}
2281
2282/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
2283static void
2284android_glTexParameteriv__II_3II
2285 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2286 GLint *params_base = (GLint *) 0;
2287 jint _remaining;
2288 GLint *params = (GLint *) 0;
2289
2290 if (!params_ref) {
2291 _env->ThrowNew(IAEClass, "params == null");
2292 goto exit;
2293 }
2294 if (offset < 0) {
2295 _env->ThrowNew(IAEClass, "offset < 0");
2296 goto exit;
2297 }
2298 _remaining = _env->GetArrayLength(params_ref) - offset;
2299 if (_remaining < 1) {
2300 _env->ThrowNew(IAEClass, "length - offset < 1");
2301 goto exit;
2302 }
2303 params_base = (GLint *)
2304 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2305 params = params_base + offset;
2306
2307 glTexParameteriv(
2308 (GLenum)target,
2309 (GLenum)pname,
2310 (GLint *)params
2311 );
2312
2313exit:
2314 if (params_base) {
2315 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2316 JNI_ABORT);
2317 }
2318}
2319
2320/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
2321static void
2322android_glTexParameteriv__IILjava_nio_IntBuffer_2
2323 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2324 jarray _array = (jarray) 0;
2325 jint _remaining;
2326 GLint *params = (GLint *) 0;
2327
2328 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2329 if (_remaining < 1) {
2330 _env->ThrowNew(IAEClass, "remaining() < 1");
2331 goto exit;
2332 }
2333 glTexParameteriv(
2334 (GLenum)target,
2335 (GLenum)pname,
2336 (GLint *)params
2337 );
2338
2339exit:
2340 if (_array) {
2341 releasePointer(_env, _array, params, JNI_FALSE);
2342 }
2343}
2344
2345/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2346static void
2347android_glTexParameterxv__II_3II
2348 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2349 GLfixed *params_base = (GLfixed *) 0;
2350 jint _remaining;
2351 GLfixed *params = (GLfixed *) 0;
2352
2353 if (!params_ref) {
2354 _env->ThrowNew(IAEClass, "params == null");
2355 goto exit;
2356 }
2357 if (offset < 0) {
2358 _env->ThrowNew(IAEClass, "offset < 0");
2359 goto exit;
2360 }
2361 _remaining = _env->GetArrayLength(params_ref) - offset;
2362 if (_remaining < 1) {
2363 _env->ThrowNew(IAEClass, "length - offset < 1");
2364 goto exit;
2365 }
2366 params_base = (GLfixed *)
2367 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2368 params = params_base + offset;
2369
2370 glTexParameterxv(
2371 (GLenum)target,
2372 (GLenum)pname,
2373 (GLfixed *)params
2374 );
2375
2376exit:
2377 if (params_base) {
2378 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2379 JNI_ABORT);
2380 }
2381}
2382
2383/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2384static void
2385android_glTexParameterxv__IILjava_nio_IntBuffer_2
2386 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2387 jarray _array = (jarray) 0;
2388 jint _remaining;
2389 GLfixed *params = (GLfixed *) 0;
2390
2391 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining);
2392 if (_remaining < 1) {
2393 _env->ThrowNew(IAEClass, "remaining() < 1");
2394 goto exit;
2395 }
2396 glTexParameterxv(
2397 (GLenum)target,
2398 (GLenum)pname,
2399 (GLfixed *)params
2400 );
2401
2402exit:
2403 if (_array) {
2404 releasePointer(_env, _array, params, JNI_FALSE);
2405 }
2406}
2407
2408/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
2409static void
2410android_glVertexPointer__IIII
2411 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
2412 glVertexPointer(
2413 (GLint)size,
2414 (GLenum)type,
2415 (GLsizei)stride,
2416 (const GLvoid *)offset
2417 );
2418}
2419
2420static const char *classPathName = "android/opengl/GLES11";
2421
2422static JNINativeMethod methods[] = {
2423{"_nativeClassInit", "()V", (void*)nativeClassInit },
2424{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
2425{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
2426{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
2427{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
2428{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
2429{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
2430{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
2431{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
2432{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
2433{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
2434{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
2435{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
2436{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
2437{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
2438{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
2439{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
2440{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
2441{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
2442{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
2443{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
2444{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
2445{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
2446{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
2447{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
2448{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
2449{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
2450{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
2451{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
2452{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
2453{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
2454{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
2455{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
2456{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
2457{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
2458{"glGetTexEnvfv", "(II[FI)V", (void *) android_glGetTexEnvfv__II_3FI },
2459{"glGetTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 },
2460{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
2461{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
2462{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
2463{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
2464{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
2465{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
2466{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
2467{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
2468{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
2469{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
2470{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
2471{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
2472{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
2473{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
2474{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
2475{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
2476{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
2477{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
2478{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
2479{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08002480{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
Jack Palevich27f80022009-04-15 19:13:17 -07002481{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
2482{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
2483{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
2484{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
2485{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
2486{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
2487{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
2488{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
2489{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
2490{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
2491{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
2492{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
2493};
2494
2495int register_android_opengl_jni_GLES11(JNIEnv *_env)
2496{
2497 int err;
2498 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
2499 return err;
2500}