diff options
author | Elliott Hughes <enh@google.com> | 2011-04-12 10:19:11 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-04-12 10:19:11 -0700 |
commit | ae447967b5f07dd789a7488aa9e190637478a97c (patch) | |
tree | 72a4493d4d88ef11c35a4107658e1d459c0149b3 /core/jni | |
parent | 3f9659a096f79902fd846f84352ffe513decb0e1 (diff) | |
parent | 24ce5fb2cc09d0a14406e7b935f8648c5720d27e (diff) | |
download | frameworks_base-ae447967b5f07dd789a7488aa9e190637478a97c.zip frameworks_base-ae447967b5f07dd789a7488aa9e190637478a97c.tar.gz frameworks_base-ae447967b5f07dd789a7488aa9e190637478a97c.tar.bz2 |
Merge "Kill the global references in the OpenGL wrappers."
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_opengl_GLES10.cpp | 186 | ||||
-rw-r--r-- | core/jni/android_opengl_GLES10Ext.cpp | 65 | ||||
-rw-r--r-- | core/jni/android_opengl_GLES11.cpp | 236 | ||||
-rw-r--r-- | core/jni/android_opengl_GLES11Ext.cpp | 236 | ||||
-rw-r--r-- | core/jni/android_opengl_GLES20.cpp | 398 | ||||
-rw-r--r-- | core/jni/com_google_android_gles_jni_GLImpl.cpp | 558 |
6 files changed, 756 insertions, 923 deletions
diff --git a/core/jni/android_opengl_GLES10.cpp b/core/jni/android_opengl_GLES10.cpp index 2685d75..6c29d6c 100644 --- a/core/jni/android_opengl_GLES10.cpp +++ b/core/jni/android_opengl_GLES10.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2009, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -41,10 +43,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; static jmethodID getBaseArrayOffsetID; @@ -55,7 +53,7 @@ static jfieldID elementSizeShiftID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -76,26 +74,6 @@ nativeClassInitBuffer(JNIEnv *_env) _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -116,13 +94,13 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -141,7 +119,8 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) { jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); buf += position << elementSizeShift; } else { - _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); + jniThrowException(_env, "java/lang/IllegalArgumentException", + "Must use a native order direct Buffer"); } return (void*) buf; } @@ -154,7 +133,6 @@ getNumCompressedTextureFormats() { } // -------------------------------------------------------------------------- - /* void glActiveTexture ( GLenum texture ) */ static void android_glActiveTexture__I @@ -431,16 +409,16 @@ android_glDeleteTextures__I_3II GLuint *textures = (GLuint *) 0; if (!textures_ref) { - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -469,7 +447,7 @@ android_glDeleteTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteTextures( @@ -560,7 +538,7 @@ android_glDrawElements__IIILjava_nio_Buffer_2 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining); if (_remaining < count) { - _env->ThrowNew(AIOOBEClass, "remaining() < count"); + jniThrowException(_env, "java/lang/ArrayIndexOutOfBoundsException", "remaining() < count"); goto exit; } glDrawElements( @@ -627,11 +605,11 @@ android_glFogfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -661,7 +639,7 @@ android_glFogfv__I_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -715,7 +693,7 @@ android_glFogfv__ILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glFogfv( @@ -748,11 +726,11 @@ android_glFogxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -782,7 +760,7 @@ android_glFogxv__I_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -836,7 +814,7 @@ android_glFogxv__ILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glFogxv( @@ -898,18 +876,18 @@ android_glGenTextures__I_3II if (!textures_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -940,7 +918,7 @@ android_glGenTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenTextures( @@ -974,12 +952,12 @@ android_glGetIntegerv__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1316,7 +1294,7 @@ android_glGetIntegerv__I_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -1678,7 +1656,7 @@ android_glGetIntegerv__ILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetIntegerv( @@ -1692,16 +1670,10 @@ exit: } } -#include <string.h> - /* const GLubyte * glGetString ( GLenum name ) */ -static -jstring -android_glGetString - (JNIEnv *_env, jobject _this, jint name) { - const char * chars = (const char *)glGetString((GLenum)name); - jstring output = _env->NewStringUTF(chars); - return output; +static jstring android_glGetString(JNIEnv* _env, jobject, jint name) { + const char* chars = (const char*) glGetString((GLenum) name); + return _env->NewStringUTF(chars); } /* void glHint ( GLenum target, GLenum mode ) */ static void @@ -1732,11 +1704,11 @@ android_glLightModelfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1757,7 +1729,7 @@ android_glLightModelfv__I_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -1802,7 +1774,7 @@ android_glLightModelfv__ILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightModelfv( @@ -1835,11 +1807,11 @@ android_glLightModelxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1860,7 +1832,7 @@ android_glLightModelxv__I_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -1905,7 +1877,7 @@ android_glLightModelxv__ILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightModelxv( @@ -1939,11 +1911,11 @@ android_glLightfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1990,7 +1962,7 @@ android_glLightfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -2062,7 +2034,7 @@ android_glLightfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightfv( @@ -2097,11 +2069,11 @@ android_glLightxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2148,7 +2120,7 @@ android_glLightxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -2220,7 +2192,7 @@ android_glLightxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightxv( @@ -2269,11 +2241,11 @@ android_glLoadMatrixf___3FI GLfloat *m = (GLfloat *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2318,11 +2290,11 @@ android_glLoadMatrixx___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2387,11 +2359,11 @@ android_glMaterialfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2424,7 +2396,7 @@ android_glMaterialfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -2482,7 +2454,7 @@ android_glMaterialfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glMaterialfv( @@ -2517,11 +2489,11 @@ android_glMaterialxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2554,7 +2526,7 @@ android_glMaterialxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -2612,7 +2584,7 @@ android_glMaterialxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glMaterialxv( @@ -2645,11 +2617,11 @@ android_glMultMatrixf___3FI GLfloat *m = (GLfloat *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2694,11 +2666,11 @@ android_glMultMatrixx___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -3079,11 +3051,11 @@ android_glTexEnvfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3110,7 +3082,7 @@ android_glTexEnvfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -3162,7 +3134,7 @@ android_glTexEnvfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnvfv( @@ -3197,11 +3169,11 @@ android_glTexEnvxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3228,7 +3200,7 @@ android_glTexEnvxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -3280,7 +3252,7 @@ android_glTexEnvxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnvxv( diff --git a/core/jni/android_opengl_GLES10Ext.cpp b/core/jni/android_opengl_GLES10Ext.cpp index f17ef21..1154cef 100644 --- a/core/jni/android_opengl_GLES10Ext.cpp +++ b/core/jni/android_opengl_GLES10Ext.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2009, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -28,10 +30,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; static jmethodID getBaseArrayOffsetID; @@ -42,7 +40,7 @@ static jfieldID elementSizeShiftID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -64,26 +62,6 @@ nativeClassInitBuffer(JNIEnv *_env) } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -104,13 +82,13 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -123,7 +101,6 @@ releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) } // -------------------------------------------------------------------------- - /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ static jint android_glQueryMatrixxOES___3II_3II @@ -139,18 +116,18 @@ android_glQueryMatrixxOES___3II_3II if (!mantissa_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "mantissa == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "mantissa == null"); goto exit; } if (mantissaOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "mantissaOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "mantissaOffset < 0"); goto exit; } _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; if (_mantissaRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "length - mantissaOffset < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - mantissaOffset < 16"); goto exit; } mantissa_base = (GLfixed *) @@ -159,18 +136,18 @@ android_glQueryMatrixxOES___3II_3II if (!exponent_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "exponent == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "exponent == null"); goto exit; } if (exponentOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "exponentOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "exponentOffset < 0"); goto exit; } _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; if (_exponentRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "length - exponentOffset < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - exponentOffset < 16"); goto exit; } exponent_base = (GLint *) @@ -210,13 +187,13 @@ android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining); if (_mantissaRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 16"); goto exit; } exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining); if (_exponentRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 16"); goto exit; } _returnValue = glQueryMatrixxOES( diff --git a/core/jni/android_opengl_GLES11.cpp b/core/jni/android_opengl_GLES11.cpp index 1c326ba..d038f20 100644 --- a/core/jni/android_opengl_GLES11.cpp +++ b/core/jni/android_opengl_GLES11.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2009, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -35,10 +37,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; static jmethodID getBaseArrayOffsetID; @@ -49,7 +47,7 @@ static jfieldID elementSizeShiftID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -71,26 +69,6 @@ nativeClassInitBuffer(JNIEnv *_env) } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -111,13 +89,13 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -137,13 +115,13 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) { jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); buf += position << elementSizeShift; } else { - _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); + jniThrowException(_env, "java/lang/IllegalArgumentException", + "Must use a native order direct Buffer"); } return (void*) buf; } // -------------------------------------------------------------------------- - /* void glBindBuffer ( GLenum target, GLuint buffer ) */ static void android_glBindBuffer__II @@ -165,7 +143,7 @@ android_glBufferData__IILjava_nio_Buffer_2I if (data_buf) { data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } } @@ -192,7 +170,7 @@ android_glBufferSubData__IIILjava_nio_Buffer_2 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } glBufferSubData( @@ -217,11 +195,11 @@ android_glClipPlanef__I_3FI GLfloat *equation = (GLfloat *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; @@ -268,11 +246,11 @@ android_glClipPlanex__I_3II GLfixed *equation = (GLfixed *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; @@ -343,16 +321,16 @@ android_glDeleteBuffers__I_3II GLuint *buffers = (GLuint *) 0; if (!buffers_ref) { - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -381,7 +359,7 @@ android_glDeleteBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteBuffers( @@ -418,18 +396,18 @@ android_glGenBuffers__I_3II if (!buffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -460,7 +438,7 @@ android_glGenBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenBuffers( @@ -485,12 +463,12 @@ android_glGetBooleanv__I_3ZI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -540,18 +518,18 @@ android_glGetBufferParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -583,7 +561,7 @@ android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetBufferParameteriv( @@ -609,12 +587,12 @@ android_glGetClipPlanef__I_3FI if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; @@ -664,12 +642,12 @@ android_glGetClipPlanex__I_3II if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; @@ -719,12 +697,12 @@ android_glGetFixedv__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -774,12 +752,12 @@ android_glGetFloatv__I_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -829,12 +807,12 @@ android_glGetLightfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -882,7 +860,7 @@ android_glGetLightfv__II_3FI } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -956,7 +934,7 @@ android_glGetLightfv__IILjava_nio_FloatBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetLightfv( @@ -982,12 +960,12 @@ android_glGetLightxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1035,7 +1013,7 @@ android_glGetLightxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -1109,7 +1087,7 @@ android_glGetLightxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetLightxv( @@ -1135,12 +1113,12 @@ android_glGetMaterialfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1174,7 +1152,7 @@ android_glGetMaterialfv__II_3FI } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -1234,7 +1212,7 @@ android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetMaterialfv( @@ -1260,12 +1238,12 @@ android_glGetMaterialxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1299,7 +1277,7 @@ android_glGetMaterialxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -1359,7 +1337,7 @@ android_glGetMaterialxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetMaterialxv( @@ -1385,12 +1363,12 @@ android_glGetTexEnvfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1418,7 +1396,7 @@ android_glGetTexEnvfv__II_3FI } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -1472,7 +1450,7 @@ android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetTexEnvfv( @@ -1498,12 +1476,12 @@ android_glGetTexEnviv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1531,7 +1509,7 @@ android_glGetTexEnviv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -1585,7 +1563,7 @@ android_glGetTexEnviv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetTexEnviv( @@ -1611,12 +1589,12 @@ android_glGetTexEnvxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1644,7 +1622,7 @@ android_glGetTexEnvxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -1698,7 +1676,7 @@ android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetTexEnvxv( @@ -1724,18 +1702,18 @@ android_glGetTexParameterfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -1767,7 +1745,7 @@ android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameterfv( @@ -1793,18 +1771,18 @@ android_glGetTexParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -1836,7 +1814,7 @@ android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameteriv( @@ -1862,18 +1840,18 @@ android_glGetTexParameterxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -1905,7 +1883,7 @@ android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameterxv( @@ -1983,16 +1961,16 @@ android_glPointParameterfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -2021,7 +1999,7 @@ android_glPointParameterfv__ILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glPointParameterfv( @@ -2054,16 +2032,16 @@ android_glPointParameterxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -2092,7 +2070,7 @@ android_glPointParameterxv__ILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glPointParameterxv( @@ -2160,11 +2138,11 @@ android_glTexEnviv__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2191,7 +2169,7 @@ android_glTexEnviv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -2243,7 +2221,7 @@ android_glTexEnviv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnviv( @@ -2267,16 +2245,16 @@ android_glTexParameterfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -2306,7 +2284,7 @@ android_glTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameterfv( @@ -2341,16 +2319,16 @@ android_glTexParameteriv__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -2380,7 +2358,7 @@ android_glTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameteriv( @@ -2404,16 +2382,16 @@ android_glTexParameterxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -2443,7 +2421,7 @@ android_glTexParameterxv__IILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameterxv( diff --git a/core/jni/android_opengl_GLES11Ext.cpp b/core/jni/android_opengl_GLES11Ext.cpp index 1390506..d6dc0fe 100644 --- a/core/jni/android_opengl_GLES11Ext.cpp +++ b/core/jni/android_opengl_GLES11Ext.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2009, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -37,10 +39,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; static jmethodID getBaseArrayOffsetID; @@ -51,7 +49,7 @@ static jfieldID elementSizeShiftID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -73,26 +71,6 @@ nativeClassInitBuffer(JNIEnv *_env) } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -113,13 +91,13 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -139,12 +117,12 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) { jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); buf += position << elementSizeShift; } else { - _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); + jniThrowException(_env, "java/lang/IllegalArgumentException", + "Must use a native order direct Buffer"); } return (void*) buf; } // -------------------------------------------------------------------------- - /* void glBlendEquationSeparateOES ( GLenum modeRGB, GLenum modeAlpha ) */ static void android_glBlendEquationSeparateOES__II @@ -224,16 +202,16 @@ android_glDrawTexsvOES___3SI GLshort *coords = (GLshort *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLshort *) @@ -261,7 +239,7 @@ android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexsvOES( @@ -283,16 +261,16 @@ android_glDrawTexivOES___3II GLint *coords = (GLint *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLint *) @@ -320,7 +298,7 @@ android_glDrawTexivOES__Ljava_nio_IntBuffer_2 coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexivOES( @@ -342,16 +320,16 @@ android_glDrawTexxvOES___3II GLfixed *coords = (GLfixed *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLfixed *) @@ -379,7 +357,7 @@ android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexxvOES( @@ -414,16 +392,16 @@ android_glDrawTexfvOES___3FI GLfloat *coords = (GLfloat *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLfloat *) @@ -451,7 +429,7 @@ android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexfvOES( @@ -542,11 +520,11 @@ android_glClipPlanexOES__I_3II GLfixed *equation = (GLfixed *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; @@ -625,11 +603,11 @@ android_glFogxvOES__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -692,18 +670,18 @@ android_glGetClipPlanexOES__I_3II if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; if (_remaining < 4) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 4"); goto exit; } eqn_base = (GLfixed *) @@ -734,7 +712,7 @@ android_glGetClipPlanexOES__ILjava_nio_IntBuffer_2 eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining); if (_remaining < 4) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 4"); goto exit; } glGetClipPlanexOES( @@ -759,12 +737,12 @@ android_glGetFixedvOES__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -814,12 +792,12 @@ android_glGetLightxvOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -871,12 +849,12 @@ android_glGetMaterialxvOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -928,12 +906,12 @@ android_glGetTexEnvxvOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -985,12 +963,12 @@ android_glGetTexParameterxvOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1050,11 +1028,11 @@ android_glLightModelxvOES__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1112,11 +1090,11 @@ android_glLightxvOES__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1174,11 +1152,11 @@ android_glLoadMatrixxOES___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -1234,11 +1212,11 @@ android_glMaterialxvOES__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1287,11 +1265,11 @@ android_glMultMatrixxOES___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -1384,11 +1362,11 @@ android_glPointParameterxvOES__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1498,11 +1476,11 @@ android_glTexEnvxvOES__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1562,11 +1540,11 @@ android_glTexParameterxvOES__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1647,16 +1625,16 @@ android_glDeleteRenderbuffersOES__I_3II GLuint *renderbuffers = (GLuint *) 0; if (!renderbuffers_ref) { - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } renderbuffers_base = (GLuint *) @@ -1685,7 +1663,7 @@ android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteRenderbuffersOES( @@ -1710,18 +1688,18 @@ android_glGenRenderbuffersOES__I_3II if (!renderbuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } renderbuffers_base = (GLuint *) @@ -1752,7 +1730,7 @@ android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenRenderbuffersOES( @@ -1789,18 +1767,18 @@ android_glGetRenderbufferParameterivOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -1832,7 +1810,7 @@ android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetRenderbufferParameterivOES( @@ -1877,16 +1855,16 @@ android_glDeleteFramebuffersOES__I_3II GLuint *framebuffers = (GLuint *) 0; if (!framebuffers_ref) { - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } framebuffers_base = (GLuint *) @@ -1915,7 +1893,7 @@ android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteFramebuffersOES( @@ -1940,18 +1918,18 @@ android_glGenFramebuffersOES__I_3II if (!framebuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } framebuffers_base = (GLuint *) @@ -1982,7 +1960,7 @@ android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenFramebuffersOES( @@ -2043,18 +2021,18 @@ android_glGetFramebufferAttachmentParameterivOES__III_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -2087,7 +2065,7 @@ android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetFramebufferAttachmentParameterivOES( @@ -2221,11 +2199,11 @@ android_glClipPlanefOES__I_3FI GLfloat *equation = (GLfloat *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; @@ -2274,18 +2252,18 @@ android_glGetClipPlanefOES__I_3FI if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; if (_remaining < 4) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 4"); goto exit; } eqn_base = (GLfloat *) @@ -2316,7 +2294,7 @@ android_glGetClipPlanefOES__ILjava_nio_FloatBuffer_2 eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining); if (_remaining < 4) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 4"); goto exit; } glGetClipPlanefOES( @@ -2359,11 +2337,11 @@ android_glTexGenfvOES__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2423,11 +2401,11 @@ android_glTexGenivOES__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2487,11 +2465,11 @@ android_glTexGenxvOES__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2542,12 +2520,12 @@ android_glGetTexGenfvOES__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2599,12 +2577,12 @@ android_glGetTexGenivOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2656,12 +2634,12 @@ android_glGetTexGenxvOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; diff --git a/core/jni/android_opengl_GLES20.cpp b/core/jni/android_opengl_GLES20.cpp index 7ac0f6e..a53e4d7 100644 --- a/core/jni/android_opengl_GLES20.cpp +++ b/core/jni/android_opengl_GLES20.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2009, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -28,10 +30,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; static jmethodID getBaseArrayOffsetID; @@ -42,7 +40,7 @@ static jfieldID elementSizeShiftID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -64,26 +62,6 @@ nativeClassInitBuffer(JNIEnv *_env) } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -104,13 +82,13 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -130,7 +108,8 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) { jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); buf += position << elementSizeShift; } else { - _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); + jniThrowException(_env, "java/lang/IllegalArgumentException", + "Must use a native order direct Buffer"); } return (void*) buf; } @@ -148,7 +127,6 @@ static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, } // -------------------------------------------------------------------------- - /* void glActiveTexture ( GLenum texture ) */ static void android_glActiveTexture__I @@ -175,7 +153,7 @@ android_glBindAttribLocation__IILjava_lang_String_2 const char* _nativename = 0; if (!name) { - _env->ThrowNew(IAEClass, "name == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); goto exit; } _nativename = _env->GetStringUTFChars(name, 0); @@ -297,7 +275,7 @@ android_glBufferData__IILjava_nio_Buffer_2I if (data_buf) { data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } } @@ -324,7 +302,7 @@ android_glBufferSubData__IIILjava_nio_Buffer_2 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } glBufferSubData( @@ -530,16 +508,16 @@ android_glDeleteBuffers__I_3II GLuint *buffers = (GLuint *) 0; if (!buffers_ref) { - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -568,7 +546,7 @@ android_glDeleteBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteBuffers( @@ -591,11 +569,11 @@ android_glDeleteFramebuffers__I_3II GLuint *framebuffers = (GLuint *) 0; if (!framebuffers_ref) { - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; @@ -651,11 +629,11 @@ android_glDeleteRenderbuffers__I_3II GLuint *renderbuffers = (GLuint *) 0; if (!renderbuffers_ref) { - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; @@ -711,16 +689,16 @@ android_glDeleteTextures__I_3II GLuint *textures = (GLuint *) 0; if (!textures_ref) { - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -749,7 +727,7 @@ android_glDeleteTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteTextures( @@ -852,7 +830,7 @@ android_glDrawElements__IIILjava_nio_Buffer_2 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining); if (_remaining < count) { - _env->ThrowNew(AIOOBEClass, "remaining() < count"); + jniThrowException(_env, "java/lang/ArrayIndexOutOfBoundsException", "remaining() < count"); goto exit; } glDrawElements( @@ -945,18 +923,18 @@ android_glGenBuffers__I_3II if (!buffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -987,7 +965,7 @@ android_glGenBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenBuffers( @@ -1021,12 +999,12 @@ android_glGenFramebuffers__I_3II if (!framebuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; @@ -1076,12 +1054,12 @@ android_glGenRenderbuffers__I_3II if (!renderbuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; @@ -1131,18 +1109,18 @@ android_glGenTextures__I_3II if (!textures_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -1173,7 +1151,7 @@ android_glGenTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenTextures( @@ -1207,12 +1185,12 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI if (!length_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "length == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); goto exit; } if (lengthOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "lengthOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); goto exit; } _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; @@ -1222,12 +1200,12 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI if (!size_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "size == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "size == null"); goto exit; } if (sizeOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "sizeOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "sizeOffset < 0"); goto exit; } _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; @@ -1237,12 +1215,12 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI if (!type_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "type == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "type == null"); goto exit; } if (typeOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "typeOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "typeOffset < 0"); goto exit; } _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; @@ -1252,12 +1230,12 @@ android_glGetActiveAttrib__III_3II_3II_3II_3BI if (!name_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "name == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); goto exit; } if (nameOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "nameOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "nameOffset < 0"); goto exit; } _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; @@ -1352,12 +1330,12 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI if (!length_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "length == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); goto exit; } if (lengthOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "lengthOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); goto exit; } _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; @@ -1367,12 +1345,12 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI if (!size_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "size == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "size == null"); goto exit; } if (sizeOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "sizeOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "sizeOffset < 0"); goto exit; } _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; @@ -1382,12 +1360,12 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI if (!type_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "type == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "type == null"); goto exit; } if (typeOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "typeOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "typeOffset < 0"); goto exit; } _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; @@ -1397,12 +1375,12 @@ android_glGetActiveUniform__III_3II_3II_3II_3BI if (!name_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "name == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); goto exit; } if (nameOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "nameOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "nameOffset < 0"); goto exit; } _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; @@ -1491,12 +1469,12 @@ android_glGetAttachedShaders__II_3II_3II if (!count_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "count == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "count == null"); goto exit; } if (countOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "countOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "countOffset < 0"); goto exit; } _countRemaining = _env->GetArrayLength(count_ref) - countOffset; @@ -1506,12 +1484,12 @@ android_glGetAttachedShaders__II_3II_3II if (!shaders_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "shaders == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "shaders == null"); goto exit; } if (shadersOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "shadersOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "shadersOffset < 0"); goto exit; } _shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset; @@ -1573,7 +1551,7 @@ android_glGetAttribLocation__ILjava_lang_String_2 const char* _nativename = 0; if (!name) { - _env->ThrowNew(IAEClass, "name == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); goto exit; } _nativename = _env->GetStringUTFChars(name, 0); @@ -1602,12 +1580,12 @@ android_glGetBooleanv__I_3ZI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1657,18 +1635,18 @@ android_glGetBufferParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -1700,7 +1678,7 @@ android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetBufferParameteriv( @@ -1735,12 +1713,12 @@ android_glGetFloatv__I_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1790,12 +1768,12 @@ android_glGetFramebufferAttachmentParameteriv__III_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1849,12 +1827,12 @@ android_glGetIntegerv__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2191,7 +2169,7 @@ android_glGetIntegerv__I_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -2553,7 +2531,7 @@ android_glGetIntegerv__ILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetIntegerv( @@ -2578,12 +2556,12 @@ android_glGetProgramiv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2624,32 +2602,24 @@ android_glGetProgramiv__IILjava_nio_IntBuffer_2 } } -#include <string.h> +#include <stdlib.h> /* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ -static -jstring -android_glGetProgramInfoLog (JNIEnv *_env, jobject _this, jint shader) { +static jstring android_glGetProgramInfoLog(JNIEnv *_env, jobject, jint shader) { GLint infoLen = 0; - jstring _result = 0; - char* buf = 0; glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen) { - char* buf = (char*) malloc(infoLen); - if (buf == 0) { - _env->ThrowNew(IAEClass, "out of memory"); - goto exit; - } - glGetProgramInfoLog(shader, infoLen, NULL, buf); - _result = _env->NewStringUTF(buf); - } else { - _result = _env->NewStringUTF(""); + if (!infoLen) { + return _env->NewStringUTF(""); } -exit: - if (buf) { - free(buf); + char* buf = (char*) malloc(infoLen); + if (buf == NULL) { + jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); + return NULL; } - return _result; + glGetProgramInfoLog(shader, infoLen, NULL, buf); + jstring result = _env->NewStringUTF(buf); + free(buf); + return result; } /* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ static void @@ -2662,12 +2632,12 @@ android_glGetRenderbufferParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2719,12 +2689,12 @@ android_glGetShaderiv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2765,32 +2735,24 @@ android_glGetShaderiv__IILjava_nio_IntBuffer_2 } } -#include <string.h> +#include <stdlib.h> /* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ -static -jstring -android_glGetShaderInfoLog (JNIEnv *_env, jobject _this, jint shader) { +static jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) { GLint infoLen = 0; - jstring _result = 0; - char* buf = 0; glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen) { - char* buf = (char*) malloc(infoLen); - if (buf == 0) { - _env->ThrowNew(IAEClass, "out of memory"); - goto exit; - } - glGetShaderInfoLog(shader, infoLen, NULL, buf); - _result = _env->NewStringUTF(buf); - } else { - _result = _env->NewStringUTF(""); + if (!infoLen) { + return _env->NewStringUTF(""); } -exit: - if (buf) { - free(buf); + char* buf = (char*) malloc(infoLen); + if (buf == NULL) { + jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); + return NULL; } - return _result; + glGetShaderInfoLog(shader, infoLen, NULL, buf); + jstring result = _env->NewStringUTF(buf); + free(buf); + return result; } /* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ static void @@ -2806,12 +2768,12 @@ android_glGetShaderPrecisionFormat__II_3II_3II if (!range_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "range == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "range == null"); goto exit; } if (rangeOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "rangeOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "rangeOffset < 0"); goto exit; } _rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset; @@ -2821,12 +2783,12 @@ android_glGetShaderPrecisionFormat__II_3II_3II if (!precision_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "precision == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "precision == null"); goto exit; } if (precisionOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "precisionOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "precisionOffset < 0"); goto exit; } _precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset; @@ -2894,12 +2856,12 @@ android_glGetShaderSource__II_3II_3BI if (!length_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "length == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); goto exit; } if (lengthOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "lengthOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); goto exit; } _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; @@ -2909,12 +2871,12 @@ android_glGetShaderSource__II_3II_3BI if (!source_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "source == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "source == null"); goto exit; } if (sourceOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "sourceOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "sourceOffset < 0"); goto exit; } _sourceRemaining = _env->GetArrayLength(source_ref) - sourceOffset; @@ -2961,16 +2923,10 @@ android_glGetShaderSource__IILjava_nio_IntBuffer_2B } } -#include <string.h> - /* const GLubyte * glGetString ( GLenum name ) */ -static -jstring -android_glGetString - (JNIEnv *_env, jobject _this, jint name) { - const char * chars = (const char *)glGetString((GLenum)name); - jstring output = _env->NewStringUTF(chars); - return output; +static jstring android_glGetString(JNIEnv* _env, jobject, jint name) { + const char* chars = (const char*) glGetString((GLenum) name); + return _env->NewStringUTF(chars); } /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ static void @@ -2983,18 +2939,18 @@ android_glGetTexParameterfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -3026,7 +2982,7 @@ android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameterfv( @@ -3052,18 +3008,18 @@ android_glGetTexParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -3095,7 +3051,7 @@ android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameteriv( @@ -3121,12 +3077,12 @@ android_glGetUniformfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3178,12 +3134,12 @@ android_glGetUniformiv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3232,7 +3188,7 @@ android_glGetUniformLocation__ILjava_lang_String_2 const char* _nativename = 0; if (!name) { - _env->ThrowNew(IAEClass, "name == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); goto exit; } _nativename = _env->GetStringUTFChars(name, 0); @@ -3261,12 +3217,12 @@ android_glGetVertexAttribfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3318,12 +3274,12 @@ android_glGetVertexAttribiv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3566,11 +3522,11 @@ android_glShaderBinary__I_3IIILjava_nio_Buffer_2I GLvoid *binary = (GLvoid *) 0; if (!shaders_ref) { - _env->ThrowNew(IAEClass, "shaders == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "shaders == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _shadersRemaining = _env->GetArrayLength(shaders_ref) - offset; @@ -3633,7 +3589,7 @@ android_glShaderSource (JNIEnv *_env, jobject _this, jint shader, jstring string) { if (!string) { - _env->ThrowNew(IAEClass, "string == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "string == null"); return; } @@ -3754,16 +3710,16 @@ android_glTexParameterfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -3793,7 +3749,7 @@ android_glTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameterfv( @@ -3828,16 +3784,16 @@ android_glTexParameteriv__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -3867,7 +3823,7 @@ android_glTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameteriv( @@ -3928,11 +3884,11 @@ android_glUniform1fv__II_3FI GLfloat *v = (GLfloat *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -3991,11 +3947,11 @@ android_glUniform1iv__II_3II GLint *v = (GLint *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4055,11 +4011,11 @@ android_glUniform2fv__II_3FI GLfloat *v = (GLfloat *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4119,11 +4075,11 @@ android_glUniform2iv__II_3II GLint *v = (GLint *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4184,11 +4140,11 @@ android_glUniform3fv__II_3FI GLfloat *v = (GLfloat *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4249,11 +4205,11 @@ android_glUniform3iv__II_3II GLint *v = (GLint *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4315,11 +4271,11 @@ android_glUniform4fv__II_3FI GLfloat *v = (GLfloat *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4381,11 +4337,11 @@ android_glUniform4iv__II_3II GLint *v = (GLint *) 0; if (!v_ref) { - _env->ThrowNew(IAEClass, "v == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(v_ref) - offset; @@ -4434,11 +4390,11 @@ android_glUniformMatrix2fv__IIZ_3FI GLfloat *value = (GLfloat *) 0; if (!value_ref) { - _env->ThrowNew(IAEClass, "value == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(value_ref) - offset; @@ -4489,11 +4445,11 @@ android_glUniformMatrix3fv__IIZ_3FI GLfloat *value = (GLfloat *) 0; if (!value_ref) { - _env->ThrowNew(IAEClass, "value == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(value_ref) - offset; @@ -4544,11 +4500,11 @@ android_glUniformMatrix4fv__IIZ_3FI GLfloat *value = (GLfloat *) 0; if (!value_ref) { - _env->ThrowNew(IAEClass, "value == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(value_ref) - offset; @@ -4627,11 +4583,11 @@ android_glVertexAttrib1fv__I_3FI GLfloat *values = (GLfloat *) 0; if (!values_ref) { - _env->ThrowNew(IAEClass, "values == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(values_ref) - offset; @@ -4689,11 +4645,11 @@ android_glVertexAttrib2fv__I_3FI GLfloat *values = (GLfloat *) 0; if (!values_ref) { - _env->ThrowNew(IAEClass, "values == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(values_ref) - offset; @@ -4752,11 +4708,11 @@ android_glVertexAttrib3fv__I_3FI GLfloat *values = (GLfloat *) 0; if (!values_ref) { - _env->ThrowNew(IAEClass, "values == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(values_ref) - offset; @@ -4816,11 +4772,11 @@ android_glVertexAttrib4fv__I_3FI GLfloat *values = (GLfloat *) 0; if (!values_ref) { - _env->ThrowNew(IAEClass, "values == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(values_ref) - offset; diff --git a/core/jni/com_google_android_gles_jni_GLImpl.cpp b/core/jni/com_google_android_gles_jni_GLImpl.cpp index bf613e1..8777131 100644 --- a/core/jni/com_google_android_gles_jni_GLImpl.cpp +++ b/core/jni/com_google_android_gles_jni_GLImpl.cpp @@ -2,21 +2,23 @@ ** ** Copyright 2006, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ // This source file is automatically generated +#include "jni.h" +#include "JNIHelp.h" #include <android_runtime/AndroidRuntime.h> #include <utils/misc.h> @@ -64,10 +66,6 @@ static int initialized = 0; static jclass nioAccessClass; static jclass bufferClass; -static jclass OOMEClass; -static jclass UOEClass; -static jclass IAEClass; -static jclass AIOOBEClass; static jclass G11ImplClass; static jmethodID getBasePointerID; static jmethodID getBaseArrayID; @@ -85,7 +83,7 @@ static jfieldID have_OES_texture_cube_mapID; /* Cache method IDs each time the class is loaded. */ static void -nativeClassInitBuffer(JNIEnv *_env) +nativeClassInit(JNIEnv *_env, jclass glImplClass) { jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); @@ -115,26 +113,6 @@ nativeClassInitBuffer(JNIEnv *_env) _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); } -static void -nativeClassInit(JNIEnv *_env, jclass glImplClass) -{ - nativeClassInitBuffer(_env); - - jclass IAEClassLocal = - _env->FindClass("java/lang/IllegalArgumentException"); - jclass OOMEClassLocal = - _env->FindClass("java/lang/OutOfMemoryError"); - jclass UOEClassLocal = - _env->FindClass("java/lang/UnsupportedOperationException"); - jclass AIOOBEClassLocal = - _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); - - IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); - OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); - UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); - AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); -} - static void * getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) { @@ -155,7 +133,7 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) *array = NULL; return (void *) (jint) pointer; } - + *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, getBaseArrayID, buffer); if (*array == NULL) { @@ -164,7 +142,7 @@ getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) offset = _env->CallStaticIntMethod(nioAccessClass, getBaseArrayOffsetID, buffer); data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); - + return (void *) ((char *) data + offset); } @@ -208,7 +186,8 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) { releasePointer(_env, array, buf, 0); } } else { - _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); + jniThrowException(_env, "java/lang/IllegalArgumentException", + "Must use a native order direct Buffer"); } } return buf; @@ -251,7 +230,7 @@ nextExtension(const GLubyte* pExtensions) { } } } - + static bool checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) { for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) { @@ -280,7 +259,6 @@ supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) { } // -------------------------------------------------------------------------- - /* void glActiveTexture ( GLenum texture ) */ static void android_glActiveTexture__I @@ -557,16 +535,16 @@ android_glDeleteTextures__I_3II GLuint *textures = (GLuint *) 0; if (!textures_ref) { - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -595,7 +573,7 @@ android_glDeleteTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteTextures( @@ -686,7 +664,7 @@ android_glDrawElements__IIILjava_nio_Buffer_2 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining); if (_remaining < count) { - _env->ThrowNew(AIOOBEClass, "remaining() < count"); + jniThrowException(_env, "java/lang/ArrayIndexOutOfBoundsException", "remaining() < count"); goto exit; } glDrawElements( @@ -753,11 +731,11 @@ android_glFogfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -787,7 +765,7 @@ android_glFogfv__I_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -841,7 +819,7 @@ android_glFogfv__ILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glFogfv( @@ -874,11 +852,11 @@ android_glFogxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -908,7 +886,7 @@ android_glFogxv__I_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -962,7 +940,7 @@ android_glFogxv__ILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glFogxv( @@ -1024,18 +1002,18 @@ android_glGenTextures__I_3II if (!textures_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "textures == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(textures_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } textures_base = (GLuint *) @@ -1066,7 +1044,7 @@ android_glGenTextures__ILjava_nio_IntBuffer_2 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenTextures( @@ -1100,12 +1078,12 @@ android_glGetIntegerv__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1442,7 +1420,7 @@ android_glGetIntegerv__I_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -1804,7 +1782,7 @@ android_glGetIntegerv__ILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetIntegerv( @@ -1818,16 +1796,10 @@ exit: } } -#include <string.h> - /* const GLubyte * glGetString ( GLenum name ) */ -static -jstring -android_glGetString - (JNIEnv *_env, jobject _this, jint name) { - const char * chars = (const char *)glGetString((GLenum)name); - jstring output = _env->NewStringUTF(chars); - return output; +static jstring android_glGetString(JNIEnv *_env, jobject, jint name) { + const char* chars = (const char*) glGetString((GLenum) name); + return _env->NewStringUTF(chars); } /* void glHint ( GLenum target, GLenum mode ) */ static void @@ -1858,11 +1830,11 @@ android_glLightModelfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1883,7 +1855,7 @@ android_glLightModelfv__I_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -1928,7 +1900,7 @@ android_glLightModelfv__ILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightModelfv( @@ -1961,11 +1933,11 @@ android_glLightModelxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -1986,7 +1958,7 @@ android_glLightModelxv__I_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -2031,7 +2003,7 @@ android_glLightModelxv__ILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightModelxv( @@ -2065,11 +2037,11 @@ android_glLightfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2116,7 +2088,7 @@ android_glLightfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -2188,7 +2160,7 @@ android_glLightfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightfv( @@ -2223,11 +2195,11 @@ android_glLightxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2274,7 +2246,7 @@ android_glLightxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -2346,7 +2318,7 @@ android_glLightxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glLightxv( @@ -2395,11 +2367,11 @@ android_glLoadMatrixf___3FI GLfloat *m = (GLfloat *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2444,11 +2416,11 @@ android_glLoadMatrixx___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2513,11 +2485,11 @@ android_glMaterialfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2550,7 +2522,7 @@ android_glMaterialfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -2608,7 +2580,7 @@ android_glMaterialfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glMaterialfv( @@ -2643,11 +2615,11 @@ android_glMaterialxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -2680,7 +2652,7 @@ android_glMaterialxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -2738,7 +2710,7 @@ android_glMaterialxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glMaterialxv( @@ -2771,11 +2743,11 @@ android_glMultMatrixf___3FI GLfloat *m = (GLfloat *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -2820,11 +2792,11 @@ android_glMultMatrixx___3II GLfixed *m = (GLfixed *) 0; if (!m_ref) { - _env->ThrowNew(IAEClass, "m == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "m == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(m_ref) - offset; @@ -3205,11 +3177,11 @@ android_glTexEnvfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3236,7 +3208,7 @@ android_glTexEnvfv__II_3FI break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -3288,7 +3260,7 @@ android_glTexEnvfv__IILjava_nio_FloatBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnvfv( @@ -3323,11 +3295,11 @@ android_glTexEnvxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -3354,7 +3326,7 @@ android_glTexEnvxv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -3406,7 +3378,7 @@ android_glTexEnvxv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnvxv( @@ -3569,18 +3541,18 @@ android_glQueryMatrixxOES___3II_3II if (!mantissa_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "mantissa == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "mantissa == null"); goto exit; } if (mantissaOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "mantissaOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "mantissaOffset < 0"); goto exit; } _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; if (_mantissaRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "length - mantissaOffset < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - mantissaOffset < 16"); goto exit; } mantissa_base = (GLfixed *) @@ -3589,18 +3561,18 @@ android_glQueryMatrixxOES___3II_3II if (!exponent_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "exponent == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "exponent == null"); goto exit; } if (exponentOffset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "exponentOffset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "exponentOffset < 0"); goto exit; } _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; if (_exponentRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "length - exponentOffset < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - exponentOffset < 16"); goto exit; } exponent_base = (GLint *) @@ -3640,13 +3612,13 @@ android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining); if (_mantissaRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 16"); goto exit; } exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining); if (_exponentRemaining < 16) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 16"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 16"); goto exit; } _returnValue = glQueryMatrixxOES( @@ -3685,7 +3657,7 @@ android_glBufferData__IILjava_nio_Buffer_2I if (data_buf) { data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } } @@ -3712,7 +3684,7 @@ android_glBufferSubData__IIILjava_nio_Buffer_2 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); if (_remaining < size) { - _env->ThrowNew(IAEClass, "remaining() < size"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); goto exit; } glBufferSubData( @@ -3737,16 +3709,16 @@ android_glClipPlanef__I_3FI GLfloat *equation = (GLfloat *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; if (_remaining < 4) { - _env->ThrowNew(IAEClass, "length - offset < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 4"); goto exit; } equation_base = (GLfloat *) @@ -3775,7 +3747,7 @@ android_glClipPlanef__ILjava_nio_FloatBuffer_2 equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining); if (_remaining < 4) { - _env->ThrowNew(IAEClass, "remaining() < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 4"); goto exit; } glClipPlanef( @@ -3798,16 +3770,16 @@ android_glClipPlanex__I_3II GLfixed *equation = (GLfixed *) 0; if (!equation_ref) { - _env->ThrowNew(IAEClass, "equation == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "equation == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(equation_ref) - offset; if (_remaining < 4) { - _env->ThrowNew(IAEClass, "length - offset < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 4"); goto exit; } equation_base = (GLfixed *) @@ -3836,7 +3808,7 @@ android_glClipPlanex__ILjava_nio_IntBuffer_2 equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining); if (_remaining < 4) { - _env->ThrowNew(IAEClass, "remaining() < 4"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 4"); goto exit; } glClipPlanex( @@ -3883,16 +3855,16 @@ android_glDeleteBuffers__I_3II GLuint *buffers = (GLuint *) 0; if (!buffers_ref) { - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -3921,7 +3893,7 @@ android_glDeleteBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteBuffers( @@ -3958,18 +3930,18 @@ android_glGenBuffers__I_3II if (!buffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "buffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(buffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } buffers_base = (GLuint *) @@ -4000,7 +3972,7 @@ android_glGenBuffers__ILjava_nio_IntBuffer_2 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenBuffers( @@ -4025,12 +3997,12 @@ android_glGetBooleanv__I_3ZI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4073,7 +4045,7 @@ android_glGetBooleanv__ILjava_nio_IntBuffer_2 static void android_glGetBufferParameteriv__II_3II (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetBufferParameteriv"); } @@ -4081,7 +4053,7 @@ android_glGetBufferParameteriv__II_3II static void android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetBufferParameteriv"); } @@ -4096,12 +4068,12 @@ android_glGetClipPlanef__I_3FI if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; @@ -4151,12 +4123,12 @@ android_glGetClipPlanex__I_3II if (!eqn_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "eqn == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "eqn == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(eqn_ref) - offset; @@ -4206,12 +4178,12 @@ android_glGetFixedv__I_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4261,12 +4233,12 @@ android_glGetFloatv__I_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4316,12 +4288,12 @@ android_glGetLightfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4369,7 +4341,7 @@ android_glGetLightfv__II_3FI } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -4443,7 +4415,7 @@ android_glGetLightfv__IILjava_nio_FloatBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetLightfv( @@ -4469,12 +4441,12 @@ android_glGetLightxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4522,7 +4494,7 @@ android_glGetLightxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -4596,7 +4568,7 @@ android_glGetLightxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetLightxv( @@ -4622,12 +4594,12 @@ android_glGetMaterialfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4661,7 +4633,7 @@ android_glGetMaterialfv__II_3FI } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfloat *) @@ -4721,7 +4693,7 @@ android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetMaterialfv( @@ -4747,12 +4719,12 @@ android_glGetMaterialxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4786,7 +4758,7 @@ android_glGetMaterialxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -4846,7 +4818,7 @@ android_glGetMaterialxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetMaterialxv( @@ -4872,12 +4844,12 @@ android_glGetTexEnviv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -4905,7 +4877,7 @@ android_glGetTexEnviv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -4959,7 +4931,7 @@ android_glGetTexEnviv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetTexEnviv( @@ -4985,12 +4957,12 @@ android_glGetTexEnvxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -5018,7 +4990,7 @@ android_glGetTexEnvxv__II_3II } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLfixed *) @@ -5072,7 +5044,7 @@ android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 } if (_remaining < _needed) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glGetTexEnvxv( @@ -5098,18 +5070,18 @@ android_glGetTexParameterfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -5141,7 +5113,7 @@ android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameterfv( @@ -5167,18 +5139,18 @@ android_glGetTexParameteriv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -5210,7 +5182,7 @@ android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameteriv( @@ -5236,18 +5208,18 @@ android_glGetTexParameterxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -5279,7 +5251,7 @@ android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glGetTexParameterxv( @@ -5357,16 +5329,16 @@ android_glPointParameterfv__I_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -5395,7 +5367,7 @@ android_glPointParameterfv__ILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glPointParameterfv( @@ -5428,16 +5400,16 @@ android_glPointParameterxv__I_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -5466,7 +5438,7 @@ android_glPointParameterxv__ILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glPointParameterxv( @@ -5534,11 +5506,11 @@ android_glTexEnviv__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -5565,7 +5537,7 @@ android_glTexEnviv__II_3II break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "length - offset < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); goto exit; } params_base = (GLint *) @@ -5617,7 +5589,7 @@ android_glTexEnviv__IILjava_nio_IntBuffer_2 break; } if (_remaining < _needed) { - _env->ThrowNew(IAEClass, "remaining() < needed"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); goto exit; } glTexEnviv( @@ -5641,16 +5613,16 @@ android_glTexParameterfv__II_3FI GLfloat *params = (GLfloat *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfloat *) @@ -5680,7 +5652,7 @@ android_glTexParameterfv__IILjava_nio_FloatBuffer_2 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameterfv( @@ -5715,16 +5687,16 @@ android_glTexParameteriv__II_3II GLint *params = (GLint *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLint *) @@ -5754,7 +5726,7 @@ android_glTexParameteriv__IILjava_nio_IntBuffer_2 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameteriv( @@ -5778,16 +5750,16 @@ android_glTexParameterxv__II_3II GLfixed *params = (GLfixed *) 0; if (!params_ref) { - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; if (_remaining < 1) { - _env->ThrowNew(IAEClass, "length - offset < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); goto exit; } params_base = (GLfixed *) @@ -5817,7 +5789,7 @@ android_glTexParameterxv__IILjava_nio_IntBuffer_2 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); if (_remaining < 1) { - _env->ThrowNew(IAEClass, "remaining() < 1"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); goto exit; } glTexParameterxv( @@ -5875,16 +5847,16 @@ android_glDrawTexfvOES___3FI GLfloat *coords = (GLfloat *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLfloat *) @@ -5912,7 +5884,7 @@ android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexfvOES( @@ -5947,16 +5919,16 @@ android_glDrawTexivOES___3II GLint *coords = (GLint *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLint *) @@ -5984,7 +5956,7 @@ android_glDrawTexivOES__Ljava_nio_IntBuffer_2 coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexivOES( @@ -6019,16 +5991,16 @@ android_glDrawTexsvOES___3SI GLshort *coords = (GLshort *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLshort *) @@ -6056,7 +6028,7 @@ android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexsvOES( @@ -6091,16 +6063,16 @@ android_glDrawTexxvOES___3II GLfixed *coords = (GLfixed *) 0; if (!coords_ref) { - _env->ThrowNew(IAEClass, "coords == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "coords == null"); goto exit; } if (offset < 0) { - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(coords_ref) - offset; if (_remaining < 5) { - _env->ThrowNew(IAEClass, "length - offset < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 5"); goto exit; } coords_base = (GLfixed *) @@ -6128,7 +6100,7 @@ android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining); if (_remaining < 5) { - _env->ThrowNew(IAEClass, "remaining() < 5"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 5"); goto exit; } glDrawTexxvOES( @@ -6223,7 +6195,7 @@ static void android_glBindFramebufferOES__II (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glBindFramebufferOES"); return; } @@ -6238,7 +6210,7 @@ static void android_glBindRenderbufferOES__II (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glBindRenderbufferOES"); return; } @@ -6253,7 +6225,7 @@ static void android_glBlendEquation__I (JNIEnv *_env, jobject _this, jint mode) { if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glBlendEquation"); return; } @@ -6267,7 +6239,7 @@ static void android_glBlendEquationSeparate__II (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glBlendEquationSeparate"); return; } @@ -6282,7 +6254,7 @@ static void android_glBlendFuncSeparate__IIII (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glBlendFuncSeparate"); return; } @@ -6299,7 +6271,7 @@ static jint android_glCheckFramebufferStatusOES__I (JNIEnv *_env, jobject _this, jint target) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glCheckFramebufferStatusOES"); return 0; } @@ -6315,7 +6287,7 @@ static void android_glDeleteFramebuffersOES__I_3II (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glDeleteFramebuffersOES"); return; } @@ -6326,18 +6298,18 @@ android_glDeleteFramebuffersOES__I_3II if (!framebuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } framebuffers_base = (GLuint *) @@ -6361,7 +6333,7 @@ static void android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glDeleteFramebuffersOES"); return; } @@ -6373,7 +6345,7 @@ android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteFramebuffersOES( @@ -6392,7 +6364,7 @@ static void android_glDeleteRenderbuffersOES__I_3II (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glDeleteRenderbuffersOES"); return; } @@ -6403,18 +6375,18 @@ android_glDeleteRenderbuffersOES__I_3II if (!renderbuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } renderbuffers_base = (GLuint *) @@ -6438,7 +6410,7 @@ static void android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glDeleteRenderbuffersOES"); return; } @@ -6450,7 +6422,7 @@ android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glDeleteRenderbuffersOES( @@ -6469,7 +6441,7 @@ static void android_glFramebufferRenderbufferOES__IIII (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glFramebufferRenderbufferOES"); return; } @@ -6486,7 +6458,7 @@ static void android_glFramebufferTexture2DOES__IIIII (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glFramebufferTexture2DOES"); return; } @@ -6504,7 +6476,7 @@ static void android_glGenerateMipmapOES__I (JNIEnv *_env, jobject _this, jint target) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGenerateMipmapOES"); return; } @@ -6518,7 +6490,7 @@ static void android_glGenFramebuffersOES__I_3II (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGenFramebuffersOES"); return; } @@ -6529,18 +6501,18 @@ android_glGenFramebuffersOES__I_3II if (!framebuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "framebuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(framebuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } framebuffers_base = (GLuint *) @@ -6564,7 +6536,7 @@ static void android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGenFramebuffersOES"); return; } @@ -6576,7 +6548,7 @@ android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenFramebuffersOES( @@ -6595,7 +6567,7 @@ static void android_glGenRenderbuffersOES__I_3II (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGenRenderbuffersOES"); return; } @@ -6606,18 +6578,18 @@ android_glGenRenderbuffersOES__I_3II if (!renderbuffers_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "renderbuffers == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "length - offset < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); goto exit; } renderbuffers_base = (GLuint *) @@ -6641,7 +6613,7 @@ static void android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGenRenderbuffersOES"); return; } @@ -6653,7 +6625,7 @@ android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); if (_remaining < n) { _exception = 1; - _env->ThrowNew(IAEClass, "remaining() < n"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); goto exit; } glGenRenderbuffersOES( @@ -6672,7 +6644,7 @@ static void android_glGetFramebufferAttachmentParameterivOES__III_3II (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetFramebufferAttachmentParameterivOES"); return; } @@ -6683,12 +6655,12 @@ android_glGetFramebufferAttachmentParameterivOES__III_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -6715,7 +6687,7 @@ static void android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetFramebufferAttachmentParameterivOES"); return; } @@ -6741,7 +6713,7 @@ static void android_glGetRenderbufferParameterivOES__II_3II (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetRenderbufferParameterivOES"); return; } @@ -6752,12 +6724,12 @@ android_glGetRenderbufferParameterivOES__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -6783,7 +6755,7 @@ static void android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetRenderbufferParameterivOES"); return; } @@ -6808,7 +6780,7 @@ static void android_glGetTexGenfv__II_3FI (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGenfv"); return; } @@ -6819,12 +6791,12 @@ android_glGetTexGenfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -6850,7 +6822,7 @@ static void android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGenfv"); return; } @@ -6875,7 +6847,7 @@ static void android_glGetTexGeniv__II_3II (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGeniv"); return; } @@ -6886,12 +6858,12 @@ android_glGetTexGeniv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -6917,7 +6889,7 @@ static void android_glGetTexGeniv__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGeniv"); return; } @@ -6942,7 +6914,7 @@ static void android_glGetTexGenxv__II_3II (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGenxv"); return; } @@ -6953,12 +6925,12 @@ android_glGetTexGenxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -6984,7 +6956,7 @@ static void android_glGetTexGenxv__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glGetTexGenxv"); return; } @@ -7009,7 +6981,7 @@ static jboolean android_glIsFramebufferOES__I (JNIEnv *_env, jobject _this, jint framebuffer) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glIsFramebufferOES"); return JNI_FALSE; } @@ -7025,7 +6997,7 @@ static jboolean android_glIsRenderbufferOES__I (JNIEnv *_env, jobject _this, jint renderbuffer) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glIsRenderbufferOES"); return JNI_FALSE; } @@ -7041,7 +7013,7 @@ static void android_glRenderbufferStorageOES__IIII (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glRenderbufferStorageOES"); return; } @@ -7058,7 +7030,7 @@ static void android_glTexGenf__IIF (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenf"); return; } @@ -7074,7 +7046,7 @@ static void android_glTexGenfv__II_3FI (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenfv"); return; } @@ -7085,12 +7057,12 @@ android_glTexGenfv__II_3FI if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -7116,7 +7088,7 @@ static void android_glTexGenfv__IILjava_nio_FloatBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenfv"); return; } @@ -7141,7 +7113,7 @@ static void android_glTexGeni__III (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGeni"); return; } @@ -7157,7 +7129,7 @@ static void android_glTexGeniv__II_3II (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGeniv"); return; } @@ -7168,12 +7140,12 @@ android_glTexGeniv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -7199,7 +7171,7 @@ static void android_glTexGeniv__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGeniv"); return; } @@ -7224,7 +7196,7 @@ static void android_glTexGenx__III (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenx"); return; } @@ -7240,7 +7212,7 @@ static void android_glTexGenxv__II_3II (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenxv"); return; } @@ -7251,12 +7223,12 @@ android_glTexGenxv__II_3II if (!params_ref) { _exception = 1; - _env->ThrowNew(IAEClass, "params == null"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); goto exit; } if (offset < 0) { _exception = 1; - _env->ThrowNew(IAEClass, "offset < 0"); + jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); goto exit; } _remaining = _env->GetArrayLength(params_ref) - offset; @@ -7282,7 +7254,7 @@ static void android_glTexGenxv__IILjava_nio_IntBuffer_2 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { - _env->ThrowNew(UOEClass, + jniThrowException(_env, "java/lang/UnsupportedOperationException", "glTexGenxv"); return; } |