Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2009, 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 |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +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 |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +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 |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +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" |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 22 | #include <android_runtime/AndroidRuntime.h> |
| 23 | #include <utils/misc.h> |
| 24 | |
| 25 | #include <assert.h> |
| 26 | #include <GLES2/gl2.h> |
| 27 | #include <GLES2/gl2ext.h> |
| 28 | |
| 29 | static int initialized = 0; |
| 30 | |
| 31 | static jclass nioAccessClass; |
| 32 | static jclass bufferClass; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 33 | static jmethodID getBasePointerID; |
| 34 | static jmethodID getBaseArrayID; |
| 35 | static jmethodID getBaseArrayOffsetID; |
| 36 | static jfieldID positionID; |
| 37 | static jfieldID limitID; |
| 38 | static jfieldID elementSizeShiftID; |
| 39 | |
| 40 | /* Cache method IDs each time the class is loaded. */ |
| 41 | |
| 42 | static void |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 43 | nativeClassInit(JNIEnv *_env, jclass glImplClass) |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 44 | { |
| 45 | jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); |
| 46 | nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); |
| 47 | |
| 48 | jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); |
| 49 | bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); |
| 50 | |
| 51 | getBasePointerID = _env->GetStaticMethodID(nioAccessClass, |
| 52 | "getBasePointer", "(Ljava/nio/Buffer;)J"); |
| 53 | getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, |
| 54 | "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); |
| 55 | getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, |
| 56 | "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); |
| 57 | |
| 58 | positionID = _env->GetFieldID(bufferClass, "position", "I"); |
| 59 | limitID = _env->GetFieldID(bufferClass, "limit", "I"); |
| 60 | elementSizeShiftID = |
| 61 | _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); |
| 62 | } |
| 63 | |
| 64 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 65 | static void * |
| 66 | getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) |
| 67 | { |
| 68 | jint position; |
| 69 | jint limit; |
| 70 | jint elementSizeShift; |
| 71 | jlong pointer; |
| 72 | jint offset; |
| 73 | void *data; |
| 74 | |
| 75 | position = _env->GetIntField(buffer, positionID); |
| 76 | limit = _env->GetIntField(buffer, limitID); |
| 77 | elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 78 | *remaining = (limit - position) << elementSizeShift; |
| 79 | pointer = _env->CallStaticLongMethod(nioAccessClass, |
| 80 | getBasePointerID, buffer); |
| 81 | if (pointer != 0L) { |
| 82 | *array = NULL; |
| 83 | return (void *) (jint) pointer; |
| 84 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 85 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 86 | *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, |
| 87 | getBaseArrayID, buffer); |
| 88 | offset = _env->CallStaticIntMethod(nioAccessClass, |
| 89 | getBaseArrayOffsetID, buffer); |
| 90 | data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 91 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 92 | return (void *) ((char *) data + offset); |
| 93 | } |
| 94 | |
| 95 | |
| 96 | static void |
| 97 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 98 | { |
| 99 | _env->ReleasePrimitiveArrayCritical(array, data, |
| 100 | commit ? 0 : JNI_ABORT); |
| 101 | } |
| 102 | |
| 103 | static void * |
| 104 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
| 105 | char* buf = (char*) _env->GetDirectBufferAddress(buffer); |
| 106 | if (buf) { |
| 107 | jint position = _env->GetIntField(buffer, positionID); |
| 108 | jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 109 | buf += position << elementSizeShift; |
| 110 | } else { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 111 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 112 | "Must use a native order direct Buffer"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 113 | } |
| 114 | return (void*) buf; |
| 115 | } |
| 116 | |
| 117 | static int |
| 118 | getNumCompressedTextureFormats() { |
| 119 | int numCompressedTextureFormats = 0; |
| 120 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); |
| 121 | return numCompressedTextureFormats; |
| 122 | } |
| 123 | |
| 124 | static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, |
| 125 | GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) { |
| 126 | glVertexAttribPointer(indx, size, type, normalized, stride, pointer); |
| 127 | } |
| 128 | |
| 129 | // -------------------------------------------------------------------------- |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 130 | /* void glActiveTexture ( GLenum texture ) */ |
| 131 | static void |
| 132 | android_glActiveTexture__I |
| 133 | (JNIEnv *_env, jobject _this, jint texture) { |
| 134 | glActiveTexture( |
| 135 | (GLenum)texture |
| 136 | ); |
| 137 | } |
| 138 | |
| 139 | /* void glAttachShader ( GLuint program, GLuint shader ) */ |
| 140 | static void |
| 141 | android_glAttachShader__II |
| 142 | (JNIEnv *_env, jobject _this, jint program, jint shader) { |
| 143 | glAttachShader( |
| 144 | (GLuint)program, |
| 145 | (GLuint)shader |
| 146 | ); |
| 147 | } |
| 148 | |
| 149 | /* void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) */ |
| 150 | static void |
| 151 | android_glBindAttribLocation__IILjava_lang_String_2 |
| 152 | (JNIEnv *_env, jobject _this, jint program, jint index, jstring name) { |
| 153 | const char* _nativename = 0; |
| 154 | |
| 155 | if (!name) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 156 | jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 157 | goto exit; |
| 158 | } |
| 159 | _nativename = _env->GetStringUTFChars(name, 0); |
| 160 | |
| 161 | glBindAttribLocation( |
| 162 | (GLuint)program, |
| 163 | (GLuint)index, |
| 164 | (char *)_nativename |
| 165 | ); |
| 166 | |
| 167 | exit: |
| 168 | if (_nativename) { |
| 169 | _env->ReleaseStringUTFChars(name, _nativename); |
| 170 | } |
| 171 | |
| 172 | } |
| 173 | |
| 174 | /* void glBindBuffer ( GLenum target, GLuint buffer ) */ |
| 175 | static void |
| 176 | android_glBindBuffer__II |
| 177 | (JNIEnv *_env, jobject _this, jint target, jint buffer) { |
| 178 | glBindBuffer( |
| 179 | (GLenum)target, |
| 180 | (GLuint)buffer |
| 181 | ); |
| 182 | } |
| 183 | |
| 184 | /* void glBindFramebuffer ( GLenum target, GLuint framebuffer ) */ |
| 185 | static void |
| 186 | android_glBindFramebuffer__II |
| 187 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
| 188 | glBindFramebuffer( |
| 189 | (GLenum)target, |
| 190 | (GLuint)framebuffer |
| 191 | ); |
| 192 | } |
| 193 | |
| 194 | /* void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) */ |
| 195 | static void |
| 196 | android_glBindRenderbuffer__II |
| 197 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
| 198 | glBindRenderbuffer( |
| 199 | (GLenum)target, |
| 200 | (GLuint)renderbuffer |
| 201 | ); |
| 202 | } |
| 203 | |
| 204 | /* void glBindTexture ( GLenum target, GLuint texture ) */ |
| 205 | static void |
| 206 | android_glBindTexture__II |
| 207 | (JNIEnv *_env, jobject _this, jint target, jint texture) { |
| 208 | glBindTexture( |
| 209 | (GLenum)target, |
| 210 | (GLuint)texture |
| 211 | ); |
| 212 | } |
| 213 | |
| 214 | /* void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ |
| 215 | static void |
| 216 | android_glBlendColor__FFFF |
| 217 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 218 | glBlendColor( |
| 219 | (GLclampf)red, |
| 220 | (GLclampf)green, |
| 221 | (GLclampf)blue, |
| 222 | (GLclampf)alpha |
| 223 | ); |
| 224 | } |
| 225 | |
| 226 | /* void glBlendEquation ( GLenum mode ) */ |
| 227 | static void |
| 228 | android_glBlendEquation__I |
| 229 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 230 | glBlendEquation( |
| 231 | (GLenum)mode |
| 232 | ); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | /* void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) */ |
| 236 | static void |
| 237 | android_glBlendEquationSeparate__II |
| 238 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 239 | glBlendEquationSeparate( |
| 240 | (GLenum)modeRGB, |
| 241 | (GLenum)modeAlpha |
| 242 | ); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ |
| 246 | static void |
| 247 | android_glBlendFunc__II |
| 248 | (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { |
| 249 | glBlendFunc( |
| 250 | (GLenum)sfactor, |
| 251 | (GLenum)dfactor |
| 252 | ); |
| 253 | } |
| 254 | |
| 255 | /* void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */ |
| 256 | static void |
| 257 | android_glBlendFuncSeparate__IIII |
| 258 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 259 | glBlendFuncSeparate( |
| 260 | (GLenum)srcRGB, |
| 261 | (GLenum)dstRGB, |
| 262 | (GLenum)srcAlpha, |
| 263 | (GLenum)dstAlpha |
| 264 | ); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ |
| 268 | static void |
| 269 | android_glBufferData__IILjava_nio_Buffer_2I |
| 270 | (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { |
| 271 | jarray _array = (jarray) 0; |
| 272 | jint _remaining; |
| 273 | GLvoid *data = (GLvoid *) 0; |
| 274 | |
| 275 | if (data_buf) { |
| 276 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); |
| 277 | if (_remaining < size) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 278 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 279 | goto exit; |
| 280 | } |
| 281 | } |
| 282 | glBufferData( |
| 283 | (GLenum)target, |
| 284 | (GLsizeiptr)size, |
| 285 | (GLvoid *)data, |
| 286 | (GLenum)usage |
| 287 | ); |
| 288 | |
| 289 | exit: |
| 290 | if (_array) { |
| 291 | releasePointer(_env, _array, data, JNI_FALSE); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ |
| 296 | static void |
| 297 | android_glBufferSubData__IIILjava_nio_Buffer_2 |
| 298 | (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { |
| 299 | jarray _array = (jarray) 0; |
| 300 | jint _remaining; |
| 301 | GLvoid *data = (GLvoid *) 0; |
| 302 | |
| 303 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); |
| 304 | if (_remaining < size) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 305 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < size"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 306 | goto exit; |
| 307 | } |
| 308 | glBufferSubData( |
| 309 | (GLenum)target, |
| 310 | (GLintptr)offset, |
| 311 | (GLsizeiptr)size, |
| 312 | (GLvoid *)data |
| 313 | ); |
| 314 | |
| 315 | exit: |
| 316 | if (_array) { |
| 317 | releasePointer(_env, _array, data, JNI_FALSE); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | /* GLenum glCheckFramebufferStatus ( GLenum target ) */ |
| 322 | static jint |
| 323 | android_glCheckFramebufferStatus__I |
| 324 | (JNIEnv *_env, jobject _this, jint target) { |
| 325 | GLenum _returnValue; |
| 326 | _returnValue = glCheckFramebufferStatus( |
| 327 | (GLenum)target |
| 328 | ); |
| 329 | return _returnValue; |
| 330 | } |
| 331 | |
| 332 | /* void glClear ( GLbitfield mask ) */ |
| 333 | static void |
| 334 | android_glClear__I |
| 335 | (JNIEnv *_env, jobject _this, jint mask) { |
| 336 | glClear( |
| 337 | (GLbitfield)mask |
| 338 | ); |
| 339 | } |
| 340 | |
| 341 | /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ |
| 342 | static void |
| 343 | android_glClearColor__FFFF |
| 344 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 345 | glClearColor( |
| 346 | (GLclampf)red, |
| 347 | (GLclampf)green, |
| 348 | (GLclampf)blue, |
| 349 | (GLclampf)alpha |
| 350 | ); |
| 351 | } |
| 352 | |
| 353 | /* void glClearDepthf ( GLclampf depth ) */ |
| 354 | static void |
| 355 | android_glClearDepthf__F |
| 356 | (JNIEnv *_env, jobject _this, jfloat depth) { |
| 357 | glClearDepthf( |
| 358 | (GLclampf)depth |
| 359 | ); |
| 360 | } |
| 361 | |
| 362 | /* void glClearStencil ( GLint s ) */ |
| 363 | static void |
| 364 | android_glClearStencil__I |
| 365 | (JNIEnv *_env, jobject _this, jint s) { |
| 366 | glClearStencil( |
| 367 | (GLint)s |
| 368 | ); |
| 369 | } |
| 370 | |
| 371 | /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ |
| 372 | static void |
| 373 | android_glColorMask__ZZZZ |
| 374 | (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { |
| 375 | glColorMask( |
| 376 | (GLboolean)red, |
| 377 | (GLboolean)green, |
| 378 | (GLboolean)blue, |
| 379 | (GLboolean)alpha |
| 380 | ); |
| 381 | } |
| 382 | |
| 383 | /* void glCompileShader ( GLuint shader ) */ |
| 384 | static void |
| 385 | android_glCompileShader__I |
| 386 | (JNIEnv *_env, jobject _this, jint shader) { |
| 387 | glCompileShader( |
| 388 | (GLuint)shader |
| 389 | ); |
| 390 | } |
| 391 | |
| 392 | /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 393 | static void |
| 394 | android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 |
| 395 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { |
| 396 | jarray _array = (jarray) 0; |
| 397 | jint _remaining; |
| 398 | GLvoid *data = (GLvoid *) 0; |
| 399 | |
| 400 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); |
| 401 | glCompressedTexImage2D( |
| 402 | (GLenum)target, |
| 403 | (GLint)level, |
| 404 | (GLenum)internalformat, |
| 405 | (GLsizei)width, |
| 406 | (GLsizei)height, |
| 407 | (GLint)border, |
| 408 | (GLsizei)imageSize, |
| 409 | (GLvoid *)data |
| 410 | ); |
| 411 | if (_array) { |
| 412 | releasePointer(_env, _array, data, JNI_FALSE); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 417 | static void |
| 418 | android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 419 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { |
| 420 | jarray _array = (jarray) 0; |
| 421 | jint _remaining; |
| 422 | GLvoid *data = (GLvoid *) 0; |
| 423 | |
| 424 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); |
| 425 | glCompressedTexSubImage2D( |
| 426 | (GLenum)target, |
| 427 | (GLint)level, |
| 428 | (GLint)xoffset, |
| 429 | (GLint)yoffset, |
| 430 | (GLsizei)width, |
| 431 | (GLsizei)height, |
| 432 | (GLenum)format, |
| 433 | (GLsizei)imageSize, |
| 434 | (GLvoid *)data |
| 435 | ); |
| 436 | if (_array) { |
| 437 | releasePointer(_env, _array, data, JNI_FALSE); |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ |
| 442 | static void |
| 443 | android_glCopyTexImage2D__IIIIIIII |
| 444 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { |
| 445 | glCopyTexImage2D( |
| 446 | (GLenum)target, |
| 447 | (GLint)level, |
| 448 | (GLenum)internalformat, |
| 449 | (GLint)x, |
| 450 | (GLint)y, |
| 451 | (GLsizei)width, |
| 452 | (GLsizei)height, |
| 453 | (GLint)border |
| 454 | ); |
| 455 | } |
| 456 | |
| 457 | /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 458 | static void |
| 459 | android_glCopyTexSubImage2D__IIIIIIII |
| 460 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { |
| 461 | glCopyTexSubImage2D( |
| 462 | (GLenum)target, |
| 463 | (GLint)level, |
| 464 | (GLint)xoffset, |
| 465 | (GLint)yoffset, |
| 466 | (GLint)x, |
| 467 | (GLint)y, |
| 468 | (GLsizei)width, |
| 469 | (GLsizei)height |
| 470 | ); |
| 471 | } |
| 472 | |
| 473 | /* GLuint glCreateProgram ( void ) */ |
| 474 | static jint |
| 475 | android_glCreateProgram__ |
| 476 | (JNIEnv *_env, jobject _this) { |
| 477 | GLuint _returnValue; |
| 478 | _returnValue = glCreateProgram(); |
| 479 | return _returnValue; |
| 480 | } |
| 481 | |
| 482 | /* GLuint glCreateShader ( GLenum type ) */ |
| 483 | static jint |
| 484 | android_glCreateShader__I |
| 485 | (JNIEnv *_env, jobject _this, jint type) { |
| 486 | GLuint _returnValue; |
| 487 | _returnValue = glCreateShader( |
| 488 | (GLenum)type |
| 489 | ); |
| 490 | return _returnValue; |
| 491 | } |
| 492 | |
| 493 | /* void glCullFace ( GLenum mode ) */ |
| 494 | static void |
| 495 | android_glCullFace__I |
| 496 | (JNIEnv *_env, jobject _this, jint mode) { |
| 497 | glCullFace( |
| 498 | (GLenum)mode |
| 499 | ); |
| 500 | } |
| 501 | |
| 502 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 503 | static void |
| 504 | android_glDeleteBuffers__I_3II |
| 505 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 506 | GLuint *buffers_base = (GLuint *) 0; |
| 507 | jint _remaining; |
| 508 | GLuint *buffers = (GLuint *) 0; |
| 509 | |
| 510 | if (!buffers_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 511 | jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 512 | goto exit; |
| 513 | } |
| 514 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 515 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 516 | goto exit; |
| 517 | } |
| 518 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 519 | if (_remaining < n) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 520 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 521 | goto exit; |
| 522 | } |
| 523 | buffers_base = (GLuint *) |
| 524 | _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); |
| 525 | buffers = buffers_base + offset; |
| 526 | |
| 527 | glDeleteBuffers( |
| 528 | (GLsizei)n, |
| 529 | (GLuint *)buffers |
| 530 | ); |
| 531 | |
| 532 | exit: |
| 533 | if (buffers_base) { |
| 534 | _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, |
| 535 | JNI_ABORT); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 540 | static void |
| 541 | android_glDeleteBuffers__ILjava_nio_IntBuffer_2 |
| 542 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 543 | jarray _array = (jarray) 0; |
| 544 | jint _remaining; |
| 545 | GLuint *buffers = (GLuint *) 0; |
| 546 | |
| 547 | buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); |
| 548 | if (_remaining < n) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 549 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 550 | goto exit; |
| 551 | } |
| 552 | glDeleteBuffers( |
| 553 | (GLsizei)n, |
| 554 | (GLuint *)buffers |
| 555 | ); |
| 556 | |
| 557 | exit: |
| 558 | if (_array) { |
| 559 | releasePointer(_env, _array, buffers, JNI_FALSE); |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | /* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ |
| 564 | static void |
| 565 | android_glDeleteFramebuffers__I_3II |
| 566 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
| 567 | GLuint *framebuffers_base = (GLuint *) 0; |
| 568 | jint _remaining; |
| 569 | GLuint *framebuffers = (GLuint *) 0; |
| 570 | |
| 571 | if (!framebuffers_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 572 | jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 573 | goto exit; |
| 574 | } |
| 575 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 576 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 577 | goto exit; |
| 578 | } |
| 579 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 580 | framebuffers_base = (GLuint *) |
| 581 | _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0); |
| 582 | framebuffers = framebuffers_base + offset; |
| 583 | |
| 584 | glDeleteFramebuffers( |
| 585 | (GLsizei)n, |
| 586 | (GLuint *)framebuffers |
| 587 | ); |
| 588 | |
| 589 | exit: |
| 590 | if (framebuffers_base) { |
| 591 | _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base, |
| 592 | JNI_ABORT); |
| 593 | } |
| 594 | } |
| 595 | |
| 596 | /* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ |
| 597 | static void |
| 598 | android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 |
| 599 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
| 600 | jarray _array = (jarray) 0; |
| 601 | jint _remaining; |
| 602 | GLuint *framebuffers = (GLuint *) 0; |
| 603 | |
| 604 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); |
| 605 | glDeleteFramebuffers( |
| 606 | (GLsizei)n, |
| 607 | (GLuint *)framebuffers |
| 608 | ); |
| 609 | if (_array) { |
| 610 | releasePointer(_env, _array, framebuffers, JNI_FALSE); |
| 611 | } |
| 612 | } |
| 613 | |
| 614 | /* void glDeleteProgram ( GLuint program ) */ |
| 615 | static void |
| 616 | android_glDeleteProgram__I |
| 617 | (JNIEnv *_env, jobject _this, jint program) { |
| 618 | glDeleteProgram( |
| 619 | (GLuint)program |
| 620 | ); |
| 621 | } |
| 622 | |
| 623 | /* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ |
| 624 | static void |
| 625 | android_glDeleteRenderbuffers__I_3II |
| 626 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
| 627 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 628 | jint _remaining; |
| 629 | GLuint *renderbuffers = (GLuint *) 0; |
| 630 | |
| 631 | if (!renderbuffers_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 632 | jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 633 | goto exit; |
| 634 | } |
| 635 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 636 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 637 | goto exit; |
| 638 | } |
| 639 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 640 | renderbuffers_base = (GLuint *) |
| 641 | _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0); |
| 642 | renderbuffers = renderbuffers_base + offset; |
| 643 | |
| 644 | glDeleteRenderbuffers( |
| 645 | (GLsizei)n, |
| 646 | (GLuint *)renderbuffers |
| 647 | ); |
| 648 | |
| 649 | exit: |
| 650 | if (renderbuffers_base) { |
| 651 | _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base, |
| 652 | JNI_ABORT); |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | /* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ |
| 657 | static void |
| 658 | android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 |
| 659 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
| 660 | jarray _array = (jarray) 0; |
| 661 | jint _remaining; |
| 662 | GLuint *renderbuffers = (GLuint *) 0; |
| 663 | |
| 664 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); |
| 665 | glDeleteRenderbuffers( |
| 666 | (GLsizei)n, |
| 667 | (GLuint *)renderbuffers |
| 668 | ); |
| 669 | if (_array) { |
| 670 | releasePointer(_env, _array, renderbuffers, JNI_FALSE); |
| 671 | } |
| 672 | } |
| 673 | |
| 674 | /* void glDeleteShader ( GLuint shader ) */ |
| 675 | static void |
| 676 | android_glDeleteShader__I |
| 677 | (JNIEnv *_env, jobject _this, jint shader) { |
| 678 | glDeleteShader( |
| 679 | (GLuint)shader |
| 680 | ); |
| 681 | } |
| 682 | |
| 683 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 684 | static void |
| 685 | android_glDeleteTextures__I_3II |
| 686 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 687 | GLuint *textures_base = (GLuint *) 0; |
| 688 | jint _remaining; |
| 689 | GLuint *textures = (GLuint *) 0; |
| 690 | |
| 691 | if (!textures_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 692 | jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 693 | goto exit; |
| 694 | } |
| 695 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 696 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 697 | goto exit; |
| 698 | } |
| 699 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 700 | if (_remaining < n) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 701 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 702 | goto exit; |
| 703 | } |
| 704 | textures_base = (GLuint *) |
| 705 | _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0); |
| 706 | textures = textures_base + offset; |
| 707 | |
| 708 | glDeleteTextures( |
| 709 | (GLsizei)n, |
| 710 | (GLuint *)textures |
| 711 | ); |
| 712 | |
| 713 | exit: |
| 714 | if (textures_base) { |
| 715 | _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base, |
| 716 | JNI_ABORT); |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 721 | static void |
| 722 | android_glDeleteTextures__ILjava_nio_IntBuffer_2 |
| 723 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 724 | jarray _array = (jarray) 0; |
| 725 | jint _remaining; |
| 726 | GLuint *textures = (GLuint *) 0; |
| 727 | |
| 728 | textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); |
| 729 | if (_remaining < n) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 730 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 731 | goto exit; |
| 732 | } |
| 733 | glDeleteTextures( |
| 734 | (GLsizei)n, |
| 735 | (GLuint *)textures |
| 736 | ); |
| 737 | |
| 738 | exit: |
| 739 | if (_array) { |
| 740 | releasePointer(_env, _array, textures, JNI_FALSE); |
| 741 | } |
| 742 | } |
| 743 | |
| 744 | /* void glDepthFunc ( GLenum func ) */ |
| 745 | static void |
| 746 | android_glDepthFunc__I |
| 747 | (JNIEnv *_env, jobject _this, jint func) { |
| 748 | glDepthFunc( |
| 749 | (GLenum)func |
| 750 | ); |
| 751 | } |
| 752 | |
| 753 | /* void glDepthMask ( GLboolean flag ) */ |
| 754 | static void |
| 755 | android_glDepthMask__Z |
| 756 | (JNIEnv *_env, jobject _this, jboolean flag) { |
| 757 | glDepthMask( |
| 758 | (GLboolean)flag |
| 759 | ); |
| 760 | } |
| 761 | |
| 762 | /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ |
| 763 | static void |
| 764 | android_glDepthRangef__FF |
| 765 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
| 766 | glDepthRangef( |
| 767 | (GLclampf)zNear, |
| 768 | (GLclampf)zFar |
| 769 | ); |
| 770 | } |
| 771 | |
| 772 | /* void glDetachShader ( GLuint program, GLuint shader ) */ |
| 773 | static void |
| 774 | android_glDetachShader__II |
| 775 | (JNIEnv *_env, jobject _this, jint program, jint shader) { |
| 776 | glDetachShader( |
| 777 | (GLuint)program, |
| 778 | (GLuint)shader |
| 779 | ); |
| 780 | } |
| 781 | |
| 782 | /* void glDisable ( GLenum cap ) */ |
| 783 | static void |
| 784 | android_glDisable__I |
| 785 | (JNIEnv *_env, jobject _this, jint cap) { |
| 786 | glDisable( |
| 787 | (GLenum)cap |
| 788 | ); |
| 789 | } |
| 790 | |
| 791 | /* void glDisableVertexAttribArray ( GLuint index ) */ |
| 792 | static void |
| 793 | android_glDisableVertexAttribArray__I |
| 794 | (JNIEnv *_env, jobject _this, jint index) { |
| 795 | glDisableVertexAttribArray( |
| 796 | (GLuint)index |
| 797 | ); |
| 798 | } |
| 799 | |
| 800 | /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ |
| 801 | static void |
| 802 | android_glDrawArrays__III |
| 803 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { |
| 804 | glDrawArrays( |
| 805 | (GLenum)mode, |
| 806 | (GLint)first, |
| 807 | (GLsizei)count |
| 808 | ); |
| 809 | } |
| 810 | |
Jack Palevich | 224107a | 2010-06-22 20:08:40 +0800 | [diff] [blame] | 811 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ |
| 812 | static void |
| 813 | android_glDrawElements__IIII |
| 814 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { |
| 815 | glDrawElements( |
| 816 | (GLenum)mode, |
| 817 | (GLsizei)count, |
| 818 | (GLenum)type, |
| 819 | (const GLvoid *)offset |
| 820 | ); |
| 821 | } |
| 822 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 823 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 824 | static void |
| 825 | android_glDrawElements__IIILjava_nio_Buffer_2 |
| 826 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) { |
| 827 | jarray _array = (jarray) 0; |
| 828 | jint _remaining; |
| 829 | GLvoid *indices = (GLvoid *) 0; |
| 830 | |
| 831 | indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining); |
| 832 | if (_remaining < count) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 833 | jniThrowException(_env, "java/lang/ArrayIndexOutOfBoundsException", "remaining() < count"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 834 | goto exit; |
| 835 | } |
| 836 | glDrawElements( |
| 837 | (GLenum)mode, |
| 838 | (GLsizei)count, |
| 839 | (GLenum)type, |
| 840 | (GLvoid *)indices |
| 841 | ); |
| 842 | |
| 843 | exit: |
| 844 | if (_array) { |
| 845 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 846 | } |
| 847 | } |
| 848 | |
| 849 | /* void glEnable ( GLenum cap ) */ |
| 850 | static void |
| 851 | android_glEnable__I |
| 852 | (JNIEnv *_env, jobject _this, jint cap) { |
| 853 | glEnable( |
| 854 | (GLenum)cap |
| 855 | ); |
| 856 | } |
| 857 | |
| 858 | /* void glEnableVertexAttribArray ( GLuint index ) */ |
| 859 | static void |
| 860 | android_glEnableVertexAttribArray__I |
| 861 | (JNIEnv *_env, jobject _this, jint index) { |
| 862 | glEnableVertexAttribArray( |
| 863 | (GLuint)index |
| 864 | ); |
| 865 | } |
| 866 | |
| 867 | /* void glFinish ( void ) */ |
| 868 | static void |
| 869 | android_glFinish__ |
| 870 | (JNIEnv *_env, jobject _this) { |
| 871 | glFinish(); |
| 872 | } |
| 873 | |
| 874 | /* void glFlush ( void ) */ |
| 875 | static void |
| 876 | android_glFlush__ |
| 877 | (JNIEnv *_env, jobject _this) { |
| 878 | glFlush(); |
| 879 | } |
| 880 | |
| 881 | /* void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) */ |
| 882 | static void |
| 883 | android_glFramebufferRenderbuffer__IIII |
| 884 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
| 885 | glFramebufferRenderbuffer( |
| 886 | (GLenum)target, |
| 887 | (GLenum)attachment, |
| 888 | (GLenum)renderbuffertarget, |
| 889 | (GLuint)renderbuffer |
| 890 | ); |
| 891 | } |
| 892 | |
| 893 | /* void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) */ |
| 894 | static void |
| 895 | android_glFramebufferTexture2D__IIIII |
| 896 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { |
| 897 | glFramebufferTexture2D( |
| 898 | (GLenum)target, |
| 899 | (GLenum)attachment, |
| 900 | (GLenum)textarget, |
| 901 | (GLuint)texture, |
| 902 | (GLint)level |
| 903 | ); |
| 904 | } |
| 905 | |
| 906 | /* void glFrontFace ( GLenum mode ) */ |
| 907 | static void |
| 908 | android_glFrontFace__I |
| 909 | (JNIEnv *_env, jobject _this, jint mode) { |
| 910 | glFrontFace( |
| 911 | (GLenum)mode |
| 912 | ); |
| 913 | } |
| 914 | |
| 915 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 916 | static void |
| 917 | android_glGenBuffers__I_3II |
| 918 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 919 | jint _exception = 0; |
| 920 | GLuint *buffers_base = (GLuint *) 0; |
| 921 | jint _remaining; |
| 922 | GLuint *buffers = (GLuint *) 0; |
| 923 | |
| 924 | if (!buffers_ref) { |
| 925 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 926 | jniThrowException(_env, "java/lang/IllegalArgumentException", "buffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 927 | goto exit; |
| 928 | } |
| 929 | if (offset < 0) { |
| 930 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 931 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 932 | goto exit; |
| 933 | } |
| 934 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 935 | if (_remaining < n) { |
| 936 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 937 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 938 | goto exit; |
| 939 | } |
| 940 | buffers_base = (GLuint *) |
| 941 | _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); |
| 942 | buffers = buffers_base + offset; |
| 943 | |
| 944 | glGenBuffers( |
| 945 | (GLsizei)n, |
| 946 | (GLuint *)buffers |
| 947 | ); |
| 948 | |
| 949 | exit: |
| 950 | if (buffers_base) { |
| 951 | _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, |
| 952 | _exception ? JNI_ABORT: 0); |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 957 | static void |
| 958 | android_glGenBuffers__ILjava_nio_IntBuffer_2 |
| 959 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 960 | jint _exception = 0; |
| 961 | jarray _array = (jarray) 0; |
| 962 | jint _remaining; |
| 963 | GLuint *buffers = (GLuint *) 0; |
| 964 | |
| 965 | buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); |
| 966 | if (_remaining < n) { |
| 967 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 968 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 969 | goto exit; |
| 970 | } |
| 971 | glGenBuffers( |
| 972 | (GLsizei)n, |
| 973 | (GLuint *)buffers |
| 974 | ); |
| 975 | |
| 976 | exit: |
| 977 | if (_array) { |
| 978 | releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | /* void glGenerateMipmap ( GLenum target ) */ |
| 983 | static void |
| 984 | android_glGenerateMipmap__I |
| 985 | (JNIEnv *_env, jobject _this, jint target) { |
| 986 | glGenerateMipmap( |
| 987 | (GLenum)target |
| 988 | ); |
| 989 | } |
| 990 | |
| 991 | /* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ |
| 992 | static void |
| 993 | android_glGenFramebuffers__I_3II |
| 994 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
| 995 | jint _exception = 0; |
| 996 | GLuint *framebuffers_base = (GLuint *) 0; |
| 997 | jint _remaining; |
| 998 | GLuint *framebuffers = (GLuint *) 0; |
| 999 | |
| 1000 | if (!framebuffers_ref) { |
| 1001 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1002 | jniThrowException(_env, "java/lang/IllegalArgumentException", "framebuffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1003 | goto exit; |
| 1004 | } |
| 1005 | if (offset < 0) { |
| 1006 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1007 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1008 | goto exit; |
| 1009 | } |
| 1010 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 1011 | framebuffers_base = (GLuint *) |
| 1012 | _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0); |
| 1013 | framebuffers = framebuffers_base + offset; |
| 1014 | |
| 1015 | glGenFramebuffers( |
| 1016 | (GLsizei)n, |
| 1017 | (GLuint *)framebuffers |
| 1018 | ); |
| 1019 | |
| 1020 | exit: |
| 1021 | if (framebuffers_base) { |
| 1022 | _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base, |
| 1023 | _exception ? JNI_ABORT: 0); |
| 1024 | } |
| 1025 | } |
| 1026 | |
| 1027 | /* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ |
| 1028 | static void |
| 1029 | android_glGenFramebuffers__ILjava_nio_IntBuffer_2 |
| 1030 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
| 1031 | jint _exception = 0; |
| 1032 | jarray _array = (jarray) 0; |
| 1033 | jint _remaining; |
| 1034 | GLuint *framebuffers = (GLuint *) 0; |
| 1035 | |
| 1036 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining); |
| 1037 | glGenFramebuffers( |
| 1038 | (GLsizei)n, |
| 1039 | (GLuint *)framebuffers |
| 1040 | ); |
| 1041 | if (_array) { |
| 1042 | releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | /* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ |
| 1047 | static void |
| 1048 | android_glGenRenderbuffers__I_3II |
| 1049 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
| 1050 | jint _exception = 0; |
| 1051 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 1052 | jint _remaining; |
| 1053 | GLuint *renderbuffers = (GLuint *) 0; |
| 1054 | |
| 1055 | if (!renderbuffers_ref) { |
| 1056 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1057 | jniThrowException(_env, "java/lang/IllegalArgumentException", "renderbuffers == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1058 | goto exit; |
| 1059 | } |
| 1060 | if (offset < 0) { |
| 1061 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1062 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1063 | goto exit; |
| 1064 | } |
| 1065 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 1066 | renderbuffers_base = (GLuint *) |
| 1067 | _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0); |
| 1068 | renderbuffers = renderbuffers_base + offset; |
| 1069 | |
| 1070 | glGenRenderbuffers( |
| 1071 | (GLsizei)n, |
| 1072 | (GLuint *)renderbuffers |
| 1073 | ); |
| 1074 | |
| 1075 | exit: |
| 1076 | if (renderbuffers_base) { |
| 1077 | _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base, |
| 1078 | _exception ? JNI_ABORT: 0); |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | /* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ |
| 1083 | static void |
| 1084 | android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 |
| 1085 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
| 1086 | jint _exception = 0; |
| 1087 | jarray _array = (jarray) 0; |
| 1088 | jint _remaining; |
| 1089 | GLuint *renderbuffers = (GLuint *) 0; |
| 1090 | |
| 1091 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining); |
| 1092 | glGenRenderbuffers( |
| 1093 | (GLsizei)n, |
| 1094 | (GLuint *)renderbuffers |
| 1095 | ); |
| 1096 | if (_array) { |
| 1097 | releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE); |
| 1098 | } |
| 1099 | } |
| 1100 | |
| 1101 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1102 | static void |
| 1103 | android_glGenTextures__I_3II |
| 1104 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 1105 | jint _exception = 0; |
| 1106 | GLuint *textures_base = (GLuint *) 0; |
| 1107 | jint _remaining; |
| 1108 | GLuint *textures = (GLuint *) 0; |
| 1109 | |
| 1110 | if (!textures_ref) { |
| 1111 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1112 | jniThrowException(_env, "java/lang/IllegalArgumentException", "textures == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1113 | goto exit; |
| 1114 | } |
| 1115 | if (offset < 0) { |
| 1116 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1117 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1118 | goto exit; |
| 1119 | } |
| 1120 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 1121 | if (_remaining < n) { |
| 1122 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1123 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1124 | goto exit; |
| 1125 | } |
| 1126 | textures_base = (GLuint *) |
| 1127 | _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0); |
| 1128 | textures = textures_base + offset; |
| 1129 | |
| 1130 | glGenTextures( |
| 1131 | (GLsizei)n, |
| 1132 | (GLuint *)textures |
| 1133 | ); |
| 1134 | |
| 1135 | exit: |
| 1136 | if (textures_base) { |
| 1137 | _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base, |
| 1138 | _exception ? JNI_ABORT: 0); |
| 1139 | } |
| 1140 | } |
| 1141 | |
| 1142 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1143 | static void |
| 1144 | android_glGenTextures__ILjava_nio_IntBuffer_2 |
| 1145 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 1146 | jint _exception = 0; |
| 1147 | jarray _array = (jarray) 0; |
| 1148 | jint _remaining; |
| 1149 | GLuint *textures = (GLuint *) 0; |
| 1150 | |
| 1151 | textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining); |
| 1152 | if (_remaining < n) { |
| 1153 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1154 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < n"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1155 | goto exit; |
| 1156 | } |
| 1157 | glGenTextures( |
| 1158 | (GLsizei)n, |
| 1159 | (GLuint *)textures |
| 1160 | ); |
| 1161 | |
| 1162 | exit: |
| 1163 | if (_array) { |
| 1164 | releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE); |
| 1165 | } |
| 1166 | } |
| 1167 | |
| 1168 | /* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ |
| 1169 | static void |
| 1170 | android_glGetActiveAttrib__III_3II_3II_3II_3BI |
| 1171 | (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { |
| 1172 | jint _exception = 0; |
| 1173 | GLsizei *length_base = (GLsizei *) 0; |
| 1174 | jint _lengthRemaining; |
| 1175 | GLsizei *length = (GLsizei *) 0; |
| 1176 | GLint *size_base = (GLint *) 0; |
| 1177 | jint _sizeRemaining; |
| 1178 | GLint *size = (GLint *) 0; |
| 1179 | GLenum *type_base = (GLenum *) 0; |
| 1180 | jint _typeRemaining; |
| 1181 | GLenum *type = (GLenum *) 0; |
| 1182 | char *name_base = (char *) 0; |
| 1183 | jint _nameRemaining; |
| 1184 | char *name = (char *) 0; |
| 1185 | |
| 1186 | if (!length_ref) { |
| 1187 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1188 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1189 | goto exit; |
| 1190 | } |
| 1191 | if (lengthOffset < 0) { |
| 1192 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1193 | jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1194 | goto exit; |
| 1195 | } |
| 1196 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 1197 | length_base = (GLsizei *) |
| 1198 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 1199 | length = length_base + lengthOffset; |
| 1200 | |
| 1201 | if (!size_ref) { |
| 1202 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1203 | jniThrowException(_env, "java/lang/IllegalArgumentException", "size == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1204 | goto exit; |
| 1205 | } |
| 1206 | if (sizeOffset < 0) { |
| 1207 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1208 | jniThrowException(_env, "java/lang/IllegalArgumentException", "sizeOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1209 | goto exit; |
| 1210 | } |
| 1211 | _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; |
| 1212 | size_base = (GLint *) |
| 1213 | _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); |
| 1214 | size = size_base + sizeOffset; |
| 1215 | |
| 1216 | if (!type_ref) { |
| 1217 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1218 | jniThrowException(_env, "java/lang/IllegalArgumentException", "type == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1219 | goto exit; |
| 1220 | } |
| 1221 | if (typeOffset < 0) { |
| 1222 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1223 | jniThrowException(_env, "java/lang/IllegalArgumentException", "typeOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1224 | goto exit; |
| 1225 | } |
| 1226 | _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; |
| 1227 | type_base = (GLenum *) |
| 1228 | _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); |
| 1229 | type = type_base + typeOffset; |
| 1230 | |
| 1231 | if (!name_ref) { |
| 1232 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1233 | jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1234 | goto exit; |
| 1235 | } |
| 1236 | if (nameOffset < 0) { |
| 1237 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1238 | jniThrowException(_env, "java/lang/IllegalArgumentException", "nameOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1239 | goto exit; |
| 1240 | } |
| 1241 | _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; |
| 1242 | name_base = (char *) |
| 1243 | _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0); |
| 1244 | name = name_base + nameOffset; |
| 1245 | |
| 1246 | glGetActiveAttrib( |
| 1247 | (GLuint)program, |
| 1248 | (GLuint)index, |
| 1249 | (GLsizei)bufsize, |
| 1250 | (GLsizei *)length, |
| 1251 | (GLint *)size, |
| 1252 | (GLenum *)type, |
| 1253 | (char *)name |
| 1254 | ); |
| 1255 | |
| 1256 | exit: |
| 1257 | if (name_base) { |
| 1258 | _env->ReleasePrimitiveArrayCritical(name_ref, name_base, |
| 1259 | _exception ? JNI_ABORT: 0); |
| 1260 | } |
| 1261 | if (type_base) { |
| 1262 | _env->ReleasePrimitiveArrayCritical(type_ref, type_base, |
| 1263 | _exception ? JNI_ABORT: 0); |
| 1264 | } |
| 1265 | if (size_base) { |
| 1266 | _env->ReleasePrimitiveArrayCritical(size_ref, size_base, |
| 1267 | _exception ? JNI_ABORT: 0); |
| 1268 | } |
| 1269 | if (length_base) { |
| 1270 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 1271 | _exception ? JNI_ABORT: 0); |
| 1272 | } |
| 1273 | } |
| 1274 | |
| 1275 | /* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ |
| 1276 | static void |
| 1277 | android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B |
| 1278 | (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { |
| 1279 | jint _exception = 0; |
| 1280 | jarray _lengthArray = (jarray) 0; |
| 1281 | jarray _sizeArray = (jarray) 0; |
| 1282 | jarray _typeArray = (jarray) 0; |
| 1283 | jint _lengthRemaining; |
| 1284 | GLsizei *length = (GLsizei *) 0; |
| 1285 | jint _sizeRemaining; |
| 1286 | GLint *size = (GLint *) 0; |
| 1287 | jint _typeRemaining; |
| 1288 | GLenum *type = (GLenum *) 0; |
| 1289 | |
| 1290 | length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining); |
| 1291 | size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining); |
| 1292 | type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining); |
| 1293 | glGetActiveAttrib( |
| 1294 | (GLuint)program, |
| 1295 | (GLuint)index, |
| 1296 | (GLsizei)bufsize, |
| 1297 | (GLsizei *)length, |
| 1298 | (GLint *)size, |
| 1299 | (GLenum *)type, |
| 1300 | (char *)name |
| 1301 | ); |
| 1302 | if (_lengthArray) { |
| 1303 | releasePointer(_env, _lengthArray, type, _exception ? JNI_FALSE : JNI_TRUE); |
| 1304 | } |
| 1305 | if (_sizeArray) { |
| 1306 | releasePointer(_env, _sizeArray, size, _exception ? JNI_FALSE : JNI_TRUE); |
| 1307 | } |
| 1308 | if (_typeArray) { |
| 1309 | releasePointer(_env, _typeArray, length, _exception ? JNI_FALSE : JNI_TRUE); |
| 1310 | } |
| 1311 | } |
| 1312 | |
| 1313 | /* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ |
| 1314 | static void |
| 1315 | android_glGetActiveUniform__III_3II_3II_3II_3BI |
| 1316 | (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { |
| 1317 | jint _exception = 0; |
| 1318 | GLsizei *length_base = (GLsizei *) 0; |
| 1319 | jint _lengthRemaining; |
| 1320 | GLsizei *length = (GLsizei *) 0; |
| 1321 | GLint *size_base = (GLint *) 0; |
| 1322 | jint _sizeRemaining; |
| 1323 | GLint *size = (GLint *) 0; |
| 1324 | GLenum *type_base = (GLenum *) 0; |
| 1325 | jint _typeRemaining; |
| 1326 | GLenum *type = (GLenum *) 0; |
| 1327 | char *name_base = (char *) 0; |
| 1328 | jint _nameRemaining; |
| 1329 | char *name = (char *) 0; |
| 1330 | |
| 1331 | if (!length_ref) { |
| 1332 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1333 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1334 | goto exit; |
| 1335 | } |
| 1336 | if (lengthOffset < 0) { |
| 1337 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1338 | jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1339 | goto exit; |
| 1340 | } |
| 1341 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 1342 | length_base = (GLsizei *) |
| 1343 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 1344 | length = length_base + lengthOffset; |
| 1345 | |
| 1346 | if (!size_ref) { |
| 1347 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1348 | jniThrowException(_env, "java/lang/IllegalArgumentException", "size == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1349 | goto exit; |
| 1350 | } |
| 1351 | if (sizeOffset < 0) { |
| 1352 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1353 | jniThrowException(_env, "java/lang/IllegalArgumentException", "sizeOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1354 | goto exit; |
| 1355 | } |
| 1356 | _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; |
| 1357 | size_base = (GLint *) |
| 1358 | _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); |
| 1359 | size = size_base + sizeOffset; |
| 1360 | |
| 1361 | if (!type_ref) { |
| 1362 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1363 | jniThrowException(_env, "java/lang/IllegalArgumentException", "type == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1364 | goto exit; |
| 1365 | } |
| 1366 | if (typeOffset < 0) { |
| 1367 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1368 | jniThrowException(_env, "java/lang/IllegalArgumentException", "typeOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1369 | goto exit; |
| 1370 | } |
| 1371 | _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; |
| 1372 | type_base = (GLenum *) |
| 1373 | _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); |
| 1374 | type = type_base + typeOffset; |
| 1375 | |
| 1376 | if (!name_ref) { |
| 1377 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1378 | jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1379 | goto exit; |
| 1380 | } |
| 1381 | if (nameOffset < 0) { |
| 1382 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1383 | jniThrowException(_env, "java/lang/IllegalArgumentException", "nameOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1384 | goto exit; |
| 1385 | } |
| 1386 | _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; |
| 1387 | name_base = (char *) |
| 1388 | _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0); |
| 1389 | name = name_base + nameOffset; |
| 1390 | |
| 1391 | glGetActiveUniform( |
| 1392 | (GLuint)program, |
| 1393 | (GLuint)index, |
| 1394 | (GLsizei)bufsize, |
| 1395 | (GLsizei *)length, |
| 1396 | (GLint *)size, |
| 1397 | (GLenum *)type, |
| 1398 | (char *)name |
| 1399 | ); |
| 1400 | |
| 1401 | exit: |
| 1402 | if (name_base) { |
| 1403 | _env->ReleasePrimitiveArrayCritical(name_ref, name_base, |
| 1404 | _exception ? JNI_ABORT: 0); |
| 1405 | } |
| 1406 | if (type_base) { |
| 1407 | _env->ReleasePrimitiveArrayCritical(type_ref, type_base, |
| 1408 | _exception ? JNI_ABORT: 0); |
| 1409 | } |
| 1410 | if (size_base) { |
| 1411 | _env->ReleasePrimitiveArrayCritical(size_ref, size_base, |
| 1412 | _exception ? JNI_ABORT: 0); |
| 1413 | } |
| 1414 | if (length_base) { |
| 1415 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 1416 | _exception ? JNI_ABORT: 0); |
| 1417 | } |
| 1418 | } |
| 1419 | |
| 1420 | /* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ |
| 1421 | static void |
| 1422 | android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B |
| 1423 | (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { |
| 1424 | jint _exception = 0; |
| 1425 | jarray _lengthArray = (jarray) 0; |
| 1426 | jarray _sizeArray = (jarray) 0; |
| 1427 | jarray _typeArray = (jarray) 0; |
| 1428 | jint _lengthRemaining; |
| 1429 | GLsizei *length = (GLsizei *) 0; |
| 1430 | jint _sizeRemaining; |
| 1431 | GLint *size = (GLint *) 0; |
| 1432 | jint _typeRemaining; |
| 1433 | GLenum *type = (GLenum *) 0; |
| 1434 | |
| 1435 | length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining); |
| 1436 | size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining); |
| 1437 | type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining); |
| 1438 | glGetActiveUniform( |
| 1439 | (GLuint)program, |
| 1440 | (GLuint)index, |
| 1441 | (GLsizei)bufsize, |
| 1442 | (GLsizei *)length, |
| 1443 | (GLint *)size, |
| 1444 | (GLenum *)type, |
| 1445 | (char *)name |
| 1446 | ); |
| 1447 | if (_lengthArray) { |
| 1448 | releasePointer(_env, _lengthArray, type, _exception ? JNI_FALSE : JNI_TRUE); |
| 1449 | } |
| 1450 | if (_sizeArray) { |
| 1451 | releasePointer(_env, _sizeArray, size, _exception ? JNI_FALSE : JNI_TRUE); |
| 1452 | } |
| 1453 | if (_typeArray) { |
| 1454 | releasePointer(_env, _typeArray, length, _exception ? JNI_FALSE : JNI_TRUE); |
| 1455 | } |
| 1456 | } |
| 1457 | |
| 1458 | /* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ |
| 1459 | static void |
| 1460 | android_glGetAttachedShaders__II_3II_3II |
| 1461 | (JNIEnv *_env, jobject _this, jint program, jint maxcount, jintArray count_ref, jint countOffset, jintArray shaders_ref, jint shadersOffset) { |
| 1462 | jint _exception = 0; |
| 1463 | GLsizei *count_base = (GLsizei *) 0; |
| 1464 | jint _countRemaining; |
| 1465 | GLsizei *count = (GLsizei *) 0; |
| 1466 | GLuint *shaders_base = (GLuint *) 0; |
| 1467 | jint _shadersRemaining; |
| 1468 | GLuint *shaders = (GLuint *) 0; |
| 1469 | |
| 1470 | if (!count_ref) { |
| 1471 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1472 | jniThrowException(_env, "java/lang/IllegalArgumentException", "count == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1473 | goto exit; |
| 1474 | } |
| 1475 | if (countOffset < 0) { |
| 1476 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1477 | jniThrowException(_env, "java/lang/IllegalArgumentException", "countOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1478 | goto exit; |
| 1479 | } |
| 1480 | _countRemaining = _env->GetArrayLength(count_ref) - countOffset; |
| 1481 | count_base = (GLsizei *) |
| 1482 | _env->GetPrimitiveArrayCritical(count_ref, (jboolean *)0); |
| 1483 | count = count_base + countOffset; |
| 1484 | |
| 1485 | if (!shaders_ref) { |
| 1486 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1487 | jniThrowException(_env, "java/lang/IllegalArgumentException", "shaders == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1488 | goto exit; |
| 1489 | } |
| 1490 | if (shadersOffset < 0) { |
| 1491 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1492 | jniThrowException(_env, "java/lang/IllegalArgumentException", "shadersOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1493 | goto exit; |
| 1494 | } |
| 1495 | _shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset; |
| 1496 | shaders_base = (GLuint *) |
| 1497 | _env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0); |
| 1498 | shaders = shaders_base + shadersOffset; |
| 1499 | |
| 1500 | glGetAttachedShaders( |
| 1501 | (GLuint)program, |
| 1502 | (GLsizei)maxcount, |
| 1503 | (GLsizei *)count, |
| 1504 | (GLuint *)shaders |
| 1505 | ); |
| 1506 | |
| 1507 | exit: |
| 1508 | if (shaders_base) { |
| 1509 | _env->ReleasePrimitiveArrayCritical(shaders_ref, shaders_base, |
| 1510 | _exception ? JNI_ABORT: 0); |
| 1511 | } |
| 1512 | if (count_base) { |
| 1513 | _env->ReleasePrimitiveArrayCritical(count_ref, count_base, |
| 1514 | _exception ? JNI_ABORT: 0); |
| 1515 | } |
| 1516 | } |
| 1517 | |
| 1518 | /* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ |
| 1519 | static void |
| 1520 | android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 1521 | (JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) { |
| 1522 | jint _exception = 0; |
| 1523 | jarray _countArray = (jarray) 0; |
| 1524 | jarray _shadersArray = (jarray) 0; |
| 1525 | jint _countRemaining; |
| 1526 | GLsizei *count = (GLsizei *) 0; |
| 1527 | jint _shadersRemaining; |
| 1528 | GLuint *shaders = (GLuint *) 0; |
| 1529 | |
| 1530 | count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining); |
| 1531 | shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining); |
| 1532 | glGetAttachedShaders( |
| 1533 | (GLuint)program, |
| 1534 | (GLsizei)maxcount, |
| 1535 | (GLsizei *)count, |
| 1536 | (GLuint *)shaders |
| 1537 | ); |
| 1538 | if (_countArray) { |
| 1539 | releasePointer(_env, _countArray, shaders, _exception ? JNI_FALSE : JNI_TRUE); |
| 1540 | } |
| 1541 | if (_shadersArray) { |
| 1542 | releasePointer(_env, _shadersArray, count, _exception ? JNI_FALSE : JNI_TRUE); |
| 1543 | } |
| 1544 | } |
| 1545 | |
| 1546 | /* int glGetAttribLocation ( GLuint program, const char *name ) */ |
| 1547 | static jint |
| 1548 | android_glGetAttribLocation__ILjava_lang_String_2 |
| 1549 | (JNIEnv *_env, jobject _this, jint program, jstring name) { |
| 1550 | int _returnValue = 0; |
| 1551 | const char* _nativename = 0; |
| 1552 | |
| 1553 | if (!name) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1554 | jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1555 | goto exit; |
| 1556 | } |
| 1557 | _nativename = _env->GetStringUTFChars(name, 0); |
| 1558 | |
| 1559 | _returnValue = glGetAttribLocation( |
| 1560 | (GLuint)program, |
| 1561 | (char *)_nativename |
| 1562 | ); |
| 1563 | |
| 1564 | exit: |
| 1565 | if (_nativename) { |
| 1566 | _env->ReleaseStringUTFChars(name, _nativename); |
| 1567 | } |
| 1568 | |
| 1569 | return _returnValue; |
| 1570 | } |
| 1571 | |
| 1572 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 1573 | static void |
| 1574 | android_glGetBooleanv__I_3ZI |
| 1575 | (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { |
| 1576 | jint _exception = 0; |
| 1577 | GLboolean *params_base = (GLboolean *) 0; |
| 1578 | jint _remaining; |
| 1579 | GLboolean *params = (GLboolean *) 0; |
| 1580 | |
| 1581 | if (!params_ref) { |
| 1582 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1583 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1584 | goto exit; |
| 1585 | } |
| 1586 | if (offset < 0) { |
| 1587 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1588 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1589 | goto exit; |
| 1590 | } |
| 1591 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1592 | params_base = (GLboolean *) |
| 1593 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 1594 | params = params_base + offset; |
| 1595 | |
| 1596 | glGetBooleanv( |
| 1597 | (GLenum)pname, |
| 1598 | (GLboolean *)params |
| 1599 | ); |
| 1600 | |
| 1601 | exit: |
| 1602 | if (params_base) { |
| 1603 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 1604 | _exception ? JNI_ABORT: 0); |
| 1605 | } |
| 1606 | } |
| 1607 | |
| 1608 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 1609 | static void |
| 1610 | android_glGetBooleanv__ILjava_nio_IntBuffer_2 |
| 1611 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1612 | jint _exception = 0; |
| 1613 | jarray _array = (jarray) 0; |
| 1614 | jint _remaining; |
| 1615 | GLboolean *params = (GLboolean *) 0; |
| 1616 | |
| 1617 | params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining); |
| 1618 | glGetBooleanv( |
| 1619 | (GLenum)pname, |
| 1620 | (GLboolean *)params |
| 1621 | ); |
| 1622 | if (_array) { |
| 1623 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 1624 | } |
| 1625 | } |
| 1626 | |
| 1627 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 1628 | static void |
| 1629 | android_glGetBufferParameteriv__II_3II |
| 1630 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1631 | jint _exception = 0; |
| 1632 | GLint *params_base = (GLint *) 0; |
| 1633 | jint _remaining; |
| 1634 | GLint *params = (GLint *) 0; |
| 1635 | |
| 1636 | if (!params_ref) { |
| 1637 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1638 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1639 | goto exit; |
| 1640 | } |
| 1641 | if (offset < 0) { |
| 1642 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1643 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1644 | goto exit; |
| 1645 | } |
| 1646 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1647 | if (_remaining < 1) { |
| 1648 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1649 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1650 | goto exit; |
| 1651 | } |
| 1652 | params_base = (GLint *) |
| 1653 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 1654 | params = params_base + offset; |
| 1655 | |
| 1656 | glGetBufferParameteriv( |
| 1657 | (GLenum)target, |
| 1658 | (GLenum)pname, |
| 1659 | (GLint *)params |
| 1660 | ); |
| 1661 | |
| 1662 | exit: |
| 1663 | if (params_base) { |
| 1664 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 1665 | _exception ? JNI_ABORT: 0); |
| 1666 | } |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1667 | } |
| 1668 | |
| 1669 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 1670 | static void |
| 1671 | android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 |
| 1672 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1673 | jint _exception = 0; |
| 1674 | jarray _array = (jarray) 0; |
| 1675 | jint _remaining; |
| 1676 | GLint *params = (GLint *) 0; |
| 1677 | |
| 1678 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 1679 | if (_remaining < 1) { |
| 1680 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1681 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 1682 | goto exit; |
| 1683 | } |
| 1684 | glGetBufferParameteriv( |
| 1685 | (GLenum)target, |
| 1686 | (GLenum)pname, |
| 1687 | (GLint *)params |
| 1688 | ); |
| 1689 | |
| 1690 | exit: |
| 1691 | if (_array) { |
| 1692 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 1693 | } |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1694 | } |
| 1695 | |
| 1696 | /* GLenum glGetError ( void ) */ |
| 1697 | static jint |
| 1698 | android_glGetError__ |
| 1699 | (JNIEnv *_env, jobject _this) { |
| 1700 | GLenum _returnValue; |
| 1701 | _returnValue = glGetError(); |
| 1702 | return _returnValue; |
| 1703 | } |
| 1704 | |
| 1705 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 1706 | static void |
| 1707 | android_glGetFloatv__I_3FI |
| 1708 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
| 1709 | jint _exception = 0; |
| 1710 | GLfloat *params_base = (GLfloat *) 0; |
| 1711 | jint _remaining; |
| 1712 | GLfloat *params = (GLfloat *) 0; |
| 1713 | |
| 1714 | if (!params_ref) { |
| 1715 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1716 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1717 | goto exit; |
| 1718 | } |
| 1719 | if (offset < 0) { |
| 1720 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1721 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1722 | goto exit; |
| 1723 | } |
| 1724 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1725 | params_base = (GLfloat *) |
| 1726 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 1727 | params = params_base + offset; |
| 1728 | |
| 1729 | glGetFloatv( |
| 1730 | (GLenum)pname, |
| 1731 | (GLfloat *)params |
| 1732 | ); |
| 1733 | |
| 1734 | exit: |
| 1735 | if (params_base) { |
| 1736 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 1737 | _exception ? JNI_ABORT: 0); |
| 1738 | } |
| 1739 | } |
| 1740 | |
| 1741 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 1742 | static void |
| 1743 | android_glGetFloatv__ILjava_nio_FloatBuffer_2 |
| 1744 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1745 | jint _exception = 0; |
| 1746 | jarray _array = (jarray) 0; |
| 1747 | jint _remaining; |
| 1748 | GLfloat *params = (GLfloat *) 0; |
| 1749 | |
| 1750 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); |
| 1751 | glGetFloatv( |
| 1752 | (GLenum)pname, |
| 1753 | (GLfloat *)params |
| 1754 | ); |
| 1755 | if (_array) { |
| 1756 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 1757 | } |
| 1758 | } |
| 1759 | |
| 1760 | /* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ |
| 1761 | static void |
| 1762 | android_glGetFramebufferAttachmentParameteriv__III_3II |
| 1763 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { |
| 1764 | jint _exception = 0; |
| 1765 | GLint *params_base = (GLint *) 0; |
| 1766 | jint _remaining; |
| 1767 | GLint *params = (GLint *) 0; |
| 1768 | |
| 1769 | if (!params_ref) { |
| 1770 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1771 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1772 | goto exit; |
| 1773 | } |
| 1774 | if (offset < 0) { |
| 1775 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1776 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1777 | goto exit; |
| 1778 | } |
| 1779 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1780 | params_base = (GLint *) |
| 1781 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 1782 | params = params_base + offset; |
| 1783 | |
| 1784 | glGetFramebufferAttachmentParameteriv( |
| 1785 | (GLenum)target, |
| 1786 | (GLenum)attachment, |
| 1787 | (GLenum)pname, |
| 1788 | (GLint *)params |
| 1789 | ); |
| 1790 | |
| 1791 | exit: |
| 1792 | if (params_base) { |
| 1793 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 1794 | _exception ? JNI_ABORT: 0); |
| 1795 | } |
| 1796 | } |
| 1797 | |
| 1798 | /* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ |
| 1799 | static void |
| 1800 | android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 |
| 1801 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { |
| 1802 | jint _exception = 0; |
| 1803 | jarray _array = (jarray) 0; |
| 1804 | jint _remaining; |
| 1805 | GLint *params = (GLint *) 0; |
| 1806 | |
| 1807 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 1808 | glGetFramebufferAttachmentParameteriv( |
| 1809 | (GLenum)target, |
| 1810 | (GLenum)attachment, |
| 1811 | (GLenum)pname, |
| 1812 | (GLint *)params |
| 1813 | ); |
| 1814 | if (_array) { |
| 1815 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 1816 | } |
| 1817 | } |
| 1818 | |
| 1819 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1820 | static void |
| 1821 | android_glGetIntegerv__I_3II |
| 1822 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 1823 | jint _exception = 0; |
| 1824 | GLint *params_base = (GLint *) 0; |
| 1825 | jint _remaining; |
| 1826 | GLint *params = (GLint *) 0; |
| 1827 | |
| 1828 | if (!params_ref) { |
| 1829 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1830 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1831 | goto exit; |
| 1832 | } |
| 1833 | if (offset < 0) { |
| 1834 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1835 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 1836 | goto exit; |
| 1837 | } |
| 1838 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1839 | int _needed; |
| 1840 | switch (pname) { |
| 1841 | #if defined(GL_ALPHA_BITS) |
| 1842 | case GL_ALPHA_BITS: |
| 1843 | #endif // defined(GL_ALPHA_BITS) |
| 1844 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1845 | case GL_ALPHA_TEST_FUNC: |
| 1846 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1847 | #if defined(GL_ALPHA_TEST_REF) |
| 1848 | case GL_ALPHA_TEST_REF: |
| 1849 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1850 | #if defined(GL_BLEND_DST) |
| 1851 | case GL_BLEND_DST: |
| 1852 | #endif // defined(GL_BLEND_DST) |
| 1853 | #if defined(GL_BLUE_BITS) |
| 1854 | case GL_BLUE_BITS: |
| 1855 | #endif // defined(GL_BLUE_BITS) |
| 1856 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1857 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1858 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1859 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1860 | case GL_COLOR_ARRAY_SIZE: |
| 1861 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1862 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1863 | case GL_COLOR_ARRAY_STRIDE: |
| 1864 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1865 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1866 | case GL_COLOR_ARRAY_TYPE: |
| 1867 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1868 | #if defined(GL_CULL_FACE) |
| 1869 | case GL_CULL_FACE: |
| 1870 | #endif // defined(GL_CULL_FACE) |
| 1871 | #if defined(GL_DEPTH_BITS) |
| 1872 | case GL_DEPTH_BITS: |
| 1873 | #endif // defined(GL_DEPTH_BITS) |
| 1874 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1875 | case GL_DEPTH_CLEAR_VALUE: |
| 1876 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1877 | #if defined(GL_DEPTH_FUNC) |
| 1878 | case GL_DEPTH_FUNC: |
| 1879 | #endif // defined(GL_DEPTH_FUNC) |
| 1880 | #if defined(GL_DEPTH_WRITEMASK) |
| 1881 | case GL_DEPTH_WRITEMASK: |
| 1882 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1883 | #if defined(GL_FOG_DENSITY) |
| 1884 | case GL_FOG_DENSITY: |
| 1885 | #endif // defined(GL_FOG_DENSITY) |
| 1886 | #if defined(GL_FOG_END) |
| 1887 | case GL_FOG_END: |
| 1888 | #endif // defined(GL_FOG_END) |
| 1889 | #if defined(GL_FOG_MODE) |
| 1890 | case GL_FOG_MODE: |
| 1891 | #endif // defined(GL_FOG_MODE) |
| 1892 | #if defined(GL_FOG_START) |
| 1893 | case GL_FOG_START: |
| 1894 | #endif // defined(GL_FOG_START) |
| 1895 | #if defined(GL_FRONT_FACE) |
| 1896 | case GL_FRONT_FACE: |
| 1897 | #endif // defined(GL_FRONT_FACE) |
| 1898 | #if defined(GL_GREEN_BITS) |
| 1899 | case GL_GREEN_BITS: |
| 1900 | #endif // defined(GL_GREEN_BITS) |
| 1901 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1902 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1903 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1904 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1905 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1906 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1907 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1908 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1909 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1910 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1911 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1912 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1913 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1914 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1915 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1916 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1917 | case GL_LINE_SMOOTH_HINT: |
| 1918 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1919 | #if defined(GL_LINE_WIDTH) |
| 1920 | case GL_LINE_WIDTH: |
| 1921 | #endif // defined(GL_LINE_WIDTH) |
| 1922 | #if defined(GL_LOGIC_OP_MODE) |
| 1923 | case GL_LOGIC_OP_MODE: |
| 1924 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1925 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1926 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1927 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1928 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1929 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1930 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1931 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1932 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1933 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1934 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1935 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1936 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1937 | #if defined(GL_MATRIX_MODE) |
| 1938 | case GL_MATRIX_MODE: |
| 1939 | #endif // defined(GL_MATRIX_MODE) |
| 1940 | #if defined(GL_MAX_CLIP_PLANES) |
| 1941 | case GL_MAX_CLIP_PLANES: |
| 1942 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1943 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1944 | case GL_MAX_ELEMENTS_INDICES: |
| 1945 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1946 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1947 | case GL_MAX_ELEMENTS_VERTICES: |
| 1948 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1949 | #if defined(GL_MAX_LIGHTS) |
| 1950 | case GL_MAX_LIGHTS: |
| 1951 | #endif // defined(GL_MAX_LIGHTS) |
| 1952 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1953 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1954 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1955 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1956 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1957 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1958 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1959 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1960 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1961 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1962 | case GL_MAX_TEXTURE_SIZE: |
| 1963 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1964 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1965 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1966 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1967 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1968 | case GL_MAX_TEXTURE_UNITS: |
| 1969 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1970 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1971 | case GL_MAX_VERTEX_UNITS_OES: |
| 1972 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1973 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1974 | case GL_MODELVIEW_STACK_DEPTH: |
| 1975 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1976 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1977 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1978 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1979 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1980 | case GL_NORMAL_ARRAY_STRIDE: |
| 1981 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1982 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1983 | case GL_NORMAL_ARRAY_TYPE: |
| 1984 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1985 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1986 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1987 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1988 | #if defined(GL_PACK_ALIGNMENT) |
| 1989 | case GL_PACK_ALIGNMENT: |
| 1990 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1991 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1992 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1993 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1994 | #if defined(GL_POINT_SIZE) |
| 1995 | case GL_POINT_SIZE: |
| 1996 | #endif // defined(GL_POINT_SIZE) |
| 1997 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1998 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1999 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 2000 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 2001 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 2002 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 2003 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 2004 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 2005 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 2006 | #if defined(GL_POINT_SMOOTH_HINT) |
| 2007 | case GL_POINT_SMOOTH_HINT: |
| 2008 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 2009 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 2010 | case GL_POLYGON_OFFSET_FACTOR: |
| 2011 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 2012 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 2013 | case GL_POLYGON_OFFSET_UNITS: |
| 2014 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 2015 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 2016 | case GL_PROJECTION_STACK_DEPTH: |
| 2017 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 2018 | #if defined(GL_RED_BITS) |
| 2019 | case GL_RED_BITS: |
| 2020 | #endif // defined(GL_RED_BITS) |
| 2021 | #if defined(GL_SHADE_MODEL) |
| 2022 | case GL_SHADE_MODEL: |
| 2023 | #endif // defined(GL_SHADE_MODEL) |
| 2024 | #if defined(GL_STENCIL_BITS) |
| 2025 | case GL_STENCIL_BITS: |
| 2026 | #endif // defined(GL_STENCIL_BITS) |
| 2027 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 2028 | case GL_STENCIL_CLEAR_VALUE: |
| 2029 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 2030 | #if defined(GL_STENCIL_FAIL) |
| 2031 | case GL_STENCIL_FAIL: |
| 2032 | #endif // defined(GL_STENCIL_FAIL) |
| 2033 | #if defined(GL_STENCIL_FUNC) |
| 2034 | case GL_STENCIL_FUNC: |
| 2035 | #endif // defined(GL_STENCIL_FUNC) |
| 2036 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 2037 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 2038 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 2039 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 2040 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 2041 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 2042 | #if defined(GL_STENCIL_REF) |
| 2043 | case GL_STENCIL_REF: |
| 2044 | #endif // defined(GL_STENCIL_REF) |
| 2045 | #if defined(GL_STENCIL_VALUE_MASK) |
| 2046 | case GL_STENCIL_VALUE_MASK: |
| 2047 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 2048 | #if defined(GL_STENCIL_WRITEMASK) |
| 2049 | case GL_STENCIL_WRITEMASK: |
| 2050 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 2051 | #if defined(GL_SUBPIXEL_BITS) |
| 2052 | case GL_SUBPIXEL_BITS: |
| 2053 | #endif // defined(GL_SUBPIXEL_BITS) |
| 2054 | #if defined(GL_TEXTURE_BINDING_2D) |
| 2055 | case GL_TEXTURE_BINDING_2D: |
| 2056 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 2057 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 2058 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 2059 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 2060 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 2061 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 2062 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 2063 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 2064 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 2065 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 2066 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 2067 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 2068 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 2069 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 2070 | case GL_TEXTURE_STACK_DEPTH: |
| 2071 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 2072 | #if defined(GL_UNPACK_ALIGNMENT) |
| 2073 | case GL_UNPACK_ALIGNMENT: |
| 2074 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 2075 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 2076 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 2077 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 2078 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 2079 | case GL_VERTEX_ARRAY_SIZE: |
| 2080 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 2081 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 2082 | case GL_VERTEX_ARRAY_STRIDE: |
| 2083 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 2084 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 2085 | case GL_VERTEX_ARRAY_TYPE: |
| 2086 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 2087 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 2088 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 2089 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 2090 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 2091 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 2092 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 2093 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 2094 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 2095 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 2096 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 2097 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 2098 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 2099 | _needed = 1; |
| 2100 | break; |
| 2101 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 2102 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 2103 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 2104 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 2105 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 2106 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 2107 | #if defined(GL_DEPTH_RANGE) |
| 2108 | case GL_DEPTH_RANGE: |
| 2109 | #endif // defined(GL_DEPTH_RANGE) |
| 2110 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 2111 | case GL_MAX_VIEWPORT_DIMS: |
| 2112 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 2113 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 2114 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 2115 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 2116 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 2117 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 2118 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 2119 | _needed = 2; |
| 2120 | break; |
| 2121 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 2122 | case GL_COLOR_CLEAR_VALUE: |
| 2123 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 2124 | #if defined(GL_COLOR_WRITEMASK) |
| 2125 | case GL_COLOR_WRITEMASK: |
| 2126 | #endif // defined(GL_COLOR_WRITEMASK) |
| 2127 | #if defined(GL_FOG_COLOR) |
| 2128 | case GL_FOG_COLOR: |
| 2129 | #endif // defined(GL_FOG_COLOR) |
| 2130 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2131 | case GL_LIGHT_MODEL_AMBIENT: |
| 2132 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2133 | #if defined(GL_SCISSOR_BOX) |
| 2134 | case GL_SCISSOR_BOX: |
| 2135 | #endif // defined(GL_SCISSOR_BOX) |
| 2136 | #if defined(GL_VIEWPORT) |
| 2137 | case GL_VIEWPORT: |
| 2138 | #endif // defined(GL_VIEWPORT) |
| 2139 | _needed = 4; |
| 2140 | break; |
| 2141 | #if defined(GL_MODELVIEW_MATRIX) |
| 2142 | case GL_MODELVIEW_MATRIX: |
| 2143 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 2144 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2145 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2146 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2147 | #if defined(GL_PROJECTION_MATRIX) |
| 2148 | case GL_PROJECTION_MATRIX: |
| 2149 | #endif // defined(GL_PROJECTION_MATRIX) |
| 2150 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2151 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2152 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2153 | #if defined(GL_TEXTURE_MATRIX) |
| 2154 | case GL_TEXTURE_MATRIX: |
| 2155 | #endif // defined(GL_TEXTURE_MATRIX) |
| 2156 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2157 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2158 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2159 | _needed = 16; |
| 2160 | break; |
| 2161 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 2162 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 2163 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 2164 | _needed = getNumCompressedTextureFormats(); |
| 2165 | break; |
| 2166 | default: |
| 2167 | _needed = 0; |
| 2168 | break; |
| 2169 | } |
| 2170 | if (_remaining < _needed) { |
| 2171 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2172 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < needed"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2173 | goto exit; |
| 2174 | } |
| 2175 | params_base = (GLint *) |
| 2176 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2177 | params = params_base + offset; |
| 2178 | |
| 2179 | glGetIntegerv( |
| 2180 | (GLenum)pname, |
| 2181 | (GLint *)params |
| 2182 | ); |
| 2183 | |
| 2184 | exit: |
| 2185 | if (params_base) { |
| 2186 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2187 | _exception ? JNI_ABORT: 0); |
| 2188 | } |
| 2189 | } |
| 2190 | |
| 2191 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 2192 | static void |
| 2193 | android_glGetIntegerv__ILjava_nio_IntBuffer_2 |
| 2194 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 2195 | jint _exception = 0; |
| 2196 | jarray _array = (jarray) 0; |
| 2197 | jint _remaining; |
| 2198 | GLint *params = (GLint *) 0; |
| 2199 | |
| 2200 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 2201 | int _needed; |
| 2202 | switch (pname) { |
| 2203 | #if defined(GL_ALPHA_BITS) |
| 2204 | case GL_ALPHA_BITS: |
| 2205 | #endif // defined(GL_ALPHA_BITS) |
| 2206 | #if defined(GL_ALPHA_TEST_FUNC) |
| 2207 | case GL_ALPHA_TEST_FUNC: |
| 2208 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 2209 | #if defined(GL_ALPHA_TEST_REF) |
| 2210 | case GL_ALPHA_TEST_REF: |
| 2211 | #endif // defined(GL_ALPHA_TEST_REF) |
| 2212 | #if defined(GL_BLEND_DST) |
| 2213 | case GL_BLEND_DST: |
| 2214 | #endif // defined(GL_BLEND_DST) |
| 2215 | #if defined(GL_BLUE_BITS) |
| 2216 | case GL_BLUE_BITS: |
| 2217 | #endif // defined(GL_BLUE_BITS) |
| 2218 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 2219 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 2220 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 2221 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 2222 | case GL_COLOR_ARRAY_SIZE: |
| 2223 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 2224 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 2225 | case GL_COLOR_ARRAY_STRIDE: |
| 2226 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 2227 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 2228 | case GL_COLOR_ARRAY_TYPE: |
| 2229 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 2230 | #if defined(GL_CULL_FACE) |
| 2231 | case GL_CULL_FACE: |
| 2232 | #endif // defined(GL_CULL_FACE) |
| 2233 | #if defined(GL_DEPTH_BITS) |
| 2234 | case GL_DEPTH_BITS: |
| 2235 | #endif // defined(GL_DEPTH_BITS) |
| 2236 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 2237 | case GL_DEPTH_CLEAR_VALUE: |
| 2238 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 2239 | #if defined(GL_DEPTH_FUNC) |
| 2240 | case GL_DEPTH_FUNC: |
| 2241 | #endif // defined(GL_DEPTH_FUNC) |
| 2242 | #if defined(GL_DEPTH_WRITEMASK) |
| 2243 | case GL_DEPTH_WRITEMASK: |
| 2244 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 2245 | #if defined(GL_FOG_DENSITY) |
| 2246 | case GL_FOG_DENSITY: |
| 2247 | #endif // defined(GL_FOG_DENSITY) |
| 2248 | #if defined(GL_FOG_END) |
| 2249 | case GL_FOG_END: |
| 2250 | #endif // defined(GL_FOG_END) |
| 2251 | #if defined(GL_FOG_MODE) |
| 2252 | case GL_FOG_MODE: |
| 2253 | #endif // defined(GL_FOG_MODE) |
| 2254 | #if defined(GL_FOG_START) |
| 2255 | case GL_FOG_START: |
| 2256 | #endif // defined(GL_FOG_START) |
| 2257 | #if defined(GL_FRONT_FACE) |
| 2258 | case GL_FRONT_FACE: |
| 2259 | #endif // defined(GL_FRONT_FACE) |
| 2260 | #if defined(GL_GREEN_BITS) |
| 2261 | case GL_GREEN_BITS: |
| 2262 | #endif // defined(GL_GREEN_BITS) |
| 2263 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 2264 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 2265 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 2266 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 2267 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 2268 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 2269 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 2270 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 2271 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 2272 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 2273 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 2274 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 2275 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2276 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2277 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2278 | #if defined(GL_LINE_SMOOTH_HINT) |
| 2279 | case GL_LINE_SMOOTH_HINT: |
| 2280 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 2281 | #if defined(GL_LINE_WIDTH) |
| 2282 | case GL_LINE_WIDTH: |
| 2283 | #endif // defined(GL_LINE_WIDTH) |
| 2284 | #if defined(GL_LOGIC_OP_MODE) |
| 2285 | case GL_LOGIC_OP_MODE: |
| 2286 | #endif // defined(GL_LOGIC_OP_MODE) |
| 2287 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 2288 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 2289 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 2290 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 2291 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 2292 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 2293 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 2294 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 2295 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 2296 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 2297 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 2298 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 2299 | #if defined(GL_MATRIX_MODE) |
| 2300 | case GL_MATRIX_MODE: |
| 2301 | #endif // defined(GL_MATRIX_MODE) |
| 2302 | #if defined(GL_MAX_CLIP_PLANES) |
| 2303 | case GL_MAX_CLIP_PLANES: |
| 2304 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 2305 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 2306 | case GL_MAX_ELEMENTS_INDICES: |
| 2307 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 2308 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 2309 | case GL_MAX_ELEMENTS_VERTICES: |
| 2310 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 2311 | #if defined(GL_MAX_LIGHTS) |
| 2312 | case GL_MAX_LIGHTS: |
| 2313 | #endif // defined(GL_MAX_LIGHTS) |
| 2314 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 2315 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 2316 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 2317 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 2318 | case GL_MAX_PALETTE_MATRICES_OES: |
| 2319 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 2320 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 2321 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 2322 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 2323 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 2324 | case GL_MAX_TEXTURE_SIZE: |
| 2325 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 2326 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 2327 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 2328 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 2329 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 2330 | case GL_MAX_TEXTURE_UNITS: |
| 2331 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 2332 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 2333 | case GL_MAX_VERTEX_UNITS_OES: |
| 2334 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 2335 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 2336 | case GL_MODELVIEW_STACK_DEPTH: |
| 2337 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 2338 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 2339 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 2340 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 2341 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 2342 | case GL_NORMAL_ARRAY_STRIDE: |
| 2343 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 2344 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 2345 | case GL_NORMAL_ARRAY_TYPE: |
| 2346 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 2347 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 2348 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 2349 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 2350 | #if defined(GL_PACK_ALIGNMENT) |
| 2351 | case GL_PACK_ALIGNMENT: |
| 2352 | #endif // defined(GL_PACK_ALIGNMENT) |
| 2353 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 2354 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 2355 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 2356 | #if defined(GL_POINT_SIZE) |
| 2357 | case GL_POINT_SIZE: |
| 2358 | #endif // defined(GL_POINT_SIZE) |
| 2359 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 2360 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 2361 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 2362 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 2363 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 2364 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 2365 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 2366 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 2367 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 2368 | #if defined(GL_POINT_SMOOTH_HINT) |
| 2369 | case GL_POINT_SMOOTH_HINT: |
| 2370 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 2371 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 2372 | case GL_POLYGON_OFFSET_FACTOR: |
| 2373 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 2374 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 2375 | case GL_POLYGON_OFFSET_UNITS: |
| 2376 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 2377 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 2378 | case GL_PROJECTION_STACK_DEPTH: |
| 2379 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 2380 | #if defined(GL_RED_BITS) |
| 2381 | case GL_RED_BITS: |
| 2382 | #endif // defined(GL_RED_BITS) |
| 2383 | #if defined(GL_SHADE_MODEL) |
| 2384 | case GL_SHADE_MODEL: |
| 2385 | #endif // defined(GL_SHADE_MODEL) |
| 2386 | #if defined(GL_STENCIL_BITS) |
| 2387 | case GL_STENCIL_BITS: |
| 2388 | #endif // defined(GL_STENCIL_BITS) |
| 2389 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 2390 | case GL_STENCIL_CLEAR_VALUE: |
| 2391 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 2392 | #if defined(GL_STENCIL_FAIL) |
| 2393 | case GL_STENCIL_FAIL: |
| 2394 | #endif // defined(GL_STENCIL_FAIL) |
| 2395 | #if defined(GL_STENCIL_FUNC) |
| 2396 | case GL_STENCIL_FUNC: |
| 2397 | #endif // defined(GL_STENCIL_FUNC) |
| 2398 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 2399 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 2400 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 2401 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 2402 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 2403 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 2404 | #if defined(GL_STENCIL_REF) |
| 2405 | case GL_STENCIL_REF: |
| 2406 | #endif // defined(GL_STENCIL_REF) |
| 2407 | #if defined(GL_STENCIL_VALUE_MASK) |
| 2408 | case GL_STENCIL_VALUE_MASK: |
| 2409 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 2410 | #if defined(GL_STENCIL_WRITEMASK) |
| 2411 | case GL_STENCIL_WRITEMASK: |
| 2412 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 2413 | #if defined(GL_SUBPIXEL_BITS) |
| 2414 | case GL_SUBPIXEL_BITS: |
| 2415 | #endif // defined(GL_SUBPIXEL_BITS) |
| 2416 | #if defined(GL_TEXTURE_BINDING_2D) |
| 2417 | case GL_TEXTURE_BINDING_2D: |
| 2418 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 2419 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 2420 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 2421 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 2422 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 2423 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 2424 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 2425 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 2426 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 2427 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 2428 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 2429 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 2430 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 2431 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 2432 | case GL_TEXTURE_STACK_DEPTH: |
| 2433 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 2434 | #if defined(GL_UNPACK_ALIGNMENT) |
| 2435 | case GL_UNPACK_ALIGNMENT: |
| 2436 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 2437 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 2438 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 2439 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 2440 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 2441 | case GL_VERTEX_ARRAY_SIZE: |
| 2442 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 2443 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 2444 | case GL_VERTEX_ARRAY_STRIDE: |
| 2445 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 2446 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 2447 | case GL_VERTEX_ARRAY_TYPE: |
| 2448 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 2449 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 2450 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 2451 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 2452 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 2453 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 2454 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 2455 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 2456 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 2457 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 2458 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 2459 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 2460 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 2461 | _needed = 1; |
| 2462 | break; |
| 2463 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 2464 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 2465 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 2466 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 2467 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 2468 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 2469 | #if defined(GL_DEPTH_RANGE) |
| 2470 | case GL_DEPTH_RANGE: |
| 2471 | #endif // defined(GL_DEPTH_RANGE) |
| 2472 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 2473 | case GL_MAX_VIEWPORT_DIMS: |
| 2474 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 2475 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 2476 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 2477 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 2478 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 2479 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 2480 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 2481 | _needed = 2; |
| 2482 | break; |
| 2483 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 2484 | case GL_COLOR_CLEAR_VALUE: |
| 2485 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 2486 | #if defined(GL_COLOR_WRITEMASK) |
| 2487 | case GL_COLOR_WRITEMASK: |
| 2488 | #endif // defined(GL_COLOR_WRITEMASK) |
| 2489 | #if defined(GL_FOG_COLOR) |
| 2490 | case GL_FOG_COLOR: |
| 2491 | #endif // defined(GL_FOG_COLOR) |
| 2492 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2493 | case GL_LIGHT_MODEL_AMBIENT: |
| 2494 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2495 | #if defined(GL_SCISSOR_BOX) |
| 2496 | case GL_SCISSOR_BOX: |
| 2497 | #endif // defined(GL_SCISSOR_BOX) |
| 2498 | #if defined(GL_VIEWPORT) |
| 2499 | case GL_VIEWPORT: |
| 2500 | #endif // defined(GL_VIEWPORT) |
| 2501 | _needed = 4; |
| 2502 | break; |
| 2503 | #if defined(GL_MODELVIEW_MATRIX) |
| 2504 | case GL_MODELVIEW_MATRIX: |
| 2505 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 2506 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2507 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2508 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2509 | #if defined(GL_PROJECTION_MATRIX) |
| 2510 | case GL_PROJECTION_MATRIX: |
| 2511 | #endif // defined(GL_PROJECTION_MATRIX) |
| 2512 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2513 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2514 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2515 | #if defined(GL_TEXTURE_MATRIX) |
| 2516 | case GL_TEXTURE_MATRIX: |
| 2517 | #endif // defined(GL_TEXTURE_MATRIX) |
| 2518 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2519 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 2520 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 2521 | _needed = 16; |
| 2522 | break; |
| 2523 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 2524 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 2525 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 2526 | _needed = getNumCompressedTextureFormats(); |
| 2527 | break; |
| 2528 | default: |
| 2529 | _needed = 0; |
| 2530 | break; |
| 2531 | } |
| 2532 | if (_remaining < _needed) { |
| 2533 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2534 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < needed"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2535 | goto exit; |
| 2536 | } |
| 2537 | glGetIntegerv( |
| 2538 | (GLenum)pname, |
| 2539 | (GLint *)params |
| 2540 | ); |
| 2541 | |
| 2542 | exit: |
| 2543 | if (_array) { |
| 2544 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 2545 | } |
| 2546 | } |
| 2547 | |
| 2548 | /* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ |
| 2549 | static void |
| 2550 | android_glGetProgramiv__II_3II |
| 2551 | (JNIEnv *_env, jobject _this, jint program, jint pname, jintArray params_ref, jint offset) { |
| 2552 | jint _exception = 0; |
| 2553 | GLint *params_base = (GLint *) 0; |
| 2554 | jint _remaining; |
| 2555 | GLint *params = (GLint *) 0; |
| 2556 | |
| 2557 | if (!params_ref) { |
| 2558 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2559 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2560 | goto exit; |
| 2561 | } |
| 2562 | if (offset < 0) { |
| 2563 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2564 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2565 | goto exit; |
| 2566 | } |
| 2567 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2568 | params_base = (GLint *) |
| 2569 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2570 | params = params_base + offset; |
| 2571 | |
| 2572 | glGetProgramiv( |
| 2573 | (GLuint)program, |
| 2574 | (GLenum)pname, |
| 2575 | (GLint *)params |
| 2576 | ); |
| 2577 | |
| 2578 | exit: |
| 2579 | if (params_base) { |
| 2580 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2581 | _exception ? JNI_ABORT: 0); |
| 2582 | } |
| 2583 | } |
| 2584 | |
| 2585 | /* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ |
| 2586 | static void |
| 2587 | android_glGetProgramiv__IILjava_nio_IntBuffer_2 |
| 2588 | (JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) { |
| 2589 | jint _exception = 0; |
| 2590 | jarray _array = (jarray) 0; |
| 2591 | jint _remaining; |
| 2592 | GLint *params = (GLint *) 0; |
| 2593 | |
| 2594 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 2595 | glGetProgramiv( |
| 2596 | (GLuint)program, |
| 2597 | (GLenum)pname, |
| 2598 | (GLint *)params |
| 2599 | ); |
| 2600 | if (_array) { |
| 2601 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 2602 | } |
| 2603 | } |
| 2604 | |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2605 | #include <stdlib.h> |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2606 | |
| 2607 | /* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2608 | static jstring android_glGetProgramInfoLog(JNIEnv *_env, jobject, jint shader) { |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2609 | GLint infoLen = 0; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2610 | glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen); |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2611 | if (!infoLen) { |
| 2612 | return _env->NewStringUTF(""); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2613 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2614 | char* buf = (char*) malloc(infoLen); |
| 2615 | if (buf == NULL) { |
| 2616 | jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); |
| 2617 | return NULL; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2618 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2619 | glGetProgramInfoLog(shader, infoLen, NULL, buf); |
| 2620 | jstring result = _env->NewStringUTF(buf); |
| 2621 | free(buf); |
| 2622 | return result; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2623 | } |
| 2624 | /* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 2625 | static void |
| 2626 | android_glGetRenderbufferParameteriv__II_3II |
| 2627 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 2628 | jint _exception = 0; |
| 2629 | GLint *params_base = (GLint *) 0; |
| 2630 | jint _remaining; |
| 2631 | GLint *params = (GLint *) 0; |
| 2632 | |
| 2633 | if (!params_ref) { |
| 2634 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2635 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2636 | goto exit; |
| 2637 | } |
| 2638 | if (offset < 0) { |
| 2639 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2640 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2641 | goto exit; |
| 2642 | } |
| 2643 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2644 | params_base = (GLint *) |
| 2645 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2646 | params = params_base + offset; |
| 2647 | |
| 2648 | glGetRenderbufferParameteriv( |
| 2649 | (GLenum)target, |
| 2650 | (GLenum)pname, |
| 2651 | (GLint *)params |
| 2652 | ); |
| 2653 | |
| 2654 | exit: |
| 2655 | if (params_base) { |
| 2656 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2657 | _exception ? JNI_ABORT: 0); |
| 2658 | } |
| 2659 | } |
| 2660 | |
| 2661 | /* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 2662 | static void |
| 2663 | android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 |
| 2664 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 2665 | jint _exception = 0; |
| 2666 | jarray _array = (jarray) 0; |
| 2667 | jint _remaining; |
| 2668 | GLint *params = (GLint *) 0; |
| 2669 | |
| 2670 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 2671 | glGetRenderbufferParameteriv( |
| 2672 | (GLenum)target, |
| 2673 | (GLenum)pname, |
| 2674 | (GLint *)params |
| 2675 | ); |
| 2676 | if (_array) { |
| 2677 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 2678 | } |
| 2679 | } |
| 2680 | |
| 2681 | /* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ |
| 2682 | static void |
| 2683 | android_glGetShaderiv__II_3II |
| 2684 | (JNIEnv *_env, jobject _this, jint shader, jint pname, jintArray params_ref, jint offset) { |
| 2685 | jint _exception = 0; |
| 2686 | GLint *params_base = (GLint *) 0; |
| 2687 | jint _remaining; |
| 2688 | GLint *params = (GLint *) 0; |
| 2689 | |
| 2690 | if (!params_ref) { |
| 2691 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2692 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2693 | goto exit; |
| 2694 | } |
| 2695 | if (offset < 0) { |
| 2696 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2697 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2698 | goto exit; |
| 2699 | } |
| 2700 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2701 | params_base = (GLint *) |
| 2702 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2703 | params = params_base + offset; |
| 2704 | |
| 2705 | glGetShaderiv( |
| 2706 | (GLuint)shader, |
| 2707 | (GLenum)pname, |
| 2708 | (GLint *)params |
| 2709 | ); |
| 2710 | |
| 2711 | exit: |
| 2712 | if (params_base) { |
| 2713 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2714 | _exception ? JNI_ABORT: 0); |
| 2715 | } |
| 2716 | } |
| 2717 | |
| 2718 | /* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ |
| 2719 | static void |
| 2720 | android_glGetShaderiv__IILjava_nio_IntBuffer_2 |
| 2721 | (JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) { |
| 2722 | jint _exception = 0; |
| 2723 | jarray _array = (jarray) 0; |
| 2724 | jint _remaining; |
| 2725 | GLint *params = (GLint *) 0; |
| 2726 | |
| 2727 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 2728 | glGetShaderiv( |
| 2729 | (GLuint)shader, |
| 2730 | (GLenum)pname, |
| 2731 | (GLint *)params |
| 2732 | ); |
| 2733 | if (_array) { |
| 2734 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 2735 | } |
| 2736 | } |
| 2737 | |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2738 | #include <stdlib.h> |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2739 | |
| 2740 | /* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2741 | static jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) { |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2742 | GLint infoLen = 0; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2743 | glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2744 | if (!infoLen) { |
| 2745 | return _env->NewStringUTF(""); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2746 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2747 | char* buf = (char*) malloc(infoLen); |
| 2748 | if (buf == NULL) { |
| 2749 | jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); |
| 2750 | return NULL; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2751 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2752 | glGetShaderInfoLog(shader, infoLen, NULL, buf); |
| 2753 | jstring result = _env->NewStringUTF(buf); |
| 2754 | free(buf); |
| 2755 | return result; |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2756 | } |
| 2757 | /* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ |
| 2758 | static void |
| 2759 | android_glGetShaderPrecisionFormat__II_3II_3II |
| 2760 | (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jintArray range_ref, jint rangeOffset, jintArray precision_ref, jint precisionOffset) { |
| 2761 | jint _exception = 0; |
| 2762 | GLint *range_base = (GLint *) 0; |
| 2763 | jint _rangeRemaining; |
| 2764 | GLint *range = (GLint *) 0; |
| 2765 | GLint *precision_base = (GLint *) 0; |
| 2766 | jint _precisionRemaining; |
| 2767 | GLint *precision = (GLint *) 0; |
| 2768 | |
| 2769 | if (!range_ref) { |
| 2770 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2771 | jniThrowException(_env, "java/lang/IllegalArgumentException", "range == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2772 | goto exit; |
| 2773 | } |
| 2774 | if (rangeOffset < 0) { |
| 2775 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2776 | jniThrowException(_env, "java/lang/IllegalArgumentException", "rangeOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2777 | goto exit; |
| 2778 | } |
| 2779 | _rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset; |
| 2780 | range_base = (GLint *) |
| 2781 | _env->GetPrimitiveArrayCritical(range_ref, (jboolean *)0); |
| 2782 | range = range_base + rangeOffset; |
| 2783 | |
| 2784 | if (!precision_ref) { |
| 2785 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2786 | jniThrowException(_env, "java/lang/IllegalArgumentException", "precision == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2787 | goto exit; |
| 2788 | } |
| 2789 | if (precisionOffset < 0) { |
| 2790 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2791 | jniThrowException(_env, "java/lang/IllegalArgumentException", "precisionOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2792 | goto exit; |
| 2793 | } |
| 2794 | _precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset; |
| 2795 | precision_base = (GLint *) |
| 2796 | _env->GetPrimitiveArrayCritical(precision_ref, (jboolean *)0); |
| 2797 | precision = precision_base + precisionOffset; |
| 2798 | |
| 2799 | glGetShaderPrecisionFormat( |
| 2800 | (GLenum)shadertype, |
| 2801 | (GLenum)precisiontype, |
| 2802 | (GLint *)range, |
| 2803 | (GLint *)precision |
| 2804 | ); |
| 2805 | |
| 2806 | exit: |
| 2807 | if (precision_base) { |
| 2808 | _env->ReleasePrimitiveArrayCritical(precision_ref, precision_base, |
| 2809 | _exception ? JNI_ABORT: 0); |
| 2810 | } |
| 2811 | if (range_base) { |
| 2812 | _env->ReleasePrimitiveArrayCritical(range_ref, range_base, |
| 2813 | _exception ? JNI_ABORT: 0); |
| 2814 | } |
| 2815 | } |
| 2816 | |
| 2817 | /* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ |
| 2818 | static void |
| 2819 | android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 2820 | (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) { |
| 2821 | jint _exception = 0; |
| 2822 | jarray _rangeArray = (jarray) 0; |
| 2823 | jarray _precisionArray = (jarray) 0; |
| 2824 | jint _rangeRemaining; |
| 2825 | GLint *range = (GLint *) 0; |
| 2826 | jint _precisionRemaining; |
| 2827 | GLint *precision = (GLint *) 0; |
| 2828 | |
| 2829 | range = (GLint *)getPointer(_env, range_buf, &_rangeArray, &_rangeRemaining); |
| 2830 | precision = (GLint *)getPointer(_env, precision_buf, &_precisionArray, &_precisionRemaining); |
| 2831 | glGetShaderPrecisionFormat( |
| 2832 | (GLenum)shadertype, |
| 2833 | (GLenum)precisiontype, |
| 2834 | (GLint *)range, |
| 2835 | (GLint *)precision |
| 2836 | ); |
| 2837 | if (_rangeArray) { |
| 2838 | releasePointer(_env, _rangeArray, precision, _exception ? JNI_FALSE : JNI_TRUE); |
| 2839 | } |
| 2840 | if (_precisionArray) { |
| 2841 | releasePointer(_env, _precisionArray, range, _exception ? JNI_FALSE : JNI_TRUE); |
| 2842 | } |
| 2843 | } |
| 2844 | |
| 2845 | /* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ |
| 2846 | static void |
| 2847 | android_glGetShaderSource__II_3II_3BI |
| 2848 | (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jintArray length_ref, jint lengthOffset, jbyteArray source_ref, jint sourceOffset) { |
| 2849 | jint _exception = 0; |
| 2850 | GLsizei *length_base = (GLsizei *) 0; |
| 2851 | jint _lengthRemaining; |
| 2852 | GLsizei *length = (GLsizei *) 0; |
| 2853 | char *source_base = (char *) 0; |
| 2854 | jint _sourceRemaining; |
| 2855 | char *source = (char *) 0; |
| 2856 | |
| 2857 | if (!length_ref) { |
| 2858 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2859 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2860 | goto exit; |
| 2861 | } |
| 2862 | if (lengthOffset < 0) { |
| 2863 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2864 | jniThrowException(_env, "java/lang/IllegalArgumentException", "lengthOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2865 | goto exit; |
| 2866 | } |
| 2867 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 2868 | length_base = (GLsizei *) |
| 2869 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 2870 | length = length_base + lengthOffset; |
| 2871 | |
| 2872 | if (!source_ref) { |
| 2873 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2874 | jniThrowException(_env, "java/lang/IllegalArgumentException", "source == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2875 | goto exit; |
| 2876 | } |
| 2877 | if (sourceOffset < 0) { |
| 2878 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2879 | jniThrowException(_env, "java/lang/IllegalArgumentException", "sourceOffset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2880 | goto exit; |
| 2881 | } |
| 2882 | _sourceRemaining = _env->GetArrayLength(source_ref) - sourceOffset; |
| 2883 | source_base = (char *) |
| 2884 | _env->GetPrimitiveArrayCritical(source_ref, (jboolean *)0); |
| 2885 | source = source_base + sourceOffset; |
| 2886 | |
| 2887 | glGetShaderSource( |
| 2888 | (GLuint)shader, |
| 2889 | (GLsizei)bufsize, |
| 2890 | (GLsizei *)length, |
| 2891 | (char *)source |
| 2892 | ); |
| 2893 | |
| 2894 | exit: |
| 2895 | if (source_base) { |
| 2896 | _env->ReleasePrimitiveArrayCritical(source_ref, source_base, |
| 2897 | _exception ? JNI_ABORT: 0); |
| 2898 | } |
| 2899 | if (length_base) { |
| 2900 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 2901 | _exception ? JNI_ABORT: 0); |
| 2902 | } |
| 2903 | } |
| 2904 | |
| 2905 | /* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ |
| 2906 | static void |
| 2907 | android_glGetShaderSource__IILjava_nio_IntBuffer_2B |
| 2908 | (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jobject length_buf, jbyte source) { |
| 2909 | jint _exception = 0; |
| 2910 | jarray _array = (jarray) 0; |
| 2911 | jint _remaining; |
| 2912 | GLsizei *length = (GLsizei *) 0; |
| 2913 | |
| 2914 | length = (GLsizei *)getPointer(_env, length_buf, &_array, &_remaining); |
| 2915 | glGetShaderSource( |
| 2916 | (GLuint)shader, |
| 2917 | (GLsizei)bufsize, |
| 2918 | (GLsizei *)length, |
| 2919 | (char *)source |
| 2920 | ); |
| 2921 | if (_array) { |
| 2922 | releasePointer(_env, _array, length, _exception ? JNI_FALSE : JNI_TRUE); |
| 2923 | } |
| 2924 | } |
| 2925 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2926 | /* const GLubyte * glGetString ( GLenum name ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2927 | static jstring android_glGetString(JNIEnv* _env, jobject, jint name) { |
| 2928 | const char* chars = (const char*) glGetString((GLenum) name); |
| 2929 | return _env->NewStringUTF(chars); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2930 | } |
| 2931 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 2932 | static void |
| 2933 | android_glGetTexParameterfv__II_3FI |
| 2934 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 2935 | jint _exception = 0; |
| 2936 | GLfloat *params_base = (GLfloat *) 0; |
| 2937 | jint _remaining; |
| 2938 | GLfloat *params = (GLfloat *) 0; |
| 2939 | |
| 2940 | if (!params_ref) { |
| 2941 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2942 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2943 | goto exit; |
| 2944 | } |
| 2945 | if (offset < 0) { |
| 2946 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2947 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2948 | goto exit; |
| 2949 | } |
| 2950 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2951 | if (_remaining < 1) { |
| 2952 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2953 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2954 | goto exit; |
| 2955 | } |
| 2956 | params_base = (GLfloat *) |
| 2957 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2958 | params = params_base + offset; |
| 2959 | |
| 2960 | glGetTexParameterfv( |
| 2961 | (GLenum)target, |
| 2962 | (GLenum)pname, |
| 2963 | (GLfloat *)params |
| 2964 | ); |
| 2965 | |
| 2966 | exit: |
| 2967 | if (params_base) { |
| 2968 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2969 | _exception ? JNI_ABORT: 0); |
| 2970 | } |
| 2971 | } |
| 2972 | |
| 2973 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 2974 | static void |
| 2975 | android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 2976 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 2977 | jint _exception = 0; |
| 2978 | jarray _array = (jarray) 0; |
| 2979 | jint _remaining; |
| 2980 | GLfloat *params = (GLfloat *) 0; |
| 2981 | |
| 2982 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); |
| 2983 | if (_remaining < 1) { |
| 2984 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2985 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 2986 | goto exit; |
| 2987 | } |
| 2988 | glGetTexParameterfv( |
| 2989 | (GLenum)target, |
| 2990 | (GLenum)pname, |
| 2991 | (GLfloat *)params |
| 2992 | ); |
| 2993 | |
| 2994 | exit: |
| 2995 | if (_array) { |
| 2996 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 2997 | } |
| 2998 | } |
| 2999 | |
| 3000 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 3001 | static void |
| 3002 | android_glGetTexParameteriv__II_3II |
| 3003 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 3004 | jint _exception = 0; |
| 3005 | GLint *params_base = (GLint *) 0; |
| 3006 | jint _remaining; |
| 3007 | GLint *params = (GLint *) 0; |
| 3008 | |
| 3009 | if (!params_ref) { |
| 3010 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3011 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3012 | goto exit; |
| 3013 | } |
| 3014 | if (offset < 0) { |
| 3015 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3016 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3017 | goto exit; |
| 3018 | } |
| 3019 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3020 | if (_remaining < 1) { |
| 3021 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3022 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3023 | goto exit; |
| 3024 | } |
| 3025 | params_base = (GLint *) |
| 3026 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3027 | params = params_base + offset; |
| 3028 | |
| 3029 | glGetTexParameteriv( |
| 3030 | (GLenum)target, |
| 3031 | (GLenum)pname, |
| 3032 | (GLint *)params |
| 3033 | ); |
| 3034 | |
| 3035 | exit: |
| 3036 | if (params_base) { |
| 3037 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3038 | _exception ? JNI_ABORT: 0); |
| 3039 | } |
| 3040 | } |
| 3041 | |
| 3042 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 3043 | static void |
| 3044 | android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 |
| 3045 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 3046 | jint _exception = 0; |
| 3047 | jarray _array = (jarray) 0; |
| 3048 | jint _remaining; |
| 3049 | GLint *params = (GLint *) 0; |
| 3050 | |
| 3051 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3052 | if (_remaining < 1) { |
| 3053 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3054 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3055 | goto exit; |
| 3056 | } |
| 3057 | glGetTexParameteriv( |
| 3058 | (GLenum)target, |
| 3059 | (GLenum)pname, |
| 3060 | (GLint *)params |
| 3061 | ); |
| 3062 | |
| 3063 | exit: |
| 3064 | if (_array) { |
| 3065 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 3066 | } |
| 3067 | } |
| 3068 | |
| 3069 | /* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ |
| 3070 | static void |
| 3071 | android_glGetUniformfv__II_3FI |
| 3072 | (JNIEnv *_env, jobject _this, jint program, jint location, jfloatArray params_ref, jint offset) { |
| 3073 | jint _exception = 0; |
| 3074 | GLfloat *params_base = (GLfloat *) 0; |
| 3075 | jint _remaining; |
| 3076 | GLfloat *params = (GLfloat *) 0; |
| 3077 | |
| 3078 | if (!params_ref) { |
| 3079 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3080 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3081 | goto exit; |
| 3082 | } |
| 3083 | if (offset < 0) { |
| 3084 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3085 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3086 | goto exit; |
| 3087 | } |
| 3088 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3089 | params_base = (GLfloat *) |
| 3090 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3091 | params = params_base + offset; |
| 3092 | |
| 3093 | glGetUniformfv( |
| 3094 | (GLuint)program, |
| 3095 | (GLint)location, |
| 3096 | (GLfloat *)params |
| 3097 | ); |
| 3098 | |
| 3099 | exit: |
| 3100 | if (params_base) { |
| 3101 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3102 | _exception ? JNI_ABORT: 0); |
| 3103 | } |
| 3104 | } |
| 3105 | |
| 3106 | /* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ |
| 3107 | static void |
| 3108 | android_glGetUniformfv__IILjava_nio_FloatBuffer_2 |
| 3109 | (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { |
| 3110 | jint _exception = 0; |
| 3111 | jarray _array = (jarray) 0; |
| 3112 | jint _remaining; |
| 3113 | GLfloat *params = (GLfloat *) 0; |
| 3114 | |
| 3115 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3116 | glGetUniformfv( |
| 3117 | (GLuint)program, |
| 3118 | (GLint)location, |
| 3119 | (GLfloat *)params |
| 3120 | ); |
| 3121 | if (_array) { |
| 3122 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 3123 | } |
| 3124 | } |
| 3125 | |
| 3126 | /* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ |
| 3127 | static void |
| 3128 | android_glGetUniformiv__II_3II |
| 3129 | (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) { |
| 3130 | jint _exception = 0; |
| 3131 | GLint *params_base = (GLint *) 0; |
| 3132 | jint _remaining; |
| 3133 | GLint *params = (GLint *) 0; |
| 3134 | |
| 3135 | if (!params_ref) { |
| 3136 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3137 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3138 | goto exit; |
| 3139 | } |
| 3140 | if (offset < 0) { |
| 3141 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3142 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3143 | goto exit; |
| 3144 | } |
| 3145 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3146 | params_base = (GLint *) |
| 3147 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3148 | params = params_base + offset; |
| 3149 | |
| 3150 | glGetUniformiv( |
| 3151 | (GLuint)program, |
| 3152 | (GLint)location, |
| 3153 | (GLint *)params |
| 3154 | ); |
| 3155 | |
| 3156 | exit: |
| 3157 | if (params_base) { |
| 3158 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3159 | _exception ? JNI_ABORT: 0); |
| 3160 | } |
| 3161 | } |
| 3162 | |
| 3163 | /* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ |
| 3164 | static void |
| 3165 | android_glGetUniformiv__IILjava_nio_IntBuffer_2 |
| 3166 | (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { |
| 3167 | jint _exception = 0; |
| 3168 | jarray _array = (jarray) 0; |
| 3169 | jint _remaining; |
| 3170 | GLint *params = (GLint *) 0; |
| 3171 | |
| 3172 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3173 | glGetUniformiv( |
| 3174 | (GLuint)program, |
| 3175 | (GLint)location, |
| 3176 | (GLint *)params |
| 3177 | ); |
| 3178 | if (_array) { |
| 3179 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 3180 | } |
| 3181 | } |
| 3182 | |
| 3183 | /* int glGetUniformLocation ( GLuint program, const char *name ) */ |
| 3184 | static jint |
| 3185 | android_glGetUniformLocation__ILjava_lang_String_2 |
| 3186 | (JNIEnv *_env, jobject _this, jint program, jstring name) { |
| 3187 | int _returnValue = 0; |
| 3188 | const char* _nativename = 0; |
| 3189 | |
| 3190 | if (!name) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3191 | jniThrowException(_env, "java/lang/IllegalArgumentException", "name == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3192 | goto exit; |
| 3193 | } |
| 3194 | _nativename = _env->GetStringUTFChars(name, 0); |
| 3195 | |
| 3196 | _returnValue = glGetUniformLocation( |
| 3197 | (GLuint)program, |
| 3198 | (char *)_nativename |
| 3199 | ); |
| 3200 | |
| 3201 | exit: |
| 3202 | if (_nativename) { |
| 3203 | _env->ReleaseStringUTFChars(name, _nativename); |
| 3204 | } |
| 3205 | |
| 3206 | return _returnValue; |
| 3207 | } |
| 3208 | |
| 3209 | /* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ |
| 3210 | static void |
| 3211 | android_glGetVertexAttribfv__II_3FI |
| 3212 | (JNIEnv *_env, jobject _this, jint index, jint pname, jfloatArray params_ref, jint offset) { |
| 3213 | jint _exception = 0; |
| 3214 | GLfloat *params_base = (GLfloat *) 0; |
| 3215 | jint _remaining; |
| 3216 | GLfloat *params = (GLfloat *) 0; |
| 3217 | |
| 3218 | if (!params_ref) { |
| 3219 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3220 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3221 | goto exit; |
| 3222 | } |
| 3223 | if (offset < 0) { |
| 3224 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3225 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3226 | goto exit; |
| 3227 | } |
| 3228 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3229 | params_base = (GLfloat *) |
| 3230 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3231 | params = params_base + offset; |
| 3232 | |
| 3233 | glGetVertexAttribfv( |
| 3234 | (GLuint)index, |
| 3235 | (GLenum)pname, |
| 3236 | (GLfloat *)params |
| 3237 | ); |
| 3238 | |
| 3239 | exit: |
| 3240 | if (params_base) { |
| 3241 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3242 | _exception ? JNI_ABORT: 0); |
| 3243 | } |
| 3244 | } |
| 3245 | |
| 3246 | /* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ |
| 3247 | static void |
| 3248 | android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 |
| 3249 | (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { |
| 3250 | jint _exception = 0; |
| 3251 | jarray _array = (jarray) 0; |
| 3252 | jint _remaining; |
| 3253 | GLfloat *params = (GLfloat *) 0; |
| 3254 | |
| 3255 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3256 | glGetVertexAttribfv( |
| 3257 | (GLuint)index, |
| 3258 | (GLenum)pname, |
| 3259 | (GLfloat *)params |
| 3260 | ); |
| 3261 | if (_array) { |
| 3262 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 3263 | } |
| 3264 | } |
| 3265 | |
| 3266 | /* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ |
| 3267 | static void |
| 3268 | android_glGetVertexAttribiv__II_3II |
| 3269 | (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) { |
| 3270 | jint _exception = 0; |
| 3271 | GLint *params_base = (GLint *) 0; |
| 3272 | jint _remaining; |
| 3273 | GLint *params = (GLint *) 0; |
| 3274 | |
| 3275 | if (!params_ref) { |
| 3276 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3277 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3278 | goto exit; |
| 3279 | } |
| 3280 | if (offset < 0) { |
| 3281 | _exception = 1; |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3282 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3283 | goto exit; |
| 3284 | } |
| 3285 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3286 | params_base = (GLint *) |
| 3287 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3288 | params = params_base + offset; |
| 3289 | |
| 3290 | glGetVertexAttribiv( |
| 3291 | (GLuint)index, |
| 3292 | (GLenum)pname, |
| 3293 | (GLint *)params |
| 3294 | ); |
| 3295 | |
| 3296 | exit: |
| 3297 | if (params_base) { |
| 3298 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3299 | _exception ? JNI_ABORT: 0); |
| 3300 | } |
| 3301 | } |
| 3302 | |
| 3303 | /* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ |
| 3304 | static void |
| 3305 | android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 |
| 3306 | (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { |
| 3307 | jint _exception = 0; |
| 3308 | jarray _array = (jarray) 0; |
| 3309 | jint _remaining; |
| 3310 | GLint *params = (GLint *) 0; |
| 3311 | |
| 3312 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3313 | glGetVertexAttribiv( |
| 3314 | (GLuint)index, |
| 3315 | (GLenum)pname, |
| 3316 | (GLint *)params |
| 3317 | ); |
| 3318 | if (_array) { |
| 3319 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 3320 | } |
| 3321 | } |
| 3322 | |
| 3323 | /* void glHint ( GLenum target, GLenum mode ) */ |
| 3324 | static void |
| 3325 | android_glHint__II |
| 3326 | (JNIEnv *_env, jobject _this, jint target, jint mode) { |
| 3327 | glHint( |
| 3328 | (GLenum)target, |
| 3329 | (GLenum)mode |
| 3330 | ); |
| 3331 | } |
| 3332 | |
| 3333 | /* GLboolean glIsBuffer ( GLuint buffer ) */ |
| 3334 | static jboolean |
| 3335 | android_glIsBuffer__I |
| 3336 | (JNIEnv *_env, jobject _this, jint buffer) { |
| 3337 | GLboolean _returnValue; |
| 3338 | _returnValue = glIsBuffer( |
| 3339 | (GLuint)buffer |
| 3340 | ); |
| 3341 | return _returnValue; |
| 3342 | } |
| 3343 | |
| 3344 | /* GLboolean glIsEnabled ( GLenum cap ) */ |
| 3345 | static jboolean |
| 3346 | android_glIsEnabled__I |
| 3347 | (JNIEnv *_env, jobject _this, jint cap) { |
| 3348 | GLboolean _returnValue; |
| 3349 | _returnValue = glIsEnabled( |
| 3350 | (GLenum)cap |
| 3351 | ); |
| 3352 | return _returnValue; |
| 3353 | } |
| 3354 | |
| 3355 | /* GLboolean glIsFramebuffer ( GLuint framebuffer ) */ |
| 3356 | static jboolean |
| 3357 | android_glIsFramebuffer__I |
| 3358 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
| 3359 | GLboolean _returnValue; |
| 3360 | _returnValue = glIsFramebuffer( |
| 3361 | (GLuint)framebuffer |
| 3362 | ); |
| 3363 | return _returnValue; |
| 3364 | } |
| 3365 | |
| 3366 | /* GLboolean glIsProgram ( GLuint program ) */ |
| 3367 | static jboolean |
| 3368 | android_glIsProgram__I |
| 3369 | (JNIEnv *_env, jobject _this, jint program) { |
| 3370 | GLboolean _returnValue; |
| 3371 | _returnValue = glIsProgram( |
| 3372 | (GLuint)program |
| 3373 | ); |
| 3374 | return _returnValue; |
| 3375 | } |
| 3376 | |
| 3377 | /* GLboolean glIsRenderbuffer ( GLuint renderbuffer ) */ |
| 3378 | static jboolean |
| 3379 | android_glIsRenderbuffer__I |
| 3380 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
| 3381 | GLboolean _returnValue; |
| 3382 | _returnValue = glIsRenderbuffer( |
| 3383 | (GLuint)renderbuffer |
| 3384 | ); |
| 3385 | return _returnValue; |
| 3386 | } |
| 3387 | |
| 3388 | /* GLboolean glIsShader ( GLuint shader ) */ |
| 3389 | static jboolean |
| 3390 | android_glIsShader__I |
| 3391 | (JNIEnv *_env, jobject _this, jint shader) { |
| 3392 | GLboolean _returnValue; |
| 3393 | _returnValue = glIsShader( |
| 3394 | (GLuint)shader |
| 3395 | ); |
| 3396 | return _returnValue; |
| 3397 | } |
| 3398 | |
| 3399 | /* GLboolean glIsTexture ( GLuint texture ) */ |
| 3400 | static jboolean |
| 3401 | android_glIsTexture__I |
| 3402 | (JNIEnv *_env, jobject _this, jint texture) { |
| 3403 | GLboolean _returnValue; |
| 3404 | _returnValue = glIsTexture( |
| 3405 | (GLuint)texture |
| 3406 | ); |
| 3407 | return _returnValue; |
| 3408 | } |
| 3409 | |
| 3410 | /* void glLineWidth ( GLfloat width ) */ |
| 3411 | static void |
| 3412 | android_glLineWidth__F |
| 3413 | (JNIEnv *_env, jobject _this, jfloat width) { |
| 3414 | glLineWidth( |
| 3415 | (GLfloat)width |
| 3416 | ); |
| 3417 | } |
| 3418 | |
| 3419 | /* void glLinkProgram ( GLuint program ) */ |
| 3420 | static void |
| 3421 | android_glLinkProgram__I |
| 3422 | (JNIEnv *_env, jobject _this, jint program) { |
| 3423 | glLinkProgram( |
| 3424 | (GLuint)program |
| 3425 | ); |
| 3426 | } |
| 3427 | |
| 3428 | /* void glPixelStorei ( GLenum pname, GLint param ) */ |
| 3429 | static void |
| 3430 | android_glPixelStorei__II |
| 3431 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 3432 | glPixelStorei( |
| 3433 | (GLenum)pname, |
| 3434 | (GLint)param |
| 3435 | ); |
| 3436 | } |
| 3437 | |
| 3438 | /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ |
| 3439 | static void |
| 3440 | android_glPolygonOffset__FF |
| 3441 | (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { |
| 3442 | glPolygonOffset( |
| 3443 | (GLfloat)factor, |
| 3444 | (GLfloat)units |
| 3445 | ); |
| 3446 | } |
| 3447 | |
| 3448 | /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ |
| 3449 | static void |
| 3450 | android_glReadPixels__IIIIIILjava_nio_Buffer_2 |
| 3451 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
| 3452 | jint _exception = 0; |
| 3453 | jarray _array = (jarray) 0; |
| 3454 | jint _remaining; |
| 3455 | GLvoid *pixels = (GLvoid *) 0; |
| 3456 | |
| 3457 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining); |
| 3458 | glReadPixels( |
| 3459 | (GLint)x, |
| 3460 | (GLint)y, |
| 3461 | (GLsizei)width, |
| 3462 | (GLsizei)height, |
| 3463 | (GLenum)format, |
| 3464 | (GLenum)type, |
| 3465 | (GLvoid *)pixels |
| 3466 | ); |
| 3467 | if (_array) { |
| 3468 | releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE); |
| 3469 | } |
| 3470 | } |
| 3471 | |
| 3472 | /* void glReleaseShaderCompiler ( void ) */ |
| 3473 | static void |
| 3474 | android_glReleaseShaderCompiler__ |
| 3475 | (JNIEnv *_env, jobject _this) { |
| 3476 | glReleaseShaderCompiler(); |
| 3477 | } |
| 3478 | |
| 3479 | /* void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) */ |
| 3480 | static void |
| 3481 | android_glRenderbufferStorage__IIII |
| 3482 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
| 3483 | glRenderbufferStorage( |
| 3484 | (GLenum)target, |
| 3485 | (GLenum)internalformat, |
| 3486 | (GLsizei)width, |
| 3487 | (GLsizei)height |
| 3488 | ); |
| 3489 | } |
| 3490 | |
| 3491 | /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ |
| 3492 | static void |
| 3493 | android_glSampleCoverage__FZ |
| 3494 | (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { |
| 3495 | glSampleCoverage( |
| 3496 | (GLclampf)value, |
| 3497 | (GLboolean)invert |
| 3498 | ); |
| 3499 | } |
| 3500 | |
| 3501 | /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3502 | static void |
| 3503 | android_glScissor__IIII |
| 3504 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3505 | glScissor( |
| 3506 | (GLint)x, |
| 3507 | (GLint)y, |
| 3508 | (GLsizei)width, |
| 3509 | (GLsizei)height |
| 3510 | ); |
| 3511 | } |
| 3512 | |
| 3513 | /* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ |
| 3514 | static void |
| 3515 | android_glShaderBinary__I_3IIILjava_nio_Buffer_2I |
| 3516 | (JNIEnv *_env, jobject _this, jint n, jintArray shaders_ref, jint offset, jint binaryformat, jobject binary_buf, jint length) { |
| 3517 | jarray _array = (jarray) 0; |
| 3518 | GLuint *shaders_base = (GLuint *) 0; |
| 3519 | jint _shadersRemaining; |
| 3520 | GLuint *shaders = (GLuint *) 0; |
| 3521 | jint _binaryRemaining; |
| 3522 | GLvoid *binary = (GLvoid *) 0; |
| 3523 | |
| 3524 | if (!shaders_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3525 | jniThrowException(_env, "java/lang/IllegalArgumentException", "shaders == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3526 | goto exit; |
| 3527 | } |
| 3528 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3529 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3530 | goto exit; |
| 3531 | } |
| 3532 | _shadersRemaining = _env->GetArrayLength(shaders_ref) - offset; |
| 3533 | shaders_base = (GLuint *) |
| 3534 | _env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0); |
| 3535 | shaders = shaders_base + offset; |
| 3536 | |
| 3537 | binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining); |
| 3538 | glShaderBinary( |
| 3539 | (GLsizei)n, |
| 3540 | (GLuint *)shaders, |
| 3541 | (GLenum)binaryformat, |
| 3542 | (GLvoid *)binary, |
| 3543 | (GLsizei)length |
| 3544 | ); |
| 3545 | |
| 3546 | exit: |
| 3547 | if (_array) { |
| 3548 | releasePointer(_env, _array, binary, JNI_FALSE); |
| 3549 | } |
| 3550 | if (shaders_base) { |
| 3551 | _env->ReleasePrimitiveArrayCritical(shaders_ref, shaders_base, |
| 3552 | JNI_ABORT); |
| 3553 | } |
| 3554 | } |
| 3555 | |
| 3556 | /* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ |
| 3557 | static void |
| 3558 | android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I |
| 3559 | (JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) { |
| 3560 | jarray _shadersArray = (jarray) 0; |
| 3561 | jarray _binaryArray = (jarray) 0; |
| 3562 | jint _shadersRemaining; |
| 3563 | GLuint *shaders = (GLuint *) 0; |
| 3564 | jint _binaryRemaining; |
| 3565 | GLvoid *binary = (GLvoid *) 0; |
| 3566 | |
| 3567 | shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining); |
| 3568 | binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining); |
| 3569 | glShaderBinary( |
| 3570 | (GLsizei)n, |
| 3571 | (GLuint *)shaders, |
| 3572 | (GLenum)binaryformat, |
| 3573 | (GLvoid *)binary, |
| 3574 | (GLsizei)length |
| 3575 | ); |
| 3576 | if (_shadersArray) { |
| 3577 | releasePointer(_env, _shadersArray, binary, JNI_FALSE); |
| 3578 | } |
| 3579 | if (_binaryArray) { |
| 3580 | releasePointer(_env, _binaryArray, shaders, JNI_FALSE); |
| 3581 | } |
| 3582 | } |
| 3583 | |
| 3584 | |
| 3585 | /* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */ |
| 3586 | static |
| 3587 | void |
| 3588 | android_glShaderSource |
| 3589 | (JNIEnv *_env, jobject _this, jint shader, jstring string) { |
| 3590 | |
| 3591 | if (!string) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3592 | jniThrowException(_env, "java/lang/IllegalArgumentException", "string == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3593 | return; |
| 3594 | } |
| 3595 | |
| 3596 | const char* nativeString = _env->GetStringUTFChars(string, 0); |
| 3597 | const char* strings[] = {nativeString}; |
| 3598 | glShaderSource(shader, 1, strings, 0); |
| 3599 | _env->ReleaseStringUTFChars(string, nativeString); |
| 3600 | } |
| 3601 | /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ |
| 3602 | static void |
| 3603 | android_glStencilFunc__III |
| 3604 | (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { |
| 3605 | glStencilFunc( |
| 3606 | (GLenum)func, |
| 3607 | (GLint)ref, |
| 3608 | (GLuint)mask |
| 3609 | ); |
| 3610 | } |
| 3611 | |
| 3612 | /* void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) */ |
| 3613 | static void |
| 3614 | android_glStencilFuncSeparate__IIII |
| 3615 | (JNIEnv *_env, jobject _this, jint face, jint func, jint ref, jint mask) { |
| 3616 | glStencilFuncSeparate( |
| 3617 | (GLenum)face, |
| 3618 | (GLenum)func, |
| 3619 | (GLint)ref, |
| 3620 | (GLuint)mask |
| 3621 | ); |
| 3622 | } |
| 3623 | |
| 3624 | /* void glStencilMask ( GLuint mask ) */ |
| 3625 | static void |
| 3626 | android_glStencilMask__I |
| 3627 | (JNIEnv *_env, jobject _this, jint mask) { |
| 3628 | glStencilMask( |
| 3629 | (GLuint)mask |
| 3630 | ); |
| 3631 | } |
| 3632 | |
| 3633 | /* void glStencilMaskSeparate ( GLenum face, GLuint mask ) */ |
| 3634 | static void |
| 3635 | android_glStencilMaskSeparate__II |
| 3636 | (JNIEnv *_env, jobject _this, jint face, jint mask) { |
| 3637 | glStencilMaskSeparate( |
| 3638 | (GLenum)face, |
| 3639 | (GLuint)mask |
| 3640 | ); |
| 3641 | } |
| 3642 | |
| 3643 | /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3644 | static void |
| 3645 | android_glStencilOp__III |
| 3646 | (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { |
| 3647 | glStencilOp( |
| 3648 | (GLenum)fail, |
| 3649 | (GLenum)zfail, |
| 3650 | (GLenum)zpass |
| 3651 | ); |
| 3652 | } |
| 3653 | |
| 3654 | /* void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3655 | static void |
| 3656 | android_glStencilOpSeparate__IIII |
| 3657 | (JNIEnv *_env, jobject _this, jint face, jint fail, jint zfail, jint zpass) { |
| 3658 | glStencilOpSeparate( |
| 3659 | (GLenum)face, |
| 3660 | (GLenum)fail, |
| 3661 | (GLenum)zfail, |
| 3662 | (GLenum)zpass |
| 3663 | ); |
| 3664 | } |
| 3665 | |
| 3666 | /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3667 | static void |
| 3668 | android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3669 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { |
| 3670 | jarray _array = (jarray) 0; |
| 3671 | jint _remaining; |
| 3672 | GLvoid *pixels = (GLvoid *) 0; |
| 3673 | |
| 3674 | if (pixels_buf) { |
| 3675 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining); |
| 3676 | } |
| 3677 | glTexImage2D( |
| 3678 | (GLenum)target, |
| 3679 | (GLint)level, |
| 3680 | (GLint)internalformat, |
| 3681 | (GLsizei)width, |
| 3682 | (GLsizei)height, |
| 3683 | (GLint)border, |
| 3684 | (GLenum)format, |
| 3685 | (GLenum)type, |
| 3686 | (GLvoid *)pixels |
| 3687 | ); |
| 3688 | if (_array) { |
| 3689 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3690 | } |
| 3691 | } |
| 3692 | |
| 3693 | /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3694 | static void |
| 3695 | android_glTexParameterf__IIF |
| 3696 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3697 | glTexParameterf( |
| 3698 | (GLenum)target, |
| 3699 | (GLenum)pname, |
| 3700 | (GLfloat)param |
| 3701 | ); |
| 3702 | } |
| 3703 | |
| 3704 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3705 | static void |
| 3706 | android_glTexParameterfv__II_3FI |
| 3707 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 3708 | GLfloat *params_base = (GLfloat *) 0; |
| 3709 | jint _remaining; |
| 3710 | GLfloat *params = (GLfloat *) 0; |
| 3711 | |
| 3712 | if (!params_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3713 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3714 | goto exit; |
| 3715 | } |
| 3716 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3717 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3718 | goto exit; |
| 3719 | } |
| 3720 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3721 | if (_remaining < 1) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3722 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3723 | goto exit; |
| 3724 | } |
| 3725 | params_base = (GLfloat *) |
| 3726 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3727 | params = params_base + offset; |
| 3728 | |
| 3729 | glTexParameterfv( |
| 3730 | (GLenum)target, |
| 3731 | (GLenum)pname, |
| 3732 | (GLfloat *)params |
| 3733 | ); |
| 3734 | |
| 3735 | exit: |
| 3736 | if (params_base) { |
| 3737 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3738 | JNI_ABORT); |
| 3739 | } |
| 3740 | } |
| 3741 | |
| 3742 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3743 | static void |
| 3744 | android_glTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 3745 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 3746 | jarray _array = (jarray) 0; |
| 3747 | jint _remaining; |
| 3748 | GLfloat *params = (GLfloat *) 0; |
| 3749 | |
| 3750 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3751 | if (_remaining < 1) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3752 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3753 | goto exit; |
| 3754 | } |
| 3755 | glTexParameterfv( |
| 3756 | (GLenum)target, |
| 3757 | (GLenum)pname, |
| 3758 | (GLfloat *)params |
| 3759 | ); |
| 3760 | |
| 3761 | exit: |
| 3762 | if (_array) { |
| 3763 | releasePointer(_env, _array, params, JNI_FALSE); |
| 3764 | } |
| 3765 | } |
| 3766 | |
| 3767 | /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ |
| 3768 | static void |
| 3769 | android_glTexParameteri__III |
| 3770 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3771 | glTexParameteri( |
| 3772 | (GLenum)target, |
| 3773 | (GLenum)pname, |
| 3774 | (GLint)param |
| 3775 | ); |
| 3776 | } |
| 3777 | |
| 3778 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 3779 | static void |
| 3780 | android_glTexParameteriv__II_3II |
| 3781 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 3782 | GLint *params_base = (GLint *) 0; |
| 3783 | jint _remaining; |
| 3784 | GLint *params = (GLint *) 0; |
| 3785 | |
| 3786 | if (!params_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3787 | jniThrowException(_env, "java/lang/IllegalArgumentException", "params == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3788 | goto exit; |
| 3789 | } |
| 3790 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3791 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3792 | goto exit; |
| 3793 | } |
| 3794 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3795 | if (_remaining < 1) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3796 | jniThrowException(_env, "java/lang/IllegalArgumentException", "length - offset < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3797 | goto exit; |
| 3798 | } |
| 3799 | params_base = (GLint *) |
| 3800 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3801 | params = params_base + offset; |
| 3802 | |
| 3803 | glTexParameteriv( |
| 3804 | (GLenum)target, |
| 3805 | (GLenum)pname, |
| 3806 | (GLint *)params |
| 3807 | ); |
| 3808 | |
| 3809 | exit: |
| 3810 | if (params_base) { |
| 3811 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3812 | JNI_ABORT); |
| 3813 | } |
| 3814 | } |
| 3815 | |
| 3816 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 3817 | static void |
| 3818 | android_glTexParameteriv__IILjava_nio_IntBuffer_2 |
| 3819 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 3820 | jarray _array = (jarray) 0; |
| 3821 | jint _remaining; |
| 3822 | GLint *params = (GLint *) 0; |
| 3823 | |
| 3824 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); |
| 3825 | if (_remaining < 1) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3826 | jniThrowException(_env, "java/lang/IllegalArgumentException", "remaining() < 1"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3827 | goto exit; |
| 3828 | } |
| 3829 | glTexParameteriv( |
| 3830 | (GLenum)target, |
| 3831 | (GLenum)pname, |
| 3832 | (GLint *)params |
| 3833 | ); |
| 3834 | |
| 3835 | exit: |
| 3836 | if (_array) { |
| 3837 | releasePointer(_env, _array, params, JNI_FALSE); |
| 3838 | } |
| 3839 | } |
| 3840 | |
| 3841 | /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3842 | static void |
| 3843 | android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3844 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
| 3845 | jarray _array = (jarray) 0; |
| 3846 | jint _remaining; |
| 3847 | GLvoid *pixels = (GLvoid *) 0; |
| 3848 | |
| 3849 | if (pixels_buf) { |
| 3850 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining); |
| 3851 | } |
| 3852 | glTexSubImage2D( |
| 3853 | (GLenum)target, |
| 3854 | (GLint)level, |
| 3855 | (GLint)xoffset, |
| 3856 | (GLint)yoffset, |
| 3857 | (GLsizei)width, |
| 3858 | (GLsizei)height, |
| 3859 | (GLenum)format, |
| 3860 | (GLenum)type, |
| 3861 | (GLvoid *)pixels |
| 3862 | ); |
| 3863 | if (_array) { |
| 3864 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3865 | } |
| 3866 | } |
| 3867 | |
| 3868 | /* void glUniform1f ( GLint location, GLfloat x ) */ |
| 3869 | static void |
| 3870 | android_glUniform1f__IF |
| 3871 | (JNIEnv *_env, jobject _this, jint location, jfloat x) { |
| 3872 | glUniform1f( |
| 3873 | (GLint)location, |
| 3874 | (GLfloat)x |
| 3875 | ); |
| 3876 | } |
| 3877 | |
| 3878 | /* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 3879 | static void |
| 3880 | android_glUniform1fv__II_3FI |
| 3881 | (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { |
| 3882 | GLfloat *v_base = (GLfloat *) 0; |
| 3883 | jint _remaining; |
| 3884 | GLfloat *v = (GLfloat *) 0; |
| 3885 | |
| 3886 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3887 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3888 | goto exit; |
| 3889 | } |
| 3890 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3891 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3892 | goto exit; |
| 3893 | } |
| 3894 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 3895 | v_base = (GLfloat *) |
| 3896 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 3897 | v = v_base + offset; |
| 3898 | |
| 3899 | glUniform1fv( |
| 3900 | (GLint)location, |
| 3901 | (GLsizei)count, |
| 3902 | (GLfloat *)v |
| 3903 | ); |
| 3904 | |
| 3905 | exit: |
| 3906 | if (v_base) { |
| 3907 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 3908 | JNI_ABORT); |
| 3909 | } |
| 3910 | } |
| 3911 | |
| 3912 | /* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 3913 | static void |
| 3914 | android_glUniform1fv__IILjava_nio_FloatBuffer_2 |
| 3915 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 3916 | jarray _array = (jarray) 0; |
| 3917 | jint _remaining; |
| 3918 | GLfloat *v = (GLfloat *) 0; |
| 3919 | |
| 3920 | v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining); |
| 3921 | glUniform1fv( |
| 3922 | (GLint)location, |
| 3923 | (GLsizei)count, |
| 3924 | (GLfloat *)v |
| 3925 | ); |
| 3926 | if (_array) { |
| 3927 | releasePointer(_env, _array, v, JNI_FALSE); |
| 3928 | } |
| 3929 | } |
| 3930 | |
| 3931 | /* void glUniform1i ( GLint location, GLint x ) */ |
| 3932 | static void |
| 3933 | android_glUniform1i__II |
| 3934 | (JNIEnv *_env, jobject _this, jint location, jint x) { |
| 3935 | glUniform1i( |
| 3936 | (GLint)location, |
| 3937 | (GLint)x |
| 3938 | ); |
| 3939 | } |
| 3940 | |
| 3941 | /* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 3942 | static void |
| 3943 | android_glUniform1iv__II_3II |
| 3944 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { |
| 3945 | GLint *v_base = (GLint *) 0; |
| 3946 | jint _remaining; |
| 3947 | GLint *v = (GLint *) 0; |
| 3948 | |
| 3949 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3950 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3951 | goto exit; |
| 3952 | } |
| 3953 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 3954 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 3955 | goto exit; |
| 3956 | } |
| 3957 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 3958 | v_base = (GLint *) |
| 3959 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 3960 | v = v_base + offset; |
| 3961 | |
| 3962 | glUniform1iv( |
| 3963 | (GLint)location, |
| 3964 | (GLsizei)count, |
| 3965 | (GLint *)v |
| 3966 | ); |
| 3967 | |
| 3968 | exit: |
| 3969 | if (v_base) { |
| 3970 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 3971 | JNI_ABORT); |
| 3972 | } |
| 3973 | } |
| 3974 | |
| 3975 | /* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 3976 | static void |
| 3977 | android_glUniform1iv__IILjava_nio_IntBuffer_2 |
| 3978 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 3979 | jarray _array = (jarray) 0; |
| 3980 | jint _remaining; |
| 3981 | GLint *v = (GLint *) 0; |
| 3982 | |
| 3983 | v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining); |
| 3984 | glUniform1iv( |
| 3985 | (GLint)location, |
| 3986 | (GLsizei)count, |
| 3987 | (GLint *)v |
| 3988 | ); |
| 3989 | if (_array) { |
| 3990 | releasePointer(_env, _array, v, JNI_FALSE); |
| 3991 | } |
| 3992 | } |
| 3993 | |
| 3994 | /* void glUniform2f ( GLint location, GLfloat x, GLfloat y ) */ |
| 3995 | static void |
| 3996 | android_glUniform2f__IFF |
| 3997 | (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y) { |
| 3998 | glUniform2f( |
| 3999 | (GLint)location, |
| 4000 | (GLfloat)x, |
| 4001 | (GLfloat)y |
| 4002 | ); |
| 4003 | } |
| 4004 | |
| 4005 | /* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4006 | static void |
| 4007 | android_glUniform2fv__II_3FI |
| 4008 | (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { |
| 4009 | GLfloat *v_base = (GLfloat *) 0; |
| 4010 | jint _remaining; |
| 4011 | GLfloat *v = (GLfloat *) 0; |
| 4012 | |
| 4013 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4014 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4015 | goto exit; |
| 4016 | } |
| 4017 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4018 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4019 | goto exit; |
| 4020 | } |
| 4021 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4022 | v_base = (GLfloat *) |
| 4023 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4024 | v = v_base + offset; |
| 4025 | |
| 4026 | glUniform2fv( |
| 4027 | (GLint)location, |
| 4028 | (GLsizei)count, |
| 4029 | (GLfloat *)v |
| 4030 | ); |
| 4031 | |
| 4032 | exit: |
| 4033 | if (v_base) { |
| 4034 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4035 | JNI_ABORT); |
| 4036 | } |
| 4037 | } |
| 4038 | |
| 4039 | /* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4040 | static void |
| 4041 | android_glUniform2fv__IILjava_nio_FloatBuffer_2 |
| 4042 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4043 | jarray _array = (jarray) 0; |
| 4044 | jint _remaining; |
| 4045 | GLfloat *v = (GLfloat *) 0; |
| 4046 | |
| 4047 | v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4048 | glUniform2fv( |
| 4049 | (GLint)location, |
| 4050 | (GLsizei)count, |
| 4051 | (GLfloat *)v |
| 4052 | ); |
| 4053 | if (_array) { |
| 4054 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4055 | } |
| 4056 | } |
| 4057 | |
| 4058 | /* void glUniform2i ( GLint location, GLint x, GLint y ) */ |
| 4059 | static void |
| 4060 | android_glUniform2i__III |
| 4061 | (JNIEnv *_env, jobject _this, jint location, jint x, jint y) { |
| 4062 | glUniform2i( |
| 4063 | (GLint)location, |
| 4064 | (GLint)x, |
| 4065 | (GLint)y |
| 4066 | ); |
| 4067 | } |
| 4068 | |
| 4069 | /* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4070 | static void |
| 4071 | android_glUniform2iv__II_3II |
| 4072 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { |
| 4073 | GLint *v_base = (GLint *) 0; |
| 4074 | jint _remaining; |
| 4075 | GLint *v = (GLint *) 0; |
| 4076 | |
| 4077 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4078 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4079 | goto exit; |
| 4080 | } |
| 4081 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4082 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4083 | goto exit; |
| 4084 | } |
| 4085 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4086 | v_base = (GLint *) |
| 4087 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4088 | v = v_base + offset; |
| 4089 | |
| 4090 | glUniform2iv( |
| 4091 | (GLint)location, |
| 4092 | (GLsizei)count, |
| 4093 | (GLint *)v |
| 4094 | ); |
| 4095 | |
| 4096 | exit: |
| 4097 | if (v_base) { |
| 4098 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4099 | JNI_ABORT); |
| 4100 | } |
| 4101 | } |
| 4102 | |
| 4103 | /* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4104 | static void |
| 4105 | android_glUniform2iv__IILjava_nio_IntBuffer_2 |
| 4106 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4107 | jarray _array = (jarray) 0; |
| 4108 | jint _remaining; |
| 4109 | GLint *v = (GLint *) 0; |
| 4110 | |
| 4111 | v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4112 | glUniform2iv( |
| 4113 | (GLint)location, |
| 4114 | (GLsizei)count, |
| 4115 | (GLint *)v |
| 4116 | ); |
| 4117 | if (_array) { |
| 4118 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4119 | } |
| 4120 | } |
| 4121 | |
| 4122 | /* void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) */ |
| 4123 | static void |
| 4124 | android_glUniform3f__IFFF |
| 4125 | (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z) { |
| 4126 | glUniform3f( |
| 4127 | (GLint)location, |
| 4128 | (GLfloat)x, |
| 4129 | (GLfloat)y, |
| 4130 | (GLfloat)z |
| 4131 | ); |
| 4132 | } |
| 4133 | |
| 4134 | /* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4135 | static void |
| 4136 | android_glUniform3fv__II_3FI |
| 4137 | (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { |
| 4138 | GLfloat *v_base = (GLfloat *) 0; |
| 4139 | jint _remaining; |
| 4140 | GLfloat *v = (GLfloat *) 0; |
| 4141 | |
| 4142 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4143 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4144 | goto exit; |
| 4145 | } |
| 4146 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4147 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4148 | goto exit; |
| 4149 | } |
| 4150 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4151 | v_base = (GLfloat *) |
| 4152 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4153 | v = v_base + offset; |
| 4154 | |
| 4155 | glUniform3fv( |
| 4156 | (GLint)location, |
| 4157 | (GLsizei)count, |
| 4158 | (GLfloat *)v |
| 4159 | ); |
| 4160 | |
| 4161 | exit: |
| 4162 | if (v_base) { |
| 4163 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4164 | JNI_ABORT); |
| 4165 | } |
| 4166 | } |
| 4167 | |
| 4168 | /* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4169 | static void |
| 4170 | android_glUniform3fv__IILjava_nio_FloatBuffer_2 |
| 4171 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4172 | jarray _array = (jarray) 0; |
| 4173 | jint _remaining; |
| 4174 | GLfloat *v = (GLfloat *) 0; |
| 4175 | |
| 4176 | v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4177 | glUniform3fv( |
| 4178 | (GLint)location, |
| 4179 | (GLsizei)count, |
| 4180 | (GLfloat *)v |
| 4181 | ); |
| 4182 | if (_array) { |
| 4183 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4184 | } |
| 4185 | } |
| 4186 | |
| 4187 | /* void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) */ |
| 4188 | static void |
| 4189 | android_glUniform3i__IIII |
| 4190 | (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z) { |
| 4191 | glUniform3i( |
| 4192 | (GLint)location, |
| 4193 | (GLint)x, |
| 4194 | (GLint)y, |
| 4195 | (GLint)z |
| 4196 | ); |
| 4197 | } |
| 4198 | |
| 4199 | /* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4200 | static void |
| 4201 | android_glUniform3iv__II_3II |
| 4202 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { |
| 4203 | GLint *v_base = (GLint *) 0; |
| 4204 | jint _remaining; |
| 4205 | GLint *v = (GLint *) 0; |
| 4206 | |
| 4207 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4208 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4209 | goto exit; |
| 4210 | } |
| 4211 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4212 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4213 | goto exit; |
| 4214 | } |
| 4215 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4216 | v_base = (GLint *) |
| 4217 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4218 | v = v_base + offset; |
| 4219 | |
| 4220 | glUniform3iv( |
| 4221 | (GLint)location, |
| 4222 | (GLsizei)count, |
| 4223 | (GLint *)v |
| 4224 | ); |
| 4225 | |
| 4226 | exit: |
| 4227 | if (v_base) { |
| 4228 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4229 | JNI_ABORT); |
| 4230 | } |
| 4231 | } |
| 4232 | |
| 4233 | /* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4234 | static void |
| 4235 | android_glUniform3iv__IILjava_nio_IntBuffer_2 |
| 4236 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4237 | jarray _array = (jarray) 0; |
| 4238 | jint _remaining; |
| 4239 | GLint *v = (GLint *) 0; |
| 4240 | |
| 4241 | v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4242 | glUniform3iv( |
| 4243 | (GLint)location, |
| 4244 | (GLsizei)count, |
| 4245 | (GLint *)v |
| 4246 | ); |
| 4247 | if (_array) { |
| 4248 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4249 | } |
| 4250 | } |
| 4251 | |
| 4252 | /* void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ |
| 4253 | static void |
| 4254 | android_glUniform4f__IFFFF |
| 4255 | (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z, jfloat w) { |
| 4256 | glUniform4f( |
| 4257 | (GLint)location, |
| 4258 | (GLfloat)x, |
| 4259 | (GLfloat)y, |
| 4260 | (GLfloat)z, |
| 4261 | (GLfloat)w |
| 4262 | ); |
| 4263 | } |
| 4264 | |
| 4265 | /* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4266 | static void |
| 4267 | android_glUniform4fv__II_3FI |
| 4268 | (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { |
| 4269 | GLfloat *v_base = (GLfloat *) 0; |
| 4270 | jint _remaining; |
| 4271 | GLfloat *v = (GLfloat *) 0; |
| 4272 | |
| 4273 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4274 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4275 | goto exit; |
| 4276 | } |
| 4277 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4278 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4279 | goto exit; |
| 4280 | } |
| 4281 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4282 | v_base = (GLfloat *) |
| 4283 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4284 | v = v_base + offset; |
| 4285 | |
| 4286 | glUniform4fv( |
| 4287 | (GLint)location, |
| 4288 | (GLsizei)count, |
| 4289 | (GLfloat *)v |
| 4290 | ); |
| 4291 | |
| 4292 | exit: |
| 4293 | if (v_base) { |
| 4294 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4295 | JNI_ABORT); |
| 4296 | } |
| 4297 | } |
| 4298 | |
| 4299 | /* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ |
| 4300 | static void |
| 4301 | android_glUniform4fv__IILjava_nio_FloatBuffer_2 |
| 4302 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4303 | jarray _array = (jarray) 0; |
| 4304 | jint _remaining; |
| 4305 | GLfloat *v = (GLfloat *) 0; |
| 4306 | |
| 4307 | v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4308 | glUniform4fv( |
| 4309 | (GLint)location, |
| 4310 | (GLsizei)count, |
| 4311 | (GLfloat *)v |
| 4312 | ); |
| 4313 | if (_array) { |
| 4314 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4315 | } |
| 4316 | } |
| 4317 | |
| 4318 | /* void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) */ |
| 4319 | static void |
| 4320 | android_glUniform4i__IIIII |
| 4321 | (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z, jint w) { |
| 4322 | glUniform4i( |
| 4323 | (GLint)location, |
| 4324 | (GLint)x, |
| 4325 | (GLint)y, |
| 4326 | (GLint)z, |
| 4327 | (GLint)w |
| 4328 | ); |
| 4329 | } |
| 4330 | |
| 4331 | /* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4332 | static void |
| 4333 | android_glUniform4iv__II_3II |
| 4334 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { |
| 4335 | GLint *v_base = (GLint *) 0; |
| 4336 | jint _remaining; |
| 4337 | GLint *v = (GLint *) 0; |
| 4338 | |
| 4339 | if (!v_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4340 | jniThrowException(_env, "java/lang/IllegalArgumentException", "v == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4341 | goto exit; |
| 4342 | } |
| 4343 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4344 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4345 | goto exit; |
| 4346 | } |
| 4347 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 4348 | v_base = (GLint *) |
| 4349 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 4350 | v = v_base + offset; |
| 4351 | |
| 4352 | glUniform4iv( |
| 4353 | (GLint)location, |
| 4354 | (GLsizei)count, |
| 4355 | (GLint *)v |
| 4356 | ); |
| 4357 | |
| 4358 | exit: |
| 4359 | if (v_base) { |
| 4360 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 4361 | JNI_ABORT); |
| 4362 | } |
| 4363 | } |
| 4364 | |
| 4365 | /* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ |
| 4366 | static void |
| 4367 | android_glUniform4iv__IILjava_nio_IntBuffer_2 |
| 4368 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { |
| 4369 | jarray _array = (jarray) 0; |
| 4370 | jint _remaining; |
| 4371 | GLint *v = (GLint *) 0; |
| 4372 | |
| 4373 | v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining); |
| 4374 | glUniform4iv( |
| 4375 | (GLint)location, |
| 4376 | (GLsizei)count, |
| 4377 | (GLint *)v |
| 4378 | ); |
| 4379 | if (_array) { |
| 4380 | releasePointer(_env, _array, v, JNI_FALSE); |
| 4381 | } |
| 4382 | } |
| 4383 | |
| 4384 | /* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4385 | static void |
| 4386 | android_glUniformMatrix2fv__IIZ_3FI |
| 4387 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 4388 | GLfloat *value_base = (GLfloat *) 0; |
| 4389 | jint _remaining; |
| 4390 | GLfloat *value = (GLfloat *) 0; |
| 4391 | |
| 4392 | if (!value_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4393 | jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4394 | goto exit; |
| 4395 | } |
| 4396 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4397 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4398 | goto exit; |
| 4399 | } |
| 4400 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 4401 | value_base = (GLfloat *) |
| 4402 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 4403 | value = value_base + offset; |
| 4404 | |
| 4405 | glUniformMatrix2fv( |
| 4406 | (GLint)location, |
| 4407 | (GLsizei)count, |
| 4408 | (GLboolean)transpose, |
| 4409 | (GLfloat *)value |
| 4410 | ); |
| 4411 | |
| 4412 | exit: |
| 4413 | if (value_base) { |
| 4414 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 4415 | JNI_ABORT); |
| 4416 | } |
| 4417 | } |
| 4418 | |
| 4419 | /* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4420 | static void |
| 4421 | android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 |
| 4422 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 4423 | jarray _array = (jarray) 0; |
| 4424 | jint _remaining; |
| 4425 | GLfloat *value = (GLfloat *) 0; |
| 4426 | |
| 4427 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining); |
| 4428 | glUniformMatrix2fv( |
| 4429 | (GLint)location, |
| 4430 | (GLsizei)count, |
| 4431 | (GLboolean)transpose, |
| 4432 | (GLfloat *)value |
| 4433 | ); |
| 4434 | if (_array) { |
| 4435 | releasePointer(_env, _array, value, JNI_FALSE); |
| 4436 | } |
| 4437 | } |
| 4438 | |
| 4439 | /* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4440 | static void |
| 4441 | android_glUniformMatrix3fv__IIZ_3FI |
| 4442 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 4443 | GLfloat *value_base = (GLfloat *) 0; |
| 4444 | jint _remaining; |
| 4445 | GLfloat *value = (GLfloat *) 0; |
| 4446 | |
| 4447 | if (!value_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4448 | jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4449 | goto exit; |
| 4450 | } |
| 4451 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4452 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4453 | goto exit; |
| 4454 | } |
| 4455 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 4456 | value_base = (GLfloat *) |
| 4457 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 4458 | value = value_base + offset; |
| 4459 | |
| 4460 | glUniformMatrix3fv( |
| 4461 | (GLint)location, |
| 4462 | (GLsizei)count, |
| 4463 | (GLboolean)transpose, |
| 4464 | (GLfloat *)value |
| 4465 | ); |
| 4466 | |
| 4467 | exit: |
| 4468 | if (value_base) { |
| 4469 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 4470 | JNI_ABORT); |
| 4471 | } |
| 4472 | } |
| 4473 | |
| 4474 | /* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4475 | static void |
| 4476 | android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 |
| 4477 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 4478 | jarray _array = (jarray) 0; |
| 4479 | jint _remaining; |
| 4480 | GLfloat *value = (GLfloat *) 0; |
| 4481 | |
| 4482 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining); |
| 4483 | glUniformMatrix3fv( |
| 4484 | (GLint)location, |
| 4485 | (GLsizei)count, |
| 4486 | (GLboolean)transpose, |
| 4487 | (GLfloat *)value |
| 4488 | ); |
| 4489 | if (_array) { |
| 4490 | releasePointer(_env, _array, value, JNI_FALSE); |
| 4491 | } |
| 4492 | } |
| 4493 | |
| 4494 | /* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4495 | static void |
| 4496 | android_glUniformMatrix4fv__IIZ_3FI |
| 4497 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 4498 | GLfloat *value_base = (GLfloat *) 0; |
| 4499 | jint _remaining; |
| 4500 | GLfloat *value = (GLfloat *) 0; |
| 4501 | |
| 4502 | if (!value_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4503 | jniThrowException(_env, "java/lang/IllegalArgumentException", "value == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4504 | goto exit; |
| 4505 | } |
| 4506 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4507 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4508 | goto exit; |
| 4509 | } |
| 4510 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 4511 | value_base = (GLfloat *) |
| 4512 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 4513 | value = value_base + offset; |
| 4514 | |
| 4515 | glUniformMatrix4fv( |
| 4516 | (GLint)location, |
| 4517 | (GLsizei)count, |
| 4518 | (GLboolean)transpose, |
| 4519 | (GLfloat *)value |
| 4520 | ); |
| 4521 | |
| 4522 | exit: |
| 4523 | if (value_base) { |
| 4524 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 4525 | JNI_ABORT); |
| 4526 | } |
| 4527 | } |
| 4528 | |
| 4529 | /* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 4530 | static void |
| 4531 | android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 |
| 4532 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 4533 | jarray _array = (jarray) 0; |
| 4534 | jint _remaining; |
| 4535 | GLfloat *value = (GLfloat *) 0; |
| 4536 | |
| 4537 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining); |
| 4538 | glUniformMatrix4fv( |
| 4539 | (GLint)location, |
| 4540 | (GLsizei)count, |
| 4541 | (GLboolean)transpose, |
| 4542 | (GLfloat *)value |
| 4543 | ); |
| 4544 | if (_array) { |
| 4545 | releasePointer(_env, _array, value, JNI_FALSE); |
| 4546 | } |
| 4547 | } |
| 4548 | |
| 4549 | /* void glUseProgram ( GLuint program ) */ |
| 4550 | static void |
| 4551 | android_glUseProgram__I |
| 4552 | (JNIEnv *_env, jobject _this, jint program) { |
| 4553 | glUseProgram( |
| 4554 | (GLuint)program |
| 4555 | ); |
| 4556 | } |
| 4557 | |
| 4558 | /* void glValidateProgram ( GLuint program ) */ |
| 4559 | static void |
| 4560 | android_glValidateProgram__I |
| 4561 | (JNIEnv *_env, jobject _this, jint program) { |
| 4562 | glValidateProgram( |
| 4563 | (GLuint)program |
| 4564 | ); |
| 4565 | } |
| 4566 | |
| 4567 | /* void glVertexAttrib1f ( GLuint indx, GLfloat x ) */ |
| 4568 | static void |
| 4569 | android_glVertexAttrib1f__IF |
| 4570 | (JNIEnv *_env, jobject _this, jint indx, jfloat x) { |
| 4571 | glVertexAttrib1f( |
| 4572 | (GLuint)indx, |
| 4573 | (GLfloat)x |
| 4574 | ); |
| 4575 | } |
| 4576 | |
| 4577 | /* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ |
| 4578 | static void |
| 4579 | android_glVertexAttrib1fv__I_3FI |
| 4580 | (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { |
| 4581 | GLfloat *values_base = (GLfloat *) 0; |
| 4582 | jint _remaining; |
| 4583 | GLfloat *values = (GLfloat *) 0; |
| 4584 | |
| 4585 | if (!values_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4586 | jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4587 | goto exit; |
| 4588 | } |
| 4589 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4590 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4591 | goto exit; |
| 4592 | } |
| 4593 | _remaining = _env->GetArrayLength(values_ref) - offset; |
| 4594 | values_base = (GLfloat *) |
| 4595 | _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0); |
| 4596 | values = values_base + offset; |
| 4597 | |
| 4598 | glVertexAttrib1fv( |
| 4599 | (GLuint)indx, |
| 4600 | (GLfloat *)values |
| 4601 | ); |
| 4602 | |
| 4603 | exit: |
| 4604 | if (values_base) { |
| 4605 | _env->ReleasePrimitiveArrayCritical(values_ref, values_base, |
| 4606 | JNI_ABORT); |
| 4607 | } |
| 4608 | } |
| 4609 | |
| 4610 | /* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ |
| 4611 | static void |
| 4612 | android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 |
| 4613 | (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { |
| 4614 | jarray _array = (jarray) 0; |
| 4615 | jint _remaining; |
| 4616 | GLfloat *values = (GLfloat *) 0; |
| 4617 | |
| 4618 | values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining); |
| 4619 | glVertexAttrib1fv( |
| 4620 | (GLuint)indx, |
| 4621 | (GLfloat *)values |
| 4622 | ); |
| 4623 | if (_array) { |
| 4624 | releasePointer(_env, _array, values, JNI_FALSE); |
| 4625 | } |
| 4626 | } |
| 4627 | |
| 4628 | /* void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) */ |
| 4629 | static void |
| 4630 | android_glVertexAttrib2f__IFF |
| 4631 | (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y) { |
| 4632 | glVertexAttrib2f( |
| 4633 | (GLuint)indx, |
| 4634 | (GLfloat)x, |
| 4635 | (GLfloat)y |
| 4636 | ); |
| 4637 | } |
| 4638 | |
| 4639 | /* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ |
| 4640 | static void |
| 4641 | android_glVertexAttrib2fv__I_3FI |
| 4642 | (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { |
| 4643 | GLfloat *values_base = (GLfloat *) 0; |
| 4644 | jint _remaining; |
| 4645 | GLfloat *values = (GLfloat *) 0; |
| 4646 | |
| 4647 | if (!values_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4648 | jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4649 | goto exit; |
| 4650 | } |
| 4651 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4652 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4653 | goto exit; |
| 4654 | } |
| 4655 | _remaining = _env->GetArrayLength(values_ref) - offset; |
| 4656 | values_base = (GLfloat *) |
| 4657 | _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0); |
| 4658 | values = values_base + offset; |
| 4659 | |
| 4660 | glVertexAttrib2fv( |
| 4661 | (GLuint)indx, |
| 4662 | (GLfloat *)values |
| 4663 | ); |
| 4664 | |
| 4665 | exit: |
| 4666 | if (values_base) { |
| 4667 | _env->ReleasePrimitiveArrayCritical(values_ref, values_base, |
| 4668 | JNI_ABORT); |
| 4669 | } |
| 4670 | } |
| 4671 | |
| 4672 | /* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ |
| 4673 | static void |
| 4674 | android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 |
| 4675 | (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { |
| 4676 | jarray _array = (jarray) 0; |
| 4677 | jint _remaining; |
| 4678 | GLfloat *values = (GLfloat *) 0; |
| 4679 | |
| 4680 | values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining); |
| 4681 | glVertexAttrib2fv( |
| 4682 | (GLuint)indx, |
| 4683 | (GLfloat *)values |
| 4684 | ); |
| 4685 | if (_array) { |
| 4686 | releasePointer(_env, _array, values, JNI_FALSE); |
| 4687 | } |
| 4688 | } |
| 4689 | |
| 4690 | /* void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) */ |
| 4691 | static void |
| 4692 | android_glVertexAttrib3f__IFFF |
| 4693 | (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z) { |
| 4694 | glVertexAttrib3f( |
| 4695 | (GLuint)indx, |
| 4696 | (GLfloat)x, |
| 4697 | (GLfloat)y, |
| 4698 | (GLfloat)z |
| 4699 | ); |
| 4700 | } |
| 4701 | |
| 4702 | /* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ |
| 4703 | static void |
| 4704 | android_glVertexAttrib3fv__I_3FI |
| 4705 | (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { |
| 4706 | GLfloat *values_base = (GLfloat *) 0; |
| 4707 | jint _remaining; |
| 4708 | GLfloat *values = (GLfloat *) 0; |
| 4709 | |
| 4710 | if (!values_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4711 | jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4712 | goto exit; |
| 4713 | } |
| 4714 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4715 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4716 | goto exit; |
| 4717 | } |
| 4718 | _remaining = _env->GetArrayLength(values_ref) - offset; |
| 4719 | values_base = (GLfloat *) |
| 4720 | _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0); |
| 4721 | values = values_base + offset; |
| 4722 | |
| 4723 | glVertexAttrib3fv( |
| 4724 | (GLuint)indx, |
| 4725 | (GLfloat *)values |
| 4726 | ); |
| 4727 | |
| 4728 | exit: |
| 4729 | if (values_base) { |
| 4730 | _env->ReleasePrimitiveArrayCritical(values_ref, values_base, |
| 4731 | JNI_ABORT); |
| 4732 | } |
| 4733 | } |
| 4734 | |
| 4735 | /* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ |
| 4736 | static void |
| 4737 | android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 |
| 4738 | (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { |
| 4739 | jarray _array = (jarray) 0; |
| 4740 | jint _remaining; |
| 4741 | GLfloat *values = (GLfloat *) 0; |
| 4742 | |
| 4743 | values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining); |
| 4744 | glVertexAttrib3fv( |
| 4745 | (GLuint)indx, |
| 4746 | (GLfloat *)values |
| 4747 | ); |
| 4748 | if (_array) { |
| 4749 | releasePointer(_env, _array, values, JNI_FALSE); |
| 4750 | } |
| 4751 | } |
| 4752 | |
| 4753 | /* void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ |
| 4754 | static void |
| 4755 | android_glVertexAttrib4f__IFFFF |
| 4756 | (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z, jfloat w) { |
| 4757 | glVertexAttrib4f( |
| 4758 | (GLuint)indx, |
| 4759 | (GLfloat)x, |
| 4760 | (GLfloat)y, |
| 4761 | (GLfloat)z, |
| 4762 | (GLfloat)w |
| 4763 | ); |
| 4764 | } |
| 4765 | |
| 4766 | /* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ |
| 4767 | static void |
| 4768 | android_glVertexAttrib4fv__I_3FI |
| 4769 | (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { |
| 4770 | GLfloat *values_base = (GLfloat *) 0; |
| 4771 | jint _remaining; |
| 4772 | GLfloat *values = (GLfloat *) 0; |
| 4773 | |
| 4774 | if (!values_ref) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4775 | jniThrowException(_env, "java/lang/IllegalArgumentException", "values == null"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4776 | goto exit; |
| 4777 | } |
| 4778 | if (offset < 0) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4779 | jniThrowException(_env, "java/lang/IllegalArgumentException", "offset < 0"); |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4780 | goto exit; |
| 4781 | } |
| 4782 | _remaining = _env->GetArrayLength(values_ref) - offset; |
| 4783 | values_base = (GLfloat *) |
| 4784 | _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0); |
| 4785 | values = values_base + offset; |
| 4786 | |
| 4787 | glVertexAttrib4fv( |
| 4788 | (GLuint)indx, |
| 4789 | (GLfloat *)values |
| 4790 | ); |
| 4791 | |
| 4792 | exit: |
| 4793 | if (values_base) { |
| 4794 | _env->ReleasePrimitiveArrayCritical(values_ref, values_base, |
| 4795 | JNI_ABORT); |
| 4796 | } |
| 4797 | } |
| 4798 | |
| 4799 | /* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ |
| 4800 | static void |
| 4801 | android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 |
| 4802 | (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { |
| 4803 | jarray _array = (jarray) 0; |
| 4804 | jint _remaining; |
| 4805 | GLfloat *values = (GLfloat *) 0; |
| 4806 | |
| 4807 | values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining); |
| 4808 | glVertexAttrib4fv( |
| 4809 | (GLuint)indx, |
| 4810 | (GLfloat *)values |
| 4811 | ); |
| 4812 | if (_array) { |
| 4813 | releasePointer(_env, _array, values, JNI_FALSE); |
| 4814 | } |
| 4815 | } |
| 4816 | |
Jack Palevich | 224107a | 2010-06-22 20:08:40 +0800 | [diff] [blame] | 4817 | /* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) */ |
| 4818 | static void |
| 4819 | android_glVertexAttribPointer__IIIZII |
| 4820 | (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jint offset) { |
| 4821 | glVertexAttribPointer( |
| 4822 | (GLuint)indx, |
| 4823 | (GLint)size, |
| 4824 | (GLenum)type, |
| 4825 | (GLboolean)normalized, |
| 4826 | (GLsizei)stride, |
| 4827 | (const GLvoid *)offset |
| 4828 | ); |
| 4829 | } |
| 4830 | |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4831 | /* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) */ |
| 4832 | static void |
| 4833 | android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I |
| 4834 | (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr_buf, jint remaining) { |
| 4835 | jarray _array = (jarray) 0; |
| 4836 | jint _remaining; |
| 4837 | GLvoid *ptr = (GLvoid *) 0; |
| 4838 | |
| 4839 | if (ptr_buf) { |
| 4840 | ptr = (GLvoid *) getDirectBufferPointer(_env, ptr_buf); |
| 4841 | if ( ! ptr ) { |
| 4842 | return; |
| 4843 | } |
| 4844 | } |
| 4845 | glVertexAttribPointerBounds( |
| 4846 | (GLuint)indx, |
| 4847 | (GLint)size, |
| 4848 | (GLenum)type, |
| 4849 | (GLboolean)normalized, |
| 4850 | (GLsizei)stride, |
| 4851 | (GLvoid *)ptr, |
| 4852 | (GLsizei)remaining |
| 4853 | ); |
| 4854 | } |
| 4855 | |
| 4856 | /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 4857 | static void |
| 4858 | android_glViewport__IIII |
| 4859 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 4860 | glViewport( |
| 4861 | (GLint)x, |
| 4862 | (GLint)y, |
| 4863 | (GLsizei)width, |
| 4864 | (GLsizei)height |
| 4865 | ); |
| 4866 | } |
| 4867 | |
| 4868 | static const char *classPathName = "android/opengl/GLES20"; |
| 4869 | |
| 4870 | static JNINativeMethod methods[] = { |
| 4871 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 4872 | {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, |
| 4873 | {"glAttachShader", "(II)V", (void *) android_glAttachShader__II }, |
| 4874 | {"glBindAttribLocation", "(IILjava/lang/String;)V", (void *) android_glBindAttribLocation__IILjava_lang_String_2 }, |
| 4875 | {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, |
| 4876 | {"glBindFramebuffer", "(II)V", (void *) android_glBindFramebuffer__II }, |
| 4877 | {"glBindRenderbuffer", "(II)V", (void *) android_glBindRenderbuffer__II }, |
| 4878 | {"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, |
| 4879 | {"glBlendColor", "(FFFF)V", (void *) android_glBlendColor__FFFF }, |
| 4880 | {"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, |
| 4881 | {"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, |
| 4882 | {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, |
| 4883 | {"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, |
| 4884 | {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, |
| 4885 | {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, |
| 4886 | {"glCheckFramebufferStatus", "(I)I", (void *) android_glCheckFramebufferStatus__I }, |
| 4887 | {"glClear", "(I)V", (void *) android_glClear__I }, |
| 4888 | {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, |
| 4889 | {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, |
| 4890 | {"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, |
| 4891 | {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, |
| 4892 | {"glCompileShader", "(I)V", (void *) android_glCompileShader__I }, |
| 4893 | {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, |
| 4894 | {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 4895 | {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, |
| 4896 | {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, |
| 4897 | {"glCreateProgram", "()I", (void *) android_glCreateProgram__ }, |
| 4898 | {"glCreateShader", "(I)I", (void *) android_glCreateShader__I }, |
| 4899 | {"glCullFace", "(I)V", (void *) android_glCullFace__I }, |
| 4900 | {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, |
| 4901 | {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, |
| 4902 | {"glDeleteFramebuffers", "(I[II)V", (void *) android_glDeleteFramebuffers__I_3II }, |
| 4903 | {"glDeleteFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 }, |
| 4904 | {"glDeleteProgram", "(I)V", (void *) android_glDeleteProgram__I }, |
| 4905 | {"glDeleteRenderbuffers", "(I[II)V", (void *) android_glDeleteRenderbuffers__I_3II }, |
| 4906 | {"glDeleteRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 }, |
| 4907 | {"glDeleteShader", "(I)V", (void *) android_glDeleteShader__I }, |
| 4908 | {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, |
| 4909 | {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, |
| 4910 | {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, |
| 4911 | {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, |
| 4912 | {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, |
| 4913 | {"glDetachShader", "(II)V", (void *) android_glDetachShader__II }, |
| 4914 | {"glDisable", "(I)V", (void *) android_glDisable__I }, |
| 4915 | {"glDisableVertexAttribArray", "(I)V", (void *) android_glDisableVertexAttribArray__I }, |
| 4916 | {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, |
Jack Palevich | 224107a | 2010-06-22 20:08:40 +0800 | [diff] [blame] | 4917 | {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 4918 | {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, |
| 4919 | {"glEnable", "(I)V", (void *) android_glEnable__I }, |
| 4920 | {"glEnableVertexAttribArray", "(I)V", (void *) android_glEnableVertexAttribArray__I }, |
| 4921 | {"glFinish", "()V", (void *) android_glFinish__ }, |
| 4922 | {"glFlush", "()V", (void *) android_glFlush__ }, |
| 4923 | {"glFramebufferRenderbuffer", "(IIII)V", (void *) android_glFramebufferRenderbuffer__IIII }, |
| 4924 | {"glFramebufferTexture2D", "(IIIII)V", (void *) android_glFramebufferTexture2D__IIIII }, |
| 4925 | {"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, |
| 4926 | {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, |
| 4927 | {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, |
| 4928 | {"glGenerateMipmap", "(I)V", (void *) android_glGenerateMipmap__I }, |
| 4929 | {"glGenFramebuffers", "(I[II)V", (void *) android_glGenFramebuffers__I_3II }, |
| 4930 | {"glGenFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffers__ILjava_nio_IntBuffer_2 }, |
| 4931 | {"glGenRenderbuffers", "(I[II)V", (void *) android_glGenRenderbuffers__I_3II }, |
| 4932 | {"glGenRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 }, |
| 4933 | {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, |
| 4934 | {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, |
| 4935 | {"glGetActiveAttrib", "(III[II[II[II[BI)V", (void *) android_glGetActiveAttrib__III_3II_3II_3II_3BI }, |
| 4936 | {"glGetActiveAttrib", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, |
| 4937 | {"glGetActiveUniform", "(III[II[II[II[BI)V", (void *) android_glGetActiveUniform__III_3II_3II_3II_3BI }, |
| 4938 | {"glGetActiveUniform", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, |
| 4939 | {"glGetAttachedShaders", "(II[II[II)V", (void *) android_glGetAttachedShaders__II_3II_3II }, |
| 4940 | {"glGetAttachedShaders", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 4941 | {"glGetAttribLocation", "(ILjava/lang/String;)I", (void *) android_glGetAttribLocation__ILjava_lang_String_2 }, |
| 4942 | {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, |
| 4943 | {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, |
| 4944 | {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, |
| 4945 | {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 4946 | {"glGetError", "()I", (void *) android_glGetError__ }, |
| 4947 | {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, |
| 4948 | {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, |
| 4949 | {"glGetFramebufferAttachmentParameteriv", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameteriv__III_3II }, |
| 4950 | {"glGetFramebufferAttachmentParameteriv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 }, |
| 4951 | {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, |
| 4952 | {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, |
| 4953 | {"glGetProgramiv", "(II[II)V", (void *) android_glGetProgramiv__II_3II }, |
| 4954 | {"glGetProgramiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetProgramiv__IILjava_nio_IntBuffer_2 }, |
| 4955 | {"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog }, |
| 4956 | {"glGetRenderbufferParameteriv", "(II[II)V", (void *) android_glGetRenderbufferParameteriv__II_3II }, |
| 4957 | {"glGetRenderbufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 4958 | {"glGetShaderiv", "(II[II)V", (void *) android_glGetShaderiv__II_3II }, |
| 4959 | {"glGetShaderiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetShaderiv__IILjava_nio_IntBuffer_2 }, |
| 4960 | {"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog }, |
| 4961 | {"glGetShaderPrecisionFormat", "(II[II[II)V", (void *) android_glGetShaderPrecisionFormat__II_3II_3II }, |
| 4962 | {"glGetShaderPrecisionFormat", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 4963 | {"glGetShaderSource", "(II[II[BI)V", (void *) android_glGetShaderSource__II_3II_3BI }, |
| 4964 | {"glGetShaderSource", "(IILjava/nio/IntBuffer;B)V", (void *) android_glGetShaderSource__IILjava_nio_IntBuffer_2B }, |
| 4965 | {"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, |
| 4966 | {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, |
| 4967 | {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 4968 | {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, |
| 4969 | {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 4970 | {"glGetUniformfv", "(II[FI)V", (void *) android_glGetUniformfv__II_3FI }, |
| 4971 | {"glGetUniformfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetUniformfv__IILjava_nio_FloatBuffer_2 }, |
| 4972 | {"glGetUniformiv", "(II[II)V", (void *) android_glGetUniformiv__II_3II }, |
| 4973 | {"glGetUniformiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformiv__IILjava_nio_IntBuffer_2 }, |
| 4974 | {"glGetUniformLocation", "(ILjava/lang/String;)I", (void *) android_glGetUniformLocation__ILjava_lang_String_2 }, |
| 4975 | {"glGetVertexAttribfv", "(II[FI)V", (void *) android_glGetVertexAttribfv__II_3FI }, |
| 4976 | {"glGetVertexAttribfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 }, |
| 4977 | {"glGetVertexAttribiv", "(II[II)V", (void *) android_glGetVertexAttribiv__II_3II }, |
| 4978 | {"glGetVertexAttribiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 }, |
| 4979 | {"glHint", "(II)V", (void *) android_glHint__II }, |
| 4980 | {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, |
| 4981 | {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, |
| 4982 | {"glIsFramebuffer", "(I)Z", (void *) android_glIsFramebuffer__I }, |
| 4983 | {"glIsProgram", "(I)Z", (void *) android_glIsProgram__I }, |
| 4984 | {"glIsRenderbuffer", "(I)Z", (void *) android_glIsRenderbuffer__I }, |
| 4985 | {"glIsShader", "(I)Z", (void *) android_glIsShader__I }, |
| 4986 | {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, |
| 4987 | {"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, |
| 4988 | {"glLinkProgram", "(I)V", (void *) android_glLinkProgram__I }, |
| 4989 | {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, |
| 4990 | {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, |
| 4991 | {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, |
| 4992 | {"glReleaseShaderCompiler", "()V", (void *) android_glReleaseShaderCompiler__ }, |
| 4993 | {"glRenderbufferStorage", "(IIII)V", (void *) android_glRenderbufferStorage__IIII }, |
| 4994 | {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, |
| 4995 | {"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, |
| 4996 | {"glShaderBinary", "(I[IIILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__I_3IIILjava_nio_Buffer_2I }, |
| 4997 | {"glShaderBinary", "(ILjava/nio/IntBuffer;ILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I }, |
| 4998 | {"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource }, |
| 4999 | {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, |
| 5000 | {"glStencilFuncSeparate", "(IIII)V", (void *) android_glStencilFuncSeparate__IIII }, |
| 5001 | {"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, |
| 5002 | {"glStencilMaskSeparate", "(II)V", (void *) android_glStencilMaskSeparate__II }, |
| 5003 | {"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, |
| 5004 | {"glStencilOpSeparate", "(IIII)V", (void *) android_glStencilOpSeparate__IIII }, |
| 5005 | {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 5006 | {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, |
| 5007 | {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, |
| 5008 | {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 5009 | {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, |
| 5010 | {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, |
| 5011 | {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 5012 | {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 5013 | {"glUniform1f", "(IF)V", (void *) android_glUniform1f__IF }, |
| 5014 | {"glUniform1fv", "(II[FI)V", (void *) android_glUniform1fv__II_3FI }, |
| 5015 | {"glUniform1fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform1fv__IILjava_nio_FloatBuffer_2 }, |
| 5016 | {"glUniform1i", "(II)V", (void *) android_glUniform1i__II }, |
| 5017 | {"glUniform1iv", "(II[II)V", (void *) android_glUniform1iv__II_3II }, |
| 5018 | {"glUniform1iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1iv__IILjava_nio_IntBuffer_2 }, |
| 5019 | {"glUniform2f", "(IFF)V", (void *) android_glUniform2f__IFF }, |
| 5020 | {"glUniform2fv", "(II[FI)V", (void *) android_glUniform2fv__II_3FI }, |
| 5021 | {"glUniform2fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform2fv__IILjava_nio_FloatBuffer_2 }, |
| 5022 | {"glUniform2i", "(III)V", (void *) android_glUniform2i__III }, |
| 5023 | {"glUniform2iv", "(II[II)V", (void *) android_glUniform2iv__II_3II }, |
| 5024 | {"glUniform2iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2iv__IILjava_nio_IntBuffer_2 }, |
| 5025 | {"glUniform3f", "(IFFF)V", (void *) android_glUniform3f__IFFF }, |
| 5026 | {"glUniform3fv", "(II[FI)V", (void *) android_glUniform3fv__II_3FI }, |
| 5027 | {"glUniform3fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform3fv__IILjava_nio_FloatBuffer_2 }, |
| 5028 | {"glUniform3i", "(IIII)V", (void *) android_glUniform3i__IIII }, |
| 5029 | {"glUniform3iv", "(II[II)V", (void *) android_glUniform3iv__II_3II }, |
| 5030 | {"glUniform3iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3iv__IILjava_nio_IntBuffer_2 }, |
| 5031 | {"glUniform4f", "(IFFFF)V", (void *) android_glUniform4f__IFFFF }, |
| 5032 | {"glUniform4fv", "(II[FI)V", (void *) android_glUniform4fv__II_3FI }, |
| 5033 | {"glUniform4fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform4fv__IILjava_nio_FloatBuffer_2 }, |
| 5034 | {"glUniform4i", "(IIIII)V", (void *) android_glUniform4i__IIIII }, |
| 5035 | {"glUniform4iv", "(II[II)V", (void *) android_glUniform4iv__II_3II }, |
| 5036 | {"glUniform4iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4iv__IILjava_nio_IntBuffer_2 }, |
| 5037 | {"glUniformMatrix2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2fv__IIZ_3FI }, |
| 5038 | {"glUniformMatrix2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5039 | {"glUniformMatrix3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3fv__IIZ_3FI }, |
| 5040 | {"glUniformMatrix3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5041 | {"glUniformMatrix4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4fv__IIZ_3FI }, |
| 5042 | {"glUniformMatrix4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5043 | {"glUseProgram", "(I)V", (void *) android_glUseProgram__I }, |
| 5044 | {"glValidateProgram", "(I)V", (void *) android_glValidateProgram__I }, |
| 5045 | {"glVertexAttrib1f", "(IF)V", (void *) android_glVertexAttrib1f__IF }, |
| 5046 | {"glVertexAttrib1fv", "(I[FI)V", (void *) android_glVertexAttrib1fv__I_3FI }, |
| 5047 | {"glVertexAttrib1fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 }, |
| 5048 | {"glVertexAttrib2f", "(IFF)V", (void *) android_glVertexAttrib2f__IFF }, |
| 5049 | {"glVertexAttrib2fv", "(I[FI)V", (void *) android_glVertexAttrib2fv__I_3FI }, |
| 5050 | {"glVertexAttrib2fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 }, |
| 5051 | {"glVertexAttrib3f", "(IFFF)V", (void *) android_glVertexAttrib3f__IFFF }, |
| 5052 | {"glVertexAttrib3fv", "(I[FI)V", (void *) android_glVertexAttrib3fv__I_3FI }, |
| 5053 | {"glVertexAttrib3fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 }, |
| 5054 | {"glVertexAttrib4f", "(IFFFF)V", (void *) android_glVertexAttrib4f__IFFFF }, |
| 5055 | {"glVertexAttrib4fv", "(I[FI)V", (void *) android_glVertexAttrib4fv__I_3FI }, |
| 5056 | {"glVertexAttrib4fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 }, |
Jack Palevich | 224107a | 2010-06-22 20:08:40 +0800 | [diff] [blame] | 5057 | {"glVertexAttribPointer", "(IIIZII)V", (void *) android_glVertexAttribPointer__IIIZII }, |
Jack Palevich | 560814f | 2009-11-19 16:34:55 +0800 | [diff] [blame] | 5058 | {"glVertexAttribPointerBounds", "(IIIZILjava/nio/Buffer;I)V", (void *) android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I }, |
| 5059 | {"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, |
| 5060 | }; |
| 5061 | |
| 5062 | int register_android_opengl_jni_GLES20(JNIEnv *_env) |
| 5063 | { |
| 5064 | int err; |
| 5065 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 5066 | return err; |
| 5067 | } |