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