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