The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* //device/libs/android_runtime/com_google_android_gles_jni_GLImpl.cpp |
| 2 | ** |
| 3 | ** Copyright 2006, The Android Open Source Project |
| 4 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 10 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | // This source file is automatically generated |
| 19 | |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 20 | #include "jni.h" |
| 21 | #include "JNIHelp.h" |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | #include <android_runtime/AndroidRuntime.h> |
| 23 | #include <utils/misc.h> |
| 24 | |
| 25 | #include <assert.h> |
| 26 | #include <GLES/gl.h> |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 27 | #include <GLES/glext.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 29 | // Work around differences between the generated name and the actual name. |
| 30 | |
| 31 | #define glBlendEquation glBlendEquationOES |
| 32 | #define glBlendEquationSeparate glBlendEquationSeparateOES |
| 33 | #define glBlendFuncSeparate glBlendFuncSeparateOES |
| 34 | #define glGetTexGenfv glGetTexGenfvOES |
| 35 | #define glGetTexGeniv glGetTexGenivOES |
| 36 | #define glGetTexGenxv glGetTexGenxvOES |
| 37 | #define glTexGenf glTexGenfOES |
| 38 | #define glTexGenfv glTexGenfvOES |
| 39 | #define glTexGeni glTexGeniOES |
| 40 | #define glTexGeniv glTexGenivOES |
| 41 | #define glTexGenx glTexGenxOES |
| 42 | #define glTexGenxv glTexGenxvOES |
| 43 | |
| 44 | |
| 45 | |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 46 | /* special calls implemented in Android's GLES wrapper used to more |
| 47 | * efficiently bound-check passed arrays */ |
| 48 | extern "C" { |
| 49 | GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, |
| 50 | const GLvoid *ptr, GLsizei count); |
| 51 | GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, |
| 52 | const GLvoid *pointer, GLsizei count); |
| 53 | GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, |
| 54 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 55 | GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, |
| 56 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 57 | GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, |
| 58 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 59 | GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, |
| 60 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 61 | GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, |
| 62 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 63 | } |
| 64 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | static int initialized = 0; |
| 66 | |
| 67 | static jclass nioAccessClass; |
| 68 | static jclass bufferClass; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 69 | static jclass G11ImplClass; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | static jmethodID getBasePointerID; |
| 71 | static jmethodID getBaseArrayID; |
| 72 | static jmethodID getBaseArrayOffsetID; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 73 | static jmethodID allowIndirectBuffersID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | static jfieldID positionID; |
| 75 | static jfieldID limitID; |
| 76 | static jfieldID elementSizeShiftID; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 77 | static jfieldID haveCheckedExtensionsID; |
| 78 | static jfieldID have_OES_blend_equation_separateID; |
| 79 | static jfieldID have_OES_blend_subtractID; |
| 80 | static jfieldID have_OES_framebuffer_objectID; |
| 81 | static jfieldID have_OES_texture_cube_mapID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | |
| 83 | /* Cache method IDs each time the class is loaded. */ |
| 84 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 85 | static void |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 86 | nativeClassInit(JNIEnv *_env, jclass glImplClass) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | { |
| 88 | jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); |
| 89 | nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); |
| 90 | |
| 91 | jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); |
| 92 | bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); |
| 93 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 94 | jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl"); |
| 95 | G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 96 | haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z"); |
| 97 | have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z"); |
| 98 | have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z"); |
| 99 | have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z"); |
| 100 | have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 101 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 102 | getBasePointerID = _env->GetStaticMethodID(nioAccessClass, |
| 103 | "getBasePointer", "(Ljava/nio/Buffer;)J"); |
| 104 | getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, |
| 105 | "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); |
| 106 | getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, |
| 107 | "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 108 | allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal, |
| 109 | "allowIndirectBuffers", "(Ljava/lang/String;)Z"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | positionID = _env->GetFieldID(bufferClass, "position", "I"); |
| 111 | limitID = _env->GetFieldID(bufferClass, "limit", "I"); |
| 112 | elementSizeShiftID = |
| 113 | _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); |
| 114 | } |
| 115 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 116 | static void * |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 117 | getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | { |
| 119 | jint position; |
| 120 | jint limit; |
| 121 | jint elementSizeShift; |
| 122 | jlong pointer; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 123 | |
| 124 | position = _env->GetIntField(buffer, positionID); |
| 125 | limit = _env->GetIntField(buffer, limitID); |
| 126 | elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 127 | *remaining = (limit - position) << elementSizeShift; |
| 128 | pointer = _env->CallStaticLongMethod(nioAccessClass, |
| 129 | getBasePointerID, buffer); |
| 130 | if (pointer != 0L) { |
| 131 | *array = NULL; |
| 132 | return (void *) (jint) pointer; |
| 133 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 134 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 135 | *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, |
| 136 | getBaseArrayID, buffer); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 137 | if (*array == NULL) { |
| 138 | return (void*) NULL; |
| 139 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 140 | *offset = _env->CallStaticIntMethod(nioAccessClass, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 141 | getBaseArrayOffsetID, buffer); |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 142 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 143 | return NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | } |
| 145 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 146 | static void |
| 147 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 148 | { |
| 149 | _env->ReleasePrimitiveArrayCritical(array, data, |
| 150 | commit ? 0 : JNI_ABORT); |
| 151 | } |
| 152 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 153 | extern "C" { |
| 154 | extern char* __progname; |
| 155 | } |
| 156 | |
| 157 | static bool |
| 158 | allowIndirectBuffers(JNIEnv *_env) { |
| 159 | static jint sIndirectBufferCompatability; |
| 160 | if (sIndirectBufferCompatability == 0) { |
| 161 | jobject appName = _env->NewStringUTF(::__progname); |
| 162 | sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1; |
| 163 | } |
| 164 | return sIndirectBufferCompatability == 2; |
| 165 | } |
| 166 | |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 167 | static void * |
| 168 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 169 | if (!buffer) { |
| 170 | return NULL; |
| 171 | } |
| 172 | void* buf = _env->GetDirectBufferAddress(buffer); |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 173 | if (buf) { |
| 174 | jint position = _env->GetIntField(buffer, positionID); |
| 175 | jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 176 | buf = ((char*) buf) + (position << elementSizeShift); |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 177 | } else { |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 178 | if (allowIndirectBuffers(_env)) { |
| 179 | jarray array = 0; |
| 180 | jint remaining; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 181 | jint offset; |
| 182 | buf = getPointer(_env, buffer, &array, &remaining, &offset); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 183 | if (array) { |
| 184 | releasePointer(_env, array, buf, 0); |
| 185 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 186 | buf = buf + offset; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 187 | } else { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 188 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 189 | "Must use a native order direct Buffer"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 190 | } |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 191 | } |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 192 | return buf; |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 193 | } |
| 194 | |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 195 | static int |
| 196 | getNumCompressedTextureFormats() { |
| 197 | int numCompressedTextureFormats = 0; |
| 198 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); |
| 199 | return numCompressedTextureFormats; |
| 200 | } |
| 201 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 202 | // Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is |
| 203 | // terminated by either 0 or space, while pExtension is terminated by 0. |
| 204 | |
| 205 | static bool |
| 206 | extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 207 | while (true) { |
| 208 | char a = *pExtensions++; |
| 209 | char b = *pExtension++; |
| 210 | bool aEnd = a == '\0' || a == ' '; |
| 211 | bool bEnd = b == '\0'; |
| 212 | if ( aEnd || bEnd) { |
| 213 | return aEnd == bEnd; |
| 214 | } |
| 215 | if ( a != b ) { |
| 216 | return false; |
| 217 | } |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | static const GLubyte* |
| 222 | nextExtension(const GLubyte* pExtensions) { |
| 223 | while (true) { |
| 224 | char a = *pExtensions++; |
| 225 | if ( a == '\0') { |
| 226 | return pExtensions-1; |
| 227 | } else if ( a == ' ') { |
| 228 | return pExtensions; |
| 229 | } |
| 230 | } |
| 231 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 232 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 233 | static bool |
| 234 | checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 235 | for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) { |
| 236 | if (extensionEqual(pExtensions, pExtension)) { |
| 237 | return true; |
| 238 | } |
| 239 | } |
| 240 | return false; |
| 241 | } |
| 242 | |
| 243 | static bool |
| 244 | supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) { |
| 245 | if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) { |
| 246 | _env->SetBooleanField(impl, haveCheckedExtensionsID, true); |
| 247 | const GLubyte* sExtensions = glGetString(GL_EXTENSIONS); |
| 248 | _env->SetBooleanField(impl, have_OES_blend_equation_separateID, |
| 249 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate")); |
| 250 | _env->SetBooleanField(impl, have_OES_blend_subtractID, |
| 251 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract")); |
| 252 | _env->SetBooleanField(impl, have_OES_framebuffer_objectID, |
| 253 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object")); |
| 254 | _env->SetBooleanField(impl, have_OES_texture_cube_mapID, |
| 255 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map")); |
| 256 | } |
| 257 | return _env->GetBooleanField(impl, fieldId); |
| 258 | } |
| 259 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 260 | // -------------------------------------------------------------------------- |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 261 | /* void glActiveTexture ( GLenum texture ) */ |
| 262 | static void |
| 263 | android_glActiveTexture__I |
| 264 | (JNIEnv *_env, jobject _this, jint texture) { |
| 265 | glActiveTexture( |
| 266 | (GLenum)texture |
| 267 | ); |
| 268 | } |
| 269 | |
| 270 | /* void glAlphaFunc ( GLenum func, GLclampf ref ) */ |
| 271 | static void |
| 272 | android_glAlphaFunc__IF |
| 273 | (JNIEnv *_env, jobject _this, jint func, jfloat ref) { |
| 274 | glAlphaFunc( |
| 275 | (GLenum)func, |
| 276 | (GLclampf)ref |
| 277 | ); |
| 278 | } |
| 279 | |
| 280 | /* void glAlphaFuncx ( GLenum func, GLclampx ref ) */ |
| 281 | static void |
| 282 | android_glAlphaFuncx__II |
| 283 | (JNIEnv *_env, jobject _this, jint func, jint ref) { |
| 284 | glAlphaFuncx( |
| 285 | (GLenum)func, |
| 286 | (GLclampx)ref |
| 287 | ); |
| 288 | } |
| 289 | |
| 290 | /* void glBindTexture ( GLenum target, GLuint texture ) */ |
| 291 | static void |
| 292 | android_glBindTexture__II |
| 293 | (JNIEnv *_env, jobject _this, jint target, jint texture) { |
| 294 | glBindTexture( |
| 295 | (GLenum)target, |
| 296 | (GLuint)texture |
| 297 | ); |
| 298 | } |
| 299 | |
| 300 | /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ |
| 301 | static void |
| 302 | android_glBlendFunc__II |
| 303 | (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { |
| 304 | glBlendFunc( |
| 305 | (GLenum)sfactor, |
| 306 | (GLenum)dfactor |
| 307 | ); |
| 308 | } |
| 309 | |
| 310 | /* void glClear ( GLbitfield mask ) */ |
| 311 | static void |
| 312 | android_glClear__I |
| 313 | (JNIEnv *_env, jobject _this, jint mask) { |
| 314 | glClear( |
| 315 | (GLbitfield)mask |
| 316 | ); |
| 317 | } |
| 318 | |
| 319 | /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ |
| 320 | static void |
| 321 | android_glClearColor__FFFF |
| 322 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 323 | glClearColor( |
| 324 | (GLclampf)red, |
| 325 | (GLclampf)green, |
| 326 | (GLclampf)blue, |
| 327 | (GLclampf)alpha |
| 328 | ); |
| 329 | } |
| 330 | |
| 331 | /* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */ |
| 332 | static void |
| 333 | android_glClearColorx__IIII |
| 334 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 335 | glClearColorx( |
| 336 | (GLclampx)red, |
| 337 | (GLclampx)green, |
| 338 | (GLclampx)blue, |
| 339 | (GLclampx)alpha |
| 340 | ); |
| 341 | } |
| 342 | |
| 343 | /* void glClearDepthf ( GLclampf depth ) */ |
| 344 | static void |
| 345 | android_glClearDepthf__F |
| 346 | (JNIEnv *_env, jobject _this, jfloat depth) { |
| 347 | glClearDepthf( |
| 348 | (GLclampf)depth |
| 349 | ); |
| 350 | } |
| 351 | |
| 352 | /* void glClearDepthx ( GLclampx depth ) */ |
| 353 | static void |
| 354 | android_glClearDepthx__I |
| 355 | (JNIEnv *_env, jobject _this, jint depth) { |
| 356 | glClearDepthx( |
| 357 | (GLclampx)depth |
| 358 | ); |
| 359 | } |
| 360 | |
| 361 | /* void glClearStencil ( GLint s ) */ |
| 362 | static void |
| 363 | android_glClearStencil__I |
| 364 | (JNIEnv *_env, jobject _this, jint s) { |
| 365 | glClearStencil( |
| 366 | (GLint)s |
| 367 | ); |
| 368 | } |
| 369 | |
| 370 | /* void glClientActiveTexture ( GLenum texture ) */ |
| 371 | static void |
| 372 | android_glClientActiveTexture__I |
| 373 | (JNIEnv *_env, jobject _this, jint texture) { |
| 374 | glClientActiveTexture( |
| 375 | (GLenum)texture |
| 376 | ); |
| 377 | } |
| 378 | |
| 379 | /* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */ |
| 380 | static void |
| 381 | android_glColor4f__FFFF |
| 382 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 383 | glColor4f( |
| 384 | (GLfloat)red, |
| 385 | (GLfloat)green, |
| 386 | (GLfloat)blue, |
| 387 | (GLfloat)alpha |
| 388 | ); |
| 389 | } |
| 390 | |
| 391 | /* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */ |
| 392 | static void |
| 393 | android_glColor4x__IIII |
| 394 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 395 | glColor4x( |
| 396 | (GLfixed)red, |
| 397 | (GLfixed)green, |
| 398 | (GLfixed)blue, |
| 399 | (GLfixed)alpha |
| 400 | ); |
| 401 | } |
| 402 | |
| 403 | /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ |
| 404 | static void |
| 405 | android_glColorMask__ZZZZ |
| 406 | (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { |
| 407 | glColorMask( |
| 408 | (GLboolean)red, |
| 409 | (GLboolean)green, |
| 410 | (GLboolean)blue, |
| 411 | (GLboolean)alpha |
| 412 | ); |
| 413 | } |
| 414 | |
| 415 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 416 | static void |
| 417 | android_glColorPointerBounds__IIILjava_nio_Buffer_2I |
| 418 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 419 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 420 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 421 | jint _remaining; |
| 422 | GLvoid *pointer = (GLvoid *) 0; |
| 423 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 424 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 425 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 426 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 427 | return; |
| 428 | } |
| 429 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 430 | glColorPointerBounds( |
| 431 | (GLint)size, |
| 432 | (GLenum)type, |
| 433 | (GLsizei)stride, |
| 434 | (GLvoid *)pointer, |
| 435 | (GLsizei)remaining |
| 436 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 437 | } |
| 438 | |
| 439 | /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 440 | static void |
| 441 | android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 |
| 442 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { |
| 443 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 444 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 445 | jint _remaining; |
| 446 | GLvoid *data = (GLvoid *) 0; |
| 447 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 448 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 449 | if (data == NULL) { |
| 450 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 451 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 452 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 453 | glCompressedTexImage2D( |
| 454 | (GLenum)target, |
| 455 | (GLint)level, |
| 456 | (GLenum)internalformat, |
| 457 | (GLsizei)width, |
| 458 | (GLsizei)height, |
| 459 | (GLint)border, |
| 460 | (GLsizei)imageSize, |
| 461 | (GLvoid *)data |
| 462 | ); |
| 463 | if (_array) { |
| 464 | releasePointer(_env, _array, data, JNI_FALSE); |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 469 | static void |
| 470 | android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 471 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { |
| 472 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 473 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 474 | jint _remaining; |
| 475 | GLvoid *data = (GLvoid *) 0; |
| 476 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 477 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 478 | if (data == NULL) { |
| 479 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 480 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 481 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 482 | glCompressedTexSubImage2D( |
| 483 | (GLenum)target, |
| 484 | (GLint)level, |
| 485 | (GLint)xoffset, |
| 486 | (GLint)yoffset, |
| 487 | (GLsizei)width, |
| 488 | (GLsizei)height, |
| 489 | (GLenum)format, |
| 490 | (GLsizei)imageSize, |
| 491 | (GLvoid *)data |
| 492 | ); |
| 493 | if (_array) { |
| 494 | releasePointer(_env, _array, data, JNI_FALSE); |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ |
| 499 | static void |
| 500 | android_glCopyTexImage2D__IIIIIIII |
| 501 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { |
| 502 | glCopyTexImage2D( |
| 503 | (GLenum)target, |
| 504 | (GLint)level, |
| 505 | (GLenum)internalformat, |
| 506 | (GLint)x, |
| 507 | (GLint)y, |
| 508 | (GLsizei)width, |
| 509 | (GLsizei)height, |
| 510 | (GLint)border |
| 511 | ); |
| 512 | } |
| 513 | |
| 514 | /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 515 | static void |
| 516 | android_glCopyTexSubImage2D__IIIIIIII |
| 517 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { |
| 518 | glCopyTexSubImage2D( |
| 519 | (GLenum)target, |
| 520 | (GLint)level, |
| 521 | (GLint)xoffset, |
| 522 | (GLint)yoffset, |
| 523 | (GLint)x, |
| 524 | (GLint)y, |
| 525 | (GLsizei)width, |
| 526 | (GLsizei)height |
| 527 | ); |
| 528 | } |
| 529 | |
| 530 | /* void glCullFace ( GLenum mode ) */ |
| 531 | static void |
| 532 | android_glCullFace__I |
| 533 | (JNIEnv *_env, jobject _this, jint mode) { |
| 534 | glCullFace( |
| 535 | (GLenum)mode |
| 536 | ); |
| 537 | } |
| 538 | |
| 539 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 540 | static void |
| 541 | android_glDeleteTextures__I_3II |
| 542 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 543 | jint _exception = 0; |
| 544 | const char * _exceptionType; |
| 545 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 546 | GLuint *textures_base = (GLuint *) 0; |
| 547 | jint _remaining; |
| 548 | GLuint *textures = (GLuint *) 0; |
| 549 | |
| 550 | if (!textures_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 551 | _exception = 1; |
| 552 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 553 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 554 | goto exit; |
| 555 | } |
| 556 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 557 | _exception = 1; |
| 558 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 559 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 560 | goto exit; |
| 561 | } |
| 562 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 563 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 564 | _exception = 1; |
| 565 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 566 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 567 | goto exit; |
| 568 | } |
| 569 | textures_base = (GLuint *) |
| 570 | _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0); |
| 571 | textures = textures_base + offset; |
| 572 | |
| 573 | glDeleteTextures( |
| 574 | (GLsizei)n, |
| 575 | (GLuint *)textures |
| 576 | ); |
| 577 | |
| 578 | exit: |
| 579 | if (textures_base) { |
| 580 | _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base, |
| 581 | JNI_ABORT); |
| 582 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 583 | if (_exception) { |
| 584 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 585 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 586 | } |
| 587 | |
| 588 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 589 | static void |
| 590 | android_glDeleteTextures__ILjava_nio_IntBuffer_2 |
| 591 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 592 | jint _exception = 0; |
| 593 | const char * _exceptionType; |
| 594 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 595 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 596 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 597 | jint _remaining; |
| 598 | GLuint *textures = (GLuint *) 0; |
| 599 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 600 | textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 601 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 602 | _exception = 1; |
| 603 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 604 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | goto exit; |
| 606 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 607 | if (textures == NULL) { |
| 608 | char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 609 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 610 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 611 | glDeleteTextures( |
| 612 | (GLsizei)n, |
| 613 | (GLuint *)textures |
| 614 | ); |
| 615 | |
| 616 | exit: |
| 617 | if (_array) { |
| 618 | releasePointer(_env, _array, textures, JNI_FALSE); |
| 619 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 620 | if (_exception) { |
| 621 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 622 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 623 | } |
| 624 | |
| 625 | /* void glDepthFunc ( GLenum func ) */ |
| 626 | static void |
| 627 | android_glDepthFunc__I |
| 628 | (JNIEnv *_env, jobject _this, jint func) { |
| 629 | glDepthFunc( |
| 630 | (GLenum)func |
| 631 | ); |
| 632 | } |
| 633 | |
| 634 | /* void glDepthMask ( GLboolean flag ) */ |
| 635 | static void |
| 636 | android_glDepthMask__Z |
| 637 | (JNIEnv *_env, jobject _this, jboolean flag) { |
| 638 | glDepthMask( |
| 639 | (GLboolean)flag |
| 640 | ); |
| 641 | } |
| 642 | |
| 643 | /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ |
| 644 | static void |
| 645 | android_glDepthRangef__FF |
| 646 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
| 647 | glDepthRangef( |
| 648 | (GLclampf)zNear, |
| 649 | (GLclampf)zFar |
| 650 | ); |
| 651 | } |
| 652 | |
| 653 | /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */ |
| 654 | static void |
| 655 | android_glDepthRangex__II |
| 656 | (JNIEnv *_env, jobject _this, jint zNear, jint zFar) { |
| 657 | glDepthRangex( |
| 658 | (GLclampx)zNear, |
| 659 | (GLclampx)zFar |
| 660 | ); |
| 661 | } |
| 662 | |
| 663 | /* void glDisable ( GLenum cap ) */ |
| 664 | static void |
| 665 | android_glDisable__I |
| 666 | (JNIEnv *_env, jobject _this, jint cap) { |
| 667 | glDisable( |
| 668 | (GLenum)cap |
| 669 | ); |
| 670 | } |
| 671 | |
| 672 | /* void glDisableClientState ( GLenum array ) */ |
| 673 | static void |
| 674 | android_glDisableClientState__I |
| 675 | (JNIEnv *_env, jobject _this, jint array) { |
| 676 | glDisableClientState( |
| 677 | (GLenum)array |
| 678 | ); |
| 679 | } |
| 680 | |
| 681 | /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ |
| 682 | static void |
| 683 | android_glDrawArrays__III |
| 684 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { |
| 685 | glDrawArrays( |
| 686 | (GLenum)mode, |
| 687 | (GLint)first, |
| 688 | (GLsizei)count |
| 689 | ); |
| 690 | } |
| 691 | |
| 692 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 693 | static void |
| 694 | android_glDrawElements__IIILjava_nio_Buffer_2 |
| 695 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 696 | jint _exception = 0; |
| 697 | const char * _exceptionType; |
| 698 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 699 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 700 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 701 | jint _remaining; |
| 702 | GLvoid *indices = (GLvoid *) 0; |
| 703 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 704 | indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | if (_remaining < count) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 706 | _exception = 1; |
| 707 | _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; |
| 708 | _exceptionMessage = "remaining() < count < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 709 | goto exit; |
| 710 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 711 | if (indices == NULL) { |
| 712 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 713 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 714 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 715 | glDrawElements( |
| 716 | (GLenum)mode, |
| 717 | (GLsizei)count, |
| 718 | (GLenum)type, |
| 719 | (GLvoid *)indices |
| 720 | ); |
| 721 | |
| 722 | exit: |
| 723 | if (_array) { |
| 724 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 725 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 726 | if (_exception) { |
| 727 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 728 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | /* void glEnable ( GLenum cap ) */ |
| 732 | static void |
| 733 | android_glEnable__I |
| 734 | (JNIEnv *_env, jobject _this, jint cap) { |
| 735 | glEnable( |
| 736 | (GLenum)cap |
| 737 | ); |
| 738 | } |
| 739 | |
| 740 | /* void glEnableClientState ( GLenum array ) */ |
| 741 | static void |
| 742 | android_glEnableClientState__I |
| 743 | (JNIEnv *_env, jobject _this, jint array) { |
| 744 | glEnableClientState( |
| 745 | (GLenum)array |
| 746 | ); |
| 747 | } |
| 748 | |
| 749 | /* void glFinish ( void ) */ |
| 750 | static void |
| 751 | android_glFinish__ |
| 752 | (JNIEnv *_env, jobject _this) { |
| 753 | glFinish(); |
| 754 | } |
| 755 | |
| 756 | /* void glFlush ( void ) */ |
| 757 | static void |
| 758 | android_glFlush__ |
| 759 | (JNIEnv *_env, jobject _this) { |
| 760 | glFlush(); |
| 761 | } |
| 762 | |
| 763 | /* void glFogf ( GLenum pname, GLfloat param ) */ |
| 764 | static void |
| 765 | android_glFogf__IF |
| 766 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 767 | glFogf( |
| 768 | (GLenum)pname, |
| 769 | (GLfloat)param |
| 770 | ); |
| 771 | } |
| 772 | |
| 773 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 774 | static void |
| 775 | android_glFogfv__I_3FI |
| 776 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 777 | jint _exception = 0; |
| 778 | const char * _exceptionType; |
| 779 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | GLfloat *params_base = (GLfloat *) 0; |
| 781 | jint _remaining; |
| 782 | GLfloat *params = (GLfloat *) 0; |
| 783 | |
| 784 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 785 | _exception = 1; |
| 786 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 787 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 788 | goto exit; |
| 789 | } |
| 790 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 791 | _exception = 1; |
| 792 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 793 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 794 | goto exit; |
| 795 | } |
| 796 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 797 | int _needed; |
| 798 | switch (pname) { |
| 799 | #if defined(GL_FOG_MODE) |
| 800 | case GL_FOG_MODE: |
| 801 | #endif // defined(GL_FOG_MODE) |
| 802 | #if defined(GL_FOG_DENSITY) |
| 803 | case GL_FOG_DENSITY: |
| 804 | #endif // defined(GL_FOG_DENSITY) |
| 805 | #if defined(GL_FOG_START) |
| 806 | case GL_FOG_START: |
| 807 | #endif // defined(GL_FOG_START) |
| 808 | #if defined(GL_FOG_END) |
| 809 | case GL_FOG_END: |
| 810 | #endif // defined(GL_FOG_END) |
| 811 | _needed = 1; |
| 812 | break; |
| 813 | #if defined(GL_FOG_COLOR) |
| 814 | case GL_FOG_COLOR: |
| 815 | #endif // defined(GL_FOG_COLOR) |
| 816 | _needed = 4; |
| 817 | break; |
| 818 | default: |
| 819 | _needed = 0; |
| 820 | break; |
| 821 | } |
| 822 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 823 | _exception = 1; |
| 824 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 825 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 826 | goto exit; |
| 827 | } |
| 828 | params_base = (GLfloat *) |
| 829 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 830 | params = params_base + offset; |
| 831 | |
| 832 | glFogfv( |
| 833 | (GLenum)pname, |
| 834 | (GLfloat *)params |
| 835 | ); |
| 836 | |
| 837 | exit: |
| 838 | if (params_base) { |
| 839 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 840 | JNI_ABORT); |
| 841 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 842 | if (_exception) { |
| 843 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 844 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 845 | } |
| 846 | |
| 847 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 848 | static void |
| 849 | android_glFogfv__ILjava_nio_FloatBuffer_2 |
| 850 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 851 | jint _exception = 0; |
| 852 | const char * _exceptionType; |
| 853 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 854 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 855 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 856 | jint _remaining; |
| 857 | GLfloat *params = (GLfloat *) 0; |
| 858 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 859 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 860 | int _needed; |
| 861 | switch (pname) { |
| 862 | #if defined(GL_FOG_MODE) |
| 863 | case GL_FOG_MODE: |
| 864 | #endif // defined(GL_FOG_MODE) |
| 865 | #if defined(GL_FOG_DENSITY) |
| 866 | case GL_FOG_DENSITY: |
| 867 | #endif // defined(GL_FOG_DENSITY) |
| 868 | #if defined(GL_FOG_START) |
| 869 | case GL_FOG_START: |
| 870 | #endif // defined(GL_FOG_START) |
| 871 | #if defined(GL_FOG_END) |
| 872 | case GL_FOG_END: |
| 873 | #endif // defined(GL_FOG_END) |
| 874 | _needed = 1; |
| 875 | break; |
| 876 | #if defined(GL_FOG_COLOR) |
| 877 | case GL_FOG_COLOR: |
| 878 | #endif // defined(GL_FOG_COLOR) |
| 879 | _needed = 4; |
| 880 | break; |
| 881 | default: |
| 882 | _needed = 0; |
| 883 | break; |
| 884 | } |
| 885 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 886 | _exception = 1; |
| 887 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 888 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 889 | goto exit; |
| 890 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 891 | if (params == NULL) { |
| 892 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 893 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 894 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 895 | glFogfv( |
| 896 | (GLenum)pname, |
| 897 | (GLfloat *)params |
| 898 | ); |
| 899 | |
| 900 | exit: |
| 901 | if (_array) { |
| 902 | releasePointer(_env, _array, params, JNI_FALSE); |
| 903 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 904 | if (_exception) { |
| 905 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 906 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 907 | } |
| 908 | |
| 909 | /* void glFogx ( GLenum pname, GLfixed param ) */ |
| 910 | static void |
| 911 | android_glFogx__II |
| 912 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 913 | glFogx( |
| 914 | (GLenum)pname, |
| 915 | (GLfixed)param |
| 916 | ); |
| 917 | } |
| 918 | |
| 919 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 920 | static void |
| 921 | android_glFogxv__I_3II |
| 922 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 923 | jint _exception = 0; |
| 924 | const char * _exceptionType; |
| 925 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 926 | GLfixed *params_base = (GLfixed *) 0; |
| 927 | jint _remaining; |
| 928 | GLfixed *params = (GLfixed *) 0; |
| 929 | |
| 930 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 931 | _exception = 1; |
| 932 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 933 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 934 | goto exit; |
| 935 | } |
| 936 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 937 | _exception = 1; |
| 938 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 939 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 940 | goto exit; |
| 941 | } |
| 942 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 943 | int _needed; |
| 944 | switch (pname) { |
| 945 | #if defined(GL_FOG_MODE) |
| 946 | case GL_FOG_MODE: |
| 947 | #endif // defined(GL_FOG_MODE) |
| 948 | #if defined(GL_FOG_DENSITY) |
| 949 | case GL_FOG_DENSITY: |
| 950 | #endif // defined(GL_FOG_DENSITY) |
| 951 | #if defined(GL_FOG_START) |
| 952 | case GL_FOG_START: |
| 953 | #endif // defined(GL_FOG_START) |
| 954 | #if defined(GL_FOG_END) |
| 955 | case GL_FOG_END: |
| 956 | #endif // defined(GL_FOG_END) |
| 957 | _needed = 1; |
| 958 | break; |
| 959 | #if defined(GL_FOG_COLOR) |
| 960 | case GL_FOG_COLOR: |
| 961 | #endif // defined(GL_FOG_COLOR) |
| 962 | _needed = 4; |
| 963 | break; |
| 964 | default: |
| 965 | _needed = 0; |
| 966 | break; |
| 967 | } |
| 968 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 969 | _exception = 1; |
| 970 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 971 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 972 | goto exit; |
| 973 | } |
| 974 | params_base = (GLfixed *) |
| 975 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 976 | params = params_base + offset; |
| 977 | |
| 978 | glFogxv( |
| 979 | (GLenum)pname, |
| 980 | (GLfixed *)params |
| 981 | ); |
| 982 | |
| 983 | exit: |
| 984 | if (params_base) { |
| 985 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 986 | JNI_ABORT); |
| 987 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 988 | if (_exception) { |
| 989 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 990 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 991 | } |
| 992 | |
| 993 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 994 | static void |
| 995 | android_glFogxv__ILjava_nio_IntBuffer_2 |
| 996 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 997 | jint _exception = 0; |
| 998 | const char * _exceptionType; |
| 999 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1000 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1001 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1002 | jint _remaining; |
| 1003 | GLfixed *params = (GLfixed *) 0; |
| 1004 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1005 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1006 | int _needed; |
| 1007 | switch (pname) { |
| 1008 | #if defined(GL_FOG_MODE) |
| 1009 | case GL_FOG_MODE: |
| 1010 | #endif // defined(GL_FOG_MODE) |
| 1011 | #if defined(GL_FOG_DENSITY) |
| 1012 | case GL_FOG_DENSITY: |
| 1013 | #endif // defined(GL_FOG_DENSITY) |
| 1014 | #if defined(GL_FOG_START) |
| 1015 | case GL_FOG_START: |
| 1016 | #endif // defined(GL_FOG_START) |
| 1017 | #if defined(GL_FOG_END) |
| 1018 | case GL_FOG_END: |
| 1019 | #endif // defined(GL_FOG_END) |
| 1020 | _needed = 1; |
| 1021 | break; |
| 1022 | #if defined(GL_FOG_COLOR) |
| 1023 | case GL_FOG_COLOR: |
| 1024 | #endif // defined(GL_FOG_COLOR) |
| 1025 | _needed = 4; |
| 1026 | break; |
| 1027 | default: |
| 1028 | _needed = 0; |
| 1029 | break; |
| 1030 | } |
| 1031 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1032 | _exception = 1; |
| 1033 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1034 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1035 | goto exit; |
| 1036 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1037 | if (params == NULL) { |
| 1038 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1039 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1040 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1041 | glFogxv( |
| 1042 | (GLenum)pname, |
| 1043 | (GLfixed *)params |
| 1044 | ); |
| 1045 | |
| 1046 | exit: |
| 1047 | if (_array) { |
| 1048 | releasePointer(_env, _array, params, JNI_FALSE); |
| 1049 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1050 | if (_exception) { |
| 1051 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1052 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1053 | } |
| 1054 | |
| 1055 | /* void glFrontFace ( GLenum mode ) */ |
| 1056 | static void |
| 1057 | android_glFrontFace__I |
| 1058 | (JNIEnv *_env, jobject _this, jint mode) { |
| 1059 | glFrontFace( |
| 1060 | (GLenum)mode |
| 1061 | ); |
| 1062 | } |
| 1063 | |
| 1064 | /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 1065 | static void |
| 1066 | android_glFrustumf__FFFFFF |
| 1067 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 1068 | glFrustumf( |
| 1069 | (GLfloat)left, |
| 1070 | (GLfloat)right, |
| 1071 | (GLfloat)bottom, |
| 1072 | (GLfloat)top, |
| 1073 | (GLfloat)zNear, |
| 1074 | (GLfloat)zFar |
| 1075 | ); |
| 1076 | } |
| 1077 | |
| 1078 | /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 1079 | static void |
| 1080 | android_glFrustumx__IIIIII |
| 1081 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 1082 | glFrustumx( |
| 1083 | (GLfixed)left, |
| 1084 | (GLfixed)right, |
| 1085 | (GLfixed)bottom, |
| 1086 | (GLfixed)top, |
| 1087 | (GLfixed)zNear, |
| 1088 | (GLfixed)zFar |
| 1089 | ); |
| 1090 | } |
| 1091 | |
| 1092 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1093 | static void |
| 1094 | android_glGenTextures__I_3II |
| 1095 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 1096 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1097 | const char * _exceptionType; |
| 1098 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1099 | GLuint *textures_base = (GLuint *) 0; |
| 1100 | jint _remaining; |
| 1101 | GLuint *textures = (GLuint *) 0; |
| 1102 | |
| 1103 | if (!textures_ref) { |
| 1104 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1105 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1106 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1107 | goto exit; |
| 1108 | } |
| 1109 | if (offset < 0) { |
| 1110 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1111 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1112 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1113 | goto exit; |
| 1114 | } |
| 1115 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 1116 | if (_remaining < n) { |
| 1117 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1118 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1119 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1120 | goto exit; |
| 1121 | } |
| 1122 | textures_base = (GLuint *) |
| 1123 | _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0); |
| 1124 | textures = textures_base + offset; |
| 1125 | |
| 1126 | glGenTextures( |
| 1127 | (GLsizei)n, |
| 1128 | (GLuint *)textures |
| 1129 | ); |
| 1130 | |
| 1131 | exit: |
| 1132 | if (textures_base) { |
| 1133 | _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base, |
| 1134 | _exception ? JNI_ABORT: 0); |
| 1135 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1136 | if (_exception) { |
| 1137 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1138 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1139 | } |
| 1140 | |
| 1141 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1142 | static void |
| 1143 | android_glGenTextures__ILjava_nio_IntBuffer_2 |
| 1144 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 1145 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1146 | const char * _exceptionType; |
| 1147 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1148 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1149 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1150 | jint _remaining; |
| 1151 | GLuint *textures = (GLuint *) 0; |
| 1152 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1153 | textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1154 | if (_remaining < n) { |
| 1155 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1156 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1157 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1158 | goto exit; |
| 1159 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1160 | if (textures == NULL) { |
| 1161 | char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1162 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 1163 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1164 | glGenTextures( |
| 1165 | (GLsizei)n, |
| 1166 | (GLuint *)textures |
| 1167 | ); |
| 1168 | |
| 1169 | exit: |
| 1170 | if (_array) { |
| 1171 | releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE); |
| 1172 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1173 | if (_exception) { |
| 1174 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1175 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1176 | } |
| 1177 | |
| 1178 | /* GLenum glGetError ( void ) */ |
| 1179 | static jint |
| 1180 | android_glGetError__ |
| 1181 | (JNIEnv *_env, jobject _this) { |
| 1182 | GLenum _returnValue; |
| 1183 | _returnValue = glGetError(); |
| 1184 | return _returnValue; |
| 1185 | } |
| 1186 | |
| 1187 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1188 | static void |
| 1189 | android_glGetIntegerv__I_3II |
| 1190 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 1191 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1192 | const char * _exceptionType; |
| 1193 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1194 | GLint *params_base = (GLint *) 0; |
| 1195 | jint _remaining; |
| 1196 | GLint *params = (GLint *) 0; |
| 1197 | |
| 1198 | if (!params_ref) { |
| 1199 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1200 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1201 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1202 | goto exit; |
| 1203 | } |
| 1204 | if (offset < 0) { |
| 1205 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1206 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1207 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1208 | goto exit; |
| 1209 | } |
| 1210 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1211 | int _needed; |
| 1212 | switch (pname) { |
| 1213 | #if defined(GL_ALPHA_BITS) |
| 1214 | case GL_ALPHA_BITS: |
| 1215 | #endif // defined(GL_ALPHA_BITS) |
| 1216 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1217 | case GL_ALPHA_TEST_FUNC: |
| 1218 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1219 | #if defined(GL_ALPHA_TEST_REF) |
| 1220 | case GL_ALPHA_TEST_REF: |
| 1221 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1222 | #if defined(GL_BLEND_DST) |
| 1223 | case GL_BLEND_DST: |
| 1224 | #endif // defined(GL_BLEND_DST) |
| 1225 | #if defined(GL_BLUE_BITS) |
| 1226 | case GL_BLUE_BITS: |
| 1227 | #endif // defined(GL_BLUE_BITS) |
| 1228 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1229 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1230 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1231 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1232 | case GL_COLOR_ARRAY_SIZE: |
| 1233 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1234 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1235 | case GL_COLOR_ARRAY_STRIDE: |
| 1236 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1237 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1238 | case GL_COLOR_ARRAY_TYPE: |
| 1239 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1240 | #if defined(GL_CULL_FACE) |
| 1241 | case GL_CULL_FACE: |
| 1242 | #endif // defined(GL_CULL_FACE) |
| 1243 | #if defined(GL_DEPTH_BITS) |
| 1244 | case GL_DEPTH_BITS: |
| 1245 | #endif // defined(GL_DEPTH_BITS) |
| 1246 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1247 | case GL_DEPTH_CLEAR_VALUE: |
| 1248 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1249 | #if defined(GL_DEPTH_FUNC) |
| 1250 | case GL_DEPTH_FUNC: |
| 1251 | #endif // defined(GL_DEPTH_FUNC) |
| 1252 | #if defined(GL_DEPTH_WRITEMASK) |
| 1253 | case GL_DEPTH_WRITEMASK: |
| 1254 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1255 | #if defined(GL_FOG_DENSITY) |
| 1256 | case GL_FOG_DENSITY: |
| 1257 | #endif // defined(GL_FOG_DENSITY) |
| 1258 | #if defined(GL_FOG_END) |
| 1259 | case GL_FOG_END: |
| 1260 | #endif // defined(GL_FOG_END) |
| 1261 | #if defined(GL_FOG_MODE) |
| 1262 | case GL_FOG_MODE: |
| 1263 | #endif // defined(GL_FOG_MODE) |
| 1264 | #if defined(GL_FOG_START) |
| 1265 | case GL_FOG_START: |
| 1266 | #endif // defined(GL_FOG_START) |
| 1267 | #if defined(GL_FRONT_FACE) |
| 1268 | case GL_FRONT_FACE: |
| 1269 | #endif // defined(GL_FRONT_FACE) |
| 1270 | #if defined(GL_GREEN_BITS) |
| 1271 | case GL_GREEN_BITS: |
| 1272 | #endif // defined(GL_GREEN_BITS) |
| 1273 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1274 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1275 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1276 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1277 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1278 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1279 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1280 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1281 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1282 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1283 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1284 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1285 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1286 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1287 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1288 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1289 | case GL_LINE_SMOOTH_HINT: |
| 1290 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1291 | #if defined(GL_LINE_WIDTH) |
| 1292 | case GL_LINE_WIDTH: |
| 1293 | #endif // defined(GL_LINE_WIDTH) |
| 1294 | #if defined(GL_LOGIC_OP_MODE) |
| 1295 | case GL_LOGIC_OP_MODE: |
| 1296 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1297 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1298 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1299 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1300 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1301 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1302 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1303 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1304 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1305 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1306 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1307 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1308 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1309 | #if defined(GL_MATRIX_MODE) |
| 1310 | case GL_MATRIX_MODE: |
| 1311 | #endif // defined(GL_MATRIX_MODE) |
| 1312 | #if defined(GL_MAX_CLIP_PLANES) |
| 1313 | case GL_MAX_CLIP_PLANES: |
| 1314 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1315 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1316 | case GL_MAX_ELEMENTS_INDICES: |
| 1317 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1318 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1319 | case GL_MAX_ELEMENTS_VERTICES: |
| 1320 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1321 | #if defined(GL_MAX_LIGHTS) |
| 1322 | case GL_MAX_LIGHTS: |
| 1323 | #endif // defined(GL_MAX_LIGHTS) |
| 1324 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1325 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1326 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1327 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1328 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1329 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1330 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1331 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1332 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1333 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1334 | case GL_MAX_TEXTURE_SIZE: |
| 1335 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1336 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1337 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1338 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1339 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1340 | case GL_MAX_TEXTURE_UNITS: |
| 1341 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1342 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1343 | case GL_MAX_VERTEX_UNITS_OES: |
| 1344 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1345 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1346 | case GL_MODELVIEW_STACK_DEPTH: |
| 1347 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1348 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1349 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1350 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1351 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1352 | case GL_NORMAL_ARRAY_STRIDE: |
| 1353 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1354 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1355 | case GL_NORMAL_ARRAY_TYPE: |
| 1356 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1357 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1358 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1359 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1360 | #if defined(GL_PACK_ALIGNMENT) |
| 1361 | case GL_PACK_ALIGNMENT: |
| 1362 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1363 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1364 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1365 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1366 | #if defined(GL_POINT_SIZE) |
| 1367 | case GL_POINT_SIZE: |
| 1368 | #endif // defined(GL_POINT_SIZE) |
| 1369 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1370 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1371 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1372 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1373 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1374 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1375 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1376 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1377 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1378 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1379 | case GL_POINT_SMOOTH_HINT: |
| 1380 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1381 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1382 | case GL_POLYGON_OFFSET_FACTOR: |
| 1383 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1384 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1385 | case GL_POLYGON_OFFSET_UNITS: |
| 1386 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1387 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1388 | case GL_PROJECTION_STACK_DEPTH: |
| 1389 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1390 | #if defined(GL_RED_BITS) |
| 1391 | case GL_RED_BITS: |
| 1392 | #endif // defined(GL_RED_BITS) |
| 1393 | #if defined(GL_SHADE_MODEL) |
| 1394 | case GL_SHADE_MODEL: |
| 1395 | #endif // defined(GL_SHADE_MODEL) |
| 1396 | #if defined(GL_STENCIL_BITS) |
| 1397 | case GL_STENCIL_BITS: |
| 1398 | #endif // defined(GL_STENCIL_BITS) |
| 1399 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1400 | case GL_STENCIL_CLEAR_VALUE: |
| 1401 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1402 | #if defined(GL_STENCIL_FAIL) |
| 1403 | case GL_STENCIL_FAIL: |
| 1404 | #endif // defined(GL_STENCIL_FAIL) |
| 1405 | #if defined(GL_STENCIL_FUNC) |
| 1406 | case GL_STENCIL_FUNC: |
| 1407 | #endif // defined(GL_STENCIL_FUNC) |
| 1408 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1409 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1410 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1411 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1412 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1413 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1414 | #if defined(GL_STENCIL_REF) |
| 1415 | case GL_STENCIL_REF: |
| 1416 | #endif // defined(GL_STENCIL_REF) |
| 1417 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1418 | case GL_STENCIL_VALUE_MASK: |
| 1419 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1420 | #if defined(GL_STENCIL_WRITEMASK) |
| 1421 | case GL_STENCIL_WRITEMASK: |
| 1422 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1423 | #if defined(GL_SUBPIXEL_BITS) |
| 1424 | case GL_SUBPIXEL_BITS: |
| 1425 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1426 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1427 | case GL_TEXTURE_BINDING_2D: |
| 1428 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1429 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1430 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1431 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1432 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1433 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1434 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1435 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1436 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1437 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1438 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1439 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1440 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1441 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1442 | case GL_TEXTURE_STACK_DEPTH: |
| 1443 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1444 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1445 | case GL_UNPACK_ALIGNMENT: |
| 1446 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1447 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1448 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1449 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1450 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1451 | case GL_VERTEX_ARRAY_SIZE: |
| 1452 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1453 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1454 | case GL_VERTEX_ARRAY_STRIDE: |
| 1455 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1456 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1457 | case GL_VERTEX_ARRAY_TYPE: |
| 1458 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1459 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1460 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1461 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1462 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1463 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1464 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1465 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1466 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1467 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1468 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1469 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1470 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1471 | _needed = 1; |
| 1472 | break; |
| 1473 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1474 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1475 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1476 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1477 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1478 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1479 | #if defined(GL_DEPTH_RANGE) |
| 1480 | case GL_DEPTH_RANGE: |
| 1481 | #endif // defined(GL_DEPTH_RANGE) |
| 1482 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1483 | case GL_MAX_VIEWPORT_DIMS: |
| 1484 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1485 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1486 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1487 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1488 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1489 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1490 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1491 | _needed = 2; |
| 1492 | break; |
| 1493 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1494 | case GL_COLOR_CLEAR_VALUE: |
| 1495 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1496 | #if defined(GL_COLOR_WRITEMASK) |
| 1497 | case GL_COLOR_WRITEMASK: |
| 1498 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1499 | #if defined(GL_FOG_COLOR) |
| 1500 | case GL_FOG_COLOR: |
| 1501 | #endif // defined(GL_FOG_COLOR) |
| 1502 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1503 | case GL_LIGHT_MODEL_AMBIENT: |
| 1504 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1505 | #if defined(GL_SCISSOR_BOX) |
| 1506 | case GL_SCISSOR_BOX: |
| 1507 | #endif // defined(GL_SCISSOR_BOX) |
| 1508 | #if defined(GL_VIEWPORT) |
| 1509 | case GL_VIEWPORT: |
| 1510 | #endif // defined(GL_VIEWPORT) |
| 1511 | _needed = 4; |
| 1512 | break; |
| 1513 | #if defined(GL_MODELVIEW_MATRIX) |
| 1514 | case GL_MODELVIEW_MATRIX: |
| 1515 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1516 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1517 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1518 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1519 | #if defined(GL_PROJECTION_MATRIX) |
| 1520 | case GL_PROJECTION_MATRIX: |
| 1521 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1522 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1523 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1524 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1525 | #if defined(GL_TEXTURE_MATRIX) |
| 1526 | case GL_TEXTURE_MATRIX: |
| 1527 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1528 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1529 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1530 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1531 | _needed = 16; |
| 1532 | break; |
| 1533 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1534 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1535 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1536 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1537 | break; |
| 1538 | default: |
| 1539 | _needed = 0; |
| 1540 | break; |
| 1541 | } |
| 1542 | if (_remaining < _needed) { |
| 1543 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1544 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1545 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1546 | goto exit; |
| 1547 | } |
| 1548 | params_base = (GLint *) |
| 1549 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 1550 | params = params_base + offset; |
| 1551 | |
| 1552 | glGetIntegerv( |
| 1553 | (GLenum)pname, |
| 1554 | (GLint *)params |
| 1555 | ); |
| 1556 | |
| 1557 | exit: |
| 1558 | if (params_base) { |
| 1559 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 1560 | _exception ? JNI_ABORT: 0); |
| 1561 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1562 | if (_exception) { |
| 1563 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1564 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1565 | } |
| 1566 | |
| 1567 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1568 | static void |
| 1569 | android_glGetIntegerv__ILjava_nio_IntBuffer_2 |
| 1570 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1571 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1572 | const char * _exceptionType; |
| 1573 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1574 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1575 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1576 | jint _remaining; |
| 1577 | GLint *params = (GLint *) 0; |
| 1578 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1579 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1580 | int _needed; |
| 1581 | switch (pname) { |
| 1582 | #if defined(GL_ALPHA_BITS) |
| 1583 | case GL_ALPHA_BITS: |
| 1584 | #endif // defined(GL_ALPHA_BITS) |
| 1585 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1586 | case GL_ALPHA_TEST_FUNC: |
| 1587 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1588 | #if defined(GL_ALPHA_TEST_REF) |
| 1589 | case GL_ALPHA_TEST_REF: |
| 1590 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1591 | #if defined(GL_BLEND_DST) |
| 1592 | case GL_BLEND_DST: |
| 1593 | #endif // defined(GL_BLEND_DST) |
| 1594 | #if defined(GL_BLUE_BITS) |
| 1595 | case GL_BLUE_BITS: |
| 1596 | #endif // defined(GL_BLUE_BITS) |
| 1597 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1598 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1599 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1600 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1601 | case GL_COLOR_ARRAY_SIZE: |
| 1602 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1603 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1604 | case GL_COLOR_ARRAY_STRIDE: |
| 1605 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1606 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1607 | case GL_COLOR_ARRAY_TYPE: |
| 1608 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1609 | #if defined(GL_CULL_FACE) |
| 1610 | case GL_CULL_FACE: |
| 1611 | #endif // defined(GL_CULL_FACE) |
| 1612 | #if defined(GL_DEPTH_BITS) |
| 1613 | case GL_DEPTH_BITS: |
| 1614 | #endif // defined(GL_DEPTH_BITS) |
| 1615 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1616 | case GL_DEPTH_CLEAR_VALUE: |
| 1617 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1618 | #if defined(GL_DEPTH_FUNC) |
| 1619 | case GL_DEPTH_FUNC: |
| 1620 | #endif // defined(GL_DEPTH_FUNC) |
| 1621 | #if defined(GL_DEPTH_WRITEMASK) |
| 1622 | case GL_DEPTH_WRITEMASK: |
| 1623 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1624 | #if defined(GL_FOG_DENSITY) |
| 1625 | case GL_FOG_DENSITY: |
| 1626 | #endif // defined(GL_FOG_DENSITY) |
| 1627 | #if defined(GL_FOG_END) |
| 1628 | case GL_FOG_END: |
| 1629 | #endif // defined(GL_FOG_END) |
| 1630 | #if defined(GL_FOG_MODE) |
| 1631 | case GL_FOG_MODE: |
| 1632 | #endif // defined(GL_FOG_MODE) |
| 1633 | #if defined(GL_FOG_START) |
| 1634 | case GL_FOG_START: |
| 1635 | #endif // defined(GL_FOG_START) |
| 1636 | #if defined(GL_FRONT_FACE) |
| 1637 | case GL_FRONT_FACE: |
| 1638 | #endif // defined(GL_FRONT_FACE) |
| 1639 | #if defined(GL_GREEN_BITS) |
| 1640 | case GL_GREEN_BITS: |
| 1641 | #endif // defined(GL_GREEN_BITS) |
| 1642 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1643 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1644 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1645 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1646 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1647 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1648 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1649 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1650 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1651 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1652 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1653 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1654 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1655 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1656 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1657 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1658 | case GL_LINE_SMOOTH_HINT: |
| 1659 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1660 | #if defined(GL_LINE_WIDTH) |
| 1661 | case GL_LINE_WIDTH: |
| 1662 | #endif // defined(GL_LINE_WIDTH) |
| 1663 | #if defined(GL_LOGIC_OP_MODE) |
| 1664 | case GL_LOGIC_OP_MODE: |
| 1665 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1666 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1667 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1668 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1669 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1670 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1671 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1672 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1673 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1674 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1675 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1676 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1677 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1678 | #if defined(GL_MATRIX_MODE) |
| 1679 | case GL_MATRIX_MODE: |
| 1680 | #endif // defined(GL_MATRIX_MODE) |
| 1681 | #if defined(GL_MAX_CLIP_PLANES) |
| 1682 | case GL_MAX_CLIP_PLANES: |
| 1683 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1684 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1685 | case GL_MAX_ELEMENTS_INDICES: |
| 1686 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1687 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1688 | case GL_MAX_ELEMENTS_VERTICES: |
| 1689 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1690 | #if defined(GL_MAX_LIGHTS) |
| 1691 | case GL_MAX_LIGHTS: |
| 1692 | #endif // defined(GL_MAX_LIGHTS) |
| 1693 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1694 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1695 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1696 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1697 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1698 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1699 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1700 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1701 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1702 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1703 | case GL_MAX_TEXTURE_SIZE: |
| 1704 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1705 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1706 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1707 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1708 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1709 | case GL_MAX_TEXTURE_UNITS: |
| 1710 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1711 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1712 | case GL_MAX_VERTEX_UNITS_OES: |
| 1713 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1714 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1715 | case GL_MODELVIEW_STACK_DEPTH: |
| 1716 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1717 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1718 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1719 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1720 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1721 | case GL_NORMAL_ARRAY_STRIDE: |
| 1722 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1723 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1724 | case GL_NORMAL_ARRAY_TYPE: |
| 1725 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1726 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1727 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1728 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1729 | #if defined(GL_PACK_ALIGNMENT) |
| 1730 | case GL_PACK_ALIGNMENT: |
| 1731 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1732 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1733 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1734 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1735 | #if defined(GL_POINT_SIZE) |
| 1736 | case GL_POINT_SIZE: |
| 1737 | #endif // defined(GL_POINT_SIZE) |
| 1738 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1739 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1740 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1741 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1742 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1743 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1744 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1745 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1746 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1747 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1748 | case GL_POINT_SMOOTH_HINT: |
| 1749 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1750 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1751 | case GL_POLYGON_OFFSET_FACTOR: |
| 1752 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1753 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1754 | case GL_POLYGON_OFFSET_UNITS: |
| 1755 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1756 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1757 | case GL_PROJECTION_STACK_DEPTH: |
| 1758 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1759 | #if defined(GL_RED_BITS) |
| 1760 | case GL_RED_BITS: |
| 1761 | #endif // defined(GL_RED_BITS) |
| 1762 | #if defined(GL_SHADE_MODEL) |
| 1763 | case GL_SHADE_MODEL: |
| 1764 | #endif // defined(GL_SHADE_MODEL) |
| 1765 | #if defined(GL_STENCIL_BITS) |
| 1766 | case GL_STENCIL_BITS: |
| 1767 | #endif // defined(GL_STENCIL_BITS) |
| 1768 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1769 | case GL_STENCIL_CLEAR_VALUE: |
| 1770 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1771 | #if defined(GL_STENCIL_FAIL) |
| 1772 | case GL_STENCIL_FAIL: |
| 1773 | #endif // defined(GL_STENCIL_FAIL) |
| 1774 | #if defined(GL_STENCIL_FUNC) |
| 1775 | case GL_STENCIL_FUNC: |
| 1776 | #endif // defined(GL_STENCIL_FUNC) |
| 1777 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1778 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1779 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1780 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1781 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1782 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1783 | #if defined(GL_STENCIL_REF) |
| 1784 | case GL_STENCIL_REF: |
| 1785 | #endif // defined(GL_STENCIL_REF) |
| 1786 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1787 | case GL_STENCIL_VALUE_MASK: |
| 1788 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1789 | #if defined(GL_STENCIL_WRITEMASK) |
| 1790 | case GL_STENCIL_WRITEMASK: |
| 1791 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1792 | #if defined(GL_SUBPIXEL_BITS) |
| 1793 | case GL_SUBPIXEL_BITS: |
| 1794 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1795 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1796 | case GL_TEXTURE_BINDING_2D: |
| 1797 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1798 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1799 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1800 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1801 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1802 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1803 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1804 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1805 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1806 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1807 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1808 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1809 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1810 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1811 | case GL_TEXTURE_STACK_DEPTH: |
| 1812 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1813 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1814 | case GL_UNPACK_ALIGNMENT: |
| 1815 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1816 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1817 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1818 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1819 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1820 | case GL_VERTEX_ARRAY_SIZE: |
| 1821 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1822 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1823 | case GL_VERTEX_ARRAY_STRIDE: |
| 1824 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1825 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1826 | case GL_VERTEX_ARRAY_TYPE: |
| 1827 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1828 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1829 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1830 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1831 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1832 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1833 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1834 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1835 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1836 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1837 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1838 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1839 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1840 | _needed = 1; |
| 1841 | break; |
| 1842 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1843 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1844 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1845 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1846 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1847 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1848 | #if defined(GL_DEPTH_RANGE) |
| 1849 | case GL_DEPTH_RANGE: |
| 1850 | #endif // defined(GL_DEPTH_RANGE) |
| 1851 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1852 | case GL_MAX_VIEWPORT_DIMS: |
| 1853 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1854 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1855 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1856 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1857 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1858 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1859 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1860 | _needed = 2; |
| 1861 | break; |
| 1862 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1863 | case GL_COLOR_CLEAR_VALUE: |
| 1864 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1865 | #if defined(GL_COLOR_WRITEMASK) |
| 1866 | case GL_COLOR_WRITEMASK: |
| 1867 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1868 | #if defined(GL_FOG_COLOR) |
| 1869 | case GL_FOG_COLOR: |
| 1870 | #endif // defined(GL_FOG_COLOR) |
| 1871 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1872 | case GL_LIGHT_MODEL_AMBIENT: |
| 1873 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1874 | #if defined(GL_SCISSOR_BOX) |
| 1875 | case GL_SCISSOR_BOX: |
| 1876 | #endif // defined(GL_SCISSOR_BOX) |
| 1877 | #if defined(GL_VIEWPORT) |
| 1878 | case GL_VIEWPORT: |
| 1879 | #endif // defined(GL_VIEWPORT) |
| 1880 | _needed = 4; |
| 1881 | break; |
| 1882 | #if defined(GL_MODELVIEW_MATRIX) |
| 1883 | case GL_MODELVIEW_MATRIX: |
| 1884 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1885 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1886 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1887 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1888 | #if defined(GL_PROJECTION_MATRIX) |
| 1889 | case GL_PROJECTION_MATRIX: |
| 1890 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1891 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1892 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1893 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1894 | #if defined(GL_TEXTURE_MATRIX) |
| 1895 | case GL_TEXTURE_MATRIX: |
| 1896 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1897 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1898 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1899 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1900 | _needed = 16; |
| 1901 | break; |
| 1902 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1903 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1904 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1905 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1906 | break; |
| 1907 | default: |
| 1908 | _needed = 0; |
| 1909 | break; |
| 1910 | } |
| 1911 | if (_remaining < _needed) { |
| 1912 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1913 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1914 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1915 | goto exit; |
| 1916 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1917 | if (params == NULL) { |
| 1918 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1919 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 1920 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1921 | glGetIntegerv( |
| 1922 | (GLenum)pname, |
| 1923 | (GLint *)params |
| 1924 | ); |
| 1925 | |
| 1926 | exit: |
| 1927 | if (_array) { |
| 1928 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 1929 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1930 | if (_exception) { |
| 1931 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1932 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1933 | } |
| 1934 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1935 | /* const GLubyte * glGetString ( GLenum name ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1936 | static jstring android_glGetString(JNIEnv *_env, jobject, jint name) { |
| 1937 | const char* chars = (const char*) glGetString((GLenum) name); |
| 1938 | return _env->NewStringUTF(chars); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1939 | } |
| 1940 | /* void glHint ( GLenum target, GLenum mode ) */ |
| 1941 | static void |
| 1942 | android_glHint__II |
| 1943 | (JNIEnv *_env, jobject _this, jint target, jint mode) { |
| 1944 | glHint( |
| 1945 | (GLenum)target, |
| 1946 | (GLenum)mode |
| 1947 | ); |
| 1948 | } |
| 1949 | |
| 1950 | /* void glLightModelf ( GLenum pname, GLfloat param ) */ |
| 1951 | static void |
| 1952 | android_glLightModelf__IF |
| 1953 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 1954 | glLightModelf( |
| 1955 | (GLenum)pname, |
| 1956 | (GLfloat)param |
| 1957 | ); |
| 1958 | } |
| 1959 | |
| 1960 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 1961 | static void |
| 1962 | android_glLightModelfv__I_3FI |
| 1963 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1964 | jint _exception = 0; |
| 1965 | const char * _exceptionType; |
| 1966 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1967 | GLfloat *params_base = (GLfloat *) 0; |
| 1968 | jint _remaining; |
| 1969 | GLfloat *params = (GLfloat *) 0; |
| 1970 | |
| 1971 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1972 | _exception = 1; |
| 1973 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1974 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1975 | goto exit; |
| 1976 | } |
| 1977 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1978 | _exception = 1; |
| 1979 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1980 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1981 | goto exit; |
| 1982 | } |
| 1983 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1984 | int _needed; |
| 1985 | switch (pname) { |
| 1986 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1987 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1988 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1989 | _needed = 1; |
| 1990 | break; |
| 1991 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1992 | case GL_LIGHT_MODEL_AMBIENT: |
| 1993 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 1994 | _needed = 4; |
| 1995 | break; |
| 1996 | default: |
| 1997 | _needed = 0; |
| 1998 | break; |
| 1999 | } |
| 2000 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2001 | _exception = 1; |
| 2002 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2003 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2004 | goto exit; |
| 2005 | } |
| 2006 | params_base = (GLfloat *) |
| 2007 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2008 | params = params_base + offset; |
| 2009 | |
| 2010 | glLightModelfv( |
| 2011 | (GLenum)pname, |
| 2012 | (GLfloat *)params |
| 2013 | ); |
| 2014 | |
| 2015 | exit: |
| 2016 | if (params_base) { |
| 2017 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2018 | JNI_ABORT); |
| 2019 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2020 | if (_exception) { |
| 2021 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2022 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2023 | } |
| 2024 | |
| 2025 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 2026 | static void |
| 2027 | android_glLightModelfv__ILjava_nio_FloatBuffer_2 |
| 2028 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2029 | jint _exception = 0; |
| 2030 | const char * _exceptionType; |
| 2031 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2032 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2033 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2034 | jint _remaining; |
| 2035 | GLfloat *params = (GLfloat *) 0; |
| 2036 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2037 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2038 | int _needed; |
| 2039 | switch (pname) { |
| 2040 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2041 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2042 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2043 | _needed = 1; |
| 2044 | break; |
| 2045 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2046 | case GL_LIGHT_MODEL_AMBIENT: |
| 2047 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2048 | _needed = 4; |
| 2049 | break; |
| 2050 | default: |
| 2051 | _needed = 0; |
| 2052 | break; |
| 2053 | } |
| 2054 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2055 | _exception = 1; |
| 2056 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2057 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2058 | goto exit; |
| 2059 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2060 | if (params == NULL) { |
| 2061 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2062 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2063 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2064 | glLightModelfv( |
| 2065 | (GLenum)pname, |
| 2066 | (GLfloat *)params |
| 2067 | ); |
| 2068 | |
| 2069 | exit: |
| 2070 | if (_array) { |
| 2071 | releasePointer(_env, _array, params, JNI_FALSE); |
| 2072 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2073 | if (_exception) { |
| 2074 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2075 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2076 | } |
| 2077 | |
| 2078 | /* void glLightModelx ( GLenum pname, GLfixed param ) */ |
| 2079 | static void |
| 2080 | android_glLightModelx__II |
| 2081 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 2082 | glLightModelx( |
| 2083 | (GLenum)pname, |
| 2084 | (GLfixed)param |
| 2085 | ); |
| 2086 | } |
| 2087 | |
| 2088 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2089 | static void |
| 2090 | android_glLightModelxv__I_3II |
| 2091 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2092 | jint _exception = 0; |
| 2093 | const char * _exceptionType; |
| 2094 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2095 | GLfixed *params_base = (GLfixed *) 0; |
| 2096 | jint _remaining; |
| 2097 | GLfixed *params = (GLfixed *) 0; |
| 2098 | |
| 2099 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2100 | _exception = 1; |
| 2101 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2102 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2103 | goto exit; |
| 2104 | } |
| 2105 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2106 | _exception = 1; |
| 2107 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2108 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2109 | goto exit; |
| 2110 | } |
| 2111 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2112 | int _needed; |
| 2113 | switch (pname) { |
| 2114 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2115 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2116 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2117 | _needed = 1; |
| 2118 | break; |
| 2119 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2120 | case GL_LIGHT_MODEL_AMBIENT: |
| 2121 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2122 | _needed = 4; |
| 2123 | break; |
| 2124 | default: |
| 2125 | _needed = 0; |
| 2126 | break; |
| 2127 | } |
| 2128 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2129 | _exception = 1; |
| 2130 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2131 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2132 | goto exit; |
| 2133 | } |
| 2134 | params_base = (GLfixed *) |
| 2135 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2136 | params = params_base + offset; |
| 2137 | |
| 2138 | glLightModelxv( |
| 2139 | (GLenum)pname, |
| 2140 | (GLfixed *)params |
| 2141 | ); |
| 2142 | |
| 2143 | exit: |
| 2144 | if (params_base) { |
| 2145 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2146 | JNI_ABORT); |
| 2147 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2148 | if (_exception) { |
| 2149 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2150 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2151 | } |
| 2152 | |
| 2153 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2154 | static void |
| 2155 | android_glLightModelxv__ILjava_nio_IntBuffer_2 |
| 2156 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2157 | jint _exception = 0; |
| 2158 | const char * _exceptionType; |
| 2159 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2160 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2161 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2162 | jint _remaining; |
| 2163 | GLfixed *params = (GLfixed *) 0; |
| 2164 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2165 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2166 | int _needed; |
| 2167 | switch (pname) { |
| 2168 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2169 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2170 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2171 | _needed = 1; |
| 2172 | break; |
| 2173 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2174 | case GL_LIGHT_MODEL_AMBIENT: |
| 2175 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2176 | _needed = 4; |
| 2177 | break; |
| 2178 | default: |
| 2179 | _needed = 0; |
| 2180 | break; |
| 2181 | } |
| 2182 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2183 | _exception = 1; |
| 2184 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2185 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2186 | goto exit; |
| 2187 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2188 | if (params == NULL) { |
| 2189 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2190 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2191 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2192 | glLightModelxv( |
| 2193 | (GLenum)pname, |
| 2194 | (GLfixed *)params |
| 2195 | ); |
| 2196 | |
| 2197 | exit: |
| 2198 | if (_array) { |
| 2199 | releasePointer(_env, _array, params, JNI_FALSE); |
| 2200 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2201 | if (_exception) { |
| 2202 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2203 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2204 | } |
| 2205 | |
| 2206 | /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */ |
| 2207 | static void |
| 2208 | android_glLightf__IIF |
| 2209 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) { |
| 2210 | glLightf( |
| 2211 | (GLenum)light, |
| 2212 | (GLenum)pname, |
| 2213 | (GLfloat)param |
| 2214 | ); |
| 2215 | } |
| 2216 | |
| 2217 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2218 | static void |
| 2219 | android_glLightfv__II_3FI |
| 2220 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2221 | jint _exception = 0; |
| 2222 | const char * _exceptionType; |
| 2223 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2224 | GLfloat *params_base = (GLfloat *) 0; |
| 2225 | jint _remaining; |
| 2226 | GLfloat *params = (GLfloat *) 0; |
| 2227 | |
| 2228 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2229 | _exception = 1; |
| 2230 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2231 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2232 | goto exit; |
| 2233 | } |
| 2234 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2235 | _exception = 1; |
| 2236 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2237 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2238 | goto exit; |
| 2239 | } |
| 2240 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2241 | int _needed; |
| 2242 | switch (pname) { |
| 2243 | #if defined(GL_SPOT_EXPONENT) |
| 2244 | case GL_SPOT_EXPONENT: |
| 2245 | #endif // defined(GL_SPOT_EXPONENT) |
| 2246 | #if defined(GL_SPOT_CUTOFF) |
| 2247 | case GL_SPOT_CUTOFF: |
| 2248 | #endif // defined(GL_SPOT_CUTOFF) |
| 2249 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2250 | case GL_CONSTANT_ATTENUATION: |
| 2251 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2252 | #if defined(GL_LINEAR_ATTENUATION) |
| 2253 | case GL_LINEAR_ATTENUATION: |
| 2254 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2255 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2256 | case GL_QUADRATIC_ATTENUATION: |
| 2257 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2258 | _needed = 1; |
| 2259 | break; |
| 2260 | #if defined(GL_SPOT_DIRECTION) |
| 2261 | case GL_SPOT_DIRECTION: |
| 2262 | #endif // defined(GL_SPOT_DIRECTION) |
| 2263 | _needed = 3; |
| 2264 | break; |
| 2265 | #if defined(GL_AMBIENT) |
| 2266 | case GL_AMBIENT: |
| 2267 | #endif // defined(GL_AMBIENT) |
| 2268 | #if defined(GL_DIFFUSE) |
| 2269 | case GL_DIFFUSE: |
| 2270 | #endif // defined(GL_DIFFUSE) |
| 2271 | #if defined(GL_SPECULAR) |
| 2272 | case GL_SPECULAR: |
| 2273 | #endif // defined(GL_SPECULAR) |
| 2274 | #if defined(GL_EMISSION) |
| 2275 | case GL_EMISSION: |
| 2276 | #endif // defined(GL_EMISSION) |
| 2277 | _needed = 4; |
| 2278 | break; |
| 2279 | default: |
| 2280 | _needed = 0; |
| 2281 | break; |
| 2282 | } |
| 2283 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2284 | _exception = 1; |
| 2285 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2286 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2287 | goto exit; |
| 2288 | } |
| 2289 | params_base = (GLfloat *) |
| 2290 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2291 | params = params_base + offset; |
| 2292 | |
| 2293 | glLightfv( |
| 2294 | (GLenum)light, |
| 2295 | (GLenum)pname, |
| 2296 | (GLfloat *)params |
| 2297 | ); |
| 2298 | |
| 2299 | exit: |
| 2300 | if (params_base) { |
| 2301 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2302 | JNI_ABORT); |
| 2303 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2304 | if (_exception) { |
| 2305 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2306 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2307 | } |
| 2308 | |
| 2309 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2310 | static void |
| 2311 | android_glLightfv__IILjava_nio_FloatBuffer_2 |
| 2312 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2313 | jint _exception = 0; |
| 2314 | const char * _exceptionType; |
| 2315 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2316 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2317 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2318 | jint _remaining; |
| 2319 | GLfloat *params = (GLfloat *) 0; |
| 2320 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2321 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2322 | int _needed; |
| 2323 | switch (pname) { |
| 2324 | #if defined(GL_SPOT_EXPONENT) |
| 2325 | case GL_SPOT_EXPONENT: |
| 2326 | #endif // defined(GL_SPOT_EXPONENT) |
| 2327 | #if defined(GL_SPOT_CUTOFF) |
| 2328 | case GL_SPOT_CUTOFF: |
| 2329 | #endif // defined(GL_SPOT_CUTOFF) |
| 2330 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2331 | case GL_CONSTANT_ATTENUATION: |
| 2332 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2333 | #if defined(GL_LINEAR_ATTENUATION) |
| 2334 | case GL_LINEAR_ATTENUATION: |
| 2335 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2336 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2337 | case GL_QUADRATIC_ATTENUATION: |
| 2338 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2339 | _needed = 1; |
| 2340 | break; |
| 2341 | #if defined(GL_SPOT_DIRECTION) |
| 2342 | case GL_SPOT_DIRECTION: |
| 2343 | #endif // defined(GL_SPOT_DIRECTION) |
| 2344 | _needed = 3; |
| 2345 | break; |
| 2346 | #if defined(GL_AMBIENT) |
| 2347 | case GL_AMBIENT: |
| 2348 | #endif // defined(GL_AMBIENT) |
| 2349 | #if defined(GL_DIFFUSE) |
| 2350 | case GL_DIFFUSE: |
| 2351 | #endif // defined(GL_DIFFUSE) |
| 2352 | #if defined(GL_SPECULAR) |
| 2353 | case GL_SPECULAR: |
| 2354 | #endif // defined(GL_SPECULAR) |
| 2355 | #if defined(GL_EMISSION) |
| 2356 | case GL_EMISSION: |
| 2357 | #endif // defined(GL_EMISSION) |
| 2358 | _needed = 4; |
| 2359 | break; |
| 2360 | default: |
| 2361 | _needed = 0; |
| 2362 | break; |
| 2363 | } |
| 2364 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2365 | _exception = 1; |
| 2366 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2367 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2368 | goto exit; |
| 2369 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2370 | if (params == NULL) { |
| 2371 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2372 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2373 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2374 | glLightfv( |
| 2375 | (GLenum)light, |
| 2376 | (GLenum)pname, |
| 2377 | (GLfloat *)params |
| 2378 | ); |
| 2379 | |
| 2380 | exit: |
| 2381 | if (_array) { |
| 2382 | releasePointer(_env, _array, params, JNI_FALSE); |
| 2383 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2384 | if (_exception) { |
| 2385 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2386 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2387 | } |
| 2388 | |
| 2389 | /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */ |
| 2390 | static void |
| 2391 | android_glLightx__III |
| 2392 | (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) { |
| 2393 | glLightx( |
| 2394 | (GLenum)light, |
| 2395 | (GLenum)pname, |
| 2396 | (GLfixed)param |
| 2397 | ); |
| 2398 | } |
| 2399 | |
| 2400 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2401 | static void |
| 2402 | android_glLightxv__II_3II |
| 2403 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2404 | jint _exception = 0; |
| 2405 | const char * _exceptionType; |
| 2406 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2407 | GLfixed *params_base = (GLfixed *) 0; |
| 2408 | jint _remaining; |
| 2409 | GLfixed *params = (GLfixed *) 0; |
| 2410 | |
| 2411 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2412 | _exception = 1; |
| 2413 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2414 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2415 | goto exit; |
| 2416 | } |
| 2417 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2418 | _exception = 1; |
| 2419 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2420 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2421 | goto exit; |
| 2422 | } |
| 2423 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2424 | int _needed; |
| 2425 | switch (pname) { |
| 2426 | #if defined(GL_SPOT_EXPONENT) |
| 2427 | case GL_SPOT_EXPONENT: |
| 2428 | #endif // defined(GL_SPOT_EXPONENT) |
| 2429 | #if defined(GL_SPOT_CUTOFF) |
| 2430 | case GL_SPOT_CUTOFF: |
| 2431 | #endif // defined(GL_SPOT_CUTOFF) |
| 2432 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2433 | case GL_CONSTANT_ATTENUATION: |
| 2434 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2435 | #if defined(GL_LINEAR_ATTENUATION) |
| 2436 | case GL_LINEAR_ATTENUATION: |
| 2437 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2438 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2439 | case GL_QUADRATIC_ATTENUATION: |
| 2440 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2441 | _needed = 1; |
| 2442 | break; |
| 2443 | #if defined(GL_SPOT_DIRECTION) |
| 2444 | case GL_SPOT_DIRECTION: |
| 2445 | #endif // defined(GL_SPOT_DIRECTION) |
| 2446 | _needed = 3; |
| 2447 | break; |
| 2448 | #if defined(GL_AMBIENT) |
| 2449 | case GL_AMBIENT: |
| 2450 | #endif // defined(GL_AMBIENT) |
| 2451 | #if defined(GL_DIFFUSE) |
| 2452 | case GL_DIFFUSE: |
| 2453 | #endif // defined(GL_DIFFUSE) |
| 2454 | #if defined(GL_SPECULAR) |
| 2455 | case GL_SPECULAR: |
| 2456 | #endif // defined(GL_SPECULAR) |
| 2457 | #if defined(GL_EMISSION) |
| 2458 | case GL_EMISSION: |
| 2459 | #endif // defined(GL_EMISSION) |
| 2460 | _needed = 4; |
| 2461 | break; |
| 2462 | default: |
| 2463 | _needed = 0; |
| 2464 | break; |
| 2465 | } |
| 2466 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2467 | _exception = 1; |
| 2468 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2469 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2470 | goto exit; |
| 2471 | } |
| 2472 | params_base = (GLfixed *) |
| 2473 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2474 | params = params_base + offset; |
| 2475 | |
| 2476 | glLightxv( |
| 2477 | (GLenum)light, |
| 2478 | (GLenum)pname, |
| 2479 | (GLfixed *)params |
| 2480 | ); |
| 2481 | |
| 2482 | exit: |
| 2483 | if (params_base) { |
| 2484 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2485 | JNI_ABORT); |
| 2486 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2487 | if (_exception) { |
| 2488 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2489 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2490 | } |
| 2491 | |
| 2492 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2493 | static void |
| 2494 | android_glLightxv__IILjava_nio_IntBuffer_2 |
| 2495 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2496 | jint _exception = 0; |
| 2497 | const char * _exceptionType; |
| 2498 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2499 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2500 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2501 | jint _remaining; |
| 2502 | GLfixed *params = (GLfixed *) 0; |
| 2503 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2504 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2505 | int _needed; |
| 2506 | switch (pname) { |
| 2507 | #if defined(GL_SPOT_EXPONENT) |
| 2508 | case GL_SPOT_EXPONENT: |
| 2509 | #endif // defined(GL_SPOT_EXPONENT) |
| 2510 | #if defined(GL_SPOT_CUTOFF) |
| 2511 | case GL_SPOT_CUTOFF: |
| 2512 | #endif // defined(GL_SPOT_CUTOFF) |
| 2513 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2514 | case GL_CONSTANT_ATTENUATION: |
| 2515 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2516 | #if defined(GL_LINEAR_ATTENUATION) |
| 2517 | case GL_LINEAR_ATTENUATION: |
| 2518 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2519 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2520 | case GL_QUADRATIC_ATTENUATION: |
| 2521 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2522 | _needed = 1; |
| 2523 | break; |
| 2524 | #if defined(GL_SPOT_DIRECTION) |
| 2525 | case GL_SPOT_DIRECTION: |
| 2526 | #endif // defined(GL_SPOT_DIRECTION) |
| 2527 | _needed = 3; |
| 2528 | break; |
| 2529 | #if defined(GL_AMBIENT) |
| 2530 | case GL_AMBIENT: |
| 2531 | #endif // defined(GL_AMBIENT) |
| 2532 | #if defined(GL_DIFFUSE) |
| 2533 | case GL_DIFFUSE: |
| 2534 | #endif // defined(GL_DIFFUSE) |
| 2535 | #if defined(GL_SPECULAR) |
| 2536 | case GL_SPECULAR: |
| 2537 | #endif // defined(GL_SPECULAR) |
| 2538 | #if defined(GL_EMISSION) |
| 2539 | case GL_EMISSION: |
| 2540 | #endif // defined(GL_EMISSION) |
| 2541 | _needed = 4; |
| 2542 | break; |
| 2543 | default: |
| 2544 | _needed = 0; |
| 2545 | break; |
| 2546 | } |
| 2547 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2548 | _exception = 1; |
| 2549 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2550 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2551 | goto exit; |
| 2552 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2553 | if (params == NULL) { |
| 2554 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2555 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2556 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2557 | glLightxv( |
| 2558 | (GLenum)light, |
| 2559 | (GLenum)pname, |
| 2560 | (GLfixed *)params |
| 2561 | ); |
| 2562 | |
| 2563 | exit: |
| 2564 | if (_array) { |
| 2565 | releasePointer(_env, _array, params, JNI_FALSE); |
| 2566 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2567 | if (_exception) { |
| 2568 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2569 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2570 | } |
| 2571 | |
| 2572 | /* void glLineWidth ( GLfloat width ) */ |
| 2573 | static void |
| 2574 | android_glLineWidth__F |
| 2575 | (JNIEnv *_env, jobject _this, jfloat width) { |
| 2576 | glLineWidth( |
| 2577 | (GLfloat)width |
| 2578 | ); |
| 2579 | } |
| 2580 | |
| 2581 | /* void glLineWidthx ( GLfixed width ) */ |
| 2582 | static void |
| 2583 | android_glLineWidthx__I |
| 2584 | (JNIEnv *_env, jobject _this, jint width) { |
| 2585 | glLineWidthx( |
| 2586 | (GLfixed)width |
| 2587 | ); |
| 2588 | } |
| 2589 | |
| 2590 | /* void glLoadIdentity ( void ) */ |
| 2591 | static void |
| 2592 | android_glLoadIdentity__ |
| 2593 | (JNIEnv *_env, jobject _this) { |
| 2594 | glLoadIdentity(); |
| 2595 | } |
| 2596 | |
| 2597 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2598 | static void |
| 2599 | android_glLoadMatrixf___3FI |
| 2600 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2601 | jint _exception = 0; |
| 2602 | const char * _exceptionType; |
| 2603 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2604 | GLfloat *m_base = (GLfloat *) 0; |
| 2605 | jint _remaining; |
| 2606 | GLfloat *m = (GLfloat *) 0; |
| 2607 | |
| 2608 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2609 | _exception = 1; |
| 2610 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2611 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2612 | goto exit; |
| 2613 | } |
| 2614 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2615 | _exception = 1; |
| 2616 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2617 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2618 | goto exit; |
| 2619 | } |
| 2620 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2621 | m_base = (GLfloat *) |
| 2622 | _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0); |
| 2623 | m = m_base + offset; |
| 2624 | |
| 2625 | glLoadMatrixf( |
| 2626 | (GLfloat *)m |
| 2627 | ); |
| 2628 | |
| 2629 | exit: |
| 2630 | if (m_base) { |
| 2631 | _env->ReleasePrimitiveArrayCritical(m_ref, m_base, |
| 2632 | JNI_ABORT); |
| 2633 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2634 | if (_exception) { |
| 2635 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2636 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2637 | } |
| 2638 | |
| 2639 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2640 | static void |
| 2641 | android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 |
| 2642 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
| 2643 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2644 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2645 | jint _remaining; |
| 2646 | GLfloat *m = (GLfloat *) 0; |
| 2647 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2648 | m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset); |
| 2649 | if (m == NULL) { |
| 2650 | char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2651 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 2652 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2653 | glLoadMatrixf( |
| 2654 | (GLfloat *)m |
| 2655 | ); |
| 2656 | if (_array) { |
| 2657 | releasePointer(_env, _array, m, JNI_FALSE); |
| 2658 | } |
| 2659 | } |
| 2660 | |
| 2661 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2662 | static void |
| 2663 | android_glLoadMatrixx___3II |
| 2664 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2665 | jint _exception = 0; |
| 2666 | const char * _exceptionType; |
| 2667 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2668 | GLfixed *m_base = (GLfixed *) 0; |
| 2669 | jint _remaining; |
| 2670 | GLfixed *m = (GLfixed *) 0; |
| 2671 | |
| 2672 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2673 | _exception = 1; |
| 2674 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2675 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2676 | goto exit; |
| 2677 | } |
| 2678 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2679 | _exception = 1; |
| 2680 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2681 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2682 | goto exit; |
| 2683 | } |
| 2684 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2685 | m_base = (GLfixed *) |
| 2686 | _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0); |
| 2687 | m = m_base + offset; |
| 2688 | |
| 2689 | glLoadMatrixx( |
| 2690 | (GLfixed *)m |
| 2691 | ); |
| 2692 | |
| 2693 | exit: |
| 2694 | if (m_base) { |
| 2695 | _env->ReleasePrimitiveArrayCritical(m_ref, m_base, |
| 2696 | JNI_ABORT); |
| 2697 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2698 | if (_exception) { |
| 2699 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2700 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2701 | } |
| 2702 | |
| 2703 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2704 | static void |
| 2705 | android_glLoadMatrixx__Ljava_nio_IntBuffer_2 |
| 2706 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
| 2707 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2708 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2709 | jint _remaining; |
| 2710 | GLfixed *m = (GLfixed *) 0; |
| 2711 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2712 | m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset); |
| 2713 | if (m == NULL) { |
| 2714 | char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2715 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 2716 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2717 | glLoadMatrixx( |
| 2718 | (GLfixed *)m |
| 2719 | ); |
| 2720 | if (_array) { |
| 2721 | releasePointer(_env, _array, m, JNI_FALSE); |
| 2722 | } |
| 2723 | } |
| 2724 | |
| 2725 | /* void glLogicOp ( GLenum opcode ) */ |
| 2726 | static void |
| 2727 | android_glLogicOp__I |
| 2728 | (JNIEnv *_env, jobject _this, jint opcode) { |
| 2729 | glLogicOp( |
| 2730 | (GLenum)opcode |
| 2731 | ); |
| 2732 | } |
| 2733 | |
| 2734 | /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */ |
| 2735 | static void |
| 2736 | android_glMaterialf__IIF |
| 2737 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) { |
| 2738 | glMaterialf( |
| 2739 | (GLenum)face, |
| 2740 | (GLenum)pname, |
| 2741 | (GLfloat)param |
| 2742 | ); |
| 2743 | } |
| 2744 | |
| 2745 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2746 | static void |
| 2747 | android_glMaterialfv__II_3FI |
| 2748 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2749 | jint _exception = 0; |
| 2750 | const char * _exceptionType; |
| 2751 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2752 | GLfloat *params_base = (GLfloat *) 0; |
| 2753 | jint _remaining; |
| 2754 | GLfloat *params = (GLfloat *) 0; |
| 2755 | |
| 2756 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2757 | _exception = 1; |
| 2758 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2759 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2760 | goto exit; |
| 2761 | } |
| 2762 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2763 | _exception = 1; |
| 2764 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2765 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2766 | goto exit; |
| 2767 | } |
| 2768 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2769 | int _needed; |
| 2770 | switch (pname) { |
| 2771 | #if defined(GL_SHININESS) |
| 2772 | case GL_SHININESS: |
| 2773 | #endif // defined(GL_SHININESS) |
| 2774 | _needed = 1; |
| 2775 | break; |
| 2776 | #if defined(GL_AMBIENT) |
| 2777 | case GL_AMBIENT: |
| 2778 | #endif // defined(GL_AMBIENT) |
| 2779 | #if defined(GL_DIFFUSE) |
| 2780 | case GL_DIFFUSE: |
| 2781 | #endif // defined(GL_DIFFUSE) |
| 2782 | #if defined(GL_SPECULAR) |
| 2783 | case GL_SPECULAR: |
| 2784 | #endif // defined(GL_SPECULAR) |
| 2785 | #if defined(GL_EMISSION) |
| 2786 | case GL_EMISSION: |
| 2787 | #endif // defined(GL_EMISSION) |
| 2788 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2789 | case GL_AMBIENT_AND_DIFFUSE: |
| 2790 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2791 | _needed = 4; |
| 2792 | break; |
| 2793 | default: |
| 2794 | _needed = 0; |
| 2795 | break; |
| 2796 | } |
| 2797 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2798 | _exception = 1; |
| 2799 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2800 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2801 | goto exit; |
| 2802 | } |
| 2803 | params_base = (GLfloat *) |
| 2804 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2805 | params = params_base + offset; |
| 2806 | |
| 2807 | glMaterialfv( |
| 2808 | (GLenum)face, |
| 2809 | (GLenum)pname, |
| 2810 | (GLfloat *)params |
| 2811 | ); |
| 2812 | |
| 2813 | exit: |
| 2814 | if (params_base) { |
| 2815 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2816 | JNI_ABORT); |
| 2817 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2818 | if (_exception) { |
| 2819 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2820 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2821 | } |
| 2822 | |
| 2823 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2824 | static void |
| 2825 | android_glMaterialfv__IILjava_nio_FloatBuffer_2 |
| 2826 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2827 | jint _exception = 0; |
| 2828 | const char * _exceptionType; |
| 2829 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2830 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2831 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2832 | jint _remaining; |
| 2833 | GLfloat *params = (GLfloat *) 0; |
| 2834 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2835 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2836 | int _needed; |
| 2837 | switch (pname) { |
| 2838 | #if defined(GL_SHININESS) |
| 2839 | case GL_SHININESS: |
| 2840 | #endif // defined(GL_SHININESS) |
| 2841 | _needed = 1; |
| 2842 | break; |
| 2843 | #if defined(GL_AMBIENT) |
| 2844 | case GL_AMBIENT: |
| 2845 | #endif // defined(GL_AMBIENT) |
| 2846 | #if defined(GL_DIFFUSE) |
| 2847 | case GL_DIFFUSE: |
| 2848 | #endif // defined(GL_DIFFUSE) |
| 2849 | #if defined(GL_SPECULAR) |
| 2850 | case GL_SPECULAR: |
| 2851 | #endif // defined(GL_SPECULAR) |
| 2852 | #if defined(GL_EMISSION) |
| 2853 | case GL_EMISSION: |
| 2854 | #endif // defined(GL_EMISSION) |
| 2855 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2856 | case GL_AMBIENT_AND_DIFFUSE: |
| 2857 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2858 | _needed = 4; |
| 2859 | break; |
| 2860 | default: |
| 2861 | _needed = 0; |
| 2862 | break; |
| 2863 | } |
| 2864 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2865 | _exception = 1; |
| 2866 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2867 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2868 | goto exit; |
| 2869 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2870 | if (params == NULL) { |
| 2871 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2872 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2873 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2874 | glMaterialfv( |
| 2875 | (GLenum)face, |
| 2876 | (GLenum)pname, |
| 2877 | (GLfloat *)params |
| 2878 | ); |
| 2879 | |
| 2880 | exit: |
| 2881 | if (_array) { |
| 2882 | releasePointer(_env, _array, params, JNI_FALSE); |
| 2883 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2884 | if (_exception) { |
| 2885 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2886 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2887 | } |
| 2888 | |
| 2889 | /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */ |
| 2890 | static void |
| 2891 | android_glMaterialx__III |
| 2892 | (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) { |
| 2893 | glMaterialx( |
| 2894 | (GLenum)face, |
| 2895 | (GLenum)pname, |
| 2896 | (GLfixed)param |
| 2897 | ); |
| 2898 | } |
| 2899 | |
| 2900 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2901 | static void |
| 2902 | android_glMaterialxv__II_3II |
| 2903 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2904 | jint _exception = 0; |
| 2905 | const char * _exceptionType; |
| 2906 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2907 | GLfixed *params_base = (GLfixed *) 0; |
| 2908 | jint _remaining; |
| 2909 | GLfixed *params = (GLfixed *) 0; |
| 2910 | |
| 2911 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2912 | _exception = 1; |
| 2913 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2914 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2915 | goto exit; |
| 2916 | } |
| 2917 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2918 | _exception = 1; |
| 2919 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2920 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | goto exit; |
| 2922 | } |
| 2923 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2924 | int _needed; |
| 2925 | switch (pname) { |
| 2926 | #if defined(GL_SHININESS) |
| 2927 | case GL_SHININESS: |
| 2928 | #endif // defined(GL_SHININESS) |
| 2929 | _needed = 1; |
| 2930 | break; |
| 2931 | #if defined(GL_AMBIENT) |
| 2932 | case GL_AMBIENT: |
| 2933 | #endif // defined(GL_AMBIENT) |
| 2934 | #if defined(GL_DIFFUSE) |
| 2935 | case GL_DIFFUSE: |
| 2936 | #endif // defined(GL_DIFFUSE) |
| 2937 | #if defined(GL_SPECULAR) |
| 2938 | case GL_SPECULAR: |
| 2939 | #endif // defined(GL_SPECULAR) |
| 2940 | #if defined(GL_EMISSION) |
| 2941 | case GL_EMISSION: |
| 2942 | #endif // defined(GL_EMISSION) |
| 2943 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2944 | case GL_AMBIENT_AND_DIFFUSE: |
| 2945 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2946 | _needed = 4; |
| 2947 | break; |
| 2948 | default: |
| 2949 | _needed = 0; |
| 2950 | break; |
| 2951 | } |
| 2952 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2953 | _exception = 1; |
| 2954 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2955 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2956 | goto exit; |
| 2957 | } |
| 2958 | params_base = (GLfixed *) |
| 2959 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2960 | params = params_base + offset; |
| 2961 | |
| 2962 | glMaterialxv( |
| 2963 | (GLenum)face, |
| 2964 | (GLenum)pname, |
| 2965 | (GLfixed *)params |
| 2966 | ); |
| 2967 | |
| 2968 | exit: |
| 2969 | if (params_base) { |
| 2970 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2971 | JNI_ABORT); |
| 2972 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2973 | if (_exception) { |
| 2974 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2975 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2976 | } |
| 2977 | |
| 2978 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2979 | static void |
| 2980 | android_glMaterialxv__IILjava_nio_IntBuffer_2 |
| 2981 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2982 | jint _exception = 0; |
| 2983 | const char * _exceptionType; |
| 2984 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2985 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2986 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2987 | jint _remaining; |
| 2988 | GLfixed *params = (GLfixed *) 0; |
| 2989 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2990 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2991 | int _needed; |
| 2992 | switch (pname) { |
| 2993 | #if defined(GL_SHININESS) |
| 2994 | case GL_SHININESS: |
| 2995 | #endif // defined(GL_SHININESS) |
| 2996 | _needed = 1; |
| 2997 | break; |
| 2998 | #if defined(GL_AMBIENT) |
| 2999 | case GL_AMBIENT: |
| 3000 | #endif // defined(GL_AMBIENT) |
| 3001 | #if defined(GL_DIFFUSE) |
| 3002 | case GL_DIFFUSE: |
| 3003 | #endif // defined(GL_DIFFUSE) |
| 3004 | #if defined(GL_SPECULAR) |
| 3005 | case GL_SPECULAR: |
| 3006 | #endif // defined(GL_SPECULAR) |
| 3007 | #if defined(GL_EMISSION) |
| 3008 | case GL_EMISSION: |
| 3009 | #endif // defined(GL_EMISSION) |
| 3010 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3011 | case GL_AMBIENT_AND_DIFFUSE: |
| 3012 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3013 | _needed = 4; |
| 3014 | break; |
| 3015 | default: |
| 3016 | _needed = 0; |
| 3017 | break; |
| 3018 | } |
| 3019 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3020 | _exception = 1; |
| 3021 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3022 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3023 | goto exit; |
| 3024 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3025 | if (params == NULL) { |
| 3026 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3027 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3028 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3029 | glMaterialxv( |
| 3030 | (GLenum)face, |
| 3031 | (GLenum)pname, |
| 3032 | (GLfixed *)params |
| 3033 | ); |
| 3034 | |
| 3035 | exit: |
| 3036 | if (_array) { |
| 3037 | releasePointer(_env, _array, params, JNI_FALSE); |
| 3038 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3039 | if (_exception) { |
| 3040 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3041 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3042 | } |
| 3043 | |
| 3044 | /* void glMatrixMode ( GLenum mode ) */ |
| 3045 | static void |
| 3046 | android_glMatrixMode__I |
| 3047 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3048 | glMatrixMode( |
| 3049 | (GLenum)mode |
| 3050 | ); |
| 3051 | } |
| 3052 | |
| 3053 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3054 | static void |
| 3055 | android_glMultMatrixf___3FI |
| 3056 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3057 | jint _exception = 0; |
| 3058 | const char * _exceptionType; |
| 3059 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3060 | GLfloat *m_base = (GLfloat *) 0; |
| 3061 | jint _remaining; |
| 3062 | GLfloat *m = (GLfloat *) 0; |
| 3063 | |
| 3064 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3065 | _exception = 1; |
| 3066 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3067 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3068 | goto exit; |
| 3069 | } |
| 3070 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3071 | _exception = 1; |
| 3072 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3073 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3074 | goto exit; |
| 3075 | } |
| 3076 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3077 | m_base = (GLfloat *) |
| 3078 | _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0); |
| 3079 | m = m_base + offset; |
| 3080 | |
| 3081 | glMultMatrixf( |
| 3082 | (GLfloat *)m |
| 3083 | ); |
| 3084 | |
| 3085 | exit: |
| 3086 | if (m_base) { |
| 3087 | _env->ReleasePrimitiveArrayCritical(m_ref, m_base, |
| 3088 | JNI_ABORT); |
| 3089 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3090 | if (_exception) { |
| 3091 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3092 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3093 | } |
| 3094 | |
| 3095 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3096 | static void |
| 3097 | android_glMultMatrixf__Ljava_nio_FloatBuffer_2 |
| 3098 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
| 3099 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3100 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3101 | jint _remaining; |
| 3102 | GLfloat *m = (GLfloat *) 0; |
| 3103 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3104 | m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset); |
| 3105 | if (m == NULL) { |
| 3106 | char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3107 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 3108 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3109 | glMultMatrixf( |
| 3110 | (GLfloat *)m |
| 3111 | ); |
| 3112 | if (_array) { |
| 3113 | releasePointer(_env, _array, m, JNI_FALSE); |
| 3114 | } |
| 3115 | } |
| 3116 | |
| 3117 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3118 | static void |
| 3119 | android_glMultMatrixx___3II |
| 3120 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3121 | jint _exception = 0; |
| 3122 | const char * _exceptionType; |
| 3123 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3124 | GLfixed *m_base = (GLfixed *) 0; |
| 3125 | jint _remaining; |
| 3126 | GLfixed *m = (GLfixed *) 0; |
| 3127 | |
| 3128 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3129 | _exception = 1; |
| 3130 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3131 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3132 | goto exit; |
| 3133 | } |
| 3134 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3135 | _exception = 1; |
| 3136 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3137 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3138 | goto exit; |
| 3139 | } |
| 3140 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3141 | m_base = (GLfixed *) |
| 3142 | _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0); |
| 3143 | m = m_base + offset; |
| 3144 | |
| 3145 | glMultMatrixx( |
| 3146 | (GLfixed *)m |
| 3147 | ); |
| 3148 | |
| 3149 | exit: |
| 3150 | if (m_base) { |
| 3151 | _env->ReleasePrimitiveArrayCritical(m_ref, m_base, |
| 3152 | JNI_ABORT); |
| 3153 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3154 | if (_exception) { |
| 3155 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3156 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3157 | } |
| 3158 | |
| 3159 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3160 | static void |
| 3161 | android_glMultMatrixx__Ljava_nio_IntBuffer_2 |
| 3162 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
| 3163 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3164 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3165 | jint _remaining; |
| 3166 | GLfixed *m = (GLfixed *) 0; |
| 3167 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3168 | m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset); |
| 3169 | if (m == NULL) { |
| 3170 | char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3171 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 3172 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3173 | glMultMatrixx( |
| 3174 | (GLfixed *)m |
| 3175 | ); |
| 3176 | if (_array) { |
| 3177 | releasePointer(_env, _array, m, JNI_FALSE); |
| 3178 | } |
| 3179 | } |
| 3180 | |
| 3181 | /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */ |
| 3182 | static void |
| 3183 | android_glMultiTexCoord4f__IFFFF |
| 3184 | (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) { |
| 3185 | glMultiTexCoord4f( |
| 3186 | (GLenum)target, |
| 3187 | (GLfloat)s, |
| 3188 | (GLfloat)t, |
| 3189 | (GLfloat)r, |
| 3190 | (GLfloat)q |
| 3191 | ); |
| 3192 | } |
| 3193 | |
| 3194 | /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */ |
| 3195 | static void |
| 3196 | android_glMultiTexCoord4x__IIIII |
| 3197 | (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) { |
| 3198 | glMultiTexCoord4x( |
| 3199 | (GLenum)target, |
| 3200 | (GLfixed)s, |
| 3201 | (GLfixed)t, |
| 3202 | (GLfixed)r, |
| 3203 | (GLfixed)q |
| 3204 | ); |
| 3205 | } |
| 3206 | |
| 3207 | /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */ |
| 3208 | static void |
| 3209 | android_glNormal3f__FFF |
| 3210 | (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) { |
| 3211 | glNormal3f( |
| 3212 | (GLfloat)nx, |
| 3213 | (GLfloat)ny, |
| 3214 | (GLfloat)nz |
| 3215 | ); |
| 3216 | } |
| 3217 | |
| 3218 | /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */ |
| 3219 | static void |
| 3220 | android_glNormal3x__III |
| 3221 | (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) { |
| 3222 | glNormal3x( |
| 3223 | (GLfixed)nx, |
| 3224 | (GLfixed)ny, |
| 3225 | (GLfixed)nz |
| 3226 | ); |
| 3227 | } |
| 3228 | |
| 3229 | /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3230 | static void |
| 3231 | android_glNormalPointerBounds__IILjava_nio_Buffer_2I |
| 3232 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3233 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3234 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3235 | jint _remaining; |
| 3236 | GLvoid *pointer = (GLvoid *) 0; |
| 3237 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3238 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3239 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3240 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3241 | return; |
| 3242 | } |
| 3243 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3244 | glNormalPointerBounds( |
| 3245 | (GLenum)type, |
| 3246 | (GLsizei)stride, |
| 3247 | (GLvoid *)pointer, |
| 3248 | (GLsizei)remaining |
| 3249 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3250 | } |
| 3251 | |
| 3252 | /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3253 | static void |
| 3254 | android_glOrthof__FFFFFF |
| 3255 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 3256 | glOrthof( |
| 3257 | (GLfloat)left, |
| 3258 | (GLfloat)right, |
| 3259 | (GLfloat)bottom, |
| 3260 | (GLfloat)top, |
| 3261 | (GLfloat)zNear, |
| 3262 | (GLfloat)zFar |
| 3263 | ); |
| 3264 | } |
| 3265 | |
| 3266 | /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 3267 | static void |
| 3268 | android_glOrthox__IIIIII |
| 3269 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 3270 | glOrthox( |
| 3271 | (GLfixed)left, |
| 3272 | (GLfixed)right, |
| 3273 | (GLfixed)bottom, |
| 3274 | (GLfixed)top, |
| 3275 | (GLfixed)zNear, |
| 3276 | (GLfixed)zFar |
| 3277 | ); |
| 3278 | } |
| 3279 | |
| 3280 | /* void glPixelStorei ( GLenum pname, GLint param ) */ |
| 3281 | static void |
| 3282 | android_glPixelStorei__II |
| 3283 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 3284 | glPixelStorei( |
| 3285 | (GLenum)pname, |
| 3286 | (GLint)param |
| 3287 | ); |
| 3288 | } |
| 3289 | |
| 3290 | /* void glPointSize ( GLfloat size ) */ |
| 3291 | static void |
| 3292 | android_glPointSize__F |
| 3293 | (JNIEnv *_env, jobject _this, jfloat size) { |
| 3294 | glPointSize( |
| 3295 | (GLfloat)size |
| 3296 | ); |
| 3297 | } |
| 3298 | |
| 3299 | /* void glPointSizex ( GLfixed size ) */ |
| 3300 | static void |
| 3301 | android_glPointSizex__I |
| 3302 | (JNIEnv *_env, jobject _this, jint size) { |
| 3303 | glPointSizex( |
| 3304 | (GLfixed)size |
| 3305 | ); |
| 3306 | } |
| 3307 | |
| 3308 | /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ |
| 3309 | static void |
| 3310 | android_glPolygonOffset__FF |
| 3311 | (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { |
| 3312 | glPolygonOffset( |
| 3313 | (GLfloat)factor, |
| 3314 | (GLfloat)units |
| 3315 | ); |
| 3316 | } |
| 3317 | |
| 3318 | /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */ |
| 3319 | static void |
| 3320 | android_glPolygonOffsetx__II |
| 3321 | (JNIEnv *_env, jobject _this, jint factor, jint units) { |
| 3322 | glPolygonOffsetx( |
| 3323 | (GLfixed)factor, |
| 3324 | (GLfixed)units |
| 3325 | ); |
| 3326 | } |
| 3327 | |
| 3328 | /* void glPopMatrix ( void ) */ |
| 3329 | static void |
| 3330 | android_glPopMatrix__ |
| 3331 | (JNIEnv *_env, jobject _this) { |
| 3332 | glPopMatrix(); |
| 3333 | } |
| 3334 | |
| 3335 | /* void glPushMatrix ( void ) */ |
| 3336 | static void |
| 3337 | android_glPushMatrix__ |
| 3338 | (JNIEnv *_env, jobject _this) { |
| 3339 | glPushMatrix(); |
| 3340 | } |
| 3341 | |
| 3342 | /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ |
| 3343 | static void |
| 3344 | android_glReadPixels__IIIIIILjava_nio_Buffer_2 |
| 3345 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3346 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3347 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3348 | jint _remaining; |
| 3349 | GLvoid *pixels = (GLvoid *) 0; |
| 3350 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3351 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset); |
| 3352 | if (pixels == NULL) { |
| 3353 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3354 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 3355 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3356 | glReadPixels( |
| 3357 | (GLint)x, |
| 3358 | (GLint)y, |
| 3359 | (GLsizei)width, |
| 3360 | (GLsizei)height, |
| 3361 | (GLenum)format, |
| 3362 | (GLenum)type, |
| 3363 | (GLvoid *)pixels |
| 3364 | ); |
| 3365 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3366 | releasePointer(_env, _array, pixels, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3367 | } |
| 3368 | } |
| 3369 | |
| 3370 | /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */ |
| 3371 | static void |
| 3372 | android_glRotatef__FFFF |
| 3373 | (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) { |
| 3374 | glRotatef( |
| 3375 | (GLfloat)angle, |
| 3376 | (GLfloat)x, |
| 3377 | (GLfloat)y, |
| 3378 | (GLfloat)z |
| 3379 | ); |
| 3380 | } |
| 3381 | |
| 3382 | /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */ |
| 3383 | static void |
| 3384 | android_glRotatex__IIII |
| 3385 | (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) { |
| 3386 | glRotatex( |
| 3387 | (GLfixed)angle, |
| 3388 | (GLfixed)x, |
| 3389 | (GLfixed)y, |
| 3390 | (GLfixed)z |
| 3391 | ); |
| 3392 | } |
| 3393 | |
| 3394 | /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ |
| 3395 | static void |
| 3396 | android_glSampleCoverage__FZ |
| 3397 | (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { |
| 3398 | glSampleCoverage( |
| 3399 | (GLclampf)value, |
| 3400 | (GLboolean)invert |
| 3401 | ); |
| 3402 | } |
| 3403 | |
| 3404 | /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */ |
| 3405 | static void |
| 3406 | android_glSampleCoveragex__IZ |
| 3407 | (JNIEnv *_env, jobject _this, jint value, jboolean invert) { |
| 3408 | glSampleCoveragex( |
| 3409 | (GLclampx)value, |
| 3410 | (GLboolean)invert |
| 3411 | ); |
| 3412 | } |
| 3413 | |
| 3414 | /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3415 | static void |
| 3416 | android_glScalef__FFF |
| 3417 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3418 | glScalef( |
| 3419 | (GLfloat)x, |
| 3420 | (GLfloat)y, |
| 3421 | (GLfloat)z |
| 3422 | ); |
| 3423 | } |
| 3424 | |
| 3425 | /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3426 | static void |
| 3427 | android_glScalex__III |
| 3428 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3429 | glScalex( |
| 3430 | (GLfixed)x, |
| 3431 | (GLfixed)y, |
| 3432 | (GLfixed)z |
| 3433 | ); |
| 3434 | } |
| 3435 | |
| 3436 | /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3437 | static void |
| 3438 | android_glScissor__IIII |
| 3439 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3440 | glScissor( |
| 3441 | (GLint)x, |
| 3442 | (GLint)y, |
| 3443 | (GLsizei)width, |
| 3444 | (GLsizei)height |
| 3445 | ); |
| 3446 | } |
| 3447 | |
| 3448 | /* void glShadeModel ( GLenum mode ) */ |
| 3449 | static void |
| 3450 | android_glShadeModel__I |
| 3451 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3452 | glShadeModel( |
| 3453 | (GLenum)mode |
| 3454 | ); |
| 3455 | } |
| 3456 | |
| 3457 | /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ |
| 3458 | static void |
| 3459 | android_glStencilFunc__III |
| 3460 | (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { |
| 3461 | glStencilFunc( |
| 3462 | (GLenum)func, |
| 3463 | (GLint)ref, |
| 3464 | (GLuint)mask |
| 3465 | ); |
| 3466 | } |
| 3467 | |
| 3468 | /* void glStencilMask ( GLuint mask ) */ |
| 3469 | static void |
| 3470 | android_glStencilMask__I |
| 3471 | (JNIEnv *_env, jobject _this, jint mask) { |
| 3472 | glStencilMask( |
| 3473 | (GLuint)mask |
| 3474 | ); |
| 3475 | } |
| 3476 | |
| 3477 | /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3478 | static void |
| 3479 | android_glStencilOp__III |
| 3480 | (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { |
| 3481 | glStencilOp( |
| 3482 | (GLenum)fail, |
| 3483 | (GLenum)zfail, |
| 3484 | (GLenum)zpass |
| 3485 | ); |
| 3486 | } |
| 3487 | |
| 3488 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3489 | static void |
| 3490 | android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I |
| 3491 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3492 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3493 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3494 | jint _remaining; |
| 3495 | GLvoid *pointer = (GLvoid *) 0; |
| 3496 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3497 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3498 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3499 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3500 | return; |
| 3501 | } |
| 3502 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3503 | glTexCoordPointerBounds( |
| 3504 | (GLint)size, |
| 3505 | (GLenum)type, |
| 3506 | (GLsizei)stride, |
| 3507 | (GLvoid *)pointer, |
| 3508 | (GLsizei)remaining |
| 3509 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3510 | } |
| 3511 | |
| 3512 | /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3513 | static void |
| 3514 | android_glTexEnvf__IIF |
| 3515 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3516 | glTexEnvf( |
| 3517 | (GLenum)target, |
| 3518 | (GLenum)pname, |
| 3519 | (GLfloat)param |
| 3520 | ); |
| 3521 | } |
| 3522 | |
| 3523 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3524 | static void |
| 3525 | android_glTexEnvfv__II_3FI |
| 3526 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3527 | jint _exception = 0; |
| 3528 | const char * _exceptionType; |
| 3529 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3530 | GLfloat *params_base = (GLfloat *) 0; |
| 3531 | jint _remaining; |
| 3532 | GLfloat *params = (GLfloat *) 0; |
| 3533 | |
| 3534 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3535 | _exception = 1; |
| 3536 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3537 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3538 | goto exit; |
| 3539 | } |
| 3540 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3541 | _exception = 1; |
| 3542 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3543 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3544 | goto exit; |
| 3545 | } |
| 3546 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3547 | int _needed; |
| 3548 | switch (pname) { |
| 3549 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3550 | case GL_TEXTURE_ENV_MODE: |
| 3551 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3552 | #if defined(GL_COMBINE_RGB) |
| 3553 | case GL_COMBINE_RGB: |
| 3554 | #endif // defined(GL_COMBINE_RGB) |
| 3555 | #if defined(GL_COMBINE_ALPHA) |
| 3556 | case GL_COMBINE_ALPHA: |
| 3557 | #endif // defined(GL_COMBINE_ALPHA) |
| 3558 | _needed = 1; |
| 3559 | break; |
| 3560 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3561 | case GL_TEXTURE_ENV_COLOR: |
| 3562 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3563 | _needed = 4; |
| 3564 | break; |
| 3565 | default: |
| 3566 | _needed = 0; |
| 3567 | break; |
| 3568 | } |
| 3569 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3570 | _exception = 1; |
| 3571 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3572 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3573 | goto exit; |
| 3574 | } |
| 3575 | params_base = (GLfloat *) |
| 3576 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3577 | params = params_base + offset; |
| 3578 | |
| 3579 | glTexEnvfv( |
| 3580 | (GLenum)target, |
| 3581 | (GLenum)pname, |
| 3582 | (GLfloat *)params |
| 3583 | ); |
| 3584 | |
| 3585 | exit: |
| 3586 | if (params_base) { |
| 3587 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3588 | JNI_ABORT); |
| 3589 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3590 | if (_exception) { |
| 3591 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3592 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3593 | } |
| 3594 | |
| 3595 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3596 | static void |
| 3597 | android_glTexEnvfv__IILjava_nio_FloatBuffer_2 |
| 3598 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3599 | jint _exception = 0; |
| 3600 | const char * _exceptionType; |
| 3601 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3602 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3603 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3604 | jint _remaining; |
| 3605 | GLfloat *params = (GLfloat *) 0; |
| 3606 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3607 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3608 | int _needed; |
| 3609 | switch (pname) { |
| 3610 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3611 | case GL_TEXTURE_ENV_MODE: |
| 3612 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3613 | #if defined(GL_COMBINE_RGB) |
| 3614 | case GL_COMBINE_RGB: |
| 3615 | #endif // defined(GL_COMBINE_RGB) |
| 3616 | #if defined(GL_COMBINE_ALPHA) |
| 3617 | case GL_COMBINE_ALPHA: |
| 3618 | #endif // defined(GL_COMBINE_ALPHA) |
| 3619 | _needed = 1; |
| 3620 | break; |
| 3621 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3622 | case GL_TEXTURE_ENV_COLOR: |
| 3623 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3624 | _needed = 4; |
| 3625 | break; |
| 3626 | default: |
| 3627 | _needed = 0; |
| 3628 | break; |
| 3629 | } |
| 3630 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3631 | _exception = 1; |
| 3632 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3633 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3634 | goto exit; |
| 3635 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3636 | if (params == NULL) { |
| 3637 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3638 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3639 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3640 | glTexEnvfv( |
| 3641 | (GLenum)target, |
| 3642 | (GLenum)pname, |
| 3643 | (GLfloat *)params |
| 3644 | ); |
| 3645 | |
| 3646 | exit: |
| 3647 | if (_array) { |
| 3648 | releasePointer(_env, _array, params, JNI_FALSE); |
| 3649 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3650 | if (_exception) { |
| 3651 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3652 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3653 | } |
| 3654 | |
| 3655 | /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3656 | static void |
| 3657 | android_glTexEnvx__III |
| 3658 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3659 | glTexEnvx( |
| 3660 | (GLenum)target, |
| 3661 | (GLenum)pname, |
| 3662 | (GLfixed)param |
| 3663 | ); |
| 3664 | } |
| 3665 | |
| 3666 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3667 | static void |
| 3668 | android_glTexEnvxv__II_3II |
| 3669 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3670 | jint _exception = 0; |
| 3671 | const char * _exceptionType; |
| 3672 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3673 | GLfixed *params_base = (GLfixed *) 0; |
| 3674 | jint _remaining; |
| 3675 | GLfixed *params = (GLfixed *) 0; |
| 3676 | |
| 3677 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3678 | _exception = 1; |
| 3679 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3680 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3681 | goto exit; |
| 3682 | } |
| 3683 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3684 | _exception = 1; |
| 3685 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3686 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3687 | goto exit; |
| 3688 | } |
| 3689 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3690 | int _needed; |
| 3691 | switch (pname) { |
| 3692 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3693 | case GL_TEXTURE_ENV_MODE: |
| 3694 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3695 | #if defined(GL_COMBINE_RGB) |
| 3696 | case GL_COMBINE_RGB: |
| 3697 | #endif // defined(GL_COMBINE_RGB) |
| 3698 | #if defined(GL_COMBINE_ALPHA) |
| 3699 | case GL_COMBINE_ALPHA: |
| 3700 | #endif // defined(GL_COMBINE_ALPHA) |
| 3701 | _needed = 1; |
| 3702 | break; |
| 3703 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3704 | case GL_TEXTURE_ENV_COLOR: |
| 3705 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3706 | _needed = 4; |
| 3707 | break; |
| 3708 | default: |
| 3709 | _needed = 0; |
| 3710 | break; |
| 3711 | } |
| 3712 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3713 | _exception = 1; |
| 3714 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3715 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3716 | goto exit; |
| 3717 | } |
| 3718 | params_base = (GLfixed *) |
| 3719 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3720 | params = params_base + offset; |
| 3721 | |
| 3722 | glTexEnvxv( |
| 3723 | (GLenum)target, |
| 3724 | (GLenum)pname, |
| 3725 | (GLfixed *)params |
| 3726 | ); |
| 3727 | |
| 3728 | exit: |
| 3729 | if (params_base) { |
| 3730 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3731 | JNI_ABORT); |
| 3732 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3733 | if (_exception) { |
| 3734 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3735 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3736 | } |
| 3737 | |
| 3738 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3739 | static void |
| 3740 | android_glTexEnvxv__IILjava_nio_IntBuffer_2 |
| 3741 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3742 | jint _exception = 0; |
| 3743 | const char * _exceptionType; |
| 3744 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3745 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3746 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3747 | jint _remaining; |
| 3748 | GLfixed *params = (GLfixed *) 0; |
| 3749 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3750 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3751 | int _needed; |
| 3752 | switch (pname) { |
| 3753 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3754 | case GL_TEXTURE_ENV_MODE: |
| 3755 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3756 | #if defined(GL_COMBINE_RGB) |
| 3757 | case GL_COMBINE_RGB: |
| 3758 | #endif // defined(GL_COMBINE_RGB) |
| 3759 | #if defined(GL_COMBINE_ALPHA) |
| 3760 | case GL_COMBINE_ALPHA: |
| 3761 | #endif // defined(GL_COMBINE_ALPHA) |
| 3762 | _needed = 1; |
| 3763 | break; |
| 3764 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3765 | case GL_TEXTURE_ENV_COLOR: |
| 3766 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3767 | _needed = 4; |
| 3768 | break; |
| 3769 | default: |
| 3770 | _needed = 0; |
| 3771 | break; |
| 3772 | } |
| 3773 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3774 | _exception = 1; |
| 3775 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3776 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3777 | goto exit; |
| 3778 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3779 | if (params == NULL) { |
| 3780 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3781 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3782 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3783 | glTexEnvxv( |
| 3784 | (GLenum)target, |
| 3785 | (GLenum)pname, |
| 3786 | (GLfixed *)params |
| 3787 | ); |
| 3788 | |
| 3789 | exit: |
| 3790 | if (_array) { |
| 3791 | releasePointer(_env, _array, params, JNI_FALSE); |
| 3792 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3793 | if (_exception) { |
| 3794 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3795 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3796 | } |
| 3797 | |
| 3798 | /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3799 | static void |
| 3800 | android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3801 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { |
| 3802 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3803 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3804 | jint _remaining; |
| 3805 | GLvoid *pixels = (GLvoid *) 0; |
| 3806 | |
| 3807 | if (pixels_buf) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3808 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset); |
| 3809 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 3810 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3811 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3812 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3813 | } |
| 3814 | glTexImage2D( |
| 3815 | (GLenum)target, |
| 3816 | (GLint)level, |
| 3817 | (GLint)internalformat, |
| 3818 | (GLsizei)width, |
| 3819 | (GLsizei)height, |
| 3820 | (GLint)border, |
| 3821 | (GLenum)format, |
| 3822 | (GLenum)type, |
| 3823 | (GLvoid *)pixels |
| 3824 | ); |
| 3825 | if (_array) { |
| 3826 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3827 | } |
| 3828 | } |
| 3829 | |
| 3830 | /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3831 | static void |
| 3832 | android_glTexParameterf__IIF |
| 3833 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3834 | glTexParameterf( |
| 3835 | (GLenum)target, |
| 3836 | (GLenum)pname, |
| 3837 | (GLfloat)param |
| 3838 | ); |
| 3839 | } |
| 3840 | |
| 3841 | /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3842 | static void |
| 3843 | android_glTexParameterx__III |
| 3844 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3845 | glTexParameterx( |
| 3846 | (GLenum)target, |
| 3847 | (GLenum)pname, |
| 3848 | (GLfixed)param |
| 3849 | ); |
| 3850 | } |
| 3851 | |
| 3852 | /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3853 | static void |
| 3854 | android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3855 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
| 3856 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3857 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3858 | jint _remaining; |
| 3859 | GLvoid *pixels = (GLvoid *) 0; |
| 3860 | |
| 3861 | if (pixels_buf) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3862 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset); |
| 3863 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 3864 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3865 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3866 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3867 | } |
| 3868 | glTexSubImage2D( |
| 3869 | (GLenum)target, |
| 3870 | (GLint)level, |
| 3871 | (GLint)xoffset, |
| 3872 | (GLint)yoffset, |
| 3873 | (GLsizei)width, |
| 3874 | (GLsizei)height, |
| 3875 | (GLenum)format, |
| 3876 | (GLenum)type, |
| 3877 | (GLvoid *)pixels |
| 3878 | ); |
| 3879 | if (_array) { |
| 3880 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3881 | } |
| 3882 | } |
| 3883 | |
| 3884 | /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3885 | static void |
| 3886 | android_glTranslatef__FFF |
| 3887 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3888 | glTranslatef( |
| 3889 | (GLfloat)x, |
| 3890 | (GLfloat)y, |
| 3891 | (GLfloat)z |
| 3892 | ); |
| 3893 | } |
| 3894 | |
| 3895 | /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3896 | static void |
| 3897 | android_glTranslatex__III |
| 3898 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3899 | glTranslatex( |
| 3900 | (GLfixed)x, |
| 3901 | (GLfixed)y, |
| 3902 | (GLfixed)z |
| 3903 | ); |
| 3904 | } |
| 3905 | |
| 3906 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3907 | static void |
| 3908 | android_glVertexPointerBounds__IIILjava_nio_Buffer_2I |
| 3909 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3910 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3911 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3912 | jint _remaining; |
| 3913 | GLvoid *pointer = (GLvoid *) 0; |
| 3914 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3915 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3916 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3917 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3918 | return; |
| 3919 | } |
| 3920 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3921 | glVertexPointerBounds( |
| 3922 | (GLint)size, |
| 3923 | (GLenum)type, |
| 3924 | (GLsizei)stride, |
| 3925 | (GLvoid *)pointer, |
| 3926 | (GLsizei)remaining |
| 3927 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3928 | } |
| 3929 | |
| 3930 | /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3931 | static void |
| 3932 | android_glViewport__IIII |
| 3933 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3934 | glViewport( |
| 3935 | (GLint)x, |
| 3936 | (GLint)y, |
| 3937 | (GLsizei)width, |
| 3938 | (GLsizei)height |
| 3939 | ); |
| 3940 | } |
| 3941 | |
| 3942 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 3943 | static jint |
| 3944 | android_glQueryMatrixxOES___3II_3II |
| 3945 | (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) { |
| 3946 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3947 | const char * _exceptionType; |
| 3948 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3949 | GLbitfield _returnValue = -1; |
| 3950 | GLfixed *mantissa_base = (GLfixed *) 0; |
| 3951 | jint _mantissaRemaining; |
| 3952 | GLfixed *mantissa = (GLfixed *) 0; |
| 3953 | GLint *exponent_base = (GLint *) 0; |
| 3954 | jint _exponentRemaining; |
| 3955 | GLint *exponent = (GLint *) 0; |
| 3956 | |
| 3957 | if (!mantissa_ref) { |
| 3958 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3959 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3960 | _exceptionMessage = "mantissa == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3961 | goto exit; |
| 3962 | } |
| 3963 | if (mantissaOffset < 0) { |
| 3964 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3965 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3966 | _exceptionMessage = "mantissaOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3967 | goto exit; |
| 3968 | } |
| 3969 | _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; |
| 3970 | if (_mantissaRemaining < 16) { |
| 3971 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3972 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3973 | _exceptionMessage = "length - mantissaOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3974 | goto exit; |
| 3975 | } |
| 3976 | mantissa_base = (GLfixed *) |
| 3977 | _env->GetPrimitiveArrayCritical(mantissa_ref, (jboolean *)0); |
| 3978 | mantissa = mantissa_base + mantissaOffset; |
| 3979 | |
| 3980 | if (!exponent_ref) { |
| 3981 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3982 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3983 | _exceptionMessage = "exponent == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3984 | goto exit; |
| 3985 | } |
| 3986 | if (exponentOffset < 0) { |
| 3987 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3988 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3989 | _exceptionMessage = "exponentOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3990 | goto exit; |
| 3991 | } |
| 3992 | _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; |
| 3993 | if (_exponentRemaining < 16) { |
| 3994 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3995 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3996 | _exceptionMessage = "length - exponentOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3997 | goto exit; |
| 3998 | } |
| 3999 | exponent_base = (GLint *) |
| 4000 | _env->GetPrimitiveArrayCritical(exponent_ref, (jboolean *)0); |
| 4001 | exponent = exponent_base + exponentOffset; |
| 4002 | |
| 4003 | _returnValue = glQueryMatrixxOES( |
| 4004 | (GLfixed *)mantissa, |
| 4005 | (GLint *)exponent |
| 4006 | ); |
| 4007 | |
| 4008 | exit: |
| 4009 | if (exponent_base) { |
| 4010 | _env->ReleasePrimitiveArrayCritical(exponent_ref, exponent_base, |
| 4011 | _exception ? JNI_ABORT: 0); |
| 4012 | } |
| 4013 | if (mantissa_base) { |
| 4014 | _env->ReleasePrimitiveArrayCritical(mantissa_ref, mantissa_base, |
| 4015 | _exception ? JNI_ABORT: 0); |
| 4016 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4017 | if (_exception) { |
| 4018 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4019 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4020 | return _returnValue; |
| 4021 | } |
| 4022 | |
| 4023 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4024 | static jint |
| 4025 | android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 4026 | (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) { |
| 4027 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4028 | const char * _exceptionType; |
| 4029 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4030 | jarray _mantissaArray = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4031 | jint _mantissaBufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4032 | jarray _exponentArray = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4033 | jint _exponentBufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4034 | GLbitfield _returnValue = -1; |
| 4035 | jint _mantissaRemaining; |
| 4036 | GLfixed *mantissa = (GLfixed *) 0; |
| 4037 | jint _exponentRemaining; |
| 4038 | GLint *exponent = (GLint *) 0; |
| 4039 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4040 | mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4041 | if (_mantissaRemaining < 16) { |
| 4042 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4043 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4044 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4045 | goto exit; |
| 4046 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4047 | exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining, &_exponentBufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4048 | if (_exponentRemaining < 16) { |
| 4049 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4050 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4051 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4052 | goto exit; |
| 4053 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4054 | if (mantissa == NULL) { |
| 4055 | char * _mantissaBase = (char *)_env->GetPrimitiveArrayCritical(_mantissaArray, (jboolean *) 0); |
| 4056 | mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset); |
| 4057 | } |
| 4058 | if (exponent == NULL) { |
| 4059 | char * _exponentBase = (char *)_env->GetPrimitiveArrayCritical(_exponentArray, (jboolean *) 0); |
| 4060 | exponent = (GLint *) (_exponentBase + _exponentBufferOffset); |
| 4061 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4062 | _returnValue = glQueryMatrixxOES( |
| 4063 | (GLfixed *)mantissa, |
| 4064 | (GLint *)exponent |
| 4065 | ); |
| 4066 | |
| 4067 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4068 | if (_exponentArray) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4069 | releasePointer(_env, _exponentArray, exponent, _exception ? JNI_FALSE : JNI_TRUE); |
| 4070 | } |
| 4071 | if (_mantissaArray) { |
| 4072 | releasePointer(_env, _mantissaArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4073 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4074 | if (_exception) { |
| 4075 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4076 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4077 | return _returnValue; |
| 4078 | } |
| 4079 | |
| 4080 | /* void glBindBuffer ( GLenum target, GLuint buffer ) */ |
| 4081 | static void |
| 4082 | android_glBindBuffer__II |
| 4083 | (JNIEnv *_env, jobject _this, jint target, jint buffer) { |
| 4084 | glBindBuffer( |
| 4085 | (GLenum)target, |
| 4086 | (GLuint)buffer |
| 4087 | ); |
| 4088 | } |
| 4089 | |
| 4090 | /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ |
| 4091 | static void |
| 4092 | android_glBufferData__IILjava_nio_Buffer_2I |
| 4093 | (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4094 | jint _exception = 0; |
| 4095 | const char * _exceptionType; |
| 4096 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4097 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4098 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4099 | jint _remaining; |
| 4100 | GLvoid *data = (GLvoid *) 0; |
| 4101 | |
| 4102 | if (data_buf) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4103 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4104 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4105 | _exception = 1; |
| 4106 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4107 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4108 | goto exit; |
| 4109 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4110 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4111 | if (data_buf && data == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4112 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4113 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4114 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4115 | glBufferData( |
| 4116 | (GLenum)target, |
| 4117 | (GLsizeiptr)size, |
| 4118 | (GLvoid *)data, |
| 4119 | (GLenum)usage |
| 4120 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4121 | |
| 4122 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4123 | if (_array) { |
| 4124 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4125 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4126 | if (_exception) { |
| 4127 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4128 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4129 | } |
| 4130 | |
| 4131 | /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ |
| 4132 | static void |
| 4133 | android_glBufferSubData__IIILjava_nio_Buffer_2 |
| 4134 | (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4135 | jint _exception = 0; |
| 4136 | const char * _exceptionType; |
| 4137 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4138 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4139 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4140 | jint _remaining; |
| 4141 | GLvoid *data = (GLvoid *) 0; |
| 4142 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4143 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4144 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4145 | _exception = 1; |
| 4146 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4147 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4148 | goto exit; |
| 4149 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4150 | if (data == NULL) { |
| 4151 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4152 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4153 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4154 | glBufferSubData( |
| 4155 | (GLenum)target, |
| 4156 | (GLintptr)offset, |
| 4157 | (GLsizeiptr)size, |
| 4158 | (GLvoid *)data |
| 4159 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4160 | |
| 4161 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4162 | if (_array) { |
| 4163 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4164 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4165 | if (_exception) { |
| 4166 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4167 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4168 | } |
| 4169 | |
| 4170 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4171 | static void |
| 4172 | android_glClipPlanef__I_3FI |
| 4173 | (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4174 | jint _exception = 0; |
| 4175 | const char * _exceptionType; |
| 4176 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4177 | GLfloat *equation_base = (GLfloat *) 0; |
| 4178 | jint _remaining; |
| 4179 | GLfloat *equation = (GLfloat *) 0; |
| 4180 | |
| 4181 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4182 | _exception = 1; |
| 4183 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4184 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4185 | goto exit; |
| 4186 | } |
| 4187 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4188 | _exception = 1; |
| 4189 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4190 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4191 | goto exit; |
| 4192 | } |
| 4193 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4194 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4195 | _exception = 1; |
| 4196 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4197 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4198 | goto exit; |
| 4199 | } |
| 4200 | equation_base = (GLfloat *) |
| 4201 | _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); |
| 4202 | equation = equation_base + offset; |
| 4203 | |
| 4204 | glClipPlanef( |
| 4205 | (GLenum)plane, |
| 4206 | (GLfloat *)equation |
| 4207 | ); |
| 4208 | |
| 4209 | exit: |
| 4210 | if (equation_base) { |
| 4211 | _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, |
| 4212 | JNI_ABORT); |
| 4213 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4214 | if (_exception) { |
| 4215 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4216 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4217 | } |
| 4218 | |
| 4219 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4220 | static void |
| 4221 | android_glClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4222 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4223 | jint _exception = 0; |
| 4224 | const char * _exceptionType; |
| 4225 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4226 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4227 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4228 | jint _remaining; |
| 4229 | GLfloat *equation = (GLfloat *) 0; |
| 4230 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4231 | equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4232 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4233 | _exception = 1; |
| 4234 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4235 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4236 | goto exit; |
| 4237 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4238 | if (equation == NULL) { |
| 4239 | char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4240 | equation = (GLfloat *) (_equationBase + _bufferOffset); |
| 4241 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4242 | glClipPlanef( |
| 4243 | (GLenum)plane, |
| 4244 | (GLfloat *)equation |
| 4245 | ); |
| 4246 | |
| 4247 | exit: |
| 4248 | if (_array) { |
| 4249 | releasePointer(_env, _array, equation, JNI_FALSE); |
| 4250 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4251 | if (_exception) { |
| 4252 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4253 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4254 | } |
| 4255 | |
| 4256 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4257 | static void |
| 4258 | android_glClipPlanex__I_3II |
| 4259 | (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4260 | jint _exception = 0; |
| 4261 | const char * _exceptionType; |
| 4262 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4263 | GLfixed *equation_base = (GLfixed *) 0; |
| 4264 | jint _remaining; |
| 4265 | GLfixed *equation = (GLfixed *) 0; |
| 4266 | |
| 4267 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4268 | _exception = 1; |
| 4269 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4270 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4271 | goto exit; |
| 4272 | } |
| 4273 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4274 | _exception = 1; |
| 4275 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4276 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4277 | goto exit; |
| 4278 | } |
| 4279 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4280 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4281 | _exception = 1; |
| 4282 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4283 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4284 | goto exit; |
| 4285 | } |
| 4286 | equation_base = (GLfixed *) |
| 4287 | _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); |
| 4288 | equation = equation_base + offset; |
| 4289 | |
| 4290 | glClipPlanex( |
| 4291 | (GLenum)plane, |
| 4292 | (GLfixed *)equation |
| 4293 | ); |
| 4294 | |
| 4295 | exit: |
| 4296 | if (equation_base) { |
| 4297 | _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, |
| 4298 | JNI_ABORT); |
| 4299 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4300 | if (_exception) { |
| 4301 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4302 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4303 | } |
| 4304 | |
| 4305 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4306 | static void |
| 4307 | android_glClipPlanex__ILjava_nio_IntBuffer_2 |
| 4308 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4309 | jint _exception = 0; |
| 4310 | const char * _exceptionType; |
| 4311 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4312 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4313 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4314 | jint _remaining; |
| 4315 | GLfixed *equation = (GLfixed *) 0; |
| 4316 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4317 | equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4318 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4319 | _exception = 1; |
| 4320 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4321 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4322 | goto exit; |
| 4323 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4324 | if (equation == NULL) { |
| 4325 | char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4326 | equation = (GLfixed *) (_equationBase + _bufferOffset); |
| 4327 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4328 | glClipPlanex( |
| 4329 | (GLenum)plane, |
| 4330 | (GLfixed *)equation |
| 4331 | ); |
| 4332 | |
| 4333 | exit: |
| 4334 | if (_array) { |
| 4335 | releasePointer(_env, _array, equation, JNI_FALSE); |
| 4336 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4337 | if (_exception) { |
| 4338 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4339 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4340 | } |
| 4341 | |
| 4342 | /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ |
| 4343 | static void |
| 4344 | android_glColor4ub__BBBB |
| 4345 | (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { |
| 4346 | glColor4ub( |
| 4347 | (GLubyte)red, |
| 4348 | (GLubyte)green, |
| 4349 | (GLubyte)blue, |
| 4350 | (GLubyte)alpha |
| 4351 | ); |
| 4352 | } |
| 4353 | |
| 4354 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 4355 | static void |
| 4356 | android_glColorPointer__IIII |
| 4357 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 4358 | glColorPointer( |
| 4359 | (GLint)size, |
| 4360 | (GLenum)type, |
| 4361 | (GLsizei)stride, |
| 4362 | (const GLvoid *)offset |
| 4363 | ); |
| 4364 | } |
| 4365 | |
| 4366 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4367 | static void |
| 4368 | android_glDeleteBuffers__I_3II |
| 4369 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4370 | jint _exception = 0; |
| 4371 | const char * _exceptionType; |
| 4372 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4373 | GLuint *buffers_base = (GLuint *) 0; |
| 4374 | jint _remaining; |
| 4375 | GLuint *buffers = (GLuint *) 0; |
| 4376 | |
| 4377 | if (!buffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4378 | _exception = 1; |
| 4379 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4380 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4381 | goto exit; |
| 4382 | } |
| 4383 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4384 | _exception = 1; |
| 4385 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4386 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4387 | goto exit; |
| 4388 | } |
| 4389 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4390 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4391 | _exception = 1; |
| 4392 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4393 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4394 | goto exit; |
| 4395 | } |
| 4396 | buffers_base = (GLuint *) |
| 4397 | _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); |
| 4398 | buffers = buffers_base + offset; |
| 4399 | |
| 4400 | glDeleteBuffers( |
| 4401 | (GLsizei)n, |
| 4402 | (GLuint *)buffers |
| 4403 | ); |
| 4404 | |
| 4405 | exit: |
| 4406 | if (buffers_base) { |
| 4407 | _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, |
| 4408 | JNI_ABORT); |
| 4409 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4410 | if (_exception) { |
| 4411 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4412 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4413 | } |
| 4414 | |
| 4415 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4416 | static void |
| 4417 | android_glDeleteBuffers__ILjava_nio_IntBuffer_2 |
| 4418 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4419 | jint _exception = 0; |
| 4420 | const char * _exceptionType; |
| 4421 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4422 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4423 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4424 | jint _remaining; |
| 4425 | GLuint *buffers = (GLuint *) 0; |
| 4426 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4427 | buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4428 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4429 | _exception = 1; |
| 4430 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4431 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | goto exit; |
| 4433 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4434 | if (buffers == NULL) { |
| 4435 | char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4436 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4437 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4438 | glDeleteBuffers( |
| 4439 | (GLsizei)n, |
| 4440 | (GLuint *)buffers |
| 4441 | ); |
| 4442 | |
| 4443 | exit: |
| 4444 | if (_array) { |
| 4445 | releasePointer(_env, _array, buffers, JNI_FALSE); |
| 4446 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4447 | if (_exception) { |
| 4448 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4449 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4450 | } |
| 4451 | |
| 4452 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ |
| 4453 | static void |
| 4454 | android_glDrawElements__IIII |
| 4455 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4456 | jint _exception = 0; |
| 4457 | const char * _exceptionType; |
| 4458 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4459 | glDrawElements( |
| 4460 | (GLenum)mode, |
| 4461 | (GLsizei)count, |
| 4462 | (GLenum)type, |
| 4463 | (const GLvoid *)offset |
| 4464 | ); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4465 | if (_exception) { |
| 4466 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4467 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4468 | } |
| 4469 | |
| 4470 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4471 | static void |
| 4472 | android_glGenBuffers__I_3II |
| 4473 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 4474 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4475 | const char * _exceptionType; |
| 4476 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4477 | GLuint *buffers_base = (GLuint *) 0; |
| 4478 | jint _remaining; |
| 4479 | GLuint *buffers = (GLuint *) 0; |
| 4480 | |
| 4481 | if (!buffers_ref) { |
| 4482 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4483 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4484 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4485 | goto exit; |
| 4486 | } |
| 4487 | if (offset < 0) { |
| 4488 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4489 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4490 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4491 | goto exit; |
| 4492 | } |
| 4493 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4494 | if (_remaining < n) { |
| 4495 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4496 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4497 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4498 | goto exit; |
| 4499 | } |
| 4500 | buffers_base = (GLuint *) |
| 4501 | _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); |
| 4502 | buffers = buffers_base + offset; |
| 4503 | |
| 4504 | glGenBuffers( |
| 4505 | (GLsizei)n, |
| 4506 | (GLuint *)buffers |
| 4507 | ); |
| 4508 | |
| 4509 | exit: |
| 4510 | if (buffers_base) { |
| 4511 | _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, |
| 4512 | _exception ? JNI_ABORT: 0); |
| 4513 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4514 | if (_exception) { |
| 4515 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4516 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4517 | } |
| 4518 | |
| 4519 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4520 | static void |
| 4521 | android_glGenBuffers__ILjava_nio_IntBuffer_2 |
| 4522 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 4523 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4524 | const char * _exceptionType; |
| 4525 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4526 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4527 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4528 | jint _remaining; |
| 4529 | GLuint *buffers = (GLuint *) 0; |
| 4530 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4531 | buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4532 | if (_remaining < n) { |
| 4533 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4534 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4535 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4536 | goto exit; |
| 4537 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4538 | if (buffers == NULL) { |
| 4539 | char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4540 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4541 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4542 | glGenBuffers( |
| 4543 | (GLsizei)n, |
| 4544 | (GLuint *)buffers |
| 4545 | ); |
| 4546 | |
| 4547 | exit: |
| 4548 | if (_array) { |
| 4549 | releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 4550 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4551 | if (_exception) { |
| 4552 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4553 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4554 | } |
| 4555 | |
| 4556 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4557 | static void |
| 4558 | android_glGetBooleanv__I_3ZI |
| 4559 | (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { |
| 4560 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4561 | const char * _exceptionType; |
| 4562 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4563 | GLboolean *params_base = (GLboolean *) 0; |
| 4564 | jint _remaining; |
| 4565 | GLboolean *params = (GLboolean *) 0; |
| 4566 | |
| 4567 | if (!params_ref) { |
| 4568 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4569 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4570 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4571 | goto exit; |
| 4572 | } |
| 4573 | if (offset < 0) { |
| 4574 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4575 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4576 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4577 | goto exit; |
| 4578 | } |
| 4579 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4580 | params_base = (GLboolean *) |
| 4581 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4582 | params = params_base + offset; |
| 4583 | |
| 4584 | glGetBooleanv( |
| 4585 | (GLenum)pname, |
| 4586 | (GLboolean *)params |
| 4587 | ); |
| 4588 | |
| 4589 | exit: |
| 4590 | if (params_base) { |
| 4591 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4592 | _exception ? JNI_ABORT: 0); |
| 4593 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4594 | if (_exception) { |
| 4595 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4596 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4597 | } |
| 4598 | |
| 4599 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4600 | static void |
| 4601 | android_glGetBooleanv__ILjava_nio_IntBuffer_2 |
| 4602 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4603 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4604 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4605 | jint _remaining; |
| 4606 | GLboolean *params = (GLboolean *) 0; |
| 4607 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4608 | params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4609 | if (params == NULL) { |
| 4610 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4611 | params = (GLboolean *) (_paramsBase + _bufferOffset); |
| 4612 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4613 | glGetBooleanv( |
| 4614 | (GLenum)pname, |
| 4615 | (GLboolean *)params |
| 4616 | ); |
| 4617 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4618 | releasePointer(_env, _array, params, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4619 | } |
| 4620 | } |
| 4621 | |
| 4622 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4623 | static void |
| 4624 | android_glGetBufferParameteriv__II_3II |
| 4625 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4626 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4627 | "glGetBufferParameteriv"); |
| 4628 | } |
| 4629 | |
| 4630 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4631 | static void |
| 4632 | android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 |
| 4633 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4634 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4635 | "glGetBufferParameteriv"); |
| 4636 | } |
| 4637 | |
| 4638 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4639 | static void |
| 4640 | android_glGetClipPlanef__I_3FI |
| 4641 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { |
| 4642 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4643 | const char * _exceptionType; |
| 4644 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4645 | GLfloat *eqn_base = (GLfloat *) 0; |
| 4646 | jint _remaining; |
| 4647 | GLfloat *eqn = (GLfloat *) 0; |
| 4648 | |
| 4649 | if (!eqn_ref) { |
| 4650 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4651 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4652 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4653 | goto exit; |
| 4654 | } |
| 4655 | if (offset < 0) { |
| 4656 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4657 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4658 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4659 | goto exit; |
| 4660 | } |
| 4661 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4662 | eqn_base = (GLfloat *) |
| 4663 | _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); |
| 4664 | eqn = eqn_base + offset; |
| 4665 | |
| 4666 | glGetClipPlanef( |
| 4667 | (GLenum)pname, |
| 4668 | (GLfloat *)eqn |
| 4669 | ); |
| 4670 | |
| 4671 | exit: |
| 4672 | if (eqn_base) { |
| 4673 | _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, |
| 4674 | _exception ? JNI_ABORT: 0); |
| 4675 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4676 | if (_exception) { |
| 4677 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4678 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4679 | } |
| 4680 | |
| 4681 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4682 | static void |
| 4683 | android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4684 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4685 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4686 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4687 | jint _remaining; |
| 4688 | GLfloat *eqn = (GLfloat *) 0; |
| 4689 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4690 | eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset); |
| 4691 | if (eqn == NULL) { |
| 4692 | char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4693 | eqn = (GLfloat *) (_eqnBase + _bufferOffset); |
| 4694 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4695 | glGetClipPlanef( |
| 4696 | (GLenum)pname, |
| 4697 | (GLfloat *)eqn |
| 4698 | ); |
| 4699 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4700 | releasePointer(_env, _array, eqn, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4701 | } |
| 4702 | } |
| 4703 | |
| 4704 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4705 | static void |
| 4706 | android_glGetClipPlanex__I_3II |
| 4707 | (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { |
| 4708 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4709 | const char * _exceptionType; |
| 4710 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4711 | GLfixed *eqn_base = (GLfixed *) 0; |
| 4712 | jint _remaining; |
| 4713 | GLfixed *eqn = (GLfixed *) 0; |
| 4714 | |
| 4715 | if (!eqn_ref) { |
| 4716 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4717 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4718 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4719 | goto exit; |
| 4720 | } |
| 4721 | if (offset < 0) { |
| 4722 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4723 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4724 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4725 | goto exit; |
| 4726 | } |
| 4727 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4728 | eqn_base = (GLfixed *) |
| 4729 | _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); |
| 4730 | eqn = eqn_base + offset; |
| 4731 | |
| 4732 | glGetClipPlanex( |
| 4733 | (GLenum)pname, |
| 4734 | (GLfixed *)eqn |
| 4735 | ); |
| 4736 | |
| 4737 | exit: |
| 4738 | if (eqn_base) { |
| 4739 | _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, |
| 4740 | _exception ? JNI_ABORT: 0); |
| 4741 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4742 | if (_exception) { |
| 4743 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4744 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4745 | } |
| 4746 | |
| 4747 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4748 | static void |
| 4749 | android_glGetClipPlanex__ILjava_nio_IntBuffer_2 |
| 4750 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4751 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4752 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4753 | jint _remaining; |
| 4754 | GLfixed *eqn = (GLfixed *) 0; |
| 4755 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4756 | eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset); |
| 4757 | if (eqn == NULL) { |
| 4758 | char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4759 | eqn = (GLfixed *) (_eqnBase + _bufferOffset); |
| 4760 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4761 | glGetClipPlanex( |
| 4762 | (GLenum)pname, |
| 4763 | (GLfixed *)eqn |
| 4764 | ); |
| 4765 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4766 | releasePointer(_env, _array, eqn, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4767 | } |
| 4768 | } |
| 4769 | |
| 4770 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 4771 | static void |
| 4772 | android_glGetFixedv__I_3II |
| 4773 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 4774 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4775 | const char * _exceptionType; |
| 4776 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4777 | GLfixed *params_base = (GLfixed *) 0; |
| 4778 | jint _remaining; |
| 4779 | GLfixed *params = (GLfixed *) 0; |
| 4780 | |
| 4781 | if (!params_ref) { |
| 4782 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4783 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4784 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4785 | goto exit; |
| 4786 | } |
| 4787 | if (offset < 0) { |
| 4788 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4789 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4790 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4791 | goto exit; |
| 4792 | } |
| 4793 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4794 | params_base = (GLfixed *) |
| 4795 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4796 | params = params_base + offset; |
| 4797 | |
| 4798 | glGetFixedv( |
| 4799 | (GLenum)pname, |
| 4800 | (GLfixed *)params |
| 4801 | ); |
| 4802 | |
| 4803 | exit: |
| 4804 | if (params_base) { |
| 4805 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4806 | _exception ? JNI_ABORT: 0); |
| 4807 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4808 | if (_exception) { |
| 4809 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4810 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4811 | } |
| 4812 | |
| 4813 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 4814 | static void |
| 4815 | android_glGetFixedv__ILjava_nio_IntBuffer_2 |
| 4816 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4817 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4818 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4819 | jint _remaining; |
| 4820 | GLfixed *params = (GLfixed *) 0; |
| 4821 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4822 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4823 | if (params == NULL) { |
| 4824 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4825 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 4826 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4827 | glGetFixedv( |
| 4828 | (GLenum)pname, |
| 4829 | (GLfixed *)params |
| 4830 | ); |
| 4831 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4832 | releasePointer(_env, _array, params, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4833 | } |
| 4834 | } |
| 4835 | |
| 4836 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 4837 | static void |
| 4838 | android_glGetFloatv__I_3FI |
| 4839 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
| 4840 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4841 | const char * _exceptionType; |
| 4842 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4843 | GLfloat *params_base = (GLfloat *) 0; |
| 4844 | jint _remaining; |
| 4845 | GLfloat *params = (GLfloat *) 0; |
| 4846 | |
| 4847 | if (!params_ref) { |
| 4848 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4849 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4850 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4851 | goto exit; |
| 4852 | } |
| 4853 | if (offset < 0) { |
| 4854 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4855 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4856 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4857 | goto exit; |
| 4858 | } |
| 4859 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4860 | params_base = (GLfloat *) |
| 4861 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4862 | params = params_base + offset; |
| 4863 | |
| 4864 | glGetFloatv( |
| 4865 | (GLenum)pname, |
| 4866 | (GLfloat *)params |
| 4867 | ); |
| 4868 | |
| 4869 | exit: |
| 4870 | if (params_base) { |
| 4871 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4872 | _exception ? JNI_ABORT: 0); |
| 4873 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4874 | if (_exception) { |
| 4875 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4876 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4877 | } |
| 4878 | |
| 4879 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 4880 | static void |
| 4881 | android_glGetFloatv__ILjava_nio_FloatBuffer_2 |
| 4882 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4883 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4884 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4885 | jint _remaining; |
| 4886 | GLfloat *params = (GLfloat *) 0; |
| 4887 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4888 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4889 | if (params == NULL) { |
| 4890 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4891 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 4892 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4893 | glGetFloatv( |
| 4894 | (GLenum)pname, |
| 4895 | (GLfloat *)params |
| 4896 | ); |
| 4897 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4898 | releasePointer(_env, _array, params, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4899 | } |
| 4900 | } |
| 4901 | |
| 4902 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 4903 | static void |
| 4904 | android_glGetLightfv__II_3FI |
| 4905 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
| 4906 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4907 | const char * _exceptionType; |
| 4908 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4909 | GLfloat *params_base = (GLfloat *) 0; |
| 4910 | jint _remaining; |
| 4911 | GLfloat *params = (GLfloat *) 0; |
| 4912 | |
| 4913 | if (!params_ref) { |
| 4914 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4915 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4916 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4917 | goto exit; |
| 4918 | } |
| 4919 | if (offset < 0) { |
| 4920 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4921 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4922 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4923 | goto exit; |
| 4924 | } |
| 4925 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4926 | int _needed; |
| 4927 | switch (pname) { |
| 4928 | #if defined(GL_SPOT_EXPONENT) |
| 4929 | case GL_SPOT_EXPONENT: |
| 4930 | #endif // defined(GL_SPOT_EXPONENT) |
| 4931 | #if defined(GL_SPOT_CUTOFF) |
| 4932 | case GL_SPOT_CUTOFF: |
| 4933 | #endif // defined(GL_SPOT_CUTOFF) |
| 4934 | #if defined(GL_CONSTANT_ATTENUATION) |
| 4935 | case GL_CONSTANT_ATTENUATION: |
| 4936 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 4937 | #if defined(GL_LINEAR_ATTENUATION) |
| 4938 | case GL_LINEAR_ATTENUATION: |
| 4939 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 4940 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 4941 | case GL_QUADRATIC_ATTENUATION: |
| 4942 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 4943 | _needed = 1; |
| 4944 | break; |
| 4945 | #if defined(GL_SPOT_DIRECTION) |
| 4946 | case GL_SPOT_DIRECTION: |
| 4947 | #endif // defined(GL_SPOT_DIRECTION) |
| 4948 | _needed = 3; |
| 4949 | break; |
| 4950 | #if defined(GL_AMBIENT) |
| 4951 | case GL_AMBIENT: |
| 4952 | #endif // defined(GL_AMBIENT) |
| 4953 | #if defined(GL_DIFFUSE) |
| 4954 | case GL_DIFFUSE: |
| 4955 | #endif // defined(GL_DIFFUSE) |
| 4956 | #if defined(GL_SPECULAR) |
| 4957 | case GL_SPECULAR: |
| 4958 | #endif // defined(GL_SPECULAR) |
| 4959 | #if defined(GL_EMISSION) |
| 4960 | case GL_EMISSION: |
| 4961 | #endif // defined(GL_EMISSION) |
| 4962 | _needed = 4; |
| 4963 | break; |
| 4964 | default: |
| 4965 | _needed = 0; |
| 4966 | break; |
| 4967 | } |
| 4968 | if (_remaining < _needed) { |
| 4969 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4970 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4971 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4972 | goto exit; |
| 4973 | } |
| 4974 | params_base = (GLfloat *) |
| 4975 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4976 | params = params_base + offset; |
| 4977 | |
| 4978 | glGetLightfv( |
| 4979 | (GLenum)light, |
| 4980 | (GLenum)pname, |
| 4981 | (GLfloat *)params |
| 4982 | ); |
| 4983 | |
| 4984 | exit: |
| 4985 | if (params_base) { |
| 4986 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4987 | _exception ? JNI_ABORT: 0); |
| 4988 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4989 | if (_exception) { |
| 4990 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4991 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4992 | } |
| 4993 | |
| 4994 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 4995 | static void |
| 4996 | android_glGetLightfv__IILjava_nio_FloatBuffer_2 |
| 4997 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 4998 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4999 | const char * _exceptionType; |
| 5000 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5001 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5002 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5003 | jint _remaining; |
| 5004 | GLfloat *params = (GLfloat *) 0; |
| 5005 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5006 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5007 | int _needed; |
| 5008 | switch (pname) { |
| 5009 | #if defined(GL_SPOT_EXPONENT) |
| 5010 | case GL_SPOT_EXPONENT: |
| 5011 | #endif // defined(GL_SPOT_EXPONENT) |
| 5012 | #if defined(GL_SPOT_CUTOFF) |
| 5013 | case GL_SPOT_CUTOFF: |
| 5014 | #endif // defined(GL_SPOT_CUTOFF) |
| 5015 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5016 | case GL_CONSTANT_ATTENUATION: |
| 5017 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5018 | #if defined(GL_LINEAR_ATTENUATION) |
| 5019 | case GL_LINEAR_ATTENUATION: |
| 5020 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5021 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5022 | case GL_QUADRATIC_ATTENUATION: |
| 5023 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5024 | _needed = 1; |
| 5025 | break; |
| 5026 | #if defined(GL_SPOT_DIRECTION) |
| 5027 | case GL_SPOT_DIRECTION: |
| 5028 | #endif // defined(GL_SPOT_DIRECTION) |
| 5029 | _needed = 3; |
| 5030 | break; |
| 5031 | #if defined(GL_AMBIENT) |
| 5032 | case GL_AMBIENT: |
| 5033 | #endif // defined(GL_AMBIENT) |
| 5034 | #if defined(GL_DIFFUSE) |
| 5035 | case GL_DIFFUSE: |
| 5036 | #endif // defined(GL_DIFFUSE) |
| 5037 | #if defined(GL_SPECULAR) |
| 5038 | case GL_SPECULAR: |
| 5039 | #endif // defined(GL_SPECULAR) |
| 5040 | #if defined(GL_EMISSION) |
| 5041 | case GL_EMISSION: |
| 5042 | #endif // defined(GL_EMISSION) |
| 5043 | _needed = 4; |
| 5044 | break; |
| 5045 | default: |
| 5046 | _needed = 0; |
| 5047 | break; |
| 5048 | } |
| 5049 | if (_remaining < _needed) { |
| 5050 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5051 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5052 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5053 | goto exit; |
| 5054 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5055 | if (params == NULL) { |
| 5056 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5057 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5058 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5059 | glGetLightfv( |
| 5060 | (GLenum)light, |
| 5061 | (GLenum)pname, |
| 5062 | (GLfloat *)params |
| 5063 | ); |
| 5064 | |
| 5065 | exit: |
| 5066 | if (_array) { |
| 5067 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5068 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5069 | if (_exception) { |
| 5070 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5071 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5072 | } |
| 5073 | |
| 5074 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5075 | static void |
| 5076 | android_glGetLightxv__II_3II |
| 5077 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
| 5078 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5079 | const char * _exceptionType; |
| 5080 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5081 | GLfixed *params_base = (GLfixed *) 0; |
| 5082 | jint _remaining; |
| 5083 | GLfixed *params = (GLfixed *) 0; |
| 5084 | |
| 5085 | if (!params_ref) { |
| 5086 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5087 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5088 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5089 | goto exit; |
| 5090 | } |
| 5091 | if (offset < 0) { |
| 5092 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5093 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5094 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5095 | goto exit; |
| 5096 | } |
| 5097 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5098 | int _needed; |
| 5099 | switch (pname) { |
| 5100 | #if defined(GL_SPOT_EXPONENT) |
| 5101 | case GL_SPOT_EXPONENT: |
| 5102 | #endif // defined(GL_SPOT_EXPONENT) |
| 5103 | #if defined(GL_SPOT_CUTOFF) |
| 5104 | case GL_SPOT_CUTOFF: |
| 5105 | #endif // defined(GL_SPOT_CUTOFF) |
| 5106 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5107 | case GL_CONSTANT_ATTENUATION: |
| 5108 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5109 | #if defined(GL_LINEAR_ATTENUATION) |
| 5110 | case GL_LINEAR_ATTENUATION: |
| 5111 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5112 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5113 | case GL_QUADRATIC_ATTENUATION: |
| 5114 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5115 | _needed = 1; |
| 5116 | break; |
| 5117 | #if defined(GL_SPOT_DIRECTION) |
| 5118 | case GL_SPOT_DIRECTION: |
| 5119 | #endif // defined(GL_SPOT_DIRECTION) |
| 5120 | _needed = 3; |
| 5121 | break; |
| 5122 | #if defined(GL_AMBIENT) |
| 5123 | case GL_AMBIENT: |
| 5124 | #endif // defined(GL_AMBIENT) |
| 5125 | #if defined(GL_DIFFUSE) |
| 5126 | case GL_DIFFUSE: |
| 5127 | #endif // defined(GL_DIFFUSE) |
| 5128 | #if defined(GL_SPECULAR) |
| 5129 | case GL_SPECULAR: |
| 5130 | #endif // defined(GL_SPECULAR) |
| 5131 | #if defined(GL_EMISSION) |
| 5132 | case GL_EMISSION: |
| 5133 | #endif // defined(GL_EMISSION) |
| 5134 | _needed = 4; |
| 5135 | break; |
| 5136 | default: |
| 5137 | _needed = 0; |
| 5138 | break; |
| 5139 | } |
| 5140 | if (_remaining < _needed) { |
| 5141 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5142 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5143 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5144 | goto exit; |
| 5145 | } |
| 5146 | params_base = (GLfixed *) |
| 5147 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5148 | params = params_base + offset; |
| 5149 | |
| 5150 | glGetLightxv( |
| 5151 | (GLenum)light, |
| 5152 | (GLenum)pname, |
| 5153 | (GLfixed *)params |
| 5154 | ); |
| 5155 | |
| 5156 | exit: |
| 5157 | if (params_base) { |
| 5158 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5159 | _exception ? JNI_ABORT: 0); |
| 5160 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5161 | if (_exception) { |
| 5162 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5163 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5164 | } |
| 5165 | |
| 5166 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5167 | static void |
| 5168 | android_glGetLightxv__IILjava_nio_IntBuffer_2 |
| 5169 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5170 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5171 | const char * _exceptionType; |
| 5172 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5173 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5174 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5175 | jint _remaining; |
| 5176 | GLfixed *params = (GLfixed *) 0; |
| 5177 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5178 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5179 | int _needed; |
| 5180 | switch (pname) { |
| 5181 | #if defined(GL_SPOT_EXPONENT) |
| 5182 | case GL_SPOT_EXPONENT: |
| 5183 | #endif // defined(GL_SPOT_EXPONENT) |
| 5184 | #if defined(GL_SPOT_CUTOFF) |
| 5185 | case GL_SPOT_CUTOFF: |
| 5186 | #endif // defined(GL_SPOT_CUTOFF) |
| 5187 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5188 | case GL_CONSTANT_ATTENUATION: |
| 5189 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5190 | #if defined(GL_LINEAR_ATTENUATION) |
| 5191 | case GL_LINEAR_ATTENUATION: |
| 5192 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5193 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5194 | case GL_QUADRATIC_ATTENUATION: |
| 5195 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5196 | _needed = 1; |
| 5197 | break; |
| 5198 | #if defined(GL_SPOT_DIRECTION) |
| 5199 | case GL_SPOT_DIRECTION: |
| 5200 | #endif // defined(GL_SPOT_DIRECTION) |
| 5201 | _needed = 3; |
| 5202 | break; |
| 5203 | #if defined(GL_AMBIENT) |
| 5204 | case GL_AMBIENT: |
| 5205 | #endif // defined(GL_AMBIENT) |
| 5206 | #if defined(GL_DIFFUSE) |
| 5207 | case GL_DIFFUSE: |
| 5208 | #endif // defined(GL_DIFFUSE) |
| 5209 | #if defined(GL_SPECULAR) |
| 5210 | case GL_SPECULAR: |
| 5211 | #endif // defined(GL_SPECULAR) |
| 5212 | #if defined(GL_EMISSION) |
| 5213 | case GL_EMISSION: |
| 5214 | #endif // defined(GL_EMISSION) |
| 5215 | _needed = 4; |
| 5216 | break; |
| 5217 | default: |
| 5218 | _needed = 0; |
| 5219 | break; |
| 5220 | } |
| 5221 | if (_remaining < _needed) { |
| 5222 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5223 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5224 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5225 | goto exit; |
| 5226 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5227 | if (params == NULL) { |
| 5228 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5229 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5230 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5231 | glGetLightxv( |
| 5232 | (GLenum)light, |
| 5233 | (GLenum)pname, |
| 5234 | (GLfixed *)params |
| 5235 | ); |
| 5236 | |
| 5237 | exit: |
| 5238 | if (_array) { |
| 5239 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5240 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5241 | if (_exception) { |
| 5242 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5243 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5244 | } |
| 5245 | |
| 5246 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5247 | static void |
| 5248 | android_glGetMaterialfv__II_3FI |
| 5249 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
| 5250 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5251 | const char * _exceptionType; |
| 5252 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5253 | GLfloat *params_base = (GLfloat *) 0; |
| 5254 | jint _remaining; |
| 5255 | GLfloat *params = (GLfloat *) 0; |
| 5256 | |
| 5257 | if (!params_ref) { |
| 5258 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5259 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5260 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5261 | goto exit; |
| 5262 | } |
| 5263 | if (offset < 0) { |
| 5264 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5265 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5266 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5267 | goto exit; |
| 5268 | } |
| 5269 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5270 | int _needed; |
| 5271 | switch (pname) { |
| 5272 | #if defined(GL_SHININESS) |
| 5273 | case GL_SHININESS: |
| 5274 | #endif // defined(GL_SHININESS) |
| 5275 | _needed = 1; |
| 5276 | break; |
| 5277 | #if defined(GL_AMBIENT) |
| 5278 | case GL_AMBIENT: |
| 5279 | #endif // defined(GL_AMBIENT) |
| 5280 | #if defined(GL_DIFFUSE) |
| 5281 | case GL_DIFFUSE: |
| 5282 | #endif // defined(GL_DIFFUSE) |
| 5283 | #if defined(GL_SPECULAR) |
| 5284 | case GL_SPECULAR: |
| 5285 | #endif // defined(GL_SPECULAR) |
| 5286 | #if defined(GL_EMISSION) |
| 5287 | case GL_EMISSION: |
| 5288 | #endif // defined(GL_EMISSION) |
| 5289 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5290 | case GL_AMBIENT_AND_DIFFUSE: |
| 5291 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5292 | _needed = 4; |
| 5293 | break; |
| 5294 | default: |
| 5295 | _needed = 0; |
| 5296 | break; |
| 5297 | } |
| 5298 | if (_remaining < _needed) { |
| 5299 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5300 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5301 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5302 | goto exit; |
| 5303 | } |
| 5304 | params_base = (GLfloat *) |
| 5305 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5306 | params = params_base + offset; |
| 5307 | |
| 5308 | glGetMaterialfv( |
| 5309 | (GLenum)face, |
| 5310 | (GLenum)pname, |
| 5311 | (GLfloat *)params |
| 5312 | ); |
| 5313 | |
| 5314 | exit: |
| 5315 | if (params_base) { |
| 5316 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5317 | _exception ? JNI_ABORT: 0); |
| 5318 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5319 | if (_exception) { |
| 5320 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5321 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5322 | } |
| 5323 | |
| 5324 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5325 | static void |
| 5326 | android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 |
| 5327 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5328 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5329 | const char * _exceptionType; |
| 5330 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5331 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5332 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5333 | jint _remaining; |
| 5334 | GLfloat *params = (GLfloat *) 0; |
| 5335 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5336 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5337 | int _needed; |
| 5338 | switch (pname) { |
| 5339 | #if defined(GL_SHININESS) |
| 5340 | case GL_SHININESS: |
| 5341 | #endif // defined(GL_SHININESS) |
| 5342 | _needed = 1; |
| 5343 | break; |
| 5344 | #if defined(GL_AMBIENT) |
| 5345 | case GL_AMBIENT: |
| 5346 | #endif // defined(GL_AMBIENT) |
| 5347 | #if defined(GL_DIFFUSE) |
| 5348 | case GL_DIFFUSE: |
| 5349 | #endif // defined(GL_DIFFUSE) |
| 5350 | #if defined(GL_SPECULAR) |
| 5351 | case GL_SPECULAR: |
| 5352 | #endif // defined(GL_SPECULAR) |
| 5353 | #if defined(GL_EMISSION) |
| 5354 | case GL_EMISSION: |
| 5355 | #endif // defined(GL_EMISSION) |
| 5356 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5357 | case GL_AMBIENT_AND_DIFFUSE: |
| 5358 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5359 | _needed = 4; |
| 5360 | break; |
| 5361 | default: |
| 5362 | _needed = 0; |
| 5363 | break; |
| 5364 | } |
| 5365 | if (_remaining < _needed) { |
| 5366 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5367 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5368 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5369 | goto exit; |
| 5370 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5371 | if (params == NULL) { |
| 5372 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5373 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5374 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5375 | glGetMaterialfv( |
| 5376 | (GLenum)face, |
| 5377 | (GLenum)pname, |
| 5378 | (GLfloat *)params |
| 5379 | ); |
| 5380 | |
| 5381 | exit: |
| 5382 | if (_array) { |
| 5383 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5384 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5385 | if (_exception) { |
| 5386 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5387 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5388 | } |
| 5389 | |
| 5390 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5391 | static void |
| 5392 | android_glGetMaterialxv__II_3II |
| 5393 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
| 5394 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5395 | const char * _exceptionType; |
| 5396 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5397 | GLfixed *params_base = (GLfixed *) 0; |
| 5398 | jint _remaining; |
| 5399 | GLfixed *params = (GLfixed *) 0; |
| 5400 | |
| 5401 | if (!params_ref) { |
| 5402 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5403 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5404 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5405 | goto exit; |
| 5406 | } |
| 5407 | if (offset < 0) { |
| 5408 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5409 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5410 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5411 | goto exit; |
| 5412 | } |
| 5413 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5414 | int _needed; |
| 5415 | switch (pname) { |
| 5416 | #if defined(GL_SHININESS) |
| 5417 | case GL_SHININESS: |
| 5418 | #endif // defined(GL_SHININESS) |
| 5419 | _needed = 1; |
| 5420 | break; |
| 5421 | #if defined(GL_AMBIENT) |
| 5422 | case GL_AMBIENT: |
| 5423 | #endif // defined(GL_AMBIENT) |
| 5424 | #if defined(GL_DIFFUSE) |
| 5425 | case GL_DIFFUSE: |
| 5426 | #endif // defined(GL_DIFFUSE) |
| 5427 | #if defined(GL_SPECULAR) |
| 5428 | case GL_SPECULAR: |
| 5429 | #endif // defined(GL_SPECULAR) |
| 5430 | #if defined(GL_EMISSION) |
| 5431 | case GL_EMISSION: |
| 5432 | #endif // defined(GL_EMISSION) |
| 5433 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5434 | case GL_AMBIENT_AND_DIFFUSE: |
| 5435 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5436 | _needed = 4; |
| 5437 | break; |
| 5438 | default: |
| 5439 | _needed = 0; |
| 5440 | break; |
| 5441 | } |
| 5442 | if (_remaining < _needed) { |
| 5443 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5444 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5445 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5446 | goto exit; |
| 5447 | } |
| 5448 | params_base = (GLfixed *) |
| 5449 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5450 | params = params_base + offset; |
| 5451 | |
| 5452 | glGetMaterialxv( |
| 5453 | (GLenum)face, |
| 5454 | (GLenum)pname, |
| 5455 | (GLfixed *)params |
| 5456 | ); |
| 5457 | |
| 5458 | exit: |
| 5459 | if (params_base) { |
| 5460 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5461 | _exception ? JNI_ABORT: 0); |
| 5462 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5463 | if (_exception) { |
| 5464 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5465 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5466 | } |
| 5467 | |
| 5468 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5469 | static void |
| 5470 | android_glGetMaterialxv__IILjava_nio_IntBuffer_2 |
| 5471 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5472 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5473 | const char * _exceptionType; |
| 5474 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5475 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5476 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5477 | jint _remaining; |
| 5478 | GLfixed *params = (GLfixed *) 0; |
| 5479 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5480 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5481 | int _needed; |
| 5482 | switch (pname) { |
| 5483 | #if defined(GL_SHININESS) |
| 5484 | case GL_SHININESS: |
| 5485 | #endif // defined(GL_SHININESS) |
| 5486 | _needed = 1; |
| 5487 | break; |
| 5488 | #if defined(GL_AMBIENT) |
| 5489 | case GL_AMBIENT: |
| 5490 | #endif // defined(GL_AMBIENT) |
| 5491 | #if defined(GL_DIFFUSE) |
| 5492 | case GL_DIFFUSE: |
| 5493 | #endif // defined(GL_DIFFUSE) |
| 5494 | #if defined(GL_SPECULAR) |
| 5495 | case GL_SPECULAR: |
| 5496 | #endif // defined(GL_SPECULAR) |
| 5497 | #if defined(GL_EMISSION) |
| 5498 | case GL_EMISSION: |
| 5499 | #endif // defined(GL_EMISSION) |
| 5500 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5501 | case GL_AMBIENT_AND_DIFFUSE: |
| 5502 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5503 | _needed = 4; |
| 5504 | break; |
| 5505 | default: |
| 5506 | _needed = 0; |
| 5507 | break; |
| 5508 | } |
| 5509 | if (_remaining < _needed) { |
| 5510 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5511 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5512 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5513 | goto exit; |
| 5514 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5515 | if (params == NULL) { |
| 5516 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5517 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5518 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5519 | glGetMaterialxv( |
| 5520 | (GLenum)face, |
| 5521 | (GLenum)pname, |
| 5522 | (GLfixed *)params |
| 5523 | ); |
| 5524 | |
| 5525 | exit: |
| 5526 | if (_array) { |
| 5527 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5528 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5529 | if (_exception) { |
| 5530 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5531 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5532 | } |
| 5533 | |
| 5534 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5535 | static void |
| 5536 | android_glGetTexEnviv__II_3II |
| 5537 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5538 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5539 | const char * _exceptionType; |
| 5540 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5541 | GLint *params_base = (GLint *) 0; |
| 5542 | jint _remaining; |
| 5543 | GLint *params = (GLint *) 0; |
| 5544 | |
| 5545 | if (!params_ref) { |
| 5546 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5547 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5548 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5549 | goto exit; |
| 5550 | } |
| 5551 | if (offset < 0) { |
| 5552 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5553 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5554 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5555 | goto exit; |
| 5556 | } |
| 5557 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5558 | int _needed; |
| 5559 | switch (pname) { |
| 5560 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5561 | case GL_TEXTURE_ENV_MODE: |
| 5562 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5563 | #if defined(GL_COMBINE_RGB) |
| 5564 | case GL_COMBINE_RGB: |
| 5565 | #endif // defined(GL_COMBINE_RGB) |
| 5566 | #if defined(GL_COMBINE_ALPHA) |
| 5567 | case GL_COMBINE_ALPHA: |
| 5568 | #endif // defined(GL_COMBINE_ALPHA) |
| 5569 | _needed = 1; |
| 5570 | break; |
| 5571 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5572 | case GL_TEXTURE_ENV_COLOR: |
| 5573 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5574 | _needed = 4; |
| 5575 | break; |
| 5576 | default: |
| 5577 | _needed = 0; |
| 5578 | break; |
| 5579 | } |
| 5580 | if (_remaining < _needed) { |
| 5581 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5582 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5583 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5584 | goto exit; |
| 5585 | } |
| 5586 | params_base = (GLint *) |
| 5587 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5588 | params = params_base + offset; |
| 5589 | |
| 5590 | glGetTexEnviv( |
| 5591 | (GLenum)env, |
| 5592 | (GLenum)pname, |
| 5593 | (GLint *)params |
| 5594 | ); |
| 5595 | |
| 5596 | exit: |
| 5597 | if (params_base) { |
| 5598 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5599 | _exception ? JNI_ABORT: 0); |
| 5600 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5601 | if (_exception) { |
| 5602 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5603 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5604 | } |
| 5605 | |
| 5606 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5607 | static void |
| 5608 | android_glGetTexEnviv__IILjava_nio_IntBuffer_2 |
| 5609 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5610 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5611 | const char * _exceptionType; |
| 5612 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5613 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5614 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5615 | jint _remaining; |
| 5616 | GLint *params = (GLint *) 0; |
| 5617 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5618 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5619 | int _needed; |
| 5620 | switch (pname) { |
| 5621 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5622 | case GL_TEXTURE_ENV_MODE: |
| 5623 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5624 | #if defined(GL_COMBINE_RGB) |
| 5625 | case GL_COMBINE_RGB: |
| 5626 | #endif // defined(GL_COMBINE_RGB) |
| 5627 | #if defined(GL_COMBINE_ALPHA) |
| 5628 | case GL_COMBINE_ALPHA: |
| 5629 | #endif // defined(GL_COMBINE_ALPHA) |
| 5630 | _needed = 1; |
| 5631 | break; |
| 5632 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5633 | case GL_TEXTURE_ENV_COLOR: |
| 5634 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5635 | _needed = 4; |
| 5636 | break; |
| 5637 | default: |
| 5638 | _needed = 0; |
| 5639 | break; |
| 5640 | } |
| 5641 | if (_remaining < _needed) { |
| 5642 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5643 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5644 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5645 | goto exit; |
| 5646 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5647 | if (params == NULL) { |
| 5648 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5649 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5650 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5651 | glGetTexEnviv( |
| 5652 | (GLenum)env, |
| 5653 | (GLenum)pname, |
| 5654 | (GLint *)params |
| 5655 | ); |
| 5656 | |
| 5657 | exit: |
| 5658 | if (_array) { |
| 5659 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5660 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5661 | if (_exception) { |
| 5662 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5663 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5664 | } |
| 5665 | |
| 5666 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 5667 | static void |
| 5668 | android_glGetTexEnvxv__II_3II |
| 5669 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5670 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5671 | const char * _exceptionType; |
| 5672 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5673 | GLfixed *params_base = (GLfixed *) 0; |
| 5674 | jint _remaining; |
| 5675 | GLfixed *params = (GLfixed *) 0; |
| 5676 | |
| 5677 | if (!params_ref) { |
| 5678 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5679 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5680 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5681 | goto exit; |
| 5682 | } |
| 5683 | if (offset < 0) { |
| 5684 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5685 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5686 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5687 | goto exit; |
| 5688 | } |
| 5689 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5690 | int _needed; |
| 5691 | switch (pname) { |
| 5692 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5693 | case GL_TEXTURE_ENV_MODE: |
| 5694 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5695 | #if defined(GL_COMBINE_RGB) |
| 5696 | case GL_COMBINE_RGB: |
| 5697 | #endif // defined(GL_COMBINE_RGB) |
| 5698 | #if defined(GL_COMBINE_ALPHA) |
| 5699 | case GL_COMBINE_ALPHA: |
| 5700 | #endif // defined(GL_COMBINE_ALPHA) |
| 5701 | _needed = 1; |
| 5702 | break; |
| 5703 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5704 | case GL_TEXTURE_ENV_COLOR: |
| 5705 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5706 | _needed = 4; |
| 5707 | break; |
| 5708 | default: |
| 5709 | _needed = 0; |
| 5710 | break; |
| 5711 | } |
| 5712 | if (_remaining < _needed) { |
| 5713 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5714 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5715 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5716 | goto exit; |
| 5717 | } |
| 5718 | params_base = (GLfixed *) |
| 5719 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5720 | params = params_base + offset; |
| 5721 | |
| 5722 | glGetTexEnvxv( |
| 5723 | (GLenum)env, |
| 5724 | (GLenum)pname, |
| 5725 | (GLfixed *)params |
| 5726 | ); |
| 5727 | |
| 5728 | exit: |
| 5729 | if (params_base) { |
| 5730 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5731 | _exception ? JNI_ABORT: 0); |
| 5732 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5733 | if (_exception) { |
| 5734 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5735 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5736 | } |
| 5737 | |
| 5738 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 5739 | static void |
| 5740 | android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 |
| 5741 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5742 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5743 | const char * _exceptionType; |
| 5744 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5745 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5746 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5747 | jint _remaining; |
| 5748 | GLfixed *params = (GLfixed *) 0; |
| 5749 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5750 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5751 | int _needed; |
| 5752 | switch (pname) { |
| 5753 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5754 | case GL_TEXTURE_ENV_MODE: |
| 5755 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5756 | #if defined(GL_COMBINE_RGB) |
| 5757 | case GL_COMBINE_RGB: |
| 5758 | #endif // defined(GL_COMBINE_RGB) |
| 5759 | #if defined(GL_COMBINE_ALPHA) |
| 5760 | case GL_COMBINE_ALPHA: |
| 5761 | #endif // defined(GL_COMBINE_ALPHA) |
| 5762 | _needed = 1; |
| 5763 | break; |
| 5764 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5765 | case GL_TEXTURE_ENV_COLOR: |
| 5766 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5767 | _needed = 4; |
| 5768 | break; |
| 5769 | default: |
| 5770 | _needed = 0; |
| 5771 | break; |
| 5772 | } |
| 5773 | if (_remaining < _needed) { |
| 5774 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5775 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5776 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5777 | goto exit; |
| 5778 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5779 | if (params == NULL) { |
| 5780 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5781 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5782 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5783 | glGetTexEnvxv( |
| 5784 | (GLenum)env, |
| 5785 | (GLenum)pname, |
| 5786 | (GLfixed *)params |
| 5787 | ); |
| 5788 | |
| 5789 | exit: |
| 5790 | if (_array) { |
| 5791 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5792 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5793 | if (_exception) { |
| 5794 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5795 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5796 | } |
| 5797 | |
| 5798 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 5799 | static void |
| 5800 | android_glGetTexParameterfv__II_3FI |
| 5801 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 5802 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5803 | const char * _exceptionType; |
| 5804 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5805 | GLfloat *params_base = (GLfloat *) 0; |
| 5806 | jint _remaining; |
| 5807 | GLfloat *params = (GLfloat *) 0; |
| 5808 | |
| 5809 | if (!params_ref) { |
| 5810 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5811 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5812 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5813 | goto exit; |
| 5814 | } |
| 5815 | if (offset < 0) { |
| 5816 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5817 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5818 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5819 | goto exit; |
| 5820 | } |
| 5821 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5822 | if (_remaining < 1) { |
| 5823 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5824 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5825 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5826 | goto exit; |
| 5827 | } |
| 5828 | params_base = (GLfloat *) |
| 5829 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5830 | params = params_base + offset; |
| 5831 | |
| 5832 | glGetTexParameterfv( |
| 5833 | (GLenum)target, |
| 5834 | (GLenum)pname, |
| 5835 | (GLfloat *)params |
| 5836 | ); |
| 5837 | |
| 5838 | exit: |
| 5839 | if (params_base) { |
| 5840 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5841 | _exception ? JNI_ABORT: 0); |
| 5842 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5843 | if (_exception) { |
| 5844 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5845 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5846 | } |
| 5847 | |
| 5848 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 5849 | static void |
| 5850 | android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 5851 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 5852 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5853 | const char * _exceptionType; |
| 5854 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5855 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5856 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5857 | jint _remaining; |
| 5858 | GLfloat *params = (GLfloat *) 0; |
| 5859 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5860 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5861 | if (_remaining < 1) { |
| 5862 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5863 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5864 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5865 | goto exit; |
| 5866 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5867 | if (params == NULL) { |
| 5868 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5869 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5870 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5871 | glGetTexParameterfv( |
| 5872 | (GLenum)target, |
| 5873 | (GLenum)pname, |
| 5874 | (GLfloat *)params |
| 5875 | ); |
| 5876 | |
| 5877 | exit: |
| 5878 | if (_array) { |
| 5879 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5880 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5881 | if (_exception) { |
| 5882 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5883 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5884 | } |
| 5885 | |
| 5886 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 5887 | static void |
| 5888 | android_glGetTexParameteriv__II_3II |
| 5889 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 5890 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5891 | const char * _exceptionType; |
| 5892 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5893 | GLint *params_base = (GLint *) 0; |
| 5894 | jint _remaining; |
| 5895 | GLint *params = (GLint *) 0; |
| 5896 | |
| 5897 | if (!params_ref) { |
| 5898 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5899 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5900 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5901 | goto exit; |
| 5902 | } |
| 5903 | if (offset < 0) { |
| 5904 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5905 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5906 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5907 | goto exit; |
| 5908 | } |
| 5909 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5910 | if (_remaining < 1) { |
| 5911 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5912 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5913 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5914 | goto exit; |
| 5915 | } |
| 5916 | params_base = (GLint *) |
| 5917 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5918 | params = params_base + offset; |
| 5919 | |
| 5920 | glGetTexParameteriv( |
| 5921 | (GLenum)target, |
| 5922 | (GLenum)pname, |
| 5923 | (GLint *)params |
| 5924 | ); |
| 5925 | |
| 5926 | exit: |
| 5927 | if (params_base) { |
| 5928 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5929 | _exception ? JNI_ABORT: 0); |
| 5930 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5931 | if (_exception) { |
| 5932 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5933 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5934 | } |
| 5935 | |
| 5936 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 5937 | static void |
| 5938 | android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 |
| 5939 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 5940 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5941 | const char * _exceptionType; |
| 5942 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5943 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5944 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5945 | jint _remaining; |
| 5946 | GLint *params = (GLint *) 0; |
| 5947 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5948 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5949 | if (_remaining < 1) { |
| 5950 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5951 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5952 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5953 | goto exit; |
| 5954 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5955 | if (params == NULL) { |
| 5956 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5957 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5958 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5959 | glGetTexParameteriv( |
| 5960 | (GLenum)target, |
| 5961 | (GLenum)pname, |
| 5962 | (GLint *)params |
| 5963 | ); |
| 5964 | |
| 5965 | exit: |
| 5966 | if (_array) { |
| 5967 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 5968 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5969 | if (_exception) { |
| 5970 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5971 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5972 | } |
| 5973 | |
| 5974 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 5975 | static void |
| 5976 | android_glGetTexParameterxv__II_3II |
| 5977 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 5978 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5979 | const char * _exceptionType; |
| 5980 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5981 | GLfixed *params_base = (GLfixed *) 0; |
| 5982 | jint _remaining; |
| 5983 | GLfixed *params = (GLfixed *) 0; |
| 5984 | |
| 5985 | if (!params_ref) { |
| 5986 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5987 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5988 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5989 | goto exit; |
| 5990 | } |
| 5991 | if (offset < 0) { |
| 5992 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5993 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5994 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5995 | goto exit; |
| 5996 | } |
| 5997 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5998 | if (_remaining < 1) { |
| 5999 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6000 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6001 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6002 | goto exit; |
| 6003 | } |
| 6004 | params_base = (GLfixed *) |
| 6005 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6006 | params = params_base + offset; |
| 6007 | |
| 6008 | glGetTexParameterxv( |
| 6009 | (GLenum)target, |
| 6010 | (GLenum)pname, |
| 6011 | (GLfixed *)params |
| 6012 | ); |
| 6013 | |
| 6014 | exit: |
| 6015 | if (params_base) { |
| 6016 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6017 | _exception ? JNI_ABORT: 0); |
| 6018 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6019 | if (_exception) { |
| 6020 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6021 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6022 | } |
| 6023 | |
| 6024 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6025 | static void |
| 6026 | android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6027 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6028 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6029 | const char * _exceptionType; |
| 6030 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6031 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6032 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6033 | jint _remaining; |
| 6034 | GLfixed *params = (GLfixed *) 0; |
| 6035 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6036 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6037 | if (_remaining < 1) { |
| 6038 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6039 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6040 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6041 | goto exit; |
| 6042 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6043 | if (params == NULL) { |
| 6044 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6045 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6046 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6047 | glGetTexParameterxv( |
| 6048 | (GLenum)target, |
| 6049 | (GLenum)pname, |
| 6050 | (GLfixed *)params |
| 6051 | ); |
| 6052 | |
| 6053 | exit: |
| 6054 | if (_array) { |
| 6055 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 6056 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6057 | if (_exception) { |
| 6058 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6059 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6060 | } |
| 6061 | |
| 6062 | /* GLboolean glIsBuffer ( GLuint buffer ) */ |
| 6063 | static jboolean |
| 6064 | android_glIsBuffer__I |
| 6065 | (JNIEnv *_env, jobject _this, jint buffer) { |
| 6066 | GLboolean _returnValue; |
| 6067 | _returnValue = glIsBuffer( |
| 6068 | (GLuint)buffer |
| 6069 | ); |
| 6070 | return _returnValue; |
| 6071 | } |
| 6072 | |
| 6073 | /* GLboolean glIsEnabled ( GLenum cap ) */ |
| 6074 | static jboolean |
| 6075 | android_glIsEnabled__I |
| 6076 | (JNIEnv *_env, jobject _this, jint cap) { |
| 6077 | GLboolean _returnValue; |
| 6078 | _returnValue = glIsEnabled( |
| 6079 | (GLenum)cap |
| 6080 | ); |
| 6081 | return _returnValue; |
| 6082 | } |
| 6083 | |
| 6084 | /* GLboolean glIsTexture ( GLuint texture ) */ |
| 6085 | static jboolean |
| 6086 | android_glIsTexture__I |
| 6087 | (JNIEnv *_env, jobject _this, jint texture) { |
| 6088 | GLboolean _returnValue; |
| 6089 | _returnValue = glIsTexture( |
| 6090 | (GLuint)texture |
| 6091 | ); |
| 6092 | return _returnValue; |
| 6093 | } |
| 6094 | |
| 6095 | /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ |
| 6096 | static void |
| 6097 | android_glNormalPointer__III |
| 6098 | (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { |
| 6099 | glNormalPointer( |
| 6100 | (GLenum)type, |
| 6101 | (GLsizei)stride, |
| 6102 | (const GLvoid *)offset |
| 6103 | ); |
| 6104 | } |
| 6105 | |
| 6106 | /* void glPointParameterf ( GLenum pname, GLfloat param ) */ |
| 6107 | static void |
| 6108 | android_glPointParameterf__IF |
| 6109 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 6110 | glPointParameterf( |
| 6111 | (GLenum)pname, |
| 6112 | (GLfloat)param |
| 6113 | ); |
| 6114 | } |
| 6115 | |
| 6116 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6117 | static void |
| 6118 | android_glPointParameterfv__I_3FI |
| 6119 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6120 | jint _exception = 0; |
| 6121 | const char * _exceptionType; |
| 6122 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6123 | GLfloat *params_base = (GLfloat *) 0; |
| 6124 | jint _remaining; |
| 6125 | GLfloat *params = (GLfloat *) 0; |
| 6126 | |
| 6127 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6128 | _exception = 1; |
| 6129 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6130 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6131 | goto exit; |
| 6132 | } |
| 6133 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6134 | _exception = 1; |
| 6135 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6136 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6137 | goto exit; |
| 6138 | } |
| 6139 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6140 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6141 | _exception = 1; |
| 6142 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6143 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6144 | goto exit; |
| 6145 | } |
| 6146 | params_base = (GLfloat *) |
| 6147 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6148 | params = params_base + offset; |
| 6149 | |
| 6150 | glPointParameterfv( |
| 6151 | (GLenum)pname, |
| 6152 | (GLfloat *)params |
| 6153 | ); |
| 6154 | |
| 6155 | exit: |
| 6156 | if (params_base) { |
| 6157 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6158 | JNI_ABORT); |
| 6159 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6160 | if (_exception) { |
| 6161 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6162 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6163 | } |
| 6164 | |
| 6165 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6166 | static void |
| 6167 | android_glPointParameterfv__ILjava_nio_FloatBuffer_2 |
| 6168 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6169 | jint _exception = 0; |
| 6170 | const char * _exceptionType; |
| 6171 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6172 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6173 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6174 | jint _remaining; |
| 6175 | GLfloat *params = (GLfloat *) 0; |
| 6176 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6177 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6178 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6179 | _exception = 1; |
| 6180 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6181 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6182 | goto exit; |
| 6183 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6184 | if (params == NULL) { |
| 6185 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6186 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6187 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6188 | glPointParameterfv( |
| 6189 | (GLenum)pname, |
| 6190 | (GLfloat *)params |
| 6191 | ); |
| 6192 | |
| 6193 | exit: |
| 6194 | if (_array) { |
| 6195 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6196 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6197 | if (_exception) { |
| 6198 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6199 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6200 | } |
| 6201 | |
| 6202 | /* void glPointParameterx ( GLenum pname, GLfixed param ) */ |
| 6203 | static void |
| 6204 | android_glPointParameterx__II |
| 6205 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 6206 | glPointParameterx( |
| 6207 | (GLenum)pname, |
| 6208 | (GLfixed)param |
| 6209 | ); |
| 6210 | } |
| 6211 | |
| 6212 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6213 | static void |
| 6214 | android_glPointParameterxv__I_3II |
| 6215 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6216 | jint _exception = 0; |
| 6217 | const char * _exceptionType; |
| 6218 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6219 | GLfixed *params_base = (GLfixed *) 0; |
| 6220 | jint _remaining; |
| 6221 | GLfixed *params = (GLfixed *) 0; |
| 6222 | |
| 6223 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6224 | _exception = 1; |
| 6225 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6226 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6227 | goto exit; |
| 6228 | } |
| 6229 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6230 | _exception = 1; |
| 6231 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6232 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6233 | goto exit; |
| 6234 | } |
| 6235 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6236 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6237 | _exception = 1; |
| 6238 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6239 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6240 | goto exit; |
| 6241 | } |
| 6242 | params_base = (GLfixed *) |
| 6243 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6244 | params = params_base + offset; |
| 6245 | |
| 6246 | glPointParameterxv( |
| 6247 | (GLenum)pname, |
| 6248 | (GLfixed *)params |
| 6249 | ); |
| 6250 | |
| 6251 | exit: |
| 6252 | if (params_base) { |
| 6253 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6254 | JNI_ABORT); |
| 6255 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6256 | if (_exception) { |
| 6257 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6258 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6259 | } |
| 6260 | |
| 6261 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6262 | static void |
| 6263 | android_glPointParameterxv__ILjava_nio_IntBuffer_2 |
| 6264 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6265 | jint _exception = 0; |
| 6266 | const char * _exceptionType; |
| 6267 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6268 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6269 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6270 | jint _remaining; |
| 6271 | GLfixed *params = (GLfixed *) 0; |
| 6272 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6273 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6274 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6275 | _exception = 1; |
| 6276 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6277 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6278 | goto exit; |
| 6279 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6280 | if (params == NULL) { |
| 6281 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6282 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6283 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6284 | glPointParameterxv( |
| 6285 | (GLenum)pname, |
| 6286 | (GLfixed *)params |
| 6287 | ); |
| 6288 | |
| 6289 | exit: |
| 6290 | if (_array) { |
| 6291 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6292 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6293 | if (_exception) { |
| 6294 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6295 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6296 | } |
| 6297 | |
| 6298 | /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 6299 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6300 | android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I |
| 6301 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6302 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6303 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6304 | jint _remaining; |
| 6305 | GLvoid *pointer = (GLvoid *) 0; |
| 6306 | |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6307 | if (pointer_buf) { |
| 6308 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 6309 | if ( ! pointer ) { |
| 6310 | return; |
| 6311 | } |
| 6312 | } |
| 6313 | glPointSizePointerOESBounds( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6314 | (GLenum)type, |
| 6315 | (GLsizei)stride, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6316 | (GLvoid *)pointer, |
| 6317 | (GLsizei)remaining |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6318 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6319 | } |
| 6320 | |
| 6321 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6322 | static void |
| 6323 | android_glTexCoordPointer__IIII |
| 6324 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6325 | glTexCoordPointer( |
| 6326 | (GLint)size, |
| 6327 | (GLenum)type, |
| 6328 | (GLsizei)stride, |
| 6329 | (const GLvoid *)offset |
| 6330 | ); |
| 6331 | } |
| 6332 | |
| 6333 | /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ |
| 6334 | static void |
| 6335 | android_glTexEnvi__III |
| 6336 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6337 | glTexEnvi( |
| 6338 | (GLenum)target, |
| 6339 | (GLenum)pname, |
| 6340 | (GLint)param |
| 6341 | ); |
| 6342 | } |
| 6343 | |
| 6344 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6345 | static void |
| 6346 | android_glTexEnviv__II_3II |
| 6347 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6348 | jint _exception = 0; |
| 6349 | const char * _exceptionType; |
| 6350 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6351 | GLint *params_base = (GLint *) 0; |
| 6352 | jint _remaining; |
| 6353 | GLint *params = (GLint *) 0; |
| 6354 | |
| 6355 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6356 | _exception = 1; |
| 6357 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6358 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6359 | goto exit; |
| 6360 | } |
| 6361 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6362 | _exception = 1; |
| 6363 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6364 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6365 | goto exit; |
| 6366 | } |
| 6367 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6368 | int _needed; |
| 6369 | switch (pname) { |
| 6370 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6371 | case GL_TEXTURE_ENV_MODE: |
| 6372 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6373 | #if defined(GL_COMBINE_RGB) |
| 6374 | case GL_COMBINE_RGB: |
| 6375 | #endif // defined(GL_COMBINE_RGB) |
| 6376 | #if defined(GL_COMBINE_ALPHA) |
| 6377 | case GL_COMBINE_ALPHA: |
| 6378 | #endif // defined(GL_COMBINE_ALPHA) |
| 6379 | _needed = 1; |
| 6380 | break; |
| 6381 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6382 | case GL_TEXTURE_ENV_COLOR: |
| 6383 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6384 | _needed = 4; |
| 6385 | break; |
| 6386 | default: |
| 6387 | _needed = 0; |
| 6388 | break; |
| 6389 | } |
| 6390 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6391 | _exception = 1; |
| 6392 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6393 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6394 | goto exit; |
| 6395 | } |
| 6396 | params_base = (GLint *) |
| 6397 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6398 | params = params_base + offset; |
| 6399 | |
| 6400 | glTexEnviv( |
| 6401 | (GLenum)target, |
| 6402 | (GLenum)pname, |
| 6403 | (GLint *)params |
| 6404 | ); |
| 6405 | |
| 6406 | exit: |
| 6407 | if (params_base) { |
| 6408 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6409 | JNI_ABORT); |
| 6410 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6411 | if (_exception) { |
| 6412 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6413 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6414 | } |
| 6415 | |
| 6416 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6417 | static void |
| 6418 | android_glTexEnviv__IILjava_nio_IntBuffer_2 |
| 6419 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6420 | jint _exception = 0; |
| 6421 | const char * _exceptionType; |
| 6422 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6423 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6424 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6425 | jint _remaining; |
| 6426 | GLint *params = (GLint *) 0; |
| 6427 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6428 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6429 | int _needed; |
| 6430 | switch (pname) { |
| 6431 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6432 | case GL_TEXTURE_ENV_MODE: |
| 6433 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6434 | #if defined(GL_COMBINE_RGB) |
| 6435 | case GL_COMBINE_RGB: |
| 6436 | #endif // defined(GL_COMBINE_RGB) |
| 6437 | #if defined(GL_COMBINE_ALPHA) |
| 6438 | case GL_COMBINE_ALPHA: |
| 6439 | #endif // defined(GL_COMBINE_ALPHA) |
| 6440 | _needed = 1; |
| 6441 | break; |
| 6442 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6443 | case GL_TEXTURE_ENV_COLOR: |
| 6444 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6445 | _needed = 4; |
| 6446 | break; |
| 6447 | default: |
| 6448 | _needed = 0; |
| 6449 | break; |
| 6450 | } |
| 6451 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6452 | _exception = 1; |
| 6453 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6454 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6455 | goto exit; |
| 6456 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6457 | if (params == NULL) { |
| 6458 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6459 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6460 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6461 | glTexEnviv( |
| 6462 | (GLenum)target, |
| 6463 | (GLenum)pname, |
| 6464 | (GLint *)params |
| 6465 | ); |
| 6466 | |
| 6467 | exit: |
| 6468 | if (_array) { |
| 6469 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6470 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6471 | if (_exception) { |
| 6472 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6473 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6474 | } |
| 6475 | |
| 6476 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6477 | static void |
| 6478 | android_glTexParameterfv__II_3FI |
| 6479 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6480 | jint _exception = 0; |
| 6481 | const char * _exceptionType; |
| 6482 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6483 | GLfloat *params_base = (GLfloat *) 0; |
| 6484 | jint _remaining; |
| 6485 | GLfloat *params = (GLfloat *) 0; |
| 6486 | |
| 6487 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6488 | _exception = 1; |
| 6489 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6490 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6491 | goto exit; |
| 6492 | } |
| 6493 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6494 | _exception = 1; |
| 6495 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6496 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6497 | goto exit; |
| 6498 | } |
| 6499 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6500 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6501 | _exception = 1; |
| 6502 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6503 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6504 | goto exit; |
| 6505 | } |
| 6506 | params_base = (GLfloat *) |
| 6507 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6508 | params = params_base + offset; |
| 6509 | |
| 6510 | glTexParameterfv( |
| 6511 | (GLenum)target, |
| 6512 | (GLenum)pname, |
| 6513 | (GLfloat *)params |
| 6514 | ); |
| 6515 | |
| 6516 | exit: |
| 6517 | if (params_base) { |
| 6518 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6519 | JNI_ABORT); |
| 6520 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6521 | if (_exception) { |
| 6522 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6523 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6524 | } |
| 6525 | |
| 6526 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6527 | static void |
| 6528 | android_glTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6529 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6530 | jint _exception = 0; |
| 6531 | const char * _exceptionType; |
| 6532 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6533 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6534 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6535 | jint _remaining; |
| 6536 | GLfloat *params = (GLfloat *) 0; |
| 6537 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6538 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6539 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6540 | _exception = 1; |
| 6541 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6542 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6543 | goto exit; |
| 6544 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6545 | if (params == NULL) { |
| 6546 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6547 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6548 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6549 | glTexParameterfv( |
| 6550 | (GLenum)target, |
| 6551 | (GLenum)pname, |
| 6552 | (GLfloat *)params |
| 6553 | ); |
| 6554 | |
| 6555 | exit: |
| 6556 | if (_array) { |
| 6557 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6558 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6559 | if (_exception) { |
| 6560 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6561 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6562 | } |
| 6563 | |
| 6564 | /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ |
| 6565 | static void |
| 6566 | android_glTexParameteri__III |
| 6567 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6568 | glTexParameteri( |
| 6569 | (GLenum)target, |
| 6570 | (GLenum)pname, |
| 6571 | (GLint)param |
| 6572 | ); |
| 6573 | } |
| 6574 | |
| 6575 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6576 | static void |
| 6577 | android_glTexParameteriv__II_3II |
| 6578 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6579 | jint _exception = 0; |
| 6580 | const char * _exceptionType; |
| 6581 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6582 | GLint *params_base = (GLint *) 0; |
| 6583 | jint _remaining; |
| 6584 | GLint *params = (GLint *) 0; |
| 6585 | |
| 6586 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6587 | _exception = 1; |
| 6588 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6589 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6590 | goto exit; |
| 6591 | } |
| 6592 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6593 | _exception = 1; |
| 6594 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6595 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6596 | goto exit; |
| 6597 | } |
| 6598 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6599 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6600 | _exception = 1; |
| 6601 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6602 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6603 | goto exit; |
| 6604 | } |
| 6605 | params_base = (GLint *) |
| 6606 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6607 | params = params_base + offset; |
| 6608 | |
| 6609 | glTexParameteriv( |
| 6610 | (GLenum)target, |
| 6611 | (GLenum)pname, |
| 6612 | (GLint *)params |
| 6613 | ); |
| 6614 | |
| 6615 | exit: |
| 6616 | if (params_base) { |
| 6617 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6618 | JNI_ABORT); |
| 6619 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6620 | if (_exception) { |
| 6621 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6622 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6623 | } |
| 6624 | |
| 6625 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6626 | static void |
| 6627 | android_glTexParameteriv__IILjava_nio_IntBuffer_2 |
| 6628 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6629 | jint _exception = 0; |
| 6630 | const char * _exceptionType; |
| 6631 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6632 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6633 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6634 | jint _remaining; |
| 6635 | GLint *params = (GLint *) 0; |
| 6636 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6637 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6638 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6639 | _exception = 1; |
| 6640 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6641 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6642 | goto exit; |
| 6643 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6644 | if (params == NULL) { |
| 6645 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6646 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6647 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6648 | glTexParameteriv( |
| 6649 | (GLenum)target, |
| 6650 | (GLenum)pname, |
| 6651 | (GLint *)params |
| 6652 | ); |
| 6653 | |
| 6654 | exit: |
| 6655 | if (_array) { |
| 6656 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6657 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6658 | if (_exception) { |
| 6659 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6660 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6661 | } |
| 6662 | |
| 6663 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 6664 | static void |
| 6665 | android_glTexParameterxv__II_3II |
| 6666 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6667 | jint _exception = 0; |
| 6668 | const char * _exceptionType; |
| 6669 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6670 | GLfixed *params_base = (GLfixed *) 0; |
| 6671 | jint _remaining; |
| 6672 | GLfixed *params = (GLfixed *) 0; |
| 6673 | |
| 6674 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6675 | _exception = 1; |
| 6676 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6677 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6678 | goto exit; |
| 6679 | } |
| 6680 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6681 | _exception = 1; |
| 6682 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6683 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6684 | goto exit; |
| 6685 | } |
| 6686 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6687 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6688 | _exception = 1; |
| 6689 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6690 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6691 | goto exit; |
| 6692 | } |
| 6693 | params_base = (GLfixed *) |
| 6694 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 6695 | params = params_base + offset; |
| 6696 | |
| 6697 | glTexParameterxv( |
| 6698 | (GLenum)target, |
| 6699 | (GLenum)pname, |
| 6700 | (GLfixed *)params |
| 6701 | ); |
| 6702 | |
| 6703 | exit: |
| 6704 | if (params_base) { |
| 6705 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 6706 | JNI_ABORT); |
| 6707 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6708 | if (_exception) { |
| 6709 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6710 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6711 | } |
| 6712 | |
| 6713 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 6714 | static void |
| 6715 | android_glTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6716 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6717 | jint _exception = 0; |
| 6718 | const char * _exceptionType; |
| 6719 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6720 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6721 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6722 | jint _remaining; |
| 6723 | GLfixed *params = (GLfixed *) 0; |
| 6724 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6725 | params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6726 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6727 | _exception = 1; |
| 6728 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6729 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6730 | goto exit; |
| 6731 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6732 | if (params == NULL) { |
| 6733 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6734 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6735 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6736 | glTexParameterxv( |
| 6737 | (GLenum)target, |
| 6738 | (GLenum)pname, |
| 6739 | (GLfixed *)params |
| 6740 | ); |
| 6741 | |
| 6742 | exit: |
| 6743 | if (_array) { |
| 6744 | releasePointer(_env, _array, params, JNI_FALSE); |
| 6745 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6746 | if (_exception) { |
| 6747 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6748 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6749 | } |
| 6750 | |
| 6751 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6752 | static void |
| 6753 | android_glVertexPointer__IIII |
| 6754 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6755 | glVertexPointer( |
| 6756 | (GLint)size, |
| 6757 | (GLenum)type, |
| 6758 | (GLsizei)stride, |
| 6759 | (const GLvoid *)offset |
| 6760 | ); |
| 6761 | } |
| 6762 | |
| 6763 | /* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */ |
| 6764 | static void |
| 6765 | android_glCurrentPaletteMatrixOES__I |
| 6766 | (JNIEnv *_env, jobject _this, jint matrixpaletteindex) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6767 | glCurrentPaletteMatrixOES( |
| 6768 | (GLuint)matrixpaletteindex |
| 6769 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6770 | } |
| 6771 | |
| 6772 | /* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */ |
| 6773 | static void |
| 6774 | android_glDrawTexfOES__FFFFF |
| 6775 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) { |
| 6776 | glDrawTexfOES( |
| 6777 | (GLfloat)x, |
| 6778 | (GLfloat)y, |
| 6779 | (GLfloat)z, |
| 6780 | (GLfloat)width, |
| 6781 | (GLfloat)height |
| 6782 | ); |
| 6783 | } |
| 6784 | |
| 6785 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 6786 | static void |
| 6787 | android_glDrawTexfvOES___3FI |
| 6788 | (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6789 | jint _exception = 0; |
| 6790 | const char * _exceptionType; |
| 6791 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6792 | GLfloat *coords_base = (GLfloat *) 0; |
| 6793 | jint _remaining; |
| 6794 | GLfloat *coords = (GLfloat *) 0; |
| 6795 | |
| 6796 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6797 | _exception = 1; |
| 6798 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6799 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6800 | goto exit; |
| 6801 | } |
| 6802 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6803 | _exception = 1; |
| 6804 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6805 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6806 | goto exit; |
| 6807 | } |
| 6808 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 6809 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6810 | _exception = 1; |
| 6811 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6812 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6813 | goto exit; |
| 6814 | } |
| 6815 | coords_base = (GLfloat *) |
| 6816 | _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0); |
| 6817 | coords = coords_base + offset; |
| 6818 | |
| 6819 | glDrawTexfvOES( |
| 6820 | (GLfloat *)coords |
| 6821 | ); |
| 6822 | |
| 6823 | exit: |
| 6824 | if (coords_base) { |
| 6825 | _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base, |
| 6826 | JNI_ABORT); |
| 6827 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6828 | if (_exception) { |
| 6829 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6830 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6831 | } |
| 6832 | |
| 6833 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 6834 | static void |
| 6835 | android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 |
| 6836 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6837 | jint _exception = 0; |
| 6838 | const char * _exceptionType; |
| 6839 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6840 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6841 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6842 | jint _remaining; |
| 6843 | GLfloat *coords = (GLfloat *) 0; |
| 6844 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6845 | coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6846 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6847 | _exception = 1; |
| 6848 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6849 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6850 | goto exit; |
| 6851 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6852 | if (coords == NULL) { |
| 6853 | char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6854 | coords = (GLfloat *) (_coordsBase + _bufferOffset); |
| 6855 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6856 | glDrawTexfvOES( |
| 6857 | (GLfloat *)coords |
| 6858 | ); |
| 6859 | |
| 6860 | exit: |
| 6861 | if (_array) { |
| 6862 | releasePointer(_env, _array, coords, JNI_FALSE); |
| 6863 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6864 | if (_exception) { |
| 6865 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6866 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6867 | } |
| 6868 | |
| 6869 | /* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */ |
| 6870 | static void |
| 6871 | android_glDrawTexiOES__IIIII |
| 6872 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 6873 | glDrawTexiOES( |
| 6874 | (GLint)x, |
| 6875 | (GLint)y, |
| 6876 | (GLint)z, |
| 6877 | (GLint)width, |
| 6878 | (GLint)height |
| 6879 | ); |
| 6880 | } |
| 6881 | |
| 6882 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 6883 | static void |
| 6884 | android_glDrawTexivOES___3II |
| 6885 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6886 | jint _exception = 0; |
| 6887 | const char * _exceptionType; |
| 6888 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6889 | GLint *coords_base = (GLint *) 0; |
| 6890 | jint _remaining; |
| 6891 | GLint *coords = (GLint *) 0; |
| 6892 | |
| 6893 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6894 | _exception = 1; |
| 6895 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6896 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6897 | goto exit; |
| 6898 | } |
| 6899 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6900 | _exception = 1; |
| 6901 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6902 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6903 | goto exit; |
| 6904 | } |
| 6905 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 6906 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6907 | _exception = 1; |
| 6908 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6909 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6910 | goto exit; |
| 6911 | } |
| 6912 | coords_base = (GLint *) |
| 6913 | _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0); |
| 6914 | coords = coords_base + offset; |
| 6915 | |
| 6916 | glDrawTexivOES( |
| 6917 | (GLint *)coords |
| 6918 | ); |
| 6919 | |
| 6920 | exit: |
| 6921 | if (coords_base) { |
| 6922 | _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base, |
| 6923 | JNI_ABORT); |
| 6924 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6925 | if (_exception) { |
| 6926 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6927 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6928 | } |
| 6929 | |
| 6930 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 6931 | static void |
| 6932 | android_glDrawTexivOES__Ljava_nio_IntBuffer_2 |
| 6933 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6934 | jint _exception = 0; |
| 6935 | const char * _exceptionType; |
| 6936 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6937 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6938 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6939 | jint _remaining; |
| 6940 | GLint *coords = (GLint *) 0; |
| 6941 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6942 | coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6943 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6944 | _exception = 1; |
| 6945 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6946 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6947 | goto exit; |
| 6948 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6949 | if (coords == NULL) { |
| 6950 | char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 6951 | coords = (GLint *) (_coordsBase + _bufferOffset); |
| 6952 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6953 | glDrawTexivOES( |
| 6954 | (GLint *)coords |
| 6955 | ); |
| 6956 | |
| 6957 | exit: |
| 6958 | if (_array) { |
| 6959 | releasePointer(_env, _array, coords, JNI_FALSE); |
| 6960 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6961 | if (_exception) { |
| 6962 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6963 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6964 | } |
| 6965 | |
| 6966 | /* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */ |
| 6967 | static void |
| 6968 | android_glDrawTexsOES__SSSSS |
| 6969 | (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) { |
| 6970 | glDrawTexsOES( |
| 6971 | (GLshort)x, |
| 6972 | (GLshort)y, |
| 6973 | (GLshort)z, |
| 6974 | (GLshort)width, |
| 6975 | (GLshort)height |
| 6976 | ); |
| 6977 | } |
| 6978 | |
| 6979 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 6980 | static void |
| 6981 | android_glDrawTexsvOES___3SI |
| 6982 | (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6983 | jint _exception = 0; |
| 6984 | const char * _exceptionType; |
| 6985 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6986 | GLshort *coords_base = (GLshort *) 0; |
| 6987 | jint _remaining; |
| 6988 | GLshort *coords = (GLshort *) 0; |
| 6989 | |
| 6990 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6991 | _exception = 1; |
| 6992 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6993 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6994 | goto exit; |
| 6995 | } |
| 6996 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6997 | _exception = 1; |
| 6998 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6999 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7000 | goto exit; |
| 7001 | } |
| 7002 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7003 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7004 | _exception = 1; |
| 7005 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7006 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7007 | goto exit; |
| 7008 | } |
| 7009 | coords_base = (GLshort *) |
| 7010 | _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0); |
| 7011 | coords = coords_base + offset; |
| 7012 | |
| 7013 | glDrawTexsvOES( |
| 7014 | (GLshort *)coords |
| 7015 | ); |
| 7016 | |
| 7017 | exit: |
| 7018 | if (coords_base) { |
| 7019 | _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base, |
| 7020 | JNI_ABORT); |
| 7021 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7022 | if (_exception) { |
| 7023 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7024 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7025 | } |
| 7026 | |
| 7027 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7028 | static void |
| 7029 | android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 |
| 7030 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7031 | jint _exception = 0; |
| 7032 | const char * _exceptionType; |
| 7033 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7034 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7035 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7036 | jint _remaining; |
| 7037 | GLshort *coords = (GLshort *) 0; |
| 7038 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7039 | coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7040 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7041 | _exception = 1; |
| 7042 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7043 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7044 | goto exit; |
| 7045 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7046 | if (coords == NULL) { |
| 7047 | char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7048 | coords = (GLshort *) (_coordsBase + _bufferOffset); |
| 7049 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7050 | glDrawTexsvOES( |
| 7051 | (GLshort *)coords |
| 7052 | ); |
| 7053 | |
| 7054 | exit: |
| 7055 | if (_array) { |
| 7056 | releasePointer(_env, _array, coords, JNI_FALSE); |
| 7057 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7058 | if (_exception) { |
| 7059 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7060 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7061 | } |
| 7062 | |
| 7063 | /* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */ |
| 7064 | static void |
| 7065 | android_glDrawTexxOES__IIIII |
| 7066 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7067 | glDrawTexxOES( |
| 7068 | (GLfixed)x, |
| 7069 | (GLfixed)y, |
| 7070 | (GLfixed)z, |
| 7071 | (GLfixed)width, |
| 7072 | (GLfixed)height |
| 7073 | ); |
| 7074 | } |
| 7075 | |
| 7076 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7077 | static void |
| 7078 | android_glDrawTexxvOES___3II |
| 7079 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7080 | jint _exception = 0; |
| 7081 | const char * _exceptionType; |
| 7082 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7083 | GLfixed *coords_base = (GLfixed *) 0; |
| 7084 | jint _remaining; |
| 7085 | GLfixed *coords = (GLfixed *) 0; |
| 7086 | |
| 7087 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7088 | _exception = 1; |
| 7089 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7090 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7091 | goto exit; |
| 7092 | } |
| 7093 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7094 | _exception = 1; |
| 7095 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7096 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7097 | goto exit; |
| 7098 | } |
| 7099 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7100 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7101 | _exception = 1; |
| 7102 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7103 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7104 | goto exit; |
| 7105 | } |
| 7106 | coords_base = (GLfixed *) |
| 7107 | _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0); |
| 7108 | coords = coords_base + offset; |
| 7109 | |
| 7110 | glDrawTexxvOES( |
| 7111 | (GLfixed *)coords |
| 7112 | ); |
| 7113 | |
| 7114 | exit: |
| 7115 | if (coords_base) { |
| 7116 | _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base, |
| 7117 | JNI_ABORT); |
| 7118 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7119 | if (_exception) { |
| 7120 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7121 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7122 | } |
| 7123 | |
| 7124 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7125 | static void |
| 7126 | android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 |
| 7127 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7128 | jint _exception = 0; |
| 7129 | const char * _exceptionType; |
| 7130 | const char * _exceptionMessage; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7131 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7132 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7133 | jint _remaining; |
| 7134 | GLfixed *coords = (GLfixed *) 0; |
| 7135 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7136 | coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7137 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7138 | _exception = 1; |
| 7139 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7140 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7141 | goto exit; |
| 7142 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7143 | if (coords == NULL) { |
| 7144 | char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7145 | coords = (GLfixed *) (_coordsBase + _bufferOffset); |
| 7146 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7147 | glDrawTexxvOES( |
| 7148 | (GLfixed *)coords |
| 7149 | ); |
| 7150 | |
| 7151 | exit: |
| 7152 | if (_array) { |
| 7153 | releasePointer(_env, _array, coords, JNI_FALSE); |
| 7154 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7155 | if (_exception) { |
| 7156 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7157 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7158 | } |
| 7159 | |
| 7160 | /* void glLoadPaletteFromModelViewMatrixOES ( void ) */ |
| 7161 | static void |
| 7162 | android_glLoadPaletteFromModelViewMatrixOES__ |
| 7163 | (JNIEnv *_env, jobject _this) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7164 | glLoadPaletteFromModelViewMatrixOES(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7165 | } |
| 7166 | |
| 7167 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7168 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7169 | android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7170 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 7171 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7172 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7173 | jint _remaining; |
| 7174 | GLvoid *pointer = (GLvoid *) 0; |
| 7175 | |
| 7176 | if (pointer_buf) { |
| 7177 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7178 | if ( ! pointer ) { |
| 7179 | return; |
| 7180 | } |
| 7181 | } |
| 7182 | glMatrixIndexPointerOESBounds( |
| 7183 | (GLint)size, |
| 7184 | (GLenum)type, |
| 7185 | (GLsizei)stride, |
| 7186 | (GLvoid *)pointer, |
| 7187 | (GLsizei)remaining |
| 7188 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7189 | } |
| 7190 | |
| 7191 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7192 | static void |
| 7193 | android_glMatrixIndexPointerOES__IIII |
| 7194 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7195 | glMatrixIndexPointerOES( |
| 7196 | (GLint)size, |
| 7197 | (GLenum)type, |
| 7198 | (GLsizei)stride, |
| 7199 | (const GLvoid *)offset |
| 7200 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7201 | } |
| 7202 | |
| 7203 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7204 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7205 | android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7206 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 7207 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7208 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7209 | jint _remaining; |
| 7210 | GLvoid *pointer = (GLvoid *) 0; |
| 7211 | |
| 7212 | if (pointer_buf) { |
| 7213 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7214 | if ( ! pointer ) { |
| 7215 | return; |
| 7216 | } |
| 7217 | } |
| 7218 | glWeightPointerOESBounds( |
| 7219 | (GLint)size, |
| 7220 | (GLenum)type, |
| 7221 | (GLsizei)stride, |
| 7222 | (GLvoid *)pointer, |
| 7223 | (GLsizei)remaining |
| 7224 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7225 | } |
| 7226 | |
| 7227 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7228 | static void |
| 7229 | android_glWeightPointerOES__IIII |
| 7230 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7231 | glWeightPointerOES( |
| 7232 | (GLint)size, |
| 7233 | (GLenum)type, |
| 7234 | (GLsizei)stride, |
| 7235 | (const GLvoid *)offset |
| 7236 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7237 | } |
| 7238 | |
| 7239 | /* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */ |
| 7240 | static void |
| 7241 | android_glBindFramebufferOES__II |
| 7242 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7243 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7244 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7245 | "glBindFramebufferOES"); |
| 7246 | return; |
| 7247 | } |
| 7248 | glBindFramebufferOES( |
| 7249 | (GLint)target, |
| 7250 | (GLint)framebuffer |
| 7251 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7252 | } |
| 7253 | |
| 7254 | /* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */ |
| 7255 | static void |
| 7256 | android_glBindRenderbufferOES__II |
| 7257 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7258 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7259 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7260 | "glBindRenderbufferOES"); |
| 7261 | return; |
| 7262 | } |
| 7263 | glBindRenderbufferOES( |
| 7264 | (GLint)target, |
| 7265 | (GLint)renderbuffer |
| 7266 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7267 | } |
| 7268 | |
| 7269 | /* void glBlendEquation ( GLint mode ) */ |
| 7270 | static void |
| 7271 | android_glBlendEquation__I |
| 7272 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7273 | if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7274 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7275 | "glBlendEquation"); |
| 7276 | return; |
| 7277 | } |
| 7278 | glBlendEquation( |
| 7279 | (GLint)mode |
| 7280 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7281 | } |
| 7282 | |
| 7283 | /* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */ |
| 7284 | static void |
| 7285 | android_glBlendEquationSeparate__II |
| 7286 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7287 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7288 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7289 | "glBlendEquationSeparate"); |
| 7290 | return; |
| 7291 | } |
| 7292 | glBlendEquationSeparate( |
| 7293 | (GLint)modeRGB, |
| 7294 | (GLint)modeAlpha |
| 7295 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7296 | } |
| 7297 | |
| 7298 | /* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */ |
| 7299 | static void |
| 7300 | android_glBlendFuncSeparate__IIII |
| 7301 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7302 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7303 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7304 | "glBlendFuncSeparate"); |
| 7305 | return; |
| 7306 | } |
| 7307 | glBlendFuncSeparate( |
| 7308 | (GLint)srcRGB, |
| 7309 | (GLint)dstRGB, |
| 7310 | (GLint)srcAlpha, |
| 7311 | (GLint)dstAlpha |
| 7312 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7313 | } |
| 7314 | |
| 7315 | /* GLint glCheckFramebufferStatusOES ( GLint target ) */ |
| 7316 | static jint |
| 7317 | android_glCheckFramebufferStatusOES__I |
| 7318 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7319 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7320 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7321 | "glCheckFramebufferStatusOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7322 | return 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7323 | } |
| 7324 | GLint _returnValue = 0; |
| 7325 | _returnValue = glCheckFramebufferStatusOES( |
| 7326 | (GLint)target |
| 7327 | ); |
| 7328 | return _returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7329 | } |
| 7330 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7331 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7332 | static void |
| 7333 | android_glDeleteFramebuffersOES__I_3II |
| 7334 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7335 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7336 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7337 | "glDeleteFramebuffersOES"); |
| 7338 | return; |
| 7339 | } |
| 7340 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7341 | const char * _exceptionType; |
| 7342 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7343 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7344 | jint _remaining; |
| 7345 | GLuint *framebuffers = (GLuint *) 0; |
| 7346 | |
| 7347 | if (!framebuffers_ref) { |
| 7348 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7349 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7350 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7351 | goto exit; |
| 7352 | } |
| 7353 | if (offset < 0) { |
| 7354 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7355 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7356 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7357 | goto exit; |
| 7358 | } |
| 7359 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7360 | if (_remaining < n) { |
| 7361 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7362 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7363 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7364 | goto exit; |
| 7365 | } |
| 7366 | framebuffers_base = (GLuint *) |
| 7367 | _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0); |
| 7368 | framebuffers = framebuffers_base + offset; |
| 7369 | |
| 7370 | glDeleteFramebuffersOES( |
| 7371 | (GLint)n, |
| 7372 | (GLuint *)framebuffers |
| 7373 | ); |
| 7374 | |
| 7375 | exit: |
| 7376 | if (framebuffers_base) { |
| 7377 | _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base, |
| 7378 | _exception ? JNI_ABORT: 0); |
| 7379 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7380 | if (_exception) { |
| 7381 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7382 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7383 | } |
| 7384 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7385 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7386 | static void |
| 7387 | android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 7388 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7389 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7390 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7391 | "glDeleteFramebuffersOES"); |
| 7392 | return; |
| 7393 | } |
| 7394 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7395 | const char * _exceptionType; |
| 7396 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7397 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7398 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7399 | jint _remaining; |
| 7400 | GLuint *framebuffers = (GLuint *) 0; |
| 7401 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7402 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7403 | if (_remaining < n) { |
| 7404 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7405 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7406 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7407 | goto exit; |
| 7408 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7409 | if (framebuffers == NULL) { |
| 7410 | char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7411 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7412 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7413 | glDeleteFramebuffersOES( |
| 7414 | (GLint)n, |
| 7415 | (GLuint *)framebuffers |
| 7416 | ); |
| 7417 | |
| 7418 | exit: |
| 7419 | if (_array) { |
| 7420 | releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 7421 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7422 | if (_exception) { |
| 7423 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7424 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7425 | } |
| 7426 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7427 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7428 | static void |
| 7429 | android_glDeleteRenderbuffersOES__I_3II |
| 7430 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7431 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7432 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7433 | "glDeleteRenderbuffersOES"); |
| 7434 | return; |
| 7435 | } |
| 7436 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7437 | const char * _exceptionType; |
| 7438 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7439 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7440 | jint _remaining; |
| 7441 | GLuint *renderbuffers = (GLuint *) 0; |
| 7442 | |
| 7443 | if (!renderbuffers_ref) { |
| 7444 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7445 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7446 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7447 | goto exit; |
| 7448 | } |
| 7449 | if (offset < 0) { |
| 7450 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7451 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7452 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7453 | goto exit; |
| 7454 | } |
| 7455 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7456 | if (_remaining < n) { |
| 7457 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7458 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7459 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7460 | goto exit; |
| 7461 | } |
| 7462 | renderbuffers_base = (GLuint *) |
| 7463 | _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0); |
| 7464 | renderbuffers = renderbuffers_base + offset; |
| 7465 | |
| 7466 | glDeleteRenderbuffersOES( |
| 7467 | (GLint)n, |
| 7468 | (GLuint *)renderbuffers |
| 7469 | ); |
| 7470 | |
| 7471 | exit: |
| 7472 | if (renderbuffers_base) { |
| 7473 | _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base, |
| 7474 | _exception ? JNI_ABORT: 0); |
| 7475 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7476 | if (_exception) { |
| 7477 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7478 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7479 | } |
| 7480 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7481 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7482 | static void |
| 7483 | android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 7484 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7485 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7486 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7487 | "glDeleteRenderbuffersOES"); |
| 7488 | return; |
| 7489 | } |
| 7490 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7491 | const char * _exceptionType; |
| 7492 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7493 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7494 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7495 | jint _remaining; |
| 7496 | GLuint *renderbuffers = (GLuint *) 0; |
| 7497 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7498 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7499 | if (_remaining < n) { |
| 7500 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7501 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7502 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7503 | goto exit; |
| 7504 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7505 | if (renderbuffers == NULL) { |
| 7506 | char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7507 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7508 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7509 | glDeleteRenderbuffersOES( |
| 7510 | (GLint)n, |
| 7511 | (GLuint *)renderbuffers |
| 7512 | ); |
| 7513 | |
| 7514 | exit: |
| 7515 | if (_array) { |
| 7516 | releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 7517 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7518 | if (_exception) { |
| 7519 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7520 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7521 | } |
| 7522 | |
| 7523 | /* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */ |
| 7524 | static void |
| 7525 | android_glFramebufferRenderbufferOES__IIII |
| 7526 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7527 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7528 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7529 | "glFramebufferRenderbufferOES"); |
| 7530 | return; |
| 7531 | } |
| 7532 | glFramebufferRenderbufferOES( |
| 7533 | (GLint)target, |
| 7534 | (GLint)attachment, |
| 7535 | (GLint)renderbuffertarget, |
| 7536 | (GLint)renderbuffer |
| 7537 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7538 | } |
| 7539 | |
| 7540 | /* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */ |
| 7541 | static void |
| 7542 | android_glFramebufferTexture2DOES__IIIII |
| 7543 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7544 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7545 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7546 | "glFramebufferTexture2DOES"); |
| 7547 | return; |
| 7548 | } |
| 7549 | glFramebufferTexture2DOES( |
| 7550 | (GLint)target, |
| 7551 | (GLint)attachment, |
| 7552 | (GLint)textarget, |
| 7553 | (GLint)texture, |
| 7554 | (GLint)level |
| 7555 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7556 | } |
| 7557 | |
| 7558 | /* void glGenerateMipmapOES ( GLint target ) */ |
| 7559 | static void |
| 7560 | android_glGenerateMipmapOES__I |
| 7561 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7562 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7563 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7564 | "glGenerateMipmapOES"); |
| 7565 | return; |
| 7566 | } |
| 7567 | glGenerateMipmapOES( |
| 7568 | (GLint)target |
| 7569 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7570 | } |
| 7571 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7572 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7573 | static void |
| 7574 | android_glGenFramebuffersOES__I_3II |
| 7575 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7576 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7577 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7578 | "glGenFramebuffersOES"); |
| 7579 | return; |
| 7580 | } |
| 7581 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7582 | const char * _exceptionType; |
| 7583 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7584 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7585 | jint _remaining; |
| 7586 | GLuint *framebuffers = (GLuint *) 0; |
| 7587 | |
| 7588 | if (!framebuffers_ref) { |
| 7589 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7590 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7591 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7592 | goto exit; |
| 7593 | } |
| 7594 | if (offset < 0) { |
| 7595 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7596 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7597 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7598 | goto exit; |
| 7599 | } |
| 7600 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7601 | if (_remaining < n) { |
| 7602 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7603 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7604 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7605 | goto exit; |
| 7606 | } |
| 7607 | framebuffers_base = (GLuint *) |
| 7608 | _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0); |
| 7609 | framebuffers = framebuffers_base + offset; |
| 7610 | |
| 7611 | glGenFramebuffersOES( |
| 7612 | (GLint)n, |
| 7613 | (GLuint *)framebuffers |
| 7614 | ); |
| 7615 | |
| 7616 | exit: |
| 7617 | if (framebuffers_base) { |
| 7618 | _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base, |
| 7619 | _exception ? JNI_ABORT: 0); |
| 7620 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7621 | if (_exception) { |
| 7622 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7623 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7624 | } |
| 7625 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7626 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7627 | static void |
| 7628 | android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 7629 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7630 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7631 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7632 | "glGenFramebuffersOES"); |
| 7633 | return; |
| 7634 | } |
| 7635 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7636 | const char * _exceptionType; |
| 7637 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7638 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7639 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7640 | jint _remaining; |
| 7641 | GLuint *framebuffers = (GLuint *) 0; |
| 7642 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7643 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7644 | if (_remaining < n) { |
| 7645 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7646 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7647 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7648 | goto exit; |
| 7649 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7650 | if (framebuffers == NULL) { |
| 7651 | char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7652 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7653 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7654 | glGenFramebuffersOES( |
| 7655 | (GLint)n, |
| 7656 | (GLuint *)framebuffers |
| 7657 | ); |
| 7658 | |
| 7659 | exit: |
| 7660 | if (_array) { |
| 7661 | releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 7662 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7663 | if (_exception) { |
| 7664 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7665 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7666 | } |
| 7667 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7668 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7669 | static void |
| 7670 | android_glGenRenderbuffersOES__I_3II |
| 7671 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7672 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7673 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7674 | "glGenRenderbuffersOES"); |
| 7675 | return; |
| 7676 | } |
| 7677 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7678 | const char * _exceptionType; |
| 7679 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7680 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7681 | jint _remaining; |
| 7682 | GLuint *renderbuffers = (GLuint *) 0; |
| 7683 | |
| 7684 | if (!renderbuffers_ref) { |
| 7685 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7686 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7687 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7688 | goto exit; |
| 7689 | } |
| 7690 | if (offset < 0) { |
| 7691 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7692 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7693 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7694 | goto exit; |
| 7695 | } |
| 7696 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7697 | if (_remaining < n) { |
| 7698 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7699 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7700 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7701 | goto exit; |
| 7702 | } |
| 7703 | renderbuffers_base = (GLuint *) |
| 7704 | _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0); |
| 7705 | renderbuffers = renderbuffers_base + offset; |
| 7706 | |
| 7707 | glGenRenderbuffersOES( |
| 7708 | (GLint)n, |
| 7709 | (GLuint *)renderbuffers |
| 7710 | ); |
| 7711 | |
| 7712 | exit: |
| 7713 | if (renderbuffers_base) { |
| 7714 | _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base, |
| 7715 | _exception ? JNI_ABORT: 0); |
| 7716 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7717 | if (_exception) { |
| 7718 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7719 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7720 | } |
| 7721 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7722 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7723 | static void |
| 7724 | android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 7725 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7726 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7727 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7728 | "glGenRenderbuffersOES"); |
| 7729 | return; |
| 7730 | } |
| 7731 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7732 | const char * _exceptionType; |
| 7733 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7734 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7735 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7736 | jint _remaining; |
| 7737 | GLuint *renderbuffers = (GLuint *) 0; |
| 7738 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7739 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7740 | if (_remaining < n) { |
| 7741 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7742 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7743 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7744 | goto exit; |
| 7745 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7746 | if (renderbuffers == NULL) { |
| 7747 | char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7748 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7749 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7750 | glGenRenderbuffersOES( |
| 7751 | (GLint)n, |
| 7752 | (GLuint *)renderbuffers |
| 7753 | ); |
| 7754 | |
| 7755 | exit: |
| 7756 | if (_array) { |
| 7757 | releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 7758 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7759 | if (_exception) { |
| 7760 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7761 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7762 | } |
| 7763 | |
| 7764 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 7765 | static void |
| 7766 | android_glGetFramebufferAttachmentParameterivOES__III_3II |
| 7767 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7768 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7769 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7770 | "glGetFramebufferAttachmentParameterivOES"); |
| 7771 | return; |
| 7772 | } |
| 7773 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7774 | const char * _exceptionType; |
| 7775 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7776 | GLint *params_base = (GLint *) 0; |
| 7777 | jint _remaining; |
| 7778 | GLint *params = (GLint *) 0; |
| 7779 | |
| 7780 | if (!params_ref) { |
| 7781 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7782 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7783 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7784 | goto exit; |
| 7785 | } |
| 7786 | if (offset < 0) { |
| 7787 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7788 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7789 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7790 | goto exit; |
| 7791 | } |
| 7792 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7793 | params_base = (GLint *) |
| 7794 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 7795 | params = params_base + offset; |
| 7796 | |
| 7797 | glGetFramebufferAttachmentParameterivOES( |
| 7798 | (GLint)target, |
| 7799 | (GLint)attachment, |
| 7800 | (GLint)pname, |
| 7801 | (GLint *)params |
| 7802 | ); |
| 7803 | |
| 7804 | exit: |
| 7805 | if (params_base) { |
| 7806 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 7807 | _exception ? JNI_ABORT: 0); |
| 7808 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7809 | if (_exception) { |
| 7810 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7811 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7812 | } |
| 7813 | |
| 7814 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 7815 | static void |
| 7816 | android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 |
| 7817 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7818 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7819 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7820 | "glGetFramebufferAttachmentParameterivOES"); |
| 7821 | return; |
| 7822 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7823 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7824 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7825 | jint _remaining; |
| 7826 | GLint *params = (GLint *) 0; |
| 7827 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7828 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 7829 | if (params == NULL) { |
| 7830 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7831 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7832 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7833 | glGetFramebufferAttachmentParameterivOES( |
| 7834 | (GLint)target, |
| 7835 | (GLint)attachment, |
| 7836 | (GLint)pname, |
| 7837 | (GLint *)params |
| 7838 | ); |
| 7839 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7840 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7841 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7842 | } |
| 7843 | |
| 7844 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 7845 | static void |
| 7846 | android_glGetRenderbufferParameterivOES__II_3II |
| 7847 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7848 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7849 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7850 | "glGetRenderbufferParameterivOES"); |
| 7851 | return; |
| 7852 | } |
| 7853 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7854 | const char * _exceptionType; |
| 7855 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7856 | GLint *params_base = (GLint *) 0; |
| 7857 | jint _remaining; |
| 7858 | GLint *params = (GLint *) 0; |
| 7859 | |
| 7860 | if (!params_ref) { |
| 7861 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7862 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7863 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7864 | goto exit; |
| 7865 | } |
| 7866 | if (offset < 0) { |
| 7867 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7868 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7869 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7870 | goto exit; |
| 7871 | } |
| 7872 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7873 | params_base = (GLint *) |
| 7874 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 7875 | params = params_base + offset; |
| 7876 | |
| 7877 | glGetRenderbufferParameterivOES( |
| 7878 | (GLint)target, |
| 7879 | (GLint)pname, |
| 7880 | (GLint *)params |
| 7881 | ); |
| 7882 | |
| 7883 | exit: |
| 7884 | if (params_base) { |
| 7885 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 7886 | _exception ? JNI_ABORT: 0); |
| 7887 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7888 | if (_exception) { |
| 7889 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7890 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7891 | } |
| 7892 | |
| 7893 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 7894 | static void |
| 7895 | android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 |
| 7896 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7897 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7898 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7899 | "glGetRenderbufferParameterivOES"); |
| 7900 | return; |
| 7901 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7902 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7903 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7904 | jint _remaining; |
| 7905 | GLint *params = (GLint *) 0; |
| 7906 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7907 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 7908 | if (params == NULL) { |
| 7909 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7910 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7911 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7912 | glGetRenderbufferParameterivOES( |
| 7913 | (GLint)target, |
| 7914 | (GLint)pname, |
| 7915 | (GLint *)params |
| 7916 | ); |
| 7917 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7918 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7919 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7920 | } |
| 7921 | |
| 7922 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 7923 | static void |
| 7924 | android_glGetTexGenfv__II_3FI |
| 7925 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7926 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7927 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7928 | "glGetTexGenfv"); |
| 7929 | return; |
| 7930 | } |
| 7931 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7932 | const char * _exceptionType; |
| 7933 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7934 | GLfloat *params_base = (GLfloat *) 0; |
| 7935 | jint _remaining; |
| 7936 | GLfloat *params = (GLfloat *) 0; |
| 7937 | |
| 7938 | if (!params_ref) { |
| 7939 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7940 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7941 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7942 | goto exit; |
| 7943 | } |
| 7944 | if (offset < 0) { |
| 7945 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7946 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7947 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7948 | goto exit; |
| 7949 | } |
| 7950 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7951 | params_base = (GLfloat *) |
| 7952 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 7953 | params = params_base + offset; |
| 7954 | |
| 7955 | glGetTexGenfv( |
| 7956 | (GLint)coord, |
| 7957 | (GLint)pname, |
| 7958 | (GLfloat *)params |
| 7959 | ); |
| 7960 | |
| 7961 | exit: |
| 7962 | if (params_base) { |
| 7963 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 7964 | _exception ? JNI_ABORT: 0); |
| 7965 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7966 | if (_exception) { |
| 7967 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7968 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7969 | } |
| 7970 | |
| 7971 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 7972 | static void |
| 7973 | android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 |
| 7974 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7975 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7976 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7977 | "glGetTexGenfv"); |
| 7978 | return; |
| 7979 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7980 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7981 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7982 | jint _remaining; |
| 7983 | GLfloat *params = (GLfloat *) 0; |
| 7984 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7985 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 7986 | if (params == NULL) { |
| 7987 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 7988 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 7989 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7990 | glGetTexGenfv( |
| 7991 | (GLint)coord, |
| 7992 | (GLint)pname, |
| 7993 | (GLfloat *)params |
| 7994 | ); |
| 7995 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7996 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7997 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7998 | } |
| 7999 | |
| 8000 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8001 | static void |
| 8002 | android_glGetTexGeniv__II_3II |
| 8003 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8004 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8005 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8006 | "glGetTexGeniv"); |
| 8007 | return; |
| 8008 | } |
| 8009 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8010 | const char * _exceptionType; |
| 8011 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8012 | GLint *params_base = (GLint *) 0; |
| 8013 | jint _remaining; |
| 8014 | GLint *params = (GLint *) 0; |
| 8015 | |
| 8016 | if (!params_ref) { |
| 8017 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8018 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8019 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8020 | goto exit; |
| 8021 | } |
| 8022 | if (offset < 0) { |
| 8023 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8024 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8025 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8026 | goto exit; |
| 8027 | } |
| 8028 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8029 | params_base = (GLint *) |
| 8030 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 8031 | params = params_base + offset; |
| 8032 | |
| 8033 | glGetTexGeniv( |
| 8034 | (GLint)coord, |
| 8035 | (GLint)pname, |
| 8036 | (GLint *)params |
| 8037 | ); |
| 8038 | |
| 8039 | exit: |
| 8040 | if (params_base) { |
| 8041 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 8042 | _exception ? JNI_ABORT: 0); |
| 8043 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8044 | if (_exception) { |
| 8045 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8046 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8047 | } |
| 8048 | |
| 8049 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8050 | static void |
| 8051 | android_glGetTexGeniv__IILjava_nio_IntBuffer_2 |
| 8052 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8053 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8054 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8055 | "glGetTexGeniv"); |
| 8056 | return; |
| 8057 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8058 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8059 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8060 | jint _remaining; |
| 8061 | GLint *params = (GLint *) 0; |
| 8062 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8063 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 8064 | if (params == NULL) { |
| 8065 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 8066 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8067 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8068 | glGetTexGeniv( |
| 8069 | (GLint)coord, |
| 8070 | (GLint)pname, |
| 8071 | (GLint *)params |
| 8072 | ); |
| 8073 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8074 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8075 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8076 | } |
| 8077 | |
| 8078 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8079 | static void |
| 8080 | android_glGetTexGenxv__II_3II |
| 8081 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8082 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8083 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8084 | "glGetTexGenxv"); |
| 8085 | return; |
| 8086 | } |
| 8087 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8088 | const char * _exceptionType; |
| 8089 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8090 | GLint *params_base = (GLint *) 0; |
| 8091 | jint _remaining; |
| 8092 | GLint *params = (GLint *) 0; |
| 8093 | |
| 8094 | if (!params_ref) { |
| 8095 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8096 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8097 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8098 | goto exit; |
| 8099 | } |
| 8100 | if (offset < 0) { |
| 8101 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8102 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8103 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8104 | goto exit; |
| 8105 | } |
| 8106 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8107 | params_base = (GLint *) |
| 8108 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 8109 | params = params_base + offset; |
| 8110 | |
| 8111 | glGetTexGenxv( |
| 8112 | (GLint)coord, |
| 8113 | (GLint)pname, |
| 8114 | (GLint *)params |
| 8115 | ); |
| 8116 | |
| 8117 | exit: |
| 8118 | if (params_base) { |
| 8119 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 8120 | _exception ? JNI_ABORT: 0); |
| 8121 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8122 | if (_exception) { |
| 8123 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8124 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8125 | } |
| 8126 | |
| 8127 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8128 | static void |
| 8129 | android_glGetTexGenxv__IILjava_nio_IntBuffer_2 |
| 8130 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8131 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8132 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8133 | "glGetTexGenxv"); |
| 8134 | return; |
| 8135 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8136 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8137 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8138 | jint _remaining; |
| 8139 | GLint *params = (GLint *) 0; |
| 8140 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8141 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 8142 | if (params == NULL) { |
| 8143 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 8144 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8145 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8146 | glGetTexGenxv( |
| 8147 | (GLint)coord, |
| 8148 | (GLint)pname, |
| 8149 | (GLint *)params |
| 8150 | ); |
| 8151 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8152 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8153 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8154 | } |
| 8155 | |
| 8156 | /* GLboolean glIsFramebufferOES ( GLint framebuffer ) */ |
| 8157 | static jboolean |
| 8158 | android_glIsFramebufferOES__I |
| 8159 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8160 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8161 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8162 | "glIsFramebufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8163 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8164 | } |
| 8165 | GLboolean _returnValue = JNI_FALSE; |
| 8166 | _returnValue = glIsFramebufferOES( |
| 8167 | (GLint)framebuffer |
| 8168 | ); |
| 8169 | return _returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8170 | } |
| 8171 | |
| 8172 | /* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */ |
| 8173 | static jboolean |
| 8174 | android_glIsRenderbufferOES__I |
| 8175 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8176 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8177 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8178 | "glIsRenderbufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8179 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8180 | } |
| 8181 | GLboolean _returnValue = JNI_FALSE; |
| 8182 | _returnValue = glIsRenderbufferOES( |
| 8183 | (GLint)renderbuffer |
| 8184 | ); |
| 8185 | return _returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8186 | } |
| 8187 | |
| 8188 | /* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */ |
| 8189 | static void |
| 8190 | android_glRenderbufferStorageOES__IIII |
| 8191 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8192 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8193 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8194 | "glRenderbufferStorageOES"); |
| 8195 | return; |
| 8196 | } |
| 8197 | glRenderbufferStorageOES( |
| 8198 | (GLint)target, |
| 8199 | (GLint)internalformat, |
| 8200 | (GLint)width, |
| 8201 | (GLint)height |
| 8202 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8203 | } |
| 8204 | |
| 8205 | /* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */ |
| 8206 | static void |
| 8207 | android_glTexGenf__IIF |
| 8208 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8209 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8210 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8211 | "glTexGenf"); |
| 8212 | return; |
| 8213 | } |
| 8214 | glTexGenf( |
| 8215 | (GLint)coord, |
| 8216 | (GLint)pname, |
| 8217 | (GLfloat)param |
| 8218 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8219 | } |
| 8220 | |
| 8221 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8222 | static void |
| 8223 | android_glTexGenfv__II_3FI |
| 8224 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8225 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8226 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8227 | "glTexGenfv"); |
| 8228 | return; |
| 8229 | } |
| 8230 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8231 | const char * _exceptionType; |
| 8232 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8233 | GLfloat *params_base = (GLfloat *) 0; |
| 8234 | jint _remaining; |
| 8235 | GLfloat *params = (GLfloat *) 0; |
| 8236 | |
| 8237 | if (!params_ref) { |
| 8238 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8239 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8240 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8241 | goto exit; |
| 8242 | } |
| 8243 | if (offset < 0) { |
| 8244 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8245 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8246 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8247 | goto exit; |
| 8248 | } |
| 8249 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8250 | params_base = (GLfloat *) |
| 8251 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 8252 | params = params_base + offset; |
| 8253 | |
| 8254 | glTexGenfv( |
| 8255 | (GLint)coord, |
| 8256 | (GLint)pname, |
| 8257 | (GLfloat *)params |
| 8258 | ); |
| 8259 | |
| 8260 | exit: |
| 8261 | if (params_base) { |
| 8262 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 8263 | _exception ? JNI_ABORT: 0); |
| 8264 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8265 | if (_exception) { |
| 8266 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8267 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8268 | } |
| 8269 | |
| 8270 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8271 | static void |
| 8272 | android_glTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8273 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8274 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8275 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8276 | "glTexGenfv"); |
| 8277 | return; |
| 8278 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8279 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8280 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8281 | jint _remaining; |
| 8282 | GLfloat *params = (GLfloat *) 0; |
| 8283 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8284 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 8285 | if (params == NULL) { |
| 8286 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 8287 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8288 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8289 | glTexGenfv( |
| 8290 | (GLint)coord, |
| 8291 | (GLint)pname, |
| 8292 | (GLfloat *)params |
| 8293 | ); |
| 8294 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8295 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8296 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8297 | } |
| 8298 | |
| 8299 | /* void glTexGeni ( GLint coord, GLint pname, GLint param ) */ |
| 8300 | static void |
| 8301 | android_glTexGeni__III |
| 8302 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8303 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8304 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8305 | "glTexGeni"); |
| 8306 | return; |
| 8307 | } |
| 8308 | glTexGeni( |
| 8309 | (GLint)coord, |
| 8310 | (GLint)pname, |
| 8311 | (GLint)param |
| 8312 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8313 | } |
| 8314 | |
| 8315 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8316 | static void |
| 8317 | android_glTexGeniv__II_3II |
| 8318 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8319 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8320 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8321 | "glTexGeniv"); |
| 8322 | return; |
| 8323 | } |
| 8324 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8325 | const char * _exceptionType; |
| 8326 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8327 | GLint *params_base = (GLint *) 0; |
| 8328 | jint _remaining; |
| 8329 | GLint *params = (GLint *) 0; |
| 8330 | |
| 8331 | if (!params_ref) { |
| 8332 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8333 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8334 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8335 | goto exit; |
| 8336 | } |
| 8337 | if (offset < 0) { |
| 8338 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8339 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8340 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8341 | goto exit; |
| 8342 | } |
| 8343 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8344 | params_base = (GLint *) |
| 8345 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 8346 | params = params_base + offset; |
| 8347 | |
| 8348 | glTexGeniv( |
| 8349 | (GLint)coord, |
| 8350 | (GLint)pname, |
| 8351 | (GLint *)params |
| 8352 | ); |
| 8353 | |
| 8354 | exit: |
| 8355 | if (params_base) { |
| 8356 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 8357 | _exception ? JNI_ABORT: 0); |
| 8358 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8359 | if (_exception) { |
| 8360 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8361 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8362 | } |
| 8363 | |
| 8364 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8365 | static void |
| 8366 | android_glTexGeniv__IILjava_nio_IntBuffer_2 |
| 8367 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8368 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8369 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8370 | "glTexGeniv"); |
| 8371 | return; |
| 8372 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8373 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8374 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8375 | jint _remaining; |
| 8376 | GLint *params = (GLint *) 0; |
| 8377 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8378 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 8379 | if (params == NULL) { |
| 8380 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 8381 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8382 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8383 | glTexGeniv( |
| 8384 | (GLint)coord, |
| 8385 | (GLint)pname, |
| 8386 | (GLint *)params |
| 8387 | ); |
| 8388 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8389 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8390 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8391 | } |
| 8392 | |
| 8393 | /* void glTexGenx ( GLint coord, GLint pname, GLint param ) */ |
| 8394 | static void |
| 8395 | android_glTexGenx__III |
| 8396 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8397 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8398 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8399 | "glTexGenx"); |
| 8400 | return; |
| 8401 | } |
| 8402 | glTexGenx( |
| 8403 | (GLint)coord, |
| 8404 | (GLint)pname, |
| 8405 | (GLint)param |
| 8406 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8407 | } |
| 8408 | |
| 8409 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8410 | static void |
| 8411 | android_glTexGenxv__II_3II |
| 8412 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8413 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8414 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8415 | "glTexGenxv"); |
| 8416 | return; |
| 8417 | } |
| 8418 | jint _exception = 0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8419 | const char * _exceptionType; |
| 8420 | const char * _exceptionMessage; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8421 | GLint *params_base = (GLint *) 0; |
| 8422 | jint _remaining; |
| 8423 | GLint *params = (GLint *) 0; |
| 8424 | |
| 8425 | if (!params_ref) { |
| 8426 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8427 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8428 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8429 | goto exit; |
| 8430 | } |
| 8431 | if (offset < 0) { |
| 8432 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8433 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8434 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8435 | goto exit; |
| 8436 | } |
| 8437 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8438 | params_base = (GLint *) |
| 8439 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 8440 | params = params_base + offset; |
| 8441 | |
| 8442 | glTexGenxv( |
| 8443 | (GLint)coord, |
| 8444 | (GLint)pname, |
| 8445 | (GLint *)params |
| 8446 | ); |
| 8447 | |
| 8448 | exit: |
| 8449 | if (params_base) { |
| 8450 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 8451 | _exception ? JNI_ABORT: 0); |
| 8452 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8453 | if (_exception) { |
| 8454 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8455 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8456 | } |
| 8457 | |
| 8458 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8459 | static void |
| 8460 | android_glTexGenxv__IILjava_nio_IntBuffer_2 |
| 8461 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8462 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8463 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8464 | "glTexGenxv"); |
| 8465 | return; |
| 8466 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8467 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8468 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8469 | jint _remaining; |
| 8470 | GLint *params = (GLint *) 0; |
| 8471 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8472 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 8473 | if (params == NULL) { |
| 8474 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 8475 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8476 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8477 | glTexGenxv( |
| 8478 | (GLint)coord, |
| 8479 | (GLint)pname, |
| 8480 | (GLint *)params |
| 8481 | ); |
| 8482 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8483 | releasePointer(_env, _array, params, JNI_TRUE); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8484 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8485 | } |
| 8486 | |
| 8487 | static const char *classPathName = "com/google/android/gles_jni/GLImpl"; |
| 8488 | |
| 8489 | static JNINativeMethod methods[] = { |
| 8490 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 8491 | {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, |
| 8492 | {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF }, |
| 8493 | {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II }, |
| 8494 | {"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, |
| 8495 | {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, |
| 8496 | {"glClear", "(I)V", (void *) android_glClear__I }, |
| 8497 | {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, |
| 8498 | {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII }, |
| 8499 | {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, |
| 8500 | {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I }, |
| 8501 | {"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, |
| 8502 | {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I }, |
| 8503 | {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF }, |
| 8504 | {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII }, |
| 8505 | {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, |
| 8506 | {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8507 | {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, |
| 8508 | {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8509 | {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, |
| 8510 | {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, |
| 8511 | {"glCullFace", "(I)V", (void *) android_glCullFace__I }, |
| 8512 | {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, |
| 8513 | {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, |
| 8514 | {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, |
| 8515 | {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, |
| 8516 | {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, |
| 8517 | {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II }, |
| 8518 | {"glDisable", "(I)V", (void *) android_glDisable__I }, |
| 8519 | {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I }, |
| 8520 | {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, |
| 8521 | {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, |
| 8522 | {"glEnable", "(I)V", (void *) android_glEnable__I }, |
| 8523 | {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I }, |
| 8524 | {"glFinish", "()V", (void *) android_glFinish__ }, |
| 8525 | {"glFlush", "()V", (void *) android_glFlush__ }, |
| 8526 | {"glFogf", "(IF)V", (void *) android_glFogf__IF }, |
| 8527 | {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI }, |
| 8528 | {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 }, |
| 8529 | {"glFogx", "(II)V", (void *) android_glFogx__II }, |
| 8530 | {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II }, |
| 8531 | {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 }, |
| 8532 | {"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, |
| 8533 | {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF }, |
| 8534 | {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII }, |
| 8535 | {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, |
| 8536 | {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, |
| 8537 | {"glGetError", "()I", (void *) android_glGetError__ }, |
| 8538 | {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, |
| 8539 | {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, |
| 8540 | {"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, |
| 8541 | {"glHint", "(II)V", (void *) android_glHint__II }, |
| 8542 | {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF }, |
| 8543 | {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI }, |
| 8544 | {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 }, |
| 8545 | {"glLightModelx", "(II)V", (void *) android_glLightModelx__II }, |
| 8546 | {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II }, |
| 8547 | {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 }, |
| 8548 | {"glLightf", "(IIF)V", (void *) android_glLightf__IIF }, |
| 8549 | {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI }, |
| 8550 | {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 }, |
| 8551 | {"glLightx", "(III)V", (void *) android_glLightx__III }, |
| 8552 | {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II }, |
| 8553 | {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 }, |
| 8554 | {"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, |
| 8555 | {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I }, |
| 8556 | {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ }, |
| 8557 | {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI }, |
| 8558 | {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 8559 | {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II }, |
| 8560 | {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 }, |
| 8561 | {"glLogicOp", "(I)V", (void *) android_glLogicOp__I }, |
| 8562 | {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF }, |
| 8563 | {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI }, |
| 8564 | {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 8565 | {"glMaterialx", "(III)V", (void *) android_glMaterialx__III }, |
| 8566 | {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II }, |
| 8567 | {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 8568 | {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I }, |
| 8569 | {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI }, |
| 8570 | {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 8571 | {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II }, |
| 8572 | {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 }, |
| 8573 | {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF }, |
| 8574 | {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII }, |
| 8575 | {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF }, |
| 8576 | {"glNormal3x", "(III)V", (void *) android_glNormal3x__III }, |
| 8577 | {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I }, |
| 8578 | {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF }, |
| 8579 | {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII }, |
| 8580 | {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, |
| 8581 | {"glPointSize", "(F)V", (void *) android_glPointSize__F }, |
| 8582 | {"glPointSizex", "(I)V", (void *) android_glPointSizex__I }, |
| 8583 | {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, |
| 8584 | {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II }, |
| 8585 | {"glPopMatrix", "()V", (void *) android_glPopMatrix__ }, |
| 8586 | {"glPushMatrix", "()V", (void *) android_glPushMatrix__ }, |
| 8587 | {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, |
| 8588 | {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF }, |
| 8589 | {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII }, |
| 8590 | {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, |
| 8591 | {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ }, |
| 8592 | {"glScalef", "(FFF)V", (void *) android_glScalef__FFF }, |
| 8593 | {"glScalex", "(III)V", (void *) android_glScalex__III }, |
| 8594 | {"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, |
| 8595 | {"glShadeModel", "(I)V", (void *) android_glShadeModel__I }, |
| 8596 | {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, |
| 8597 | {"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, |
| 8598 | {"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, |
| 8599 | {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8600 | {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF }, |
| 8601 | {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI }, |
| 8602 | {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 }, |
| 8603 | {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III }, |
| 8604 | {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II }, |
| 8605 | {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 8606 | {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8607 | {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, |
| 8608 | {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III }, |
| 8609 | {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8610 | {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF }, |
| 8611 | {"glTranslatex", "(III)V", (void *) android_glTranslatex__III }, |
| 8612 | {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8613 | {"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, |
| 8614 | {"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II }, |
| 8615 | {"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 8616 | {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, |
| 8617 | {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, |
| 8618 | {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, |
| 8619 | {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, |
| 8620 | {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 8621 | {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, |
| 8622 | {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 8623 | {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, |
| 8624 | {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, |
| 8625 | {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, |
| 8626 | {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, |
| 8627 | {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, |
| 8628 | {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, |
| 8629 | {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, |
| 8630 | {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, |
| 8631 | {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, |
| 8632 | {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, |
| 8633 | {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8634 | {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, |
| 8635 | {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 8636 | {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, |
| 8637 | {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 8638 | {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, |
| 8639 | {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, |
| 8640 | {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, |
| 8641 | {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, |
| 8642 | {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, |
| 8643 | {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, |
| 8644 | {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, |
| 8645 | {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, |
| 8646 | {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, |
| 8647 | {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 8648 | {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, |
| 8649 | {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 8650 | {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, |
| 8651 | {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 8652 | {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, |
| 8653 | {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 8654 | {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, |
| 8655 | {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 8656 | {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, |
| 8657 | {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8658 | {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, |
| 8659 | {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 8660 | {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, |
| 8661 | {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, |
| 8662 | {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, |
| 8663 | {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, |
| 8664 | {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, |
| 8665 | {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, |
| 8666 | {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, |
| 8667 | {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, |
| 8668 | {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, |
| 8669 | {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8670 | {"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8671 | {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, |
| 8672 | {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, |
| 8673 | {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, |
| 8674 | {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 8675 | {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, |
| 8676 | {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 8677 | {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, |
| 8678 | {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, |
| 8679 | {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8680 | {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, |
| 8681 | {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 8682 | {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, |
| 8683 | {"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I }, |
| 8684 | {"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF }, |
| 8685 | {"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI }, |
| 8686 | {"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 }, |
| 8687 | {"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII }, |
| 8688 | {"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II }, |
| 8689 | {"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 }, |
| 8690 | {"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS }, |
| 8691 | {"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI }, |
| 8692 | {"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 }, |
| 8693 | {"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII }, |
| 8694 | {"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II }, |
| 8695 | {"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 }, |
| 8696 | {"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8697 | {"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8698 | {"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8699 | {"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8700 | {"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII }, |
| 8701 | {"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II }, |
| 8702 | {"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II }, |
| 8703 | {"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, |
| 8704 | {"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, |
| 8705 | {"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, |
| 8706 | {"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I }, |
| 8707 | {"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II }, |
| 8708 | {"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8709 | {"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II }, |
| 8710 | {"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8711 | {"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII }, |
| 8712 | {"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII }, |
| 8713 | {"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I }, |
| 8714 | {"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II }, |
| 8715 | {"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8716 | {"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II }, |
| 8717 | {"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8718 | {"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II }, |
| 8719 | {"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 }, |
| 8720 | {"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II }, |
| 8721 | {"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 }, |
| 8722 | {"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI }, |
| 8723 | {"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 8724 | {"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II }, |
| 8725 | {"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 8726 | {"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II }, |
| 8727 | {"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 8728 | {"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I }, |
| 8729 | {"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I }, |
| 8730 | {"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII }, |
| 8731 | {"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF }, |
| 8732 | {"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI }, |
| 8733 | {"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 8734 | {"glTexGeni", "(III)V", (void *) android_glTexGeni__III }, |
| 8735 | {"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II }, |
| 8736 | {"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 8737 | {"glTexGenx", "(III)V", (void *) android_glTexGenx__III }, |
| 8738 | {"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II }, |
| 8739 | {"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 8740 | }; |
| 8741 | |
| 8742 | int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env) |
| 8743 | { |
| 8744 | int err; |
| 8745 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 8746 | return err; |
| 8747 | } |