3 ** Copyright 2009, The Android Open Source Project
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
9 ** http://www.apache.org/licenses/LICENSE-2.0
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.
18 // This source file is automatically generated
20 #pragma GCC diagnostic ignored "-Wunused-variable"
21 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22 #pragma GCC diagnostic ignored "-Wunused-function"
25 #include <GLES/glext.h>
29 #include <android_runtime/AndroidRuntime.h>
30 #include <utils/misc.h>
33 static int initialized = 0;
35 static jclass nioAccessClass;
36 static jclass bufferClass;
37 static jmethodID getBasePointerID;
38 static jmethodID getBaseArrayID;
39 static jmethodID getBaseArrayOffsetID;
40 static jfieldID positionID;
41 static jfieldID limitID;
42 static jfieldID elementSizeShiftID;
45 /* special calls implemented in Android's GLES wrapper used to more
46 * efficiently bound-check passed arrays */
48 #ifdef GL_VERSION_ES_CM_1_1
49 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
64 #ifdef GL_ES_VERSION_2_0
65 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
66 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
67 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
70 #ifdef GL_ES_VERSION_3_0
71 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
72 GLsizei stride, const GLvoid *pointer, GLsizei count) {
73 glVertexAttribIPointer(indx, size, type, stride, pointer);
78 /* Cache method IDs each time the class is loaded. */
81 nativeClassInit(JNIEnv *_env, jclass glImplClass)
83 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
84 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
86 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
87 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
89 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
90 "getBasePointer", "(Ljava/nio/Buffer;)J");
91 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
93 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
94 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
96 positionID = _env->GetFieldID(bufferClass, "position", "I");
97 limitID = _env->GetFieldID(bufferClass, "limit", "I");
99 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
103 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
107 jint elementSizeShift;
110 position = _env->GetIntField(buffer, positionID);
111 limit = _env->GetIntField(buffer, limitID);
112 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
113 *remaining = (limit - position) << elementSizeShift;
114 pointer = _env->CallStaticLongMethod(nioAccessClass,
115 getBasePointerID, buffer);
118 return reinterpret_cast<void*>(pointer);
121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
122 getBaseArrayID, buffer);
123 *offset = _env->CallStaticIntMethod(nioAccessClass,
124 getBaseArrayOffsetID, buffer);
129 class ByteArrayGetter {
131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
132 return _env->GetByteArrayElements(array, is_copy);
135 class BooleanArrayGetter {
137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
138 return _env->GetBooleanArrayElements(array, is_copy);
141 class CharArrayGetter {
143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
144 return _env->GetCharArrayElements(array, is_copy);
147 class ShortArrayGetter {
149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
150 return _env->GetShortArrayElements(array, is_copy);
153 class IntArrayGetter {
155 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
156 return _env->GetIntArrayElements(array, is_copy);
159 class LongArrayGetter {
161 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
162 return _env->GetLongArrayElements(array, is_copy);
165 class FloatArrayGetter {
167 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
168 return _env->GetFloatArrayElements(array, is_copy);
171 class DoubleArrayGetter {
173 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
174 return _env->GetDoubleArrayElements(array, is_copy);
178 template<typename JTYPEARRAY, typename ARRAYGETTER>
180 getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
181 return ARRAYGETTER::Get(_env, array, is_copy);
184 class ByteArrayReleaser {
186 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
187 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
190 class BooleanArrayReleaser {
192 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
193 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
196 class CharArrayReleaser {
198 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
199 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
202 class ShortArrayReleaser {
204 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
205 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
208 class IntArrayReleaser {
210 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
211 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
214 class LongArrayReleaser {
216 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
217 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
220 class FloatArrayReleaser {
222 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
223 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
226 class DoubleArrayReleaser {
228 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
229 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
233 template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
235 releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
236 ARRAYRELEASER::Release(_env, array, data, commit);
240 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
242 _env->ReleasePrimitiveArrayCritical(array, data,
243 commit ? 0 : JNI_ABORT);
247 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
248 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
250 jint position = _env->GetIntField(buffer, positionID);
251 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
252 buf += position << elementSizeShift;
254 jniThrowException(_env, "java/lang/IllegalArgumentException",
255 "Must use a native order direct Buffer");
260 // --------------------------------------------------------------------------
263 * returns the number of values glGet returns for a given pname.
265 * The code below is written such that pnames requiring only one values
266 * are the default (and are not explicitely tested for). This makes the
267 * checking code much shorter/readable/efficient.
269 * This means that unknown pnames (e.g.: extensions) will default to 1. If
270 * that unknown pname needs more than 1 value, then the validation check
271 * is incomplete and the app may crash if it passed the wrong number params.
273 static int getNeededCount(GLint pname) {
275 #ifdef GL_ES_VERSION_2_0
278 case GL_ALIASED_LINE_WIDTH_RANGE:
279 case GL_ALIASED_POINT_SIZE_RANGE:
284 case GL_COLOR_CLEAR_VALUE:
285 case GL_COLOR_WRITEMASK:
291 case GL_COMPRESSED_TEXTURE_FORMATS:
292 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
295 case GL_SHADER_BINARY_FORMATS:
296 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
301 #ifdef GL_VERSION_ES_CM_1_1
304 case GL_ALIASED_LINE_WIDTH_RANGE:
305 case GL_ALIASED_POINT_SIZE_RANGE:
307 case GL_SMOOTH_LINE_WIDTH_RANGE:
308 case GL_SMOOTH_POINT_SIZE_RANGE:
312 case GL_CURRENT_NORMAL:
313 case GL_POINT_DISTANCE_ATTENUATION:
317 case GL_COLOR_CLEAR_VALUE:
318 case GL_COLOR_WRITEMASK:
319 case GL_CURRENT_COLOR:
320 case GL_CURRENT_TEXTURE_COORDS:
322 case GL_LIGHT_MODEL_AMBIENT:
328 case GL_MODELVIEW_MATRIX:
329 case GL_PROJECTION_MATRIX:
330 case GL_TEXTURE_MATRIX:
334 case GL_COMPRESSED_TEXTURE_FORMATS:
335 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
342 template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
343 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
346 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
348 const char * _exceptionType;
349 const char * _exceptionMessage;
350 CTYPE *params_base = (CTYPE *) 0;
352 CTYPE *params = (CTYPE *) 0;
357 _exceptionType = "java/lang/IllegalArgumentException";
358 _exceptionMessage = "params == null";
363 _exceptionType = "java/lang/IllegalArgumentException";
364 _exceptionMessage = "offset < 0";
367 _remaining = _env->GetArrayLength(params_ref) - offset;
368 _needed = getNeededCount(pname);
369 // if we didn't find this pname, we just assume the user passed
370 // an array of the right size -- this might happen with extensions
371 // or if we forget an enum here.
372 if (_remaining < _needed) {
374 _exceptionType = "java/lang/IllegalArgumentException";
375 _exceptionMessage = "length - offset < needed";
378 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
379 _env, params_ref, (jboolean *)0);
380 params = params_base + offset;
389 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
390 _env, params_ref, params_base, !_exception);
393 jniThrowException(_env, _exceptionType, _exceptionMessage);
398 template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
399 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
402 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
404 const char * _exceptionType;
405 const char * _exceptionMessage;
406 JTYPEARRAY _array = (JTYPEARRAY) 0;
407 jint _bufferOffset = (jint) 0;
409 CTYPE *params = (CTYPE *) 0;
412 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
413 _remaining /= sizeof(CTYPE); // convert from bytes to item count
414 _needed = getNeededCount(pname);
415 // if we didn't find this pname, we just assume the user passed
416 // an array of the right size -- this might happen with extensions
417 // or if we forget an enum here.
418 if (_needed>0 && _remaining < _needed) {
420 _exceptionType = "java/lang/IllegalArgumentException";
421 _exceptionMessage = "remaining() < needed";
424 if (params == NULL) {
425 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
426 _env, _array, (jboolean *) 0);
427 params = (CTYPE *) (_paramsBase + _bufferOffset);
436 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
437 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
440 jniThrowException(_env, _exceptionType, _exceptionMessage);
444 // --------------------------------------------------------------------------
445 /* void glActiveTexture ( GLenum texture ) */
447 android_glActiveTexture__I
448 (JNIEnv *_env, jobject _this, jint texture) {
454 /* void glAlphaFunc ( GLenum func, GLclampf ref ) */
456 android_glAlphaFunc__IF
457 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
464 /* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
466 android_glAlphaFuncx__II
467 (JNIEnv *_env, jobject _this, jint func, jint ref) {
474 /* void glBindTexture ( GLenum target, GLuint texture ) */
476 android_glBindTexture__II
477 (JNIEnv *_env, jobject _this, jint target, jint texture) {
484 /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
486 android_glBlendFunc__II
487 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
494 /* void glClear ( GLbitfield mask ) */
497 (JNIEnv *_env, jobject _this, jint mask) {
503 /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
505 android_glClearColor__FFFF
506 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
515 /* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
517 android_glClearColorx__IIII
518 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
527 /* void glClearDepthf ( GLclampf depth ) */
529 android_glClearDepthf__F
530 (JNIEnv *_env, jobject _this, jfloat depth) {
536 /* void glClearDepthx ( GLclampx depth ) */
538 android_glClearDepthx__I
539 (JNIEnv *_env, jobject _this, jint depth) {
545 /* void glClearStencil ( GLint s ) */
547 android_glClearStencil__I
548 (JNIEnv *_env, jobject _this, jint s) {
554 /* void glClientActiveTexture ( GLenum texture ) */
556 android_glClientActiveTexture__I
557 (JNIEnv *_env, jobject _this, jint texture) {
558 glClientActiveTexture(
563 /* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
565 android_glColor4f__FFFF
566 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
575 /* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
577 android_glColor4x__IIII
578 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
587 /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
589 android_glColorMask__ZZZZ
590 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
599 /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
601 android_glColorPointerBounds__IIILjava_nio_Buffer_2I
602 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
603 jarray _array = (jarray) 0;
604 jint _bufferOffset = (jint) 0;
606 GLvoid *pointer = (GLvoid *) 0;
609 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
614 glColorPointerBounds(
623 /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
625 android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
626 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
627 jarray _array = (jarray) 0;
628 jint _bufferOffset = (jint) 0;
630 GLvoid *data = (GLvoid *) 0;
632 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
634 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
635 data = (GLvoid *) (_dataBase + _bufferOffset);
637 glCompressedTexImage2D(
640 (GLenum)internalformat,
648 releasePointer(_env, _array, data, JNI_FALSE);
652 /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
654 android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
655 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
656 jarray _array = (jarray) 0;
657 jint _bufferOffset = (jint) 0;
659 GLvoid *data = (GLvoid *) 0;
661 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
663 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
664 data = (GLvoid *) (_dataBase + _bufferOffset);
666 glCompressedTexSubImage2D(
678 releasePointer(_env, _array, data, JNI_FALSE);
682 /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
684 android_glCopyTexImage2D__IIIIIIII
685 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
689 (GLenum)internalformat,
698 /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
700 android_glCopyTexSubImage2D__IIIIIIII
701 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
714 /* void glCullFace ( GLenum mode ) */
716 android_glCullFace__I
717 (JNIEnv *_env, jobject _this, jint mode) {
723 /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
725 android_glDeleteTextures__I_3II
726 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
728 const char * _exceptionType = NULL;
729 const char * _exceptionMessage = NULL;
730 GLuint *textures_base = (GLuint *) 0;
732 GLuint *textures = (GLuint *) 0;
736 _exceptionType = "java/lang/IllegalArgumentException";
737 _exceptionMessage = "textures == null";
742 _exceptionType = "java/lang/IllegalArgumentException";
743 _exceptionMessage = "offset < 0";
746 _remaining = _env->GetArrayLength(textures_ref) - offset;
747 if (_remaining < n) {
749 _exceptionType = "java/lang/IllegalArgumentException";
750 _exceptionMessage = "length - offset < n < needed";
753 textures_base = (GLuint *)
754 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
755 textures = textures_base + offset;
764 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
768 jniThrowException(_env, _exceptionType, _exceptionMessage);
772 /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
774 android_glDeleteTextures__ILjava_nio_IntBuffer_2
775 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
777 const char * _exceptionType = NULL;
778 const char * _exceptionMessage = NULL;
779 jintArray _array = (jintArray) 0;
780 jint _bufferOffset = (jint) 0;
782 GLuint *textures = (GLuint *) 0;
784 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
785 if (_remaining < n) {
787 _exceptionType = "java/lang/IllegalArgumentException";
788 _exceptionMessage = "remaining() < n < needed";
791 if (textures == NULL) {
792 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
793 textures = (GLuint *) (_texturesBase + _bufferOffset);
802 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
805 jniThrowException(_env, _exceptionType, _exceptionMessage);
809 /* void glDepthFunc ( GLenum func ) */
811 android_glDepthFunc__I
812 (JNIEnv *_env, jobject _this, jint func) {
818 /* void glDepthMask ( GLboolean flag ) */
820 android_glDepthMask__Z
821 (JNIEnv *_env, jobject _this, jboolean flag) {
827 /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
829 android_glDepthRangef__FF
830 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
837 /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
839 android_glDepthRangex__II
840 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
847 /* void glDisable ( GLenum cap ) */
850 (JNIEnv *_env, jobject _this, jint cap) {
856 /* void glDisableClientState ( GLenum array ) */
858 android_glDisableClientState__I
859 (JNIEnv *_env, jobject _this, jint array) {
860 glDisableClientState(
865 /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
867 android_glDrawArrays__III
868 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
876 /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
878 android_glDrawElements__IIILjava_nio_Buffer_2
879 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
881 const char * _exceptionType = NULL;
882 const char * _exceptionMessage = NULL;
883 jarray _array = (jarray) 0;
884 jint _bufferOffset = (jint) 0;
886 GLvoid *indices = (GLvoid *) 0;
888 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
889 if (_remaining < count) {
891 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
892 _exceptionMessage = "remaining() < count < needed";
895 if (indices == NULL) {
896 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
897 indices = (GLvoid *) (_indicesBase + _bufferOffset);
908 releasePointer(_env, _array, indices, JNI_FALSE);
911 jniThrowException(_env, _exceptionType, _exceptionMessage);
915 /* void glEnable ( GLenum cap ) */
918 (JNIEnv *_env, jobject _this, jint cap) {
924 /* void glEnableClientState ( GLenum array ) */
926 android_glEnableClientState__I
927 (JNIEnv *_env, jobject _this, jint array) {
933 /* void glFinish ( void ) */
936 (JNIEnv *_env, jobject _this) {
940 /* void glFlush ( void ) */
943 (JNIEnv *_env, jobject _this) {
947 /* void glFogf ( GLenum pname, GLfloat param ) */
950 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
957 /* void glFogfv ( GLenum pname, const GLfloat *params ) */
959 android_glFogfv__I_3FI
960 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
962 const char * _exceptionType = NULL;
963 const char * _exceptionMessage = NULL;
964 GLfloat *params_base = (GLfloat *) 0;
966 GLfloat *params = (GLfloat *) 0;
970 _exceptionType = "java/lang/IllegalArgumentException";
971 _exceptionMessage = "params == null";
976 _exceptionType = "java/lang/IllegalArgumentException";
977 _exceptionMessage = "offset < 0";
980 _remaining = _env->GetArrayLength(params_ref) - offset;
983 #if defined(GL_FOG_COLOR)
985 #endif // defined(GL_FOG_COLOR)
992 if (_remaining < _needed) {
994 _exceptionType = "java/lang/IllegalArgumentException";
995 _exceptionMessage = "length - offset < needed";
998 params_base = (GLfloat *)
999 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1000 params = params_base + offset;
1009 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1013 jniThrowException(_env, _exceptionType, _exceptionMessage);
1017 /* void glFogfv ( GLenum pname, const GLfloat *params ) */
1019 android_glFogfv__ILjava_nio_FloatBuffer_2
1020 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1021 jint _exception = 0;
1022 const char * _exceptionType = NULL;
1023 const char * _exceptionMessage = NULL;
1024 jfloatArray _array = (jfloatArray) 0;
1025 jint _bufferOffset = (jint) 0;
1027 GLfloat *params = (GLfloat *) 0;
1029 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1032 #if defined(GL_FOG_COLOR)
1034 #endif // defined(GL_FOG_COLOR)
1041 if (_remaining < _needed) {
1043 _exceptionType = "java/lang/IllegalArgumentException";
1044 _exceptionMessage = "remaining() < needed";
1047 if (params == NULL) {
1048 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1049 params = (GLfloat *) (_paramsBase + _bufferOffset);
1058 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1061 jniThrowException(_env, _exceptionType, _exceptionMessage);
1065 /* void glFogx ( GLenum pname, GLfixed param ) */
1068 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1075 /* void glFogxv ( GLenum pname, const GLfixed *params ) */
1077 android_glFogxv__I_3II
1078 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1079 jint _exception = 0;
1080 const char * _exceptionType = NULL;
1081 const char * _exceptionMessage = NULL;
1082 GLfixed *params_base = (GLfixed *) 0;
1084 GLfixed *params = (GLfixed *) 0;
1088 _exceptionType = "java/lang/IllegalArgumentException";
1089 _exceptionMessage = "params == null";
1094 _exceptionType = "java/lang/IllegalArgumentException";
1095 _exceptionMessage = "offset < 0";
1098 _remaining = _env->GetArrayLength(params_ref) - offset;
1101 #if defined(GL_FOG_COLOR)
1103 #endif // defined(GL_FOG_COLOR)
1110 if (_remaining < _needed) {
1112 _exceptionType = "java/lang/IllegalArgumentException";
1113 _exceptionMessage = "length - offset < needed";
1116 params_base = (GLfixed *)
1117 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1118 params = params_base + offset;
1127 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1131 jniThrowException(_env, _exceptionType, _exceptionMessage);
1135 /* void glFogxv ( GLenum pname, const GLfixed *params ) */
1137 android_glFogxv__ILjava_nio_IntBuffer_2
1138 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1139 jint _exception = 0;
1140 const char * _exceptionType = NULL;
1141 const char * _exceptionMessage = NULL;
1142 jintArray _array = (jintArray) 0;
1143 jint _bufferOffset = (jint) 0;
1145 GLfixed *params = (GLfixed *) 0;
1147 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1150 #if defined(GL_FOG_COLOR)
1152 #endif // defined(GL_FOG_COLOR)
1159 if (_remaining < _needed) {
1161 _exceptionType = "java/lang/IllegalArgumentException";
1162 _exceptionMessage = "remaining() < needed";
1165 if (params == NULL) {
1166 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1167 params = (GLfixed *) (_paramsBase + _bufferOffset);
1176 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1179 jniThrowException(_env, _exceptionType, _exceptionMessage);
1183 /* void glFrontFace ( GLenum mode ) */
1185 android_glFrontFace__I
1186 (JNIEnv *_env, jobject _this, jint mode) {
1192 /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1194 android_glFrustumf__FFFFFF
1195 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1206 /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1208 android_glFrustumx__IIIIII
1209 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1220 /* void glGenTextures ( GLsizei n, GLuint *textures ) */
1222 android_glGenTextures__I_3II
1223 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1224 jint _exception = 0;
1225 const char * _exceptionType = NULL;
1226 const char * _exceptionMessage = NULL;
1227 GLuint *textures_base = (GLuint *) 0;
1229 GLuint *textures = (GLuint *) 0;
1231 if (!textures_ref) {
1233 _exceptionType = "java/lang/IllegalArgumentException";
1234 _exceptionMessage = "textures == null";
1239 _exceptionType = "java/lang/IllegalArgumentException";
1240 _exceptionMessage = "offset < 0";
1243 _remaining = _env->GetArrayLength(textures_ref) - offset;
1244 if (_remaining < n) {
1246 _exceptionType = "java/lang/IllegalArgumentException";
1247 _exceptionMessage = "length - offset < n < needed";
1250 textures_base = (GLuint *)
1251 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
1252 textures = textures_base + offset;
1260 if (textures_base) {
1261 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
1262 _exception ? JNI_ABORT: 0);
1265 jniThrowException(_env, _exceptionType, _exceptionMessage);
1269 /* void glGenTextures ( GLsizei n, GLuint *textures ) */
1271 android_glGenTextures__ILjava_nio_IntBuffer_2
1272 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1273 jint _exception = 0;
1274 const char * _exceptionType = NULL;
1275 const char * _exceptionMessage = NULL;
1276 jintArray _array = (jintArray) 0;
1277 jint _bufferOffset = (jint) 0;
1279 GLuint *textures = (GLuint *) 0;
1281 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1282 if (_remaining < n) {
1284 _exceptionType = "java/lang/IllegalArgumentException";
1285 _exceptionMessage = "remaining() < n < needed";
1288 if (textures == NULL) {
1289 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1290 textures = (GLuint *) (_texturesBase + _bufferOffset);
1299 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
1302 jniThrowException(_env, _exceptionType, _exceptionMessage);
1306 /* GLenum glGetError ( void ) */
1308 android_glGetError__
1309 (JNIEnv *_env, jobject _this) {
1310 GLenum _returnValue;
1311 _returnValue = glGetError();
1312 return (jint)_returnValue;
1315 /* void glGetIntegerv ( GLenum pname, GLint *params ) */
1317 android_glGetIntegerv__I_3II
1318 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1319 get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>(
1320 _env, _this, pname, params_ref, offset);
1323 /* void glGetIntegerv ( GLenum pname, GLint *params ) */
1325 android_glGetIntegerv__ILjava_nio_IntBuffer_2
1326 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1327 getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>(
1328 _env, _this, pname, params_buf);
1330 /* const GLubyte * glGetString ( GLenum name ) */
1331 static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1332 const char* chars = (const char*) glGetString((GLenum) name);
1333 return _env->NewStringUTF(chars);
1335 /* void glHint ( GLenum target, GLenum mode ) */
1338 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1345 /* void glLightModelf ( GLenum pname, GLfloat param ) */
1347 android_glLightModelf__IF
1348 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1355 /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1357 android_glLightModelfv__I_3FI
1358 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
1359 jint _exception = 0;
1360 const char * _exceptionType = NULL;
1361 const char * _exceptionMessage = NULL;
1362 GLfloat *params_base = (GLfloat *) 0;
1364 GLfloat *params = (GLfloat *) 0;
1368 _exceptionType = "java/lang/IllegalArgumentException";
1369 _exceptionMessage = "params == null";
1374 _exceptionType = "java/lang/IllegalArgumentException";
1375 _exceptionMessage = "offset < 0";
1378 _remaining = _env->GetArrayLength(params_ref) - offset;
1381 #if defined(GL_LIGHT_MODEL_AMBIENT)
1382 case GL_LIGHT_MODEL_AMBIENT:
1383 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1390 if (_remaining < _needed) {
1392 _exceptionType = "java/lang/IllegalArgumentException";
1393 _exceptionMessage = "length - offset < needed";
1396 params_base = (GLfloat *)
1397 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1398 params = params_base + offset;
1407 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1411 jniThrowException(_env, _exceptionType, _exceptionMessage);
1415 /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1417 android_glLightModelfv__ILjava_nio_FloatBuffer_2
1418 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1419 jint _exception = 0;
1420 const char * _exceptionType = NULL;
1421 const char * _exceptionMessage = NULL;
1422 jfloatArray _array = (jfloatArray) 0;
1423 jint _bufferOffset = (jint) 0;
1425 GLfloat *params = (GLfloat *) 0;
1427 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1430 #if defined(GL_LIGHT_MODEL_AMBIENT)
1431 case GL_LIGHT_MODEL_AMBIENT:
1432 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1439 if (_remaining < _needed) {
1441 _exceptionType = "java/lang/IllegalArgumentException";
1442 _exceptionMessage = "remaining() < needed";
1445 if (params == NULL) {
1446 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1447 params = (GLfloat *) (_paramsBase + _bufferOffset);
1456 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1459 jniThrowException(_env, _exceptionType, _exceptionMessage);
1463 /* void glLightModelx ( GLenum pname, GLfixed param ) */
1465 android_glLightModelx__II
1466 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1473 /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1475 android_glLightModelxv__I_3II
1476 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1477 jint _exception = 0;
1478 const char * _exceptionType = NULL;
1479 const char * _exceptionMessage = NULL;
1480 GLfixed *params_base = (GLfixed *) 0;
1482 GLfixed *params = (GLfixed *) 0;
1486 _exceptionType = "java/lang/IllegalArgumentException";
1487 _exceptionMessage = "params == null";
1492 _exceptionType = "java/lang/IllegalArgumentException";
1493 _exceptionMessage = "offset < 0";
1496 _remaining = _env->GetArrayLength(params_ref) - offset;
1499 #if defined(GL_LIGHT_MODEL_AMBIENT)
1500 case GL_LIGHT_MODEL_AMBIENT:
1501 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1508 if (_remaining < _needed) {
1510 _exceptionType = "java/lang/IllegalArgumentException";
1511 _exceptionMessage = "length - offset < needed";
1514 params_base = (GLfixed *)
1515 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1516 params = params_base + offset;
1525 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1529 jniThrowException(_env, _exceptionType, _exceptionMessage);
1533 /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1535 android_glLightModelxv__ILjava_nio_IntBuffer_2
1536 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1537 jint _exception = 0;
1538 const char * _exceptionType = NULL;
1539 const char * _exceptionMessage = NULL;
1540 jintArray _array = (jintArray) 0;
1541 jint _bufferOffset = (jint) 0;
1543 GLfixed *params = (GLfixed *) 0;
1545 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1548 #if defined(GL_LIGHT_MODEL_AMBIENT)
1549 case GL_LIGHT_MODEL_AMBIENT:
1550 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1557 if (_remaining < _needed) {
1559 _exceptionType = "java/lang/IllegalArgumentException";
1560 _exceptionMessage = "remaining() < needed";
1563 if (params == NULL) {
1564 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1565 params = (GLfixed *) (_paramsBase + _bufferOffset);
1574 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1577 jniThrowException(_env, _exceptionType, _exceptionMessage);
1581 /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1583 android_glLightf__IIF
1584 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1592 /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1594 android_glLightfv__II_3FI
1595 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
1596 jint _exception = 0;
1597 const char * _exceptionType = NULL;
1598 const char * _exceptionMessage = NULL;
1599 GLfloat *params_base = (GLfloat *) 0;
1601 GLfloat *params = (GLfloat *) 0;
1605 _exceptionType = "java/lang/IllegalArgumentException";
1606 _exceptionMessage = "params == null";
1611 _exceptionType = "java/lang/IllegalArgumentException";
1612 _exceptionMessage = "offset < 0";
1615 _remaining = _env->GetArrayLength(params_ref) - offset;
1618 #if defined(GL_SPOT_DIRECTION)
1619 case GL_SPOT_DIRECTION:
1620 #endif // defined(GL_SPOT_DIRECTION)
1623 #if defined(GL_AMBIENT)
1625 #endif // defined(GL_AMBIENT)
1626 #if defined(GL_DIFFUSE)
1628 #endif // defined(GL_DIFFUSE)
1629 #if defined(GL_SPECULAR)
1631 #endif // defined(GL_SPECULAR)
1632 #if defined(GL_EMISSION)
1634 #endif // defined(GL_EMISSION)
1641 if (_remaining < _needed) {
1643 _exceptionType = "java/lang/IllegalArgumentException";
1644 _exceptionMessage = "length - offset < needed";
1647 params_base = (GLfloat *)
1648 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1649 params = params_base + offset;
1659 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1663 jniThrowException(_env, _exceptionType, _exceptionMessage);
1667 /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1669 android_glLightfv__IILjava_nio_FloatBuffer_2
1670 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1671 jint _exception = 0;
1672 const char * _exceptionType = NULL;
1673 const char * _exceptionMessage = NULL;
1674 jfloatArray _array = (jfloatArray) 0;
1675 jint _bufferOffset = (jint) 0;
1677 GLfloat *params = (GLfloat *) 0;
1679 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1682 #if defined(GL_SPOT_DIRECTION)
1683 case GL_SPOT_DIRECTION:
1684 #endif // defined(GL_SPOT_DIRECTION)
1687 #if defined(GL_AMBIENT)
1689 #endif // defined(GL_AMBIENT)
1690 #if defined(GL_DIFFUSE)
1692 #endif // defined(GL_DIFFUSE)
1693 #if defined(GL_SPECULAR)
1695 #endif // defined(GL_SPECULAR)
1696 #if defined(GL_EMISSION)
1698 #endif // defined(GL_EMISSION)
1705 if (_remaining < _needed) {
1707 _exceptionType = "java/lang/IllegalArgumentException";
1708 _exceptionMessage = "remaining() < needed";
1711 if (params == NULL) {
1712 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1713 params = (GLfloat *) (_paramsBase + _bufferOffset);
1723 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1726 jniThrowException(_env, _exceptionType, _exceptionMessage);
1730 /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1732 android_glLightx__III
1733 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1741 /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1743 android_glLightxv__II_3II
1744 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
1745 jint _exception = 0;
1746 const char * _exceptionType = NULL;
1747 const char * _exceptionMessage = NULL;
1748 GLfixed *params_base = (GLfixed *) 0;
1750 GLfixed *params = (GLfixed *) 0;
1754 _exceptionType = "java/lang/IllegalArgumentException";
1755 _exceptionMessage = "params == null";
1760 _exceptionType = "java/lang/IllegalArgumentException";
1761 _exceptionMessage = "offset < 0";
1764 _remaining = _env->GetArrayLength(params_ref) - offset;
1767 #if defined(GL_SPOT_DIRECTION)
1768 case GL_SPOT_DIRECTION:
1769 #endif // defined(GL_SPOT_DIRECTION)
1772 #if defined(GL_AMBIENT)
1774 #endif // defined(GL_AMBIENT)
1775 #if defined(GL_DIFFUSE)
1777 #endif // defined(GL_DIFFUSE)
1778 #if defined(GL_SPECULAR)
1780 #endif // defined(GL_SPECULAR)
1781 #if defined(GL_EMISSION)
1783 #endif // defined(GL_EMISSION)
1790 if (_remaining < _needed) {
1792 _exceptionType = "java/lang/IllegalArgumentException";
1793 _exceptionMessage = "length - offset < needed";
1796 params_base = (GLfixed *)
1797 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1798 params = params_base + offset;
1808 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1812 jniThrowException(_env, _exceptionType, _exceptionMessage);
1816 /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1818 android_glLightxv__IILjava_nio_IntBuffer_2
1819 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1820 jint _exception = 0;
1821 const char * _exceptionType = NULL;
1822 const char * _exceptionMessage = NULL;
1823 jintArray _array = (jintArray) 0;
1824 jint _bufferOffset = (jint) 0;
1826 GLfixed *params = (GLfixed *) 0;
1828 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1831 #if defined(GL_SPOT_DIRECTION)
1832 case GL_SPOT_DIRECTION:
1833 #endif // defined(GL_SPOT_DIRECTION)
1836 #if defined(GL_AMBIENT)
1838 #endif // defined(GL_AMBIENT)
1839 #if defined(GL_DIFFUSE)
1841 #endif // defined(GL_DIFFUSE)
1842 #if defined(GL_SPECULAR)
1844 #endif // defined(GL_SPECULAR)
1845 #if defined(GL_EMISSION)
1847 #endif // defined(GL_EMISSION)
1854 if (_remaining < _needed) {
1856 _exceptionType = "java/lang/IllegalArgumentException";
1857 _exceptionMessage = "remaining() < needed";
1860 if (params == NULL) {
1861 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1862 params = (GLfixed *) (_paramsBase + _bufferOffset);
1872 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1875 jniThrowException(_env, _exceptionType, _exceptionMessage);
1879 /* void glLineWidth ( GLfloat width ) */
1881 android_glLineWidth__F
1882 (JNIEnv *_env, jobject _this, jfloat width) {
1888 /* void glLineWidthx ( GLfixed width ) */
1890 android_glLineWidthx__I
1891 (JNIEnv *_env, jobject _this, jint width) {
1897 /* void glLoadIdentity ( void ) */
1899 android_glLoadIdentity__
1900 (JNIEnv *_env, jobject _this) {
1904 /* void glLoadMatrixf ( const GLfloat *m ) */
1906 android_glLoadMatrixf___3FI
1907 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
1908 jint _exception = 0;
1909 const char * _exceptionType = NULL;
1910 const char * _exceptionMessage = NULL;
1911 GLfloat *m_base = (GLfloat *) 0;
1913 GLfloat *m = (GLfloat *) 0;
1917 _exceptionType = "java/lang/IllegalArgumentException";
1918 _exceptionMessage = "m == null";
1923 _exceptionType = "java/lang/IllegalArgumentException";
1924 _exceptionMessage = "offset < 0";
1927 _remaining = _env->GetArrayLength(m_ref) - offset;
1928 m_base = (GLfloat *)
1929 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
1930 m = m_base + offset;
1938 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
1942 jniThrowException(_env, _exceptionType, _exceptionMessage);
1946 /* void glLoadMatrixf ( const GLfloat *m ) */
1948 android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
1949 (JNIEnv *_env, jobject _this, jobject m_buf) {
1950 jfloatArray _array = (jfloatArray) 0;
1951 jint _bufferOffset = (jint) 0;
1953 GLfloat *m = (GLfloat *) 0;
1955 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1957 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1958 m = (GLfloat *) (_mBase + _bufferOffset);
1964 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
1968 /* void glLoadMatrixx ( const GLfixed *m ) */
1970 android_glLoadMatrixx___3II
1971 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
1972 jint _exception = 0;
1973 const char * _exceptionType = NULL;
1974 const char * _exceptionMessage = NULL;
1975 GLfixed *m_base = (GLfixed *) 0;
1977 GLfixed *m = (GLfixed *) 0;
1981 _exceptionType = "java/lang/IllegalArgumentException";
1982 _exceptionMessage = "m == null";
1987 _exceptionType = "java/lang/IllegalArgumentException";
1988 _exceptionMessage = "offset < 0";
1991 _remaining = _env->GetArrayLength(m_ref) - offset;
1992 m_base = (GLfixed *)
1993 _env->GetIntArrayElements(m_ref, (jboolean *)0);
1994 m = m_base + offset;
2002 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
2006 jniThrowException(_env, _exceptionType, _exceptionMessage);
2010 /* void glLoadMatrixx ( const GLfixed *m ) */
2012 android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2013 (JNIEnv *_env, jobject _this, jobject m_buf) {
2014 jintArray _array = (jintArray) 0;
2015 jint _bufferOffset = (jint) 0;
2017 GLfixed *m = (GLfixed *) 0;
2019 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2021 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2022 m = (GLfixed *) (_mBase + _bufferOffset);
2028 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
2032 /* void glLogicOp ( GLenum opcode ) */
2034 android_glLogicOp__I
2035 (JNIEnv *_env, jobject _this, jint opcode) {
2041 /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2043 android_glMaterialf__IIF
2044 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2052 /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2054 android_glMaterialfv__II_3FI
2055 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
2056 jint _exception = 0;
2057 const char * _exceptionType = NULL;
2058 const char * _exceptionMessage = NULL;
2059 GLfloat *params_base = (GLfloat *) 0;
2061 GLfloat *params = (GLfloat *) 0;
2065 _exceptionType = "java/lang/IllegalArgumentException";
2066 _exceptionMessage = "params == null";
2071 _exceptionType = "java/lang/IllegalArgumentException";
2072 _exceptionMessage = "offset < 0";
2075 _remaining = _env->GetArrayLength(params_ref) - offset;
2078 #if defined(GL_AMBIENT)
2080 #endif // defined(GL_AMBIENT)
2081 #if defined(GL_DIFFUSE)
2083 #endif // defined(GL_DIFFUSE)
2084 #if defined(GL_SPECULAR)
2086 #endif // defined(GL_SPECULAR)
2087 #if defined(GL_EMISSION)
2089 #endif // defined(GL_EMISSION)
2090 #if defined(GL_AMBIENT_AND_DIFFUSE)
2091 case GL_AMBIENT_AND_DIFFUSE:
2092 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2099 if (_remaining < _needed) {
2101 _exceptionType = "java/lang/IllegalArgumentException";
2102 _exceptionMessage = "length - offset < needed";
2105 params_base = (GLfloat *)
2106 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2107 params = params_base + offset;
2117 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2121 jniThrowException(_env, _exceptionType, _exceptionMessage);
2125 /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2127 android_glMaterialfv__IILjava_nio_FloatBuffer_2
2128 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
2129 jint _exception = 0;
2130 const char * _exceptionType = NULL;
2131 const char * _exceptionMessage = NULL;
2132 jfloatArray _array = (jfloatArray) 0;
2133 jint _bufferOffset = (jint) 0;
2135 GLfloat *params = (GLfloat *) 0;
2137 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2140 #if defined(GL_AMBIENT)
2142 #endif // defined(GL_AMBIENT)
2143 #if defined(GL_DIFFUSE)
2145 #endif // defined(GL_DIFFUSE)
2146 #if defined(GL_SPECULAR)
2148 #endif // defined(GL_SPECULAR)
2149 #if defined(GL_EMISSION)
2151 #endif // defined(GL_EMISSION)
2152 #if defined(GL_AMBIENT_AND_DIFFUSE)
2153 case GL_AMBIENT_AND_DIFFUSE:
2154 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2161 if (_remaining < _needed) {
2163 _exceptionType = "java/lang/IllegalArgumentException";
2164 _exceptionMessage = "remaining() < needed";
2167 if (params == NULL) {
2168 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2169 params = (GLfloat *) (_paramsBase + _bufferOffset);
2179 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2182 jniThrowException(_env, _exceptionType, _exceptionMessage);
2186 /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2188 android_glMaterialx__III
2189 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2197 /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2199 android_glMaterialxv__II_3II
2200 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
2201 jint _exception = 0;
2202 const char * _exceptionType = NULL;
2203 const char * _exceptionMessage = NULL;
2204 GLfixed *params_base = (GLfixed *) 0;
2206 GLfixed *params = (GLfixed *) 0;
2210 _exceptionType = "java/lang/IllegalArgumentException";
2211 _exceptionMessage = "params == null";
2216 _exceptionType = "java/lang/IllegalArgumentException";
2217 _exceptionMessage = "offset < 0";
2220 _remaining = _env->GetArrayLength(params_ref) - offset;
2223 #if defined(GL_AMBIENT)
2225 #endif // defined(GL_AMBIENT)
2226 #if defined(GL_DIFFUSE)
2228 #endif // defined(GL_DIFFUSE)
2229 #if defined(GL_SPECULAR)
2231 #endif // defined(GL_SPECULAR)
2232 #if defined(GL_EMISSION)
2234 #endif // defined(GL_EMISSION)
2235 #if defined(GL_AMBIENT_AND_DIFFUSE)
2236 case GL_AMBIENT_AND_DIFFUSE:
2237 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2244 if (_remaining < _needed) {
2246 _exceptionType = "java/lang/IllegalArgumentException";
2247 _exceptionMessage = "length - offset < needed";
2250 params_base = (GLfixed *)
2251 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2252 params = params_base + offset;
2262 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2266 jniThrowException(_env, _exceptionType, _exceptionMessage);
2270 /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2272 android_glMaterialxv__IILjava_nio_IntBuffer_2
2273 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
2274 jint _exception = 0;
2275 const char * _exceptionType = NULL;
2276 const char * _exceptionMessage = NULL;
2277 jintArray _array = (jintArray) 0;
2278 jint _bufferOffset = (jint) 0;
2280 GLfixed *params = (GLfixed *) 0;
2282 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2285 #if defined(GL_AMBIENT)
2287 #endif // defined(GL_AMBIENT)
2288 #if defined(GL_DIFFUSE)
2290 #endif // defined(GL_DIFFUSE)
2291 #if defined(GL_SPECULAR)
2293 #endif // defined(GL_SPECULAR)
2294 #if defined(GL_EMISSION)
2296 #endif // defined(GL_EMISSION)
2297 #if defined(GL_AMBIENT_AND_DIFFUSE)
2298 case GL_AMBIENT_AND_DIFFUSE:
2299 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2306 if (_remaining < _needed) {
2308 _exceptionType = "java/lang/IllegalArgumentException";
2309 _exceptionMessage = "remaining() < needed";
2312 if (params == NULL) {
2313 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2314 params = (GLfixed *) (_paramsBase + _bufferOffset);
2324 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2327 jniThrowException(_env, _exceptionType, _exceptionMessage);
2331 /* void glMatrixMode ( GLenum mode ) */
2333 android_glMatrixMode__I
2334 (JNIEnv *_env, jobject _this, jint mode) {
2340 /* void glMultMatrixf ( const GLfloat *m ) */
2342 android_glMultMatrixf___3FI
2343 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
2344 jint _exception = 0;
2345 const char * _exceptionType = NULL;
2346 const char * _exceptionMessage = NULL;
2347 GLfloat *m_base = (GLfloat *) 0;
2349 GLfloat *m = (GLfloat *) 0;
2353 _exceptionType = "java/lang/IllegalArgumentException";
2354 _exceptionMessage = "m == null";
2359 _exceptionType = "java/lang/IllegalArgumentException";
2360 _exceptionMessage = "offset < 0";
2363 _remaining = _env->GetArrayLength(m_ref) - offset;
2364 m_base = (GLfloat *)
2365 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
2366 m = m_base + offset;
2374 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
2378 jniThrowException(_env, _exceptionType, _exceptionMessage);
2382 /* void glMultMatrixf ( const GLfloat *m ) */
2384 android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2385 (JNIEnv *_env, jobject _this, jobject m_buf) {
2386 jfloatArray _array = (jfloatArray) 0;
2387 jint _bufferOffset = (jint) 0;
2389 GLfloat *m = (GLfloat *) 0;
2391 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2393 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2394 m = (GLfloat *) (_mBase + _bufferOffset);
2400 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
2404 /* void glMultMatrixx ( const GLfixed *m ) */
2406 android_glMultMatrixx___3II
2407 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
2408 jint _exception = 0;
2409 const char * _exceptionType = NULL;
2410 const char * _exceptionMessage = NULL;
2411 GLfixed *m_base = (GLfixed *) 0;
2413 GLfixed *m = (GLfixed *) 0;
2417 _exceptionType = "java/lang/IllegalArgumentException";
2418 _exceptionMessage = "m == null";
2423 _exceptionType = "java/lang/IllegalArgumentException";
2424 _exceptionMessage = "offset < 0";
2427 _remaining = _env->GetArrayLength(m_ref) - offset;
2428 m_base = (GLfixed *)
2429 _env->GetIntArrayElements(m_ref, (jboolean *)0);
2430 m = m_base + offset;
2438 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
2442 jniThrowException(_env, _exceptionType, _exceptionMessage);
2446 /* void glMultMatrixx ( const GLfixed *m ) */
2448 android_glMultMatrixx__Ljava_nio_IntBuffer_2
2449 (JNIEnv *_env, jobject _this, jobject m_buf) {
2450 jintArray _array = (jintArray) 0;
2451 jint _bufferOffset = (jint) 0;
2453 GLfixed *m = (GLfixed *) 0;
2455 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2457 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2458 m = (GLfixed *) (_mBase + _bufferOffset);
2464 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
2468 /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2470 android_glMultiTexCoord4f__IFFFF
2471 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2481 /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2483 android_glMultiTexCoord4x__IIIII
2484 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2494 /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2496 android_glNormal3f__FFF
2497 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2505 /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2507 android_glNormal3x__III
2508 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2516 /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2518 android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2519 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2520 jarray _array = (jarray) 0;
2521 jint _bufferOffset = (jint) 0;
2523 GLvoid *pointer = (GLvoid *) 0;
2526 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2531 glNormalPointerBounds(
2539 /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2541 android_glOrthof__FFFFFF
2542 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2553 /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2555 android_glOrthox__IIIIII
2556 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2567 /* void glPixelStorei ( GLenum pname, GLint param ) */
2569 android_glPixelStorei__II
2570 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2577 /* void glPointSize ( GLfloat size ) */
2579 android_glPointSize__F
2580 (JNIEnv *_env, jobject _this, jfloat size) {
2586 /* void glPointSizex ( GLfixed size ) */
2588 android_glPointSizex__I
2589 (JNIEnv *_env, jobject _this, jint size) {
2595 /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2597 android_glPolygonOffset__FF
2598 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2605 /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2607 android_glPolygonOffsetx__II
2608 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2615 /* void glPopMatrix ( void ) */
2617 android_glPopMatrix__
2618 (JNIEnv *_env, jobject _this) {
2622 /* void glPushMatrix ( void ) */
2624 android_glPushMatrix__
2625 (JNIEnv *_env, jobject _this) {
2629 /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2631 android_glReadPixels__IIIIIILjava_nio_Buffer_2
2632 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
2633 jarray _array = (jarray) 0;
2634 jint _bufferOffset = (jint) 0;
2636 GLvoid *pixels = (GLvoid *) 0;
2638 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2639 if (pixels == NULL) {
2640 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2641 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2653 releasePointer(_env, _array, pixels, JNI_TRUE);
2657 /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2659 android_glRotatef__FFFF
2660 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2669 /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2671 android_glRotatex__IIII
2672 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2681 /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2683 android_glSampleCoverage__FZ
2684 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2691 /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2693 android_glSampleCoveragex__IZ
2694 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2701 /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2703 android_glScalef__FFF
2704 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2712 /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2714 android_glScalex__III
2715 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2723 /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2725 android_glScissor__IIII
2726 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2735 /* void glShadeModel ( GLenum mode ) */
2737 android_glShadeModel__I
2738 (JNIEnv *_env, jobject _this, jint mode) {
2744 /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2746 android_glStencilFunc__III
2747 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2755 /* void glStencilMask ( GLuint mask ) */
2757 android_glStencilMask__I
2758 (JNIEnv *_env, jobject _this, jint mask) {
2764 /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2766 android_glStencilOp__III
2767 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2775 /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2777 android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2778 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2779 jarray _array = (jarray) 0;
2780 jint _bufferOffset = (jint) 0;
2782 GLvoid *pointer = (GLvoid *) 0;
2785 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2790 glTexCoordPointerBounds(
2799 /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2801 android_glTexEnvf__IIF
2802 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2810 /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2812 android_glTexEnvfv__II_3FI
2813 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2814 jint _exception = 0;
2815 const char * _exceptionType = NULL;
2816 const char * _exceptionMessage = NULL;
2817 GLfloat *params_base = (GLfloat *) 0;
2819 GLfloat *params = (GLfloat *) 0;
2823 _exceptionType = "java/lang/IllegalArgumentException";
2824 _exceptionMessage = "params == null";
2829 _exceptionType = "java/lang/IllegalArgumentException";
2830 _exceptionMessage = "offset < 0";
2833 _remaining = _env->GetArrayLength(params_ref) - offset;
2836 #if defined(GL_TEXTURE_ENV_COLOR)
2837 case GL_TEXTURE_ENV_COLOR:
2838 #endif // defined(GL_TEXTURE_ENV_COLOR)
2845 if (_remaining < _needed) {
2847 _exceptionType = "java/lang/IllegalArgumentException";
2848 _exceptionMessage = "length - offset < needed";
2851 params_base = (GLfloat *)
2852 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2853 params = params_base + offset;
2863 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2867 jniThrowException(_env, _exceptionType, _exceptionMessage);
2871 /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2873 android_glTexEnvfv__IILjava_nio_FloatBuffer_2
2874 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2875 jint _exception = 0;
2876 const char * _exceptionType = NULL;
2877 const char * _exceptionMessage = NULL;
2878 jfloatArray _array = (jfloatArray) 0;
2879 jint _bufferOffset = (jint) 0;
2881 GLfloat *params = (GLfloat *) 0;
2883 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2886 #if defined(GL_TEXTURE_ENV_COLOR)
2887 case GL_TEXTURE_ENV_COLOR:
2888 #endif // defined(GL_TEXTURE_ENV_COLOR)
2895 if (_remaining < _needed) {
2897 _exceptionType = "java/lang/IllegalArgumentException";
2898 _exceptionMessage = "remaining() < needed";
2901 if (params == NULL) {
2902 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2903 params = (GLfloat *) (_paramsBase + _bufferOffset);
2913 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2916 jniThrowException(_env, _exceptionType, _exceptionMessage);
2920 /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
2922 android_glTexEnvx__III
2923 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2931 /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2933 android_glTexEnvxv__II_3II
2934 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2935 jint _exception = 0;
2936 const char * _exceptionType = NULL;
2937 const char * _exceptionMessage = NULL;
2938 GLfixed *params_base = (GLfixed *) 0;
2940 GLfixed *params = (GLfixed *) 0;
2944 _exceptionType = "java/lang/IllegalArgumentException";
2945 _exceptionMessage = "params == null";
2950 _exceptionType = "java/lang/IllegalArgumentException";
2951 _exceptionMessage = "offset < 0";
2954 _remaining = _env->GetArrayLength(params_ref) - offset;
2957 #if defined(GL_TEXTURE_ENV_COLOR)
2958 case GL_TEXTURE_ENV_COLOR:
2959 #endif // defined(GL_TEXTURE_ENV_COLOR)
2966 if (_remaining < _needed) {
2968 _exceptionType = "java/lang/IllegalArgumentException";
2969 _exceptionMessage = "length - offset < needed";
2972 params_base = (GLfixed *)
2973 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2974 params = params_base + offset;
2984 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2988 jniThrowException(_env, _exceptionType, _exceptionMessage);
2992 /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2994 android_glTexEnvxv__IILjava_nio_IntBuffer_2
2995 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2996 jint _exception = 0;
2997 const char * _exceptionType = NULL;
2998 const char * _exceptionMessage = NULL;
2999 jintArray _array = (jintArray) 0;
3000 jint _bufferOffset = (jint) 0;
3002 GLfixed *params = (GLfixed *) 0;
3004 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3007 #if defined(GL_TEXTURE_ENV_COLOR)
3008 case GL_TEXTURE_ENV_COLOR:
3009 #endif // defined(GL_TEXTURE_ENV_COLOR)
3016 if (_remaining < _needed) {
3018 _exceptionType = "java/lang/IllegalArgumentException";
3019 _exceptionMessage = "remaining() < needed";
3022 if (params == NULL) {
3023 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3024 params = (GLfixed *) (_paramsBase + _bufferOffset);
3034 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3037 jniThrowException(_env, _exceptionType, _exceptionMessage);
3041 /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3043 android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3044 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3045 jarray _array = (jarray) 0;
3046 jint _bufferOffset = (jint) 0;
3048 GLvoid *pixels = (GLvoid *) 0;
3051 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3053 if (pixels_buf && pixels == NULL) {
3054 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3055 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3060 (GLint)internalformat,
3069 releasePointer(_env, _array, pixels, JNI_FALSE);
3073 /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3075 android_glTexParameterf__IIF
3076 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3084 /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3086 android_glTexParameterx__III
3087 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3095 /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3097 android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3098 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3099 jarray _array = (jarray) 0;
3100 jint _bufferOffset = (jint) 0;
3102 GLvoid *pixels = (GLvoid *) 0;
3105 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3107 if (pixels_buf && pixels == NULL) {
3108 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3109 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3123 releasePointer(_env, _array, pixels, JNI_FALSE);
3127 /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3129 android_glTranslatef__FFF
3130 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3138 /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3140 android_glTranslatex__III
3141 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3149 /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3151 android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3152 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3153 jarray _array = (jarray) 0;
3154 jint _bufferOffset = (jint) 0;
3156 GLvoid *pointer = (GLvoid *) 0;
3159 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
3164 glVertexPointerBounds(
3173 /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3175 android_glViewport__IIII
3176 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3185 static const char *classPathName = "android/opengl/GLES10";
3187 static JNINativeMethod methods[] = {
3188 {"_nativeClassInit", "()V", (void*)nativeClassInit },
3189 {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3190 {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3191 {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3192 {"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3193 {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3194 {"glClear", "(I)V", (void *) android_glClear__I },
3195 {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3196 {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3197 {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3198 {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3199 {"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3200 {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3201 {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3202 {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3203 {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3204 {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3205 {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3206 {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3207 {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3208 {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3209 {"glCullFace", "(I)V", (void *) android_glCullFace__I },
3210 {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3211 {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3212 {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3213 {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3214 {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3215 {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3216 {"glDisable", "(I)V", (void *) android_glDisable__I },
3217 {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3218 {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3219 {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3220 {"glEnable", "(I)V", (void *) android_glEnable__I },
3221 {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3222 {"glFinish", "()V", (void *) android_glFinish__ },
3223 {"glFlush", "()V", (void *) android_glFlush__ },
3224 {"glFogf", "(IF)V", (void *) android_glFogf__IF },
3225 {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3226 {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3227 {"glFogx", "(II)V", (void *) android_glFogx__II },
3228 {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3229 {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3230 {"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3231 {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3232 {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3233 {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3234 {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3235 {"glGetError", "()I", (void *) android_glGetError__ },
3236 {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3237 {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
3238 {"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
3239 {"glHint", "(II)V", (void *) android_glHint__II },
3240 {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3241 {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3242 {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3243 {"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3244 {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3245 {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3246 {"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3247 {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3248 {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3249 {"glLightx", "(III)V", (void *) android_glLightx__III },
3250 {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3251 {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3252 {"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3253 {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3254 {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3255 {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3256 {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3257 {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3258 {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3259 {"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3260 {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3261 {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3262 {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3263 {"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3264 {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3265 {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3266 {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3267 {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3268 {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3269 {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3270 {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3271 {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3272 {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3273 {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3274 {"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3275 {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3276 {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3277 {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3278 {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3279 {"glPointSize", "(F)V", (void *) android_glPointSize__F },
3280 {"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3281 {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3282 {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3283 {"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3284 {"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3285 {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3286 {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3287 {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3288 {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3289 {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3290 {"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3291 {"glScalex", "(III)V", (void *) android_glScalex__III },
3292 {"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3293 {"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3294 {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3295 {"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3296 {"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3297 {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3298 {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3299 {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3300 {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3301 {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3302 {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3303 {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3304 {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3305 {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3306 {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3307 {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3308 {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3309 {"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3310 {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3311 {"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3314 int register_android_opengl_jni_GLES10(JNIEnv *_env)
3317 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));