1 /* 2 ** 3 ** Copyright 2009, The Android Open Source Project 4 ** 5 ** Licensed under the Apache License, Version 2.0 (the "License"); 6 ** you may not use this file except in compliance with the License. 7 ** You may obtain a copy of the License at 8 ** 9 ** http://www.apache.org/licenses/LICENSE-2.0 10 ** 11 ** Unless required by applicable law or agreed to in writing, software 12 ** distributed under the License is distributed on an "AS IS" BASIS, 13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ** See the License for the specific language governing permissions and 15 ** limitations under the License. 16 */ 17 18 // This source file is automatically generated 19 20 #include <GLES/gl.h> 21 #include <GLES/glext.h> 22 23 #include "jni.h" 24 #include "JNIHelp.h" 25 #include <android_runtime/AndroidRuntime.h> 26 #include <utils/misc.h> 27 #include <assert.h> 28 29 static int initialized = 0; 30 31 static jclass nioAccessClass; 32 static jclass bufferClass; 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 41 /* special calls implemented in Android's GLES wrapper used to more 42 * efficiently bound-check passed arrays */ 43 extern "C" { 44 #ifdef GL_VERSION_ES_CM_1_1 45 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, 46 const GLvoid *ptr, GLsizei count); 47 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, 48 const GLvoid *pointer, GLsizei count); 49 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, 50 GLsizei stride, const GLvoid *pointer, GLsizei count); 51 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, 52 GLsizei stride, const GLvoid *pointer, GLsizei count); 53 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, 54 GLsizei stride, const GLvoid *pointer, GLsizei count); 55 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, 56 GLsizei stride, const GLvoid *pointer, GLsizei count); 57 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, 58 GLsizei stride, const GLvoid *pointer, GLsizei count); 59 #endif 60 #ifdef GL_ES_VERSION_2_0 61 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, 62 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) { 63 glVertexAttribPointer(indx, size, type, normalized, stride, pointer); 64 } 65 #endif 66 #ifdef GL_ES_VERSION_3_0 67 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type, 68 GLsizei stride, const GLvoid *pointer, GLsizei count) { 69 glVertexAttribIPointer(indx, size, type, stride, pointer); 70 } 71 #endif 72 } 73 74 /* Cache method IDs each time the class is loaded. */ 75 76 static void 77 nativeClassInit(JNIEnv *_env, jclass glImplClass) 78 { 79 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); 80 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); 81 82 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); 83 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); 84 85 getBasePointerID = _env->GetStaticMethodID(nioAccessClass, 86 "getBasePointer", "(Ljava/nio/Buffer;)J"); 87 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, 88 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); 89 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, 90 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); 91 92 positionID = _env->GetFieldID(bufferClass, "position", "I"); 93 limitID = _env->GetFieldID(bufferClass, "limit", "I"); 94 elementSizeShiftID = 95 _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); 96 } 97 98 static void * 99 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) 100 { 101 jint position; 102 jint limit; 103 jint elementSizeShift; 104 jlong pointer; 105 106 position = _env->GetIntField(buffer, positionID); 107 limit = _env->GetIntField(buffer, limitID); 108 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 109 *remaining = (limit - position) << elementSizeShift; 110 pointer = _env->CallStaticLongMethod(nioAccessClass, 111 getBasePointerID, buffer); 112 if (pointer != 0L) { 113 *array = NULL; 114 return (void *) (jint) pointer; 115 } 116 117 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, 118 getBaseArrayID, buffer); 119 *offset = _env->CallStaticIntMethod(nioAccessClass, 120 getBaseArrayOffsetID, buffer); 121 122 return NULL; 123 } 124 125 static void 126 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 127 { 128 _env->ReleasePrimitiveArrayCritical(array, data, 129 commit ? 0 : JNI_ABORT); 130 } 131 132 static void * 133 getDirectBufferPointer(JNIEnv *_env, jobject buffer) { 134 char* buf = (char*) _env->GetDirectBufferAddress(buffer); 135 if (buf) { 136 jint position = _env->GetIntField(buffer, positionID); 137 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 138 buf += position << elementSizeShift; 139 } else { 140 jniThrowException(_env, "java/lang/IllegalArgumentException", 141 "Must use a native order direct Buffer"); 142 } 143 return (void*) buf; 144 } 145 146 // -------------------------------------------------------------------------- 147 148 /* 149 * returns the number of values glGet returns for a given pname. 150 * 151 * The code below is written such that pnames requiring only one values 152 * are the default (and are not explicitely tested for). This makes the 153 * checking code much shorter/readable/efficient. 154 * 155 * This means that unknown pnames (e.g.: extensions) will default to 1. If 156 * that unknown pname needs more than 1 value, then the validation check 157 * is incomplete and the app may crash if it passed the wrong number params. 158 */ 159 static int getNeededCount(GLint pname) { 160 int needed = 1; 161 #ifdef GL_ES_VERSION_2_0 162 // GLES 2.x pnames 163 switch (pname) { 164 case GL_ALIASED_LINE_WIDTH_RANGE: 165 case GL_ALIASED_POINT_SIZE_RANGE: 166 needed = 2; 167 break; 168 169 case GL_BLEND_COLOR: 170 case GL_COLOR_CLEAR_VALUE: 171 case GL_COLOR_WRITEMASK: 172 case GL_SCISSOR_BOX: 173 case GL_VIEWPORT: 174 needed = 4; 175 break; 176 177 case GL_COMPRESSED_TEXTURE_FORMATS: 178 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 179 break; 180 181 case GL_SHADER_BINARY_FORMATS: 182 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); 183 break; 184 } 185 #endif 186 187 #ifdef GL_VERSION_ES_CM_1_1 188 // GLES 1.x pnames 189 switch (pname) { 190 case GL_ALIASED_LINE_WIDTH_RANGE: 191 case GL_ALIASED_POINT_SIZE_RANGE: 192 case GL_DEPTH_RANGE: 193 case GL_SMOOTH_LINE_WIDTH_RANGE: 194 case GL_SMOOTH_POINT_SIZE_RANGE: 195 needed = 2; 196 break; 197 198 case GL_CURRENT_NORMAL: 199 case GL_POINT_DISTANCE_ATTENUATION: 200 needed = 3; 201 break; 202 203 case GL_COLOR_CLEAR_VALUE: 204 case GL_COLOR_WRITEMASK: 205 case GL_CURRENT_COLOR: 206 case GL_CURRENT_TEXTURE_COORDS: 207 case GL_FOG_COLOR: 208 case GL_LIGHT_MODEL_AMBIENT: 209 case GL_SCISSOR_BOX: 210 case GL_VIEWPORT: 211 needed = 4; 212 break; 213 214 case GL_MODELVIEW_MATRIX: 215 case GL_PROJECTION_MATRIX: 216 case GL_TEXTURE_MATRIX: 217 needed = 16; 218 break; 219 220 case GL_COMPRESSED_TEXTURE_FORMATS: 221 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 222 break; 223 } 224 #endif 225 return needed; 226 } 227 228 template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)> 229 static void 230 get 231 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { 232 jint _exception = 0; 233 const char * _exceptionType; 234 const char * _exceptionMessage; 235 CTYPE *params_base = (CTYPE *) 0; 236 jint _remaining; 237 CTYPE *params = (CTYPE *) 0; 238 int _needed = 0; 239 240 if (!params_ref) { 241 _exception = 1; 242 _exceptionType = "java/lang/IllegalArgumentException"; 243 _exceptionMessage = "params == null"; 244 goto exit; 245 } 246 if (offset < 0) { 247 _exception = 1; 248 _exceptionType = "java/lang/IllegalArgumentException"; 249 _exceptionMessage = "offset < 0"; 250 goto exit; 251 } 252 _remaining = _env->GetArrayLength(params_ref) - offset; 253 _needed = getNeededCount(pname); 254 // if we didn't find this pname, we just assume the user passed 255 // an array of the right size -- this might happen with extensions 256 // or if we forget an enum here. 257 if (_remaining < _needed) { 258 _exception = 1; 259 _exceptionType = "java/lang/IllegalArgumentException"; 260 _exceptionMessage = "length - offset < needed"; 261 goto exit; 262 } 263 params_base = (CTYPE *) 264 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 265 params = params_base + offset; 266 267 GET( 268 (GLenum)pname, 269 (CTYPE *)params 270 ); 271 272 exit: 273 if (params_base) { 274 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 275 _exception ? JNI_ABORT: 0); 276 } 277 if (_exception) { 278 jniThrowException(_env, _exceptionType, _exceptionMessage); 279 } 280 } 281 282 283 template <typename CTYPE, void GET(GLenum, CTYPE*)> 284 static void 285 getarray 286 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 287 jint _exception = 0; 288 const char * _exceptionType; 289 const char * _exceptionMessage; 290 jarray _array = (jarray) 0; 291 jint _bufferOffset = (jint) 0; 292 jint _remaining; 293 CTYPE *params = (CTYPE *) 0; 294 int _needed = 0; 295 296 params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 297 _remaining /= sizeof(CTYPE); // convert from bytes to item count 298 _needed = getNeededCount(pname); 299 // if we didn't find this pname, we just assume the user passed 300 // an array of the right size -- this might happen with extensions 301 // or if we forget an enum here. 302 if (_needed>0 && _remaining < _needed) { 303 _exception = 1; 304 _exceptionType = "java/lang/IllegalArgumentException"; 305 _exceptionMessage = "remaining() < needed"; 306 goto exit; 307 } 308 if (params == NULL) { 309 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 310 params = (CTYPE *) (_paramsBase + _bufferOffset); 311 } 312 GET( 313 (GLenum)pname, 314 (CTYPE *)params 315 ); 316 317 exit: 318 if (_array) { 319 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 320 } 321 if (_exception) { 322 jniThrowException(_env, _exceptionType, _exceptionMessage); 323 } 324 } 325 326 // -------------------------------------------------------------------------- 327 /* void glBindBuffer ( GLenum target, GLuint buffer ) */ 328 static void 329 android_glBindBuffer__II 330 (JNIEnv *_env, jobject _this, jint target, jint buffer) { 331 glBindBuffer( 332 (GLenum)target, 333 (GLuint)buffer 334 ); 335 } 336 337 /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ 338 static void 339 android_glBufferData__IILjava_nio_Buffer_2I 340 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { 341 jint _exception = 0; 342 const char * _exceptionType = NULL; 343 const char * _exceptionMessage = NULL; 344 jarray _array = (jarray) 0; 345 jint _bufferOffset = (jint) 0; 346 jint _remaining; 347 GLvoid *data = (GLvoid *) 0; 348 349 if (data_buf) { 350 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); 351 if (_remaining < size) { 352 _exception = 1; 353 _exceptionType = "java/lang/IllegalArgumentException"; 354 _exceptionMessage = "remaining() < size < needed"; 355 goto exit; 356 } 357 } 358 if (data_buf && data == NULL) { 359 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 360 data = (GLvoid *) (_dataBase + _bufferOffset); 361 } 362 glBufferData( 363 (GLenum)target, 364 (GLsizeiptr)size, 365 (GLvoid *)data, 366 (GLenum)usage 367 ); 368 369 exit: 370 if (_array) { 371 releasePointer(_env, _array, data, JNI_FALSE); 372 } 373 if (_exception) { 374 jniThrowException(_env, _exceptionType, _exceptionMessage); 375 } 376 } 377 378 /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ 379 static void 380 android_glBufferSubData__IIILjava_nio_Buffer_2 381 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { 382 jint _exception = 0; 383 const char * _exceptionType = NULL; 384 const char * _exceptionMessage = NULL; 385 jarray _array = (jarray) 0; 386 jint _bufferOffset = (jint) 0; 387 jint _remaining; 388 GLvoid *data = (GLvoid *) 0; 389 390 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); 391 if (_remaining < size) { 392 _exception = 1; 393 _exceptionType = "java/lang/IllegalArgumentException"; 394 _exceptionMessage = "remaining() < size < needed"; 395 goto exit; 396 } 397 if (data == NULL) { 398 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 399 data = (GLvoid *) (_dataBase + _bufferOffset); 400 } 401 glBufferSubData( 402 (GLenum)target, 403 (GLintptr)offset, 404 (GLsizeiptr)size, 405 (GLvoid *)data 406 ); 407 408 exit: 409 if (_array) { 410 releasePointer(_env, _array, data, JNI_FALSE); 411 } 412 if (_exception) { 413 jniThrowException(_env, _exceptionType, _exceptionMessage); 414 } 415 } 416 417 /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ 418 static void 419 android_glClipPlanef__I_3FI 420 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { 421 jint _exception = 0; 422 const char * _exceptionType = NULL; 423 const char * _exceptionMessage = NULL; 424 GLfloat *equation_base = (GLfloat *) 0; 425 jint _remaining; 426 GLfloat *equation = (GLfloat *) 0; 427 428 if (!equation_ref) { 429 _exception = 1; 430 _exceptionType = "java/lang/IllegalArgumentException"; 431 _exceptionMessage = "equation == null"; 432 goto exit; 433 } 434 if (offset < 0) { 435 _exception = 1; 436 _exceptionType = "java/lang/IllegalArgumentException"; 437 _exceptionMessage = "offset < 0"; 438 goto exit; 439 } 440 _remaining = _env->GetArrayLength(equation_ref) - offset; 441 equation_base = (GLfloat *) 442 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); 443 equation = equation_base + offset; 444 445 glClipPlanef( 446 (GLenum)plane, 447 (GLfloat *)equation 448 ); 449 450 exit: 451 if (equation_base) { 452 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, 453 JNI_ABORT); 454 } 455 if (_exception) { 456 jniThrowException(_env, _exceptionType, _exceptionMessage); 457 } 458 } 459 460 /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ 461 static void 462 android_glClipPlanef__ILjava_nio_FloatBuffer_2 463 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { 464 jint _exception = 0; 465 const char * _exceptionType = NULL; 466 const char * _exceptionMessage = NULL; 467 jarray _array = (jarray) 0; 468 jint _bufferOffset = (jint) 0; 469 jint _remaining; 470 GLfloat *equation = (GLfloat *) 0; 471 472 equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset); 473 if (equation == NULL) { 474 char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 475 equation = (GLfloat *) (_equationBase + _bufferOffset); 476 } 477 glClipPlanef( 478 (GLenum)plane, 479 (GLfloat *)equation 480 ); 481 if (_array) { 482 releasePointer(_env, _array, equation, JNI_FALSE); 483 } 484 if (_exception) { 485 jniThrowException(_env, _exceptionType, _exceptionMessage); 486 } 487 } 488 489 /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ 490 static void 491 android_glClipPlanex__I_3II 492 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { 493 jint _exception = 0; 494 const char * _exceptionType = NULL; 495 const char * _exceptionMessage = NULL; 496 GLfixed *equation_base = (GLfixed *) 0; 497 jint _remaining; 498 GLfixed *equation = (GLfixed *) 0; 499 500 if (!equation_ref) { 501 _exception = 1; 502 _exceptionType = "java/lang/IllegalArgumentException"; 503 _exceptionMessage = "equation == null"; 504 goto exit; 505 } 506 if (offset < 0) { 507 _exception = 1; 508 _exceptionType = "java/lang/IllegalArgumentException"; 509 _exceptionMessage = "offset < 0"; 510 goto exit; 511 } 512 _remaining = _env->GetArrayLength(equation_ref) - offset; 513 equation_base = (GLfixed *) 514 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); 515 equation = equation_base + offset; 516 517 glClipPlanex( 518 (GLenum)plane, 519 (GLfixed *)equation 520 ); 521 522 exit: 523 if (equation_base) { 524 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, 525 JNI_ABORT); 526 } 527 if (_exception) { 528 jniThrowException(_env, _exceptionType, _exceptionMessage); 529 } 530 } 531 532 /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ 533 static void 534 android_glClipPlanex__ILjava_nio_IntBuffer_2 535 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { 536 jint _exception = 0; 537 const char * _exceptionType = NULL; 538 const char * _exceptionMessage = NULL; 539 jarray _array = (jarray) 0; 540 jint _bufferOffset = (jint) 0; 541 jint _remaining; 542 GLfixed *equation = (GLfixed *) 0; 543 544 equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset); 545 if (equation == NULL) { 546 char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 547 equation = (GLfixed *) (_equationBase + _bufferOffset); 548 } 549 glClipPlanex( 550 (GLenum)plane, 551 (GLfixed *)equation 552 ); 553 if (_array) { 554 releasePointer(_env, _array, equation, JNI_FALSE); 555 } 556 if (_exception) { 557 jniThrowException(_env, _exceptionType, _exceptionMessage); 558 } 559 } 560 561 /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ 562 static void 563 android_glColor4ub__BBBB 564 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { 565 glColor4ub( 566 (GLubyte)red, 567 (GLubyte)green, 568 (GLubyte)blue, 569 (GLubyte)alpha 570 ); 571 } 572 573 /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 574 static void 575 android_glColorPointer__IIII 576 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 577 glColorPointer( 578 (GLint)size, 579 (GLenum)type, 580 (GLsizei)stride, 581 (GLvoid *)offset 582 ); 583 } 584 585 /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 586 static void 587 android_glDeleteBuffers__I_3II 588 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 589 jint _exception = 0; 590 const char * _exceptionType = NULL; 591 const char * _exceptionMessage = NULL; 592 GLuint *buffers_base = (GLuint *) 0; 593 jint _remaining; 594 GLuint *buffers = (GLuint *) 0; 595 596 if (!buffers_ref) { 597 _exception = 1; 598 _exceptionType = "java/lang/IllegalArgumentException"; 599 _exceptionMessage = "buffers == null"; 600 goto exit; 601 } 602 if (offset < 0) { 603 _exception = 1; 604 _exceptionType = "java/lang/IllegalArgumentException"; 605 _exceptionMessage = "offset < 0"; 606 goto exit; 607 } 608 _remaining = _env->GetArrayLength(buffers_ref) - offset; 609 if (_remaining < n) { 610 _exception = 1; 611 _exceptionType = "java/lang/IllegalArgumentException"; 612 _exceptionMessage = "length - offset < n < needed"; 613 goto exit; 614 } 615 buffers_base = (GLuint *) 616 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); 617 buffers = buffers_base + offset; 618 619 glDeleteBuffers( 620 (GLsizei)n, 621 (GLuint *)buffers 622 ); 623 624 exit: 625 if (buffers_base) { 626 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, 627 JNI_ABORT); 628 } 629 if (_exception) { 630 jniThrowException(_env, _exceptionType, _exceptionMessage); 631 } 632 } 633 634 /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 635 static void 636 android_glDeleteBuffers__ILjava_nio_IntBuffer_2 637 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 638 jint _exception = 0; 639 const char * _exceptionType = NULL; 640 const char * _exceptionMessage = NULL; 641 jarray _array = (jarray) 0; 642 jint _bufferOffset = (jint) 0; 643 jint _remaining; 644 GLuint *buffers = (GLuint *) 0; 645 646 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset); 647 if (_remaining < n) { 648 _exception = 1; 649 _exceptionType = "java/lang/IllegalArgumentException"; 650 _exceptionMessage = "remaining() < n < needed"; 651 goto exit; 652 } 653 if (buffers == NULL) { 654 char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 655 buffers = (GLuint *) (_buffersBase + _bufferOffset); 656 } 657 glDeleteBuffers( 658 (GLsizei)n, 659 (GLuint *)buffers 660 ); 661 662 exit: 663 if (_array) { 664 releasePointer(_env, _array, buffers, JNI_FALSE); 665 } 666 if (_exception) { 667 jniThrowException(_env, _exceptionType, _exceptionMessage); 668 } 669 } 670 671 /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ 672 static void 673 android_glDrawElements__IIII 674 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { 675 jint _exception = 0; 676 const char * _exceptionType = NULL; 677 const char * _exceptionMessage = NULL; 678 glDrawElements( 679 (GLenum)mode, 680 (GLsizei)count, 681 (GLenum)type, 682 (GLvoid *)offset 683 ); 684 if (_exception) { 685 jniThrowException(_env, _exceptionType, _exceptionMessage); 686 } 687 } 688 689 /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 690 static void 691 android_glGenBuffers__I_3II 692 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 693 jint _exception = 0; 694 const char * _exceptionType = NULL; 695 const char * _exceptionMessage = NULL; 696 GLuint *buffers_base = (GLuint *) 0; 697 jint _remaining; 698 GLuint *buffers = (GLuint *) 0; 699 700 if (!buffers_ref) { 701 _exception = 1; 702 _exceptionType = "java/lang/IllegalArgumentException"; 703 _exceptionMessage = "buffers == null"; 704 goto exit; 705 } 706 if (offset < 0) { 707 _exception = 1; 708 _exceptionType = "java/lang/IllegalArgumentException"; 709 _exceptionMessage = "offset < 0"; 710 goto exit; 711 } 712 _remaining = _env->GetArrayLength(buffers_ref) - offset; 713 if (_remaining < n) { 714 _exception = 1; 715 _exceptionType = "java/lang/IllegalArgumentException"; 716 _exceptionMessage = "length - offset < n < needed"; 717 goto exit; 718 } 719 buffers_base = (GLuint *) 720 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); 721 buffers = buffers_base + offset; 722 723 glGenBuffers( 724 (GLsizei)n, 725 (GLuint *)buffers 726 ); 727 728 exit: 729 if (buffers_base) { 730 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, 731 _exception ? JNI_ABORT: 0); 732 } 733 if (_exception) { 734 jniThrowException(_env, _exceptionType, _exceptionMessage); 735 } 736 } 737 738 /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 739 static void 740 android_glGenBuffers__ILjava_nio_IntBuffer_2 741 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 742 jint _exception = 0; 743 const char * _exceptionType = NULL; 744 const char * _exceptionMessage = NULL; 745 jarray _array = (jarray) 0; 746 jint _bufferOffset = (jint) 0; 747 jint _remaining; 748 GLuint *buffers = (GLuint *) 0; 749 750 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset); 751 if (_remaining < n) { 752 _exception = 1; 753 _exceptionType = "java/lang/IllegalArgumentException"; 754 _exceptionMessage = "remaining() < n < needed"; 755 goto exit; 756 } 757 if (buffers == NULL) { 758 char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 759 buffers = (GLuint *) (_buffersBase + _bufferOffset); 760 } 761 glGenBuffers( 762 (GLsizei)n, 763 (GLuint *)buffers 764 ); 765 766 exit: 767 if (_array) { 768 releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE); 769 } 770 if (_exception) { 771 jniThrowException(_env, _exceptionType, _exceptionMessage); 772 } 773 } 774 775 /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 776 static void 777 android_glGetBooleanv__I_3ZI 778 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { 779 get<jbooleanArray, GLboolean, glGetBooleanv>(_env, _this, pname, params_ref, offset); 780 } 781 782 /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 783 static void 784 android_glGetBooleanv__ILjava_nio_IntBuffer_2 785 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 786 getarray<GLboolean, glGetBooleanv>(_env, _this, pname, params_buf); 787 } 788 /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 789 static void 790 android_glGetBufferParameteriv__II_3II 791 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 792 jint _exception = 0; 793 const char * _exceptionType = NULL; 794 const char * _exceptionMessage = NULL; 795 GLint *params_base = (GLint *) 0; 796 jint _remaining; 797 GLint *params = (GLint *) 0; 798 799 if (!params_ref) { 800 _exception = 1; 801 _exceptionType = "java/lang/IllegalArgumentException"; 802 _exceptionMessage = "params == null"; 803 goto exit; 804 } 805 if (offset < 0) { 806 _exception = 1; 807 _exceptionType = "java/lang/IllegalArgumentException"; 808 _exceptionMessage = "offset < 0"; 809 goto exit; 810 } 811 _remaining = _env->GetArrayLength(params_ref) - offset; 812 if (_remaining < 1) { 813 _exception = 1; 814 _exceptionType = "java/lang/IllegalArgumentException"; 815 _exceptionMessage = "length - offset < 1 < needed"; 816 goto exit; 817 } 818 params_base = (GLint *) 819 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 820 params = params_base + offset; 821 822 glGetBufferParameteriv( 823 (GLenum)target, 824 (GLenum)pname, 825 (GLint *)params 826 ); 827 828 exit: 829 if (params_base) { 830 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 831 _exception ? JNI_ABORT: 0); 832 } 833 if (_exception) { 834 jniThrowException(_env, _exceptionType, _exceptionMessage); 835 } 836 } 837 838 /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 839 static void 840 android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 841 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 842 jint _exception = 0; 843 const char * _exceptionType = NULL; 844 const char * _exceptionMessage = NULL; 845 jarray _array = (jarray) 0; 846 jint _bufferOffset = (jint) 0; 847 jint _remaining; 848 GLint *params = (GLint *) 0; 849 850 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 851 if (_remaining < 1) { 852 _exception = 1; 853 _exceptionType = "java/lang/IllegalArgumentException"; 854 _exceptionMessage = "remaining() < 1 < needed"; 855 goto exit; 856 } 857 if (params == NULL) { 858 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 859 params = (GLint *) (_paramsBase + _bufferOffset); 860 } 861 glGetBufferParameteriv( 862 (GLenum)target, 863 (GLenum)pname, 864 (GLint *)params 865 ); 866 867 exit: 868 if (_array) { 869 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 870 } 871 if (_exception) { 872 jniThrowException(_env, _exceptionType, _exceptionMessage); 873 } 874 } 875 876 /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ 877 static void 878 android_glGetClipPlanef__I_3FI 879 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { 880 jint _exception = 0; 881 const char * _exceptionType = NULL; 882 const char * _exceptionMessage = NULL; 883 GLfloat *eqn_base = (GLfloat *) 0; 884 jint _remaining; 885 GLfloat *eqn = (GLfloat *) 0; 886 887 if (!eqn_ref) { 888 _exception = 1; 889 _exceptionType = "java/lang/IllegalArgumentException"; 890 _exceptionMessage = "eqn == null"; 891 goto exit; 892 } 893 if (offset < 0) { 894 _exception = 1; 895 _exceptionType = "java/lang/IllegalArgumentException"; 896 _exceptionMessage = "offset < 0"; 897 goto exit; 898 } 899 _remaining = _env->GetArrayLength(eqn_ref) - offset; 900 if (_remaining < 4) { 901 _exception = 1; 902 _exceptionType = "java/lang/IllegalArgumentException"; 903 _exceptionMessage = "length - offset < 4 < needed"; 904 goto exit; 905 } 906 eqn_base = (GLfloat *) 907 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); 908 eqn = eqn_base + offset; 909 910 glGetClipPlanef( 911 (GLenum)pname, 912 (GLfloat *)eqn 913 ); 914 915 exit: 916 if (eqn_base) { 917 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, 918 _exception ? JNI_ABORT: 0); 919 } 920 if (_exception) { 921 jniThrowException(_env, _exceptionType, _exceptionMessage); 922 } 923 } 924 925 /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ 926 static void 927 android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 928 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { 929 jint _exception = 0; 930 const char * _exceptionType = NULL; 931 const char * _exceptionMessage = NULL; 932 jarray _array = (jarray) 0; 933 jint _bufferOffset = (jint) 0; 934 jint _remaining; 935 GLfloat *eqn = (GLfloat *) 0; 936 937 eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset); 938 if (_remaining < 4) { 939 _exception = 1; 940 _exceptionType = "java/lang/IllegalArgumentException"; 941 _exceptionMessage = "remaining() < 4 < needed"; 942 goto exit; 943 } 944 if (eqn == NULL) { 945 char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 946 eqn = (GLfloat *) (_eqnBase + _bufferOffset); 947 } 948 glGetClipPlanef( 949 (GLenum)pname, 950 (GLfloat *)eqn 951 ); 952 953 exit: 954 if (_array) { 955 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE); 956 } 957 if (_exception) { 958 jniThrowException(_env, _exceptionType, _exceptionMessage); 959 } 960 } 961 962 /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ 963 static void 964 android_glGetClipPlanex__I_3II 965 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { 966 jint _exception = 0; 967 const char * _exceptionType = NULL; 968 const char * _exceptionMessage = NULL; 969 GLfixed *eqn_base = (GLfixed *) 0; 970 jint _remaining; 971 GLfixed *eqn = (GLfixed *) 0; 972 973 if (!eqn_ref) { 974 _exception = 1; 975 _exceptionType = "java/lang/IllegalArgumentException"; 976 _exceptionMessage = "eqn == null"; 977 goto exit; 978 } 979 if (offset < 0) { 980 _exception = 1; 981 _exceptionType = "java/lang/IllegalArgumentException"; 982 _exceptionMessage = "offset < 0"; 983 goto exit; 984 } 985 _remaining = _env->GetArrayLength(eqn_ref) - offset; 986 if (_remaining < 4) { 987 _exception = 1; 988 _exceptionType = "java/lang/IllegalArgumentException"; 989 _exceptionMessage = "length - offset < 4 < needed"; 990 goto exit; 991 } 992 eqn_base = (GLfixed *) 993 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); 994 eqn = eqn_base + offset; 995 996 glGetClipPlanex( 997 (GLenum)pname, 998 (GLfixed *)eqn 999 ); 1000 1001 exit: 1002 if (eqn_base) { 1003 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, 1004 _exception ? JNI_ABORT: 0); 1005 } 1006 if (_exception) { 1007 jniThrowException(_env, _exceptionType, _exceptionMessage); 1008 } 1009 } 1010 1011 /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ 1012 static void 1013 android_glGetClipPlanex__ILjava_nio_IntBuffer_2 1014 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { 1015 jint _exception = 0; 1016 const char * _exceptionType = NULL; 1017 const char * _exceptionMessage = NULL; 1018 jarray _array = (jarray) 0; 1019 jint _bufferOffset = (jint) 0; 1020 jint _remaining; 1021 GLfixed *eqn = (GLfixed *) 0; 1022 1023 eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset); 1024 if (_remaining < 4) { 1025 _exception = 1; 1026 _exceptionType = "java/lang/IllegalArgumentException"; 1027 _exceptionMessage = "remaining() < 4 < needed"; 1028 goto exit; 1029 } 1030 if (eqn == NULL) { 1031 char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1032 eqn = (GLfixed *) (_eqnBase + _bufferOffset); 1033 } 1034 glGetClipPlanex( 1035 (GLenum)pname, 1036 (GLfixed *)eqn 1037 ); 1038 1039 exit: 1040 if (_array) { 1041 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE); 1042 } 1043 if (_exception) { 1044 jniThrowException(_env, _exceptionType, _exceptionMessage); 1045 } 1046 } 1047 1048 /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ 1049 static void 1050 android_glGetFixedv__I_3II 1051 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 1052 jint _exception = 0; 1053 const char * _exceptionType = NULL; 1054 const char * _exceptionMessage = NULL; 1055 GLfixed *params_base = (GLfixed *) 0; 1056 jint _remaining; 1057 GLfixed *params = (GLfixed *) 0; 1058 1059 if (!params_ref) { 1060 _exception = 1; 1061 _exceptionType = "java/lang/IllegalArgumentException"; 1062 _exceptionMessage = "params == null"; 1063 goto exit; 1064 } 1065 if (offset < 0) { 1066 _exception = 1; 1067 _exceptionType = "java/lang/IllegalArgumentException"; 1068 _exceptionMessage = "offset < 0"; 1069 goto exit; 1070 } 1071 _remaining = _env->GetArrayLength(params_ref) - offset; 1072 params_base = (GLfixed *) 1073 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1074 params = params_base + offset; 1075 1076 glGetFixedv( 1077 (GLenum)pname, 1078 (GLfixed *)params 1079 ); 1080 1081 exit: 1082 if (params_base) { 1083 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1084 _exception ? JNI_ABORT: 0); 1085 } 1086 if (_exception) { 1087 jniThrowException(_env, _exceptionType, _exceptionMessage); 1088 } 1089 } 1090 1091 /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ 1092 static void 1093 android_glGetFixedv__ILjava_nio_IntBuffer_2 1094 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 1095 jarray _array = (jarray) 0; 1096 jint _bufferOffset = (jint) 0; 1097 jint _remaining; 1098 GLfixed *params = (GLfixed *) 0; 1099 1100 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1101 if (params == NULL) { 1102 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1103 params = (GLfixed *) (_paramsBase + _bufferOffset); 1104 } 1105 glGetFixedv( 1106 (GLenum)pname, 1107 (GLfixed *)params 1108 ); 1109 if (_array) { 1110 releasePointer(_env, _array, params, JNI_TRUE); 1111 } 1112 } 1113 1114 /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 1115 static void 1116 android_glGetFloatv__I_3FI 1117 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 1118 get<jfloatArray, GLfloat, glGetFloatv>(_env, _this, pname, params_ref, offset); 1119 } 1120 1121 /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 1122 static void 1123 android_glGetFloatv__ILjava_nio_FloatBuffer_2 1124 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 1125 getarray<GLfloat, glGetFloatv>(_env, _this, pname, params_buf); 1126 } 1127 /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ 1128 static void 1129 android_glGetLightfv__II_3FI 1130 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { 1131 jint _exception = 0; 1132 const char * _exceptionType = NULL; 1133 const char * _exceptionMessage = NULL; 1134 GLfloat *params_base = (GLfloat *) 0; 1135 jint _remaining; 1136 GLfloat *params = (GLfloat *) 0; 1137 1138 if (!params_ref) { 1139 _exception = 1; 1140 _exceptionType = "java/lang/IllegalArgumentException"; 1141 _exceptionMessage = "params == null"; 1142 goto exit; 1143 } 1144 if (offset < 0) { 1145 _exception = 1; 1146 _exceptionType = "java/lang/IllegalArgumentException"; 1147 _exceptionMessage = "offset < 0"; 1148 goto exit; 1149 } 1150 _remaining = _env->GetArrayLength(params_ref) - offset; 1151 int _needed; 1152 switch (pname) { 1153 #if defined(GL_SPOT_DIRECTION) 1154 case GL_SPOT_DIRECTION: 1155 #endif // defined(GL_SPOT_DIRECTION) 1156 _needed = 3; 1157 break; 1158 #if defined(GL_AMBIENT) 1159 case GL_AMBIENT: 1160 #endif // defined(GL_AMBIENT) 1161 #if defined(GL_DIFFUSE) 1162 case GL_DIFFUSE: 1163 #endif // defined(GL_DIFFUSE) 1164 #if defined(GL_SPECULAR) 1165 case GL_SPECULAR: 1166 #endif // defined(GL_SPECULAR) 1167 #if defined(GL_EMISSION) 1168 case GL_EMISSION: 1169 #endif // defined(GL_EMISSION) 1170 _needed = 4; 1171 break; 1172 default: 1173 _needed = 1; 1174 break; 1175 } 1176 if (_remaining < _needed) { 1177 _exception = 1; 1178 _exceptionType = "java/lang/IllegalArgumentException"; 1179 _exceptionMessage = "length - offset < needed"; 1180 goto exit; 1181 } 1182 params_base = (GLfloat *) 1183 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1184 params = params_base + offset; 1185 1186 glGetLightfv( 1187 (GLenum)light, 1188 (GLenum)pname, 1189 (GLfloat *)params 1190 ); 1191 1192 exit: 1193 if (params_base) { 1194 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1195 _exception ? JNI_ABORT: 0); 1196 } 1197 if (_exception) { 1198 jniThrowException(_env, _exceptionType, _exceptionMessage); 1199 } 1200 } 1201 1202 /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ 1203 static void 1204 android_glGetLightfv__IILjava_nio_FloatBuffer_2 1205 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { 1206 jint _exception = 0; 1207 const char * _exceptionType = NULL; 1208 const char * _exceptionMessage = NULL; 1209 jarray _array = (jarray) 0; 1210 jint _bufferOffset = (jint) 0; 1211 jint _remaining; 1212 GLfloat *params = (GLfloat *) 0; 1213 1214 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1215 int _needed; 1216 switch (pname) { 1217 #if defined(GL_SPOT_DIRECTION) 1218 case GL_SPOT_DIRECTION: 1219 #endif // defined(GL_SPOT_DIRECTION) 1220 _needed = 3; 1221 break; 1222 #if defined(GL_AMBIENT) 1223 case GL_AMBIENT: 1224 #endif // defined(GL_AMBIENT) 1225 #if defined(GL_DIFFUSE) 1226 case GL_DIFFUSE: 1227 #endif // defined(GL_DIFFUSE) 1228 #if defined(GL_SPECULAR) 1229 case GL_SPECULAR: 1230 #endif // defined(GL_SPECULAR) 1231 #if defined(GL_EMISSION) 1232 case GL_EMISSION: 1233 #endif // defined(GL_EMISSION) 1234 _needed = 4; 1235 break; 1236 default: 1237 _needed = 1; 1238 break; 1239 } 1240 if (_remaining < _needed) { 1241 _exception = 1; 1242 _exceptionType = "java/lang/IllegalArgumentException"; 1243 _exceptionMessage = "remaining() < needed"; 1244 goto exit; 1245 } 1246 if (params == NULL) { 1247 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1248 params = (GLfloat *) (_paramsBase + _bufferOffset); 1249 } 1250 glGetLightfv( 1251 (GLenum)light, 1252 (GLenum)pname, 1253 (GLfloat *)params 1254 ); 1255 1256 exit: 1257 if (_array) { 1258 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1259 } 1260 if (_exception) { 1261 jniThrowException(_env, _exceptionType, _exceptionMessage); 1262 } 1263 } 1264 1265 /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ 1266 static void 1267 android_glGetLightxv__II_3II 1268 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { 1269 jint _exception = 0; 1270 const char * _exceptionType = NULL; 1271 const char * _exceptionMessage = NULL; 1272 GLfixed *params_base = (GLfixed *) 0; 1273 jint _remaining; 1274 GLfixed *params = (GLfixed *) 0; 1275 1276 if (!params_ref) { 1277 _exception = 1; 1278 _exceptionType = "java/lang/IllegalArgumentException"; 1279 _exceptionMessage = "params == null"; 1280 goto exit; 1281 } 1282 if (offset < 0) { 1283 _exception = 1; 1284 _exceptionType = "java/lang/IllegalArgumentException"; 1285 _exceptionMessage = "offset < 0"; 1286 goto exit; 1287 } 1288 _remaining = _env->GetArrayLength(params_ref) - offset; 1289 int _needed; 1290 switch (pname) { 1291 #if defined(GL_SPOT_DIRECTION) 1292 case GL_SPOT_DIRECTION: 1293 #endif // defined(GL_SPOT_DIRECTION) 1294 _needed = 3; 1295 break; 1296 #if defined(GL_AMBIENT) 1297 case GL_AMBIENT: 1298 #endif // defined(GL_AMBIENT) 1299 #if defined(GL_DIFFUSE) 1300 case GL_DIFFUSE: 1301 #endif // defined(GL_DIFFUSE) 1302 #if defined(GL_SPECULAR) 1303 case GL_SPECULAR: 1304 #endif // defined(GL_SPECULAR) 1305 #if defined(GL_EMISSION) 1306 case GL_EMISSION: 1307 #endif // defined(GL_EMISSION) 1308 _needed = 4; 1309 break; 1310 default: 1311 _needed = 1; 1312 break; 1313 } 1314 if (_remaining < _needed) { 1315 _exception = 1; 1316 _exceptionType = "java/lang/IllegalArgumentException"; 1317 _exceptionMessage = "length - offset < needed"; 1318 goto exit; 1319 } 1320 params_base = (GLfixed *) 1321 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1322 params = params_base + offset; 1323 1324 glGetLightxv( 1325 (GLenum)light, 1326 (GLenum)pname, 1327 (GLfixed *)params 1328 ); 1329 1330 exit: 1331 if (params_base) { 1332 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1333 _exception ? JNI_ABORT: 0); 1334 } 1335 if (_exception) { 1336 jniThrowException(_env, _exceptionType, _exceptionMessage); 1337 } 1338 } 1339 1340 /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ 1341 static void 1342 android_glGetLightxv__IILjava_nio_IntBuffer_2 1343 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { 1344 jint _exception = 0; 1345 const char * _exceptionType = NULL; 1346 const char * _exceptionMessage = NULL; 1347 jarray _array = (jarray) 0; 1348 jint _bufferOffset = (jint) 0; 1349 jint _remaining; 1350 GLfixed *params = (GLfixed *) 0; 1351 1352 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1353 int _needed; 1354 switch (pname) { 1355 #if defined(GL_SPOT_DIRECTION) 1356 case GL_SPOT_DIRECTION: 1357 #endif // defined(GL_SPOT_DIRECTION) 1358 _needed = 3; 1359 break; 1360 #if defined(GL_AMBIENT) 1361 case GL_AMBIENT: 1362 #endif // defined(GL_AMBIENT) 1363 #if defined(GL_DIFFUSE) 1364 case GL_DIFFUSE: 1365 #endif // defined(GL_DIFFUSE) 1366 #if defined(GL_SPECULAR) 1367 case GL_SPECULAR: 1368 #endif // defined(GL_SPECULAR) 1369 #if defined(GL_EMISSION) 1370 case GL_EMISSION: 1371 #endif // defined(GL_EMISSION) 1372 _needed = 4; 1373 break; 1374 default: 1375 _needed = 1; 1376 break; 1377 } 1378 if (_remaining < _needed) { 1379 _exception = 1; 1380 _exceptionType = "java/lang/IllegalArgumentException"; 1381 _exceptionMessage = "remaining() < needed"; 1382 goto exit; 1383 } 1384 if (params == NULL) { 1385 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1386 params = (GLfixed *) (_paramsBase + _bufferOffset); 1387 } 1388 glGetLightxv( 1389 (GLenum)light, 1390 (GLenum)pname, 1391 (GLfixed *)params 1392 ); 1393 1394 exit: 1395 if (_array) { 1396 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1397 } 1398 if (_exception) { 1399 jniThrowException(_env, _exceptionType, _exceptionMessage); 1400 } 1401 } 1402 1403 /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ 1404 static void 1405 android_glGetMaterialfv__II_3FI 1406 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { 1407 jint _exception = 0; 1408 const char * _exceptionType = NULL; 1409 const char * _exceptionMessage = NULL; 1410 GLfloat *params_base = (GLfloat *) 0; 1411 jint _remaining; 1412 GLfloat *params = (GLfloat *) 0; 1413 1414 if (!params_ref) { 1415 _exception = 1; 1416 _exceptionType = "java/lang/IllegalArgumentException"; 1417 _exceptionMessage = "params == null"; 1418 goto exit; 1419 } 1420 if (offset < 0) { 1421 _exception = 1; 1422 _exceptionType = "java/lang/IllegalArgumentException"; 1423 _exceptionMessage = "offset < 0"; 1424 goto exit; 1425 } 1426 _remaining = _env->GetArrayLength(params_ref) - offset; 1427 int _needed; 1428 switch (pname) { 1429 #if defined(GL_AMBIENT) 1430 case GL_AMBIENT: 1431 #endif // defined(GL_AMBIENT) 1432 #if defined(GL_DIFFUSE) 1433 case GL_DIFFUSE: 1434 #endif // defined(GL_DIFFUSE) 1435 #if defined(GL_SPECULAR) 1436 case GL_SPECULAR: 1437 #endif // defined(GL_SPECULAR) 1438 #if defined(GL_EMISSION) 1439 case GL_EMISSION: 1440 #endif // defined(GL_EMISSION) 1441 #if defined(GL_AMBIENT_AND_DIFFUSE) 1442 case GL_AMBIENT_AND_DIFFUSE: 1443 #endif // defined(GL_AMBIENT_AND_DIFFUSE) 1444 _needed = 4; 1445 break; 1446 default: 1447 _needed = 1; 1448 break; 1449 } 1450 if (_remaining < _needed) { 1451 _exception = 1; 1452 _exceptionType = "java/lang/IllegalArgumentException"; 1453 _exceptionMessage = "length - offset < needed"; 1454 goto exit; 1455 } 1456 params_base = (GLfloat *) 1457 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1458 params = params_base + offset; 1459 1460 glGetMaterialfv( 1461 (GLenum)face, 1462 (GLenum)pname, 1463 (GLfloat *)params 1464 ); 1465 1466 exit: 1467 if (params_base) { 1468 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1469 _exception ? JNI_ABORT: 0); 1470 } 1471 if (_exception) { 1472 jniThrowException(_env, _exceptionType, _exceptionMessage); 1473 } 1474 } 1475 1476 /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ 1477 static void 1478 android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 1479 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { 1480 jint _exception = 0; 1481 const char * _exceptionType = NULL; 1482 const char * _exceptionMessage = NULL; 1483 jarray _array = (jarray) 0; 1484 jint _bufferOffset = (jint) 0; 1485 jint _remaining; 1486 GLfloat *params = (GLfloat *) 0; 1487 1488 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1489 int _needed; 1490 switch (pname) { 1491 #if defined(GL_AMBIENT) 1492 case GL_AMBIENT: 1493 #endif // defined(GL_AMBIENT) 1494 #if defined(GL_DIFFUSE) 1495 case GL_DIFFUSE: 1496 #endif // defined(GL_DIFFUSE) 1497 #if defined(GL_SPECULAR) 1498 case GL_SPECULAR: 1499 #endif // defined(GL_SPECULAR) 1500 #if defined(GL_EMISSION) 1501 case GL_EMISSION: 1502 #endif // defined(GL_EMISSION) 1503 #if defined(GL_AMBIENT_AND_DIFFUSE) 1504 case GL_AMBIENT_AND_DIFFUSE: 1505 #endif // defined(GL_AMBIENT_AND_DIFFUSE) 1506 _needed = 4; 1507 break; 1508 default: 1509 _needed = 1; 1510 break; 1511 } 1512 if (_remaining < _needed) { 1513 _exception = 1; 1514 _exceptionType = "java/lang/IllegalArgumentException"; 1515 _exceptionMessage = "remaining() < needed"; 1516 goto exit; 1517 } 1518 if (params == NULL) { 1519 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1520 params = (GLfloat *) (_paramsBase + _bufferOffset); 1521 } 1522 glGetMaterialfv( 1523 (GLenum)face, 1524 (GLenum)pname, 1525 (GLfloat *)params 1526 ); 1527 1528 exit: 1529 if (_array) { 1530 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1531 } 1532 if (_exception) { 1533 jniThrowException(_env, _exceptionType, _exceptionMessage); 1534 } 1535 } 1536 1537 /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ 1538 static void 1539 android_glGetMaterialxv__II_3II 1540 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { 1541 jint _exception = 0; 1542 const char * _exceptionType = NULL; 1543 const char * _exceptionMessage = NULL; 1544 GLfixed *params_base = (GLfixed *) 0; 1545 jint _remaining; 1546 GLfixed *params = (GLfixed *) 0; 1547 1548 if (!params_ref) { 1549 _exception = 1; 1550 _exceptionType = "java/lang/IllegalArgumentException"; 1551 _exceptionMessage = "params == null"; 1552 goto exit; 1553 } 1554 if (offset < 0) { 1555 _exception = 1; 1556 _exceptionType = "java/lang/IllegalArgumentException"; 1557 _exceptionMessage = "offset < 0"; 1558 goto exit; 1559 } 1560 _remaining = _env->GetArrayLength(params_ref) - offset; 1561 int _needed; 1562 switch (pname) { 1563 #if defined(GL_AMBIENT) 1564 case GL_AMBIENT: 1565 #endif // defined(GL_AMBIENT) 1566 #if defined(GL_DIFFUSE) 1567 case GL_DIFFUSE: 1568 #endif // defined(GL_DIFFUSE) 1569 #if defined(GL_SPECULAR) 1570 case GL_SPECULAR: 1571 #endif // defined(GL_SPECULAR) 1572 #if defined(GL_EMISSION) 1573 case GL_EMISSION: 1574 #endif // defined(GL_EMISSION) 1575 #if defined(GL_AMBIENT_AND_DIFFUSE) 1576 case GL_AMBIENT_AND_DIFFUSE: 1577 #endif // defined(GL_AMBIENT_AND_DIFFUSE) 1578 _needed = 4; 1579 break; 1580 default: 1581 _needed = 1; 1582 break; 1583 } 1584 if (_remaining < _needed) { 1585 _exception = 1; 1586 _exceptionType = "java/lang/IllegalArgumentException"; 1587 _exceptionMessage = "length - offset < needed"; 1588 goto exit; 1589 } 1590 params_base = (GLfixed *) 1591 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1592 params = params_base + offset; 1593 1594 glGetMaterialxv( 1595 (GLenum)face, 1596 (GLenum)pname, 1597 (GLfixed *)params 1598 ); 1599 1600 exit: 1601 if (params_base) { 1602 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1603 _exception ? JNI_ABORT: 0); 1604 } 1605 if (_exception) { 1606 jniThrowException(_env, _exceptionType, _exceptionMessage); 1607 } 1608 } 1609 1610 /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ 1611 static void 1612 android_glGetMaterialxv__IILjava_nio_IntBuffer_2 1613 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { 1614 jint _exception = 0; 1615 const char * _exceptionType = NULL; 1616 const char * _exceptionMessage = NULL; 1617 jarray _array = (jarray) 0; 1618 jint _bufferOffset = (jint) 0; 1619 jint _remaining; 1620 GLfixed *params = (GLfixed *) 0; 1621 1622 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1623 int _needed; 1624 switch (pname) { 1625 #if defined(GL_AMBIENT) 1626 case GL_AMBIENT: 1627 #endif // defined(GL_AMBIENT) 1628 #if defined(GL_DIFFUSE) 1629 case GL_DIFFUSE: 1630 #endif // defined(GL_DIFFUSE) 1631 #if defined(GL_SPECULAR) 1632 case GL_SPECULAR: 1633 #endif // defined(GL_SPECULAR) 1634 #if defined(GL_EMISSION) 1635 case GL_EMISSION: 1636 #endif // defined(GL_EMISSION) 1637 #if defined(GL_AMBIENT_AND_DIFFUSE) 1638 case GL_AMBIENT_AND_DIFFUSE: 1639 #endif // defined(GL_AMBIENT_AND_DIFFUSE) 1640 _needed = 4; 1641 break; 1642 default: 1643 _needed = 1; 1644 break; 1645 } 1646 if (_remaining < _needed) { 1647 _exception = 1; 1648 _exceptionType = "java/lang/IllegalArgumentException"; 1649 _exceptionMessage = "remaining() < needed"; 1650 goto exit; 1651 } 1652 if (params == NULL) { 1653 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1654 params = (GLfixed *) (_paramsBase + _bufferOffset); 1655 } 1656 glGetMaterialxv( 1657 (GLenum)face, 1658 (GLenum)pname, 1659 (GLfixed *)params 1660 ); 1661 1662 exit: 1663 if (_array) { 1664 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1665 } 1666 if (_exception) { 1667 jniThrowException(_env, _exceptionType, _exceptionMessage); 1668 } 1669 } 1670 1671 /* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */ 1672 static void 1673 android_glGetTexEnvfv__II_3FI 1674 (JNIEnv *_env, jobject _this, jint env, jint pname, jfloatArray params_ref, jint offset) { 1675 jint _exception = 0; 1676 const char * _exceptionType = NULL; 1677 const char * _exceptionMessage = NULL; 1678 GLfloat *params_base = (GLfloat *) 0; 1679 jint _remaining; 1680 GLfloat *params = (GLfloat *) 0; 1681 1682 if (!params_ref) { 1683 _exception = 1; 1684 _exceptionType = "java/lang/IllegalArgumentException"; 1685 _exceptionMessage = "params == null"; 1686 goto exit; 1687 } 1688 if (offset < 0) { 1689 _exception = 1; 1690 _exceptionType = "java/lang/IllegalArgumentException"; 1691 _exceptionMessage = "offset < 0"; 1692 goto exit; 1693 } 1694 _remaining = _env->GetArrayLength(params_ref) - offset; 1695 int _needed; 1696 switch (pname) { 1697 #if defined(GL_TEXTURE_ENV_COLOR) 1698 case GL_TEXTURE_ENV_COLOR: 1699 #endif // defined(GL_TEXTURE_ENV_COLOR) 1700 _needed = 4; 1701 break; 1702 default: 1703 _needed = 1; 1704 break; 1705 } 1706 if (_remaining < _needed) { 1707 _exception = 1; 1708 _exceptionType = "java/lang/IllegalArgumentException"; 1709 _exceptionMessage = "length - offset < needed"; 1710 goto exit; 1711 } 1712 params_base = (GLfloat *) 1713 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1714 params = params_base + offset; 1715 1716 glGetTexEnvfv( 1717 (GLenum)env, 1718 (GLenum)pname, 1719 (GLfloat *)params 1720 ); 1721 1722 exit: 1723 if (params_base) { 1724 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1725 _exception ? JNI_ABORT: 0); 1726 } 1727 if (_exception) { 1728 jniThrowException(_env, _exceptionType, _exceptionMessage); 1729 } 1730 } 1731 1732 /* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */ 1733 static void 1734 android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 1735 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1736 jint _exception = 0; 1737 const char * _exceptionType = NULL; 1738 const char * _exceptionMessage = NULL; 1739 jarray _array = (jarray) 0; 1740 jint _bufferOffset = (jint) 0; 1741 jint _remaining; 1742 GLfloat *params = (GLfloat *) 0; 1743 1744 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1745 int _needed; 1746 switch (pname) { 1747 #if defined(GL_TEXTURE_ENV_COLOR) 1748 case GL_TEXTURE_ENV_COLOR: 1749 #endif // defined(GL_TEXTURE_ENV_COLOR) 1750 _needed = 4; 1751 break; 1752 default: 1753 _needed = 1; 1754 break; 1755 } 1756 if (_remaining < _needed) { 1757 _exception = 1; 1758 _exceptionType = "java/lang/IllegalArgumentException"; 1759 _exceptionMessage = "remaining() < needed"; 1760 goto exit; 1761 } 1762 if (params == NULL) { 1763 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1764 params = (GLfloat *) (_paramsBase + _bufferOffset); 1765 } 1766 glGetTexEnvfv( 1767 (GLenum)env, 1768 (GLenum)pname, 1769 (GLfloat *)params 1770 ); 1771 1772 exit: 1773 if (_array) { 1774 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1775 } 1776 if (_exception) { 1777 jniThrowException(_env, _exceptionType, _exceptionMessage); 1778 } 1779 } 1780 1781 /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ 1782 static void 1783 android_glGetTexEnviv__II_3II 1784 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { 1785 jint _exception = 0; 1786 const char * _exceptionType = NULL; 1787 const char * _exceptionMessage = NULL; 1788 GLint *params_base = (GLint *) 0; 1789 jint _remaining; 1790 GLint *params = (GLint *) 0; 1791 1792 if (!params_ref) { 1793 _exception = 1; 1794 _exceptionType = "java/lang/IllegalArgumentException"; 1795 _exceptionMessage = "params == null"; 1796 goto exit; 1797 } 1798 if (offset < 0) { 1799 _exception = 1; 1800 _exceptionType = "java/lang/IllegalArgumentException"; 1801 _exceptionMessage = "offset < 0"; 1802 goto exit; 1803 } 1804 _remaining = _env->GetArrayLength(params_ref) - offset; 1805 int _needed; 1806 switch (pname) { 1807 #if defined(GL_TEXTURE_ENV_COLOR) 1808 case GL_TEXTURE_ENV_COLOR: 1809 #endif // defined(GL_TEXTURE_ENV_COLOR) 1810 _needed = 4; 1811 break; 1812 default: 1813 _needed = 1; 1814 break; 1815 } 1816 if (_remaining < _needed) { 1817 _exception = 1; 1818 _exceptionType = "java/lang/IllegalArgumentException"; 1819 _exceptionMessage = "length - offset < needed"; 1820 goto exit; 1821 } 1822 params_base = (GLint *) 1823 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1824 params = params_base + offset; 1825 1826 glGetTexEnviv( 1827 (GLenum)env, 1828 (GLenum)pname, 1829 (GLint *)params 1830 ); 1831 1832 exit: 1833 if (params_base) { 1834 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1835 _exception ? JNI_ABORT: 0); 1836 } 1837 if (_exception) { 1838 jniThrowException(_env, _exceptionType, _exceptionMessage); 1839 } 1840 } 1841 1842 /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ 1843 static void 1844 android_glGetTexEnviv__IILjava_nio_IntBuffer_2 1845 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1846 jint _exception = 0; 1847 const char * _exceptionType = NULL; 1848 const char * _exceptionMessage = NULL; 1849 jarray _array = (jarray) 0; 1850 jint _bufferOffset = (jint) 0; 1851 jint _remaining; 1852 GLint *params = (GLint *) 0; 1853 1854 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1855 int _needed; 1856 switch (pname) { 1857 #if defined(GL_TEXTURE_ENV_COLOR) 1858 case GL_TEXTURE_ENV_COLOR: 1859 #endif // defined(GL_TEXTURE_ENV_COLOR) 1860 _needed = 4; 1861 break; 1862 default: 1863 _needed = 1; 1864 break; 1865 } 1866 if (_remaining < _needed) { 1867 _exception = 1; 1868 _exceptionType = "java/lang/IllegalArgumentException"; 1869 _exceptionMessage = "remaining() < needed"; 1870 goto exit; 1871 } 1872 if (params == NULL) { 1873 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1874 params = (GLint *) (_paramsBase + _bufferOffset); 1875 } 1876 glGetTexEnviv( 1877 (GLenum)env, 1878 (GLenum)pname, 1879 (GLint *)params 1880 ); 1881 1882 exit: 1883 if (_array) { 1884 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1885 } 1886 if (_exception) { 1887 jniThrowException(_env, _exceptionType, _exceptionMessage); 1888 } 1889 } 1890 1891 /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ 1892 static void 1893 android_glGetTexEnvxv__II_3II 1894 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { 1895 jint _exception = 0; 1896 const char * _exceptionType = NULL; 1897 const char * _exceptionMessage = NULL; 1898 GLfixed *params_base = (GLfixed *) 0; 1899 jint _remaining; 1900 GLfixed *params = (GLfixed *) 0; 1901 1902 if (!params_ref) { 1903 _exception = 1; 1904 _exceptionType = "java/lang/IllegalArgumentException"; 1905 _exceptionMessage = "params == null"; 1906 goto exit; 1907 } 1908 if (offset < 0) { 1909 _exception = 1; 1910 _exceptionType = "java/lang/IllegalArgumentException"; 1911 _exceptionMessage = "offset < 0"; 1912 goto exit; 1913 } 1914 _remaining = _env->GetArrayLength(params_ref) - offset; 1915 int _needed; 1916 switch (pname) { 1917 #if defined(GL_TEXTURE_ENV_COLOR) 1918 case GL_TEXTURE_ENV_COLOR: 1919 #endif // defined(GL_TEXTURE_ENV_COLOR) 1920 _needed = 4; 1921 break; 1922 default: 1923 _needed = 1; 1924 break; 1925 } 1926 if (_remaining < _needed) { 1927 _exception = 1; 1928 _exceptionType = "java/lang/IllegalArgumentException"; 1929 _exceptionMessage = "length - offset < needed"; 1930 goto exit; 1931 } 1932 params_base = (GLfixed *) 1933 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1934 params = params_base + offset; 1935 1936 glGetTexEnvxv( 1937 (GLenum)env, 1938 (GLenum)pname, 1939 (GLfixed *)params 1940 ); 1941 1942 exit: 1943 if (params_base) { 1944 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1945 _exception ? JNI_ABORT: 0); 1946 } 1947 if (_exception) { 1948 jniThrowException(_env, _exceptionType, _exceptionMessage); 1949 } 1950 } 1951 1952 /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ 1953 static void 1954 android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 1955 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1956 jint _exception = 0; 1957 const char * _exceptionType = NULL; 1958 const char * _exceptionMessage = NULL; 1959 jarray _array = (jarray) 0; 1960 jint _bufferOffset = (jint) 0; 1961 jint _remaining; 1962 GLfixed *params = (GLfixed *) 0; 1963 1964 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1965 int _needed; 1966 switch (pname) { 1967 #if defined(GL_TEXTURE_ENV_COLOR) 1968 case GL_TEXTURE_ENV_COLOR: 1969 #endif // defined(GL_TEXTURE_ENV_COLOR) 1970 _needed = 4; 1971 break; 1972 default: 1973 _needed = 1; 1974 break; 1975 } 1976 if (_remaining < _needed) { 1977 _exception = 1; 1978 _exceptionType = "java/lang/IllegalArgumentException"; 1979 _exceptionMessage = "remaining() < needed"; 1980 goto exit; 1981 } 1982 if (params == NULL) { 1983 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1984 params = (GLfixed *) (_paramsBase + _bufferOffset); 1985 } 1986 glGetTexEnvxv( 1987 (GLenum)env, 1988 (GLenum)pname, 1989 (GLfixed *)params 1990 ); 1991 1992 exit: 1993 if (_array) { 1994 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1995 } 1996 if (_exception) { 1997 jniThrowException(_env, _exceptionType, _exceptionMessage); 1998 } 1999 } 2000 2001 /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 2002 static void 2003 android_glGetTexParameterfv__II_3FI 2004 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 2005 jint _exception = 0; 2006 const char * _exceptionType = NULL; 2007 const char * _exceptionMessage = NULL; 2008 GLfloat *params_base = (GLfloat *) 0; 2009 jint _remaining; 2010 GLfloat *params = (GLfloat *) 0; 2011 2012 if (!params_ref) { 2013 _exception = 1; 2014 _exceptionType = "java/lang/IllegalArgumentException"; 2015 _exceptionMessage = "params == null"; 2016 goto exit; 2017 } 2018 if (offset < 0) { 2019 _exception = 1; 2020 _exceptionType = "java/lang/IllegalArgumentException"; 2021 _exceptionMessage = "offset < 0"; 2022 goto exit; 2023 } 2024 _remaining = _env->GetArrayLength(params_ref) - offset; 2025 if (_remaining < 1) { 2026 _exception = 1; 2027 _exceptionType = "java/lang/IllegalArgumentException"; 2028 _exceptionMessage = "length - offset < 1 < needed"; 2029 goto exit; 2030 } 2031 params_base = (GLfloat *) 2032 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2033 params = params_base + offset; 2034 2035 glGetTexParameterfv( 2036 (GLenum)target, 2037 (GLenum)pname, 2038 (GLfloat *)params 2039 ); 2040 2041 exit: 2042 if (params_base) { 2043 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2044 _exception ? JNI_ABORT: 0); 2045 } 2046 if (_exception) { 2047 jniThrowException(_env, _exceptionType, _exceptionMessage); 2048 } 2049 } 2050 2051 /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 2052 static void 2053 android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 2054 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2055 jint _exception = 0; 2056 const char * _exceptionType = NULL; 2057 const char * _exceptionMessage = NULL; 2058 jarray _array = (jarray) 0; 2059 jint _bufferOffset = (jint) 0; 2060 jint _remaining; 2061 GLfloat *params = (GLfloat *) 0; 2062 2063 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2064 if (_remaining < 1) { 2065 _exception = 1; 2066 _exceptionType = "java/lang/IllegalArgumentException"; 2067 _exceptionMessage = "remaining() < 1 < needed"; 2068 goto exit; 2069 } 2070 if (params == NULL) { 2071 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2072 params = (GLfloat *) (_paramsBase + _bufferOffset); 2073 } 2074 glGetTexParameterfv( 2075 (GLenum)target, 2076 (GLenum)pname, 2077 (GLfloat *)params 2078 ); 2079 2080 exit: 2081 if (_array) { 2082 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 2083 } 2084 if (_exception) { 2085 jniThrowException(_env, _exceptionType, _exceptionMessage); 2086 } 2087 } 2088 2089 /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2090 static void 2091 android_glGetTexParameteriv__II_3II 2092 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2093 jint _exception = 0; 2094 const char * _exceptionType = NULL; 2095 const char * _exceptionMessage = NULL; 2096 GLint *params_base = (GLint *) 0; 2097 jint _remaining; 2098 GLint *params = (GLint *) 0; 2099 2100 if (!params_ref) { 2101 _exception = 1; 2102 _exceptionType = "java/lang/IllegalArgumentException"; 2103 _exceptionMessage = "params == null"; 2104 goto exit; 2105 } 2106 if (offset < 0) { 2107 _exception = 1; 2108 _exceptionType = "java/lang/IllegalArgumentException"; 2109 _exceptionMessage = "offset < 0"; 2110 goto exit; 2111 } 2112 _remaining = _env->GetArrayLength(params_ref) - offset; 2113 if (_remaining < 1) { 2114 _exception = 1; 2115 _exceptionType = "java/lang/IllegalArgumentException"; 2116 _exceptionMessage = "length - offset < 1 < needed"; 2117 goto exit; 2118 } 2119 params_base = (GLint *) 2120 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2121 params = params_base + offset; 2122 2123 glGetTexParameteriv( 2124 (GLenum)target, 2125 (GLenum)pname, 2126 (GLint *)params 2127 ); 2128 2129 exit: 2130 if (params_base) { 2131 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2132 _exception ? JNI_ABORT: 0); 2133 } 2134 if (_exception) { 2135 jniThrowException(_env, _exceptionType, _exceptionMessage); 2136 } 2137 } 2138 2139 /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2140 static void 2141 android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 2142 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2143 jint _exception = 0; 2144 const char * _exceptionType = NULL; 2145 const char * _exceptionMessage = NULL; 2146 jarray _array = (jarray) 0; 2147 jint _bufferOffset = (jint) 0; 2148 jint _remaining; 2149 GLint *params = (GLint *) 0; 2150 2151 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2152 if (_remaining < 1) { 2153 _exception = 1; 2154 _exceptionType = "java/lang/IllegalArgumentException"; 2155 _exceptionMessage = "remaining() < 1 < needed"; 2156 goto exit; 2157 } 2158 if (params == NULL) { 2159 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2160 params = (GLint *) (_paramsBase + _bufferOffset); 2161 } 2162 glGetTexParameteriv( 2163 (GLenum)target, 2164 (GLenum)pname, 2165 (GLint *)params 2166 ); 2167 2168 exit: 2169 if (_array) { 2170 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 2171 } 2172 if (_exception) { 2173 jniThrowException(_env, _exceptionType, _exceptionMessage); 2174 } 2175 } 2176 2177 /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ 2178 static void 2179 android_glGetTexParameterxv__II_3II 2180 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2181 jint _exception = 0; 2182 const char * _exceptionType = NULL; 2183 const char * _exceptionMessage = NULL; 2184 GLfixed *params_base = (GLfixed *) 0; 2185 jint _remaining; 2186 GLfixed *params = (GLfixed *) 0; 2187 2188 if (!params_ref) { 2189 _exception = 1; 2190 _exceptionType = "java/lang/IllegalArgumentException"; 2191 _exceptionMessage = "params == null"; 2192 goto exit; 2193 } 2194 if (offset < 0) { 2195 _exception = 1; 2196 _exceptionType = "java/lang/IllegalArgumentException"; 2197 _exceptionMessage = "offset < 0"; 2198 goto exit; 2199 } 2200 _remaining = _env->GetArrayLength(params_ref) - offset; 2201 if (_remaining < 1) { 2202 _exception = 1; 2203 _exceptionType = "java/lang/IllegalArgumentException"; 2204 _exceptionMessage = "length - offset < 1 < needed"; 2205 goto exit; 2206 } 2207 params_base = (GLfixed *) 2208 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2209 params = params_base + offset; 2210 2211 glGetTexParameterxv( 2212 (GLenum)target, 2213 (GLenum)pname, 2214 (GLfixed *)params 2215 ); 2216 2217 exit: 2218 if (params_base) { 2219 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2220 _exception ? JNI_ABORT: 0); 2221 } 2222 if (_exception) { 2223 jniThrowException(_env, _exceptionType, _exceptionMessage); 2224 } 2225 } 2226 2227 /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ 2228 static void 2229 android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 2230 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2231 jint _exception = 0; 2232 const char * _exceptionType = NULL; 2233 const char * _exceptionMessage = NULL; 2234 jarray _array = (jarray) 0; 2235 jint _bufferOffset = (jint) 0; 2236 jint _remaining; 2237 GLfixed *params = (GLfixed *) 0; 2238 2239 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2240 if (_remaining < 1) { 2241 _exception = 1; 2242 _exceptionType = "java/lang/IllegalArgumentException"; 2243 _exceptionMessage = "remaining() < 1 < needed"; 2244 goto exit; 2245 } 2246 if (params == NULL) { 2247 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2248 params = (GLfixed *) (_paramsBase + _bufferOffset); 2249 } 2250 glGetTexParameterxv( 2251 (GLenum)target, 2252 (GLenum)pname, 2253 (GLfixed *)params 2254 ); 2255 2256 exit: 2257 if (_array) { 2258 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 2259 } 2260 if (_exception) { 2261 jniThrowException(_env, _exceptionType, _exceptionMessage); 2262 } 2263 } 2264 2265 /* GLboolean glIsBuffer ( GLuint buffer ) */ 2266 static jboolean 2267 android_glIsBuffer__I 2268 (JNIEnv *_env, jobject _this, jint buffer) { 2269 GLboolean _returnValue; 2270 _returnValue = glIsBuffer( 2271 (GLuint)buffer 2272 ); 2273 return (jboolean)_returnValue; 2274 } 2275 2276 /* GLboolean glIsEnabled ( GLenum cap ) */ 2277 static jboolean 2278 android_glIsEnabled__I 2279 (JNIEnv *_env, jobject _this, jint cap) { 2280 GLboolean _returnValue; 2281 _returnValue = glIsEnabled( 2282 (GLenum)cap 2283 ); 2284 return (jboolean)_returnValue; 2285 } 2286 2287 /* GLboolean glIsTexture ( GLuint texture ) */ 2288 static jboolean 2289 android_glIsTexture__I 2290 (JNIEnv *_env, jobject _this, jint texture) { 2291 GLboolean _returnValue; 2292 _returnValue = glIsTexture( 2293 (GLuint)texture 2294 ); 2295 return (jboolean)_returnValue; 2296 } 2297 2298 /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ 2299 static void 2300 android_glNormalPointer__III 2301 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { 2302 glNormalPointer( 2303 (GLenum)type, 2304 (GLsizei)stride, 2305 (GLvoid *)offset 2306 ); 2307 } 2308 2309 /* void glPointParameterf ( GLenum pname, GLfloat param ) */ 2310 static void 2311 android_glPointParameterf__IF 2312 (JNIEnv *_env, jobject _this, jint pname, jfloat param) { 2313 glPointParameterf( 2314 (GLenum)pname, 2315 (GLfloat)param 2316 ); 2317 } 2318 2319 /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ 2320 static void 2321 android_glPointParameterfv__I_3FI 2322 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 2323 jint _exception = 0; 2324 const char * _exceptionType = NULL; 2325 const char * _exceptionMessage = NULL; 2326 GLfloat *params_base = (GLfloat *) 0; 2327 jint _remaining; 2328 GLfloat *params = (GLfloat *) 0; 2329 2330 if (!params_ref) { 2331 _exception = 1; 2332 _exceptionType = "java/lang/IllegalArgumentException"; 2333 _exceptionMessage = "params == null"; 2334 goto exit; 2335 } 2336 if (offset < 0) { 2337 _exception = 1; 2338 _exceptionType = "java/lang/IllegalArgumentException"; 2339 _exceptionMessage = "offset < 0"; 2340 goto exit; 2341 } 2342 _remaining = _env->GetArrayLength(params_ref) - offset; 2343 if (_remaining < 1) { 2344 _exception = 1; 2345 _exceptionType = "java/lang/IllegalArgumentException"; 2346 _exceptionMessage = "length - offset < 1 < needed"; 2347 goto exit; 2348 } 2349 params_base = (GLfloat *) 2350 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2351 params = params_base + offset; 2352 2353 glPointParameterfv( 2354 (GLenum)pname, 2355 (GLfloat *)params 2356 ); 2357 2358 exit: 2359 if (params_base) { 2360 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2361 JNI_ABORT); 2362 } 2363 if (_exception) { 2364 jniThrowException(_env, _exceptionType, _exceptionMessage); 2365 } 2366 } 2367 2368 /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ 2369 static void 2370 android_glPointParameterfv__ILjava_nio_FloatBuffer_2 2371 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2372 jint _exception = 0; 2373 const char * _exceptionType = NULL; 2374 const char * _exceptionMessage = NULL; 2375 jarray _array = (jarray) 0; 2376 jint _bufferOffset = (jint) 0; 2377 jint _remaining; 2378 GLfloat *params = (GLfloat *) 0; 2379 2380 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2381 if (_remaining < 1) { 2382 _exception = 1; 2383 _exceptionType = "java/lang/IllegalArgumentException"; 2384 _exceptionMessage = "remaining() < 1 < needed"; 2385 goto exit; 2386 } 2387 if (params == NULL) { 2388 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2389 params = (GLfloat *) (_paramsBase + _bufferOffset); 2390 } 2391 glPointParameterfv( 2392 (GLenum)pname, 2393 (GLfloat *)params 2394 ); 2395 2396 exit: 2397 if (_array) { 2398 releasePointer(_env, _array, params, JNI_FALSE); 2399 } 2400 if (_exception) { 2401 jniThrowException(_env, _exceptionType, _exceptionMessage); 2402 } 2403 } 2404 2405 /* void glPointParameterx ( GLenum pname, GLfixed param ) */ 2406 static void 2407 android_glPointParameterx__II 2408 (JNIEnv *_env, jobject _this, jint pname, jint param) { 2409 glPointParameterx( 2410 (GLenum)pname, 2411 (GLfixed)param 2412 ); 2413 } 2414 2415 /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ 2416 static void 2417 android_glPointParameterxv__I_3II 2418 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 2419 jint _exception = 0; 2420 const char * _exceptionType = NULL; 2421 const char * _exceptionMessage = NULL; 2422 GLfixed *params_base = (GLfixed *) 0; 2423 jint _remaining; 2424 GLfixed *params = (GLfixed *) 0; 2425 2426 if (!params_ref) { 2427 _exception = 1; 2428 _exceptionType = "java/lang/IllegalArgumentException"; 2429 _exceptionMessage = "params == null"; 2430 goto exit; 2431 } 2432 if (offset < 0) { 2433 _exception = 1; 2434 _exceptionType = "java/lang/IllegalArgumentException"; 2435 _exceptionMessage = "offset < 0"; 2436 goto exit; 2437 } 2438 _remaining = _env->GetArrayLength(params_ref) - offset; 2439 if (_remaining < 1) { 2440 _exception = 1; 2441 _exceptionType = "java/lang/IllegalArgumentException"; 2442 _exceptionMessage = "length - offset < 1 < needed"; 2443 goto exit; 2444 } 2445 params_base = (GLfixed *) 2446 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2447 params = params_base + offset; 2448 2449 glPointParameterxv( 2450 (GLenum)pname, 2451 (GLfixed *)params 2452 ); 2453 2454 exit: 2455 if (params_base) { 2456 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2457 JNI_ABORT); 2458 } 2459 if (_exception) { 2460 jniThrowException(_env, _exceptionType, _exceptionMessage); 2461 } 2462 } 2463 2464 /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ 2465 static void 2466 android_glPointParameterxv__ILjava_nio_IntBuffer_2 2467 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2468 jint _exception = 0; 2469 const char * _exceptionType = NULL; 2470 const char * _exceptionMessage = NULL; 2471 jarray _array = (jarray) 0; 2472 jint _bufferOffset = (jint) 0; 2473 jint _remaining; 2474 GLfixed *params = (GLfixed *) 0; 2475 2476 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2477 if (_remaining < 1) { 2478 _exception = 1; 2479 _exceptionType = "java/lang/IllegalArgumentException"; 2480 _exceptionMessage = "remaining() < 1 < needed"; 2481 goto exit; 2482 } 2483 if (params == NULL) { 2484 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2485 params = (GLfixed *) (_paramsBase + _bufferOffset); 2486 } 2487 glPointParameterxv( 2488 (GLenum)pname, 2489 (GLfixed *)params 2490 ); 2491 2492 exit: 2493 if (_array) { 2494 releasePointer(_env, _array, params, JNI_FALSE); 2495 } 2496 if (_exception) { 2497 jniThrowException(_env, _exceptionType, _exceptionMessage); 2498 } 2499 } 2500 2501 /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ 2502 static void 2503 android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I 2504 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { 2505 jarray _array = (jarray) 0; 2506 jint _bufferOffset = (jint) 0; 2507 jint _remaining; 2508 GLvoid *pointer = (GLvoid *) 0; 2509 2510 if (pointer_buf) { 2511 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); 2512 if ( ! pointer ) { 2513 return; 2514 } 2515 } 2516 glPointSizePointerOESBounds( 2517 (GLenum)type, 2518 (GLsizei)stride, 2519 (GLvoid *)pointer, 2520 (GLsizei)remaining 2521 ); 2522 } 2523 2524 /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 2525 static void 2526 android_glTexCoordPointer__IIII 2527 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 2528 glTexCoordPointer( 2529 (GLint)size, 2530 (GLenum)type, 2531 (GLsizei)stride, 2532 (GLvoid *)offset 2533 ); 2534 } 2535 2536 /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ 2537 static void 2538 android_glTexEnvi__III 2539 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 2540 glTexEnvi( 2541 (GLenum)target, 2542 (GLenum)pname, 2543 (GLint)param 2544 ); 2545 } 2546 2547 /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ 2548 static void 2549 android_glTexEnviv__II_3II 2550 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2551 jint _exception = 0; 2552 const char * _exceptionType = NULL; 2553 const char * _exceptionMessage = NULL; 2554 GLint *params_base = (GLint *) 0; 2555 jint _remaining; 2556 GLint *params = (GLint *) 0; 2557 2558 if (!params_ref) { 2559 _exception = 1; 2560 _exceptionType = "java/lang/IllegalArgumentException"; 2561 _exceptionMessage = "params == null"; 2562 goto exit; 2563 } 2564 if (offset < 0) { 2565 _exception = 1; 2566 _exceptionType = "java/lang/IllegalArgumentException"; 2567 _exceptionMessage = "offset < 0"; 2568 goto exit; 2569 } 2570 _remaining = _env->GetArrayLength(params_ref) - offset; 2571 int _needed; 2572 switch (pname) { 2573 #if defined(GL_TEXTURE_ENV_COLOR) 2574 case GL_TEXTURE_ENV_COLOR: 2575 #endif // defined(GL_TEXTURE_ENV_COLOR) 2576 _needed = 4; 2577 break; 2578 default: 2579 _needed = 1; 2580 break; 2581 } 2582 if (_remaining < _needed) { 2583 _exception = 1; 2584 _exceptionType = "java/lang/IllegalArgumentException"; 2585 _exceptionMessage = "length - offset < needed"; 2586 goto exit; 2587 } 2588 params_base = (GLint *) 2589 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2590 params = params_base + offset; 2591 2592 glTexEnviv( 2593 (GLenum)target, 2594 (GLenum)pname, 2595 (GLint *)params 2596 ); 2597 2598 exit: 2599 if (params_base) { 2600 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2601 JNI_ABORT); 2602 } 2603 if (_exception) { 2604 jniThrowException(_env, _exceptionType, _exceptionMessage); 2605 } 2606 } 2607 2608 /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ 2609 static void 2610 android_glTexEnviv__IILjava_nio_IntBuffer_2 2611 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2612 jint _exception = 0; 2613 const char * _exceptionType = NULL; 2614 const char * _exceptionMessage = NULL; 2615 jarray _array = (jarray) 0; 2616 jint _bufferOffset = (jint) 0; 2617 jint _remaining; 2618 GLint *params = (GLint *) 0; 2619 2620 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2621 int _needed; 2622 switch (pname) { 2623 #if defined(GL_TEXTURE_ENV_COLOR) 2624 case GL_TEXTURE_ENV_COLOR: 2625 #endif // defined(GL_TEXTURE_ENV_COLOR) 2626 _needed = 4; 2627 break; 2628 default: 2629 _needed = 1; 2630 break; 2631 } 2632 if (_remaining < _needed) { 2633 _exception = 1; 2634 _exceptionType = "java/lang/IllegalArgumentException"; 2635 _exceptionMessage = "remaining() < needed"; 2636 goto exit; 2637 } 2638 if (params == NULL) { 2639 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2640 params = (GLint *) (_paramsBase + _bufferOffset); 2641 } 2642 glTexEnviv( 2643 (GLenum)target, 2644 (GLenum)pname, 2645 (GLint *)params 2646 ); 2647 2648 exit: 2649 if (_array) { 2650 releasePointer(_env, _array, params, JNI_FALSE); 2651 } 2652 if (_exception) { 2653 jniThrowException(_env, _exceptionType, _exceptionMessage); 2654 } 2655 } 2656 2657 /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 2658 static void 2659 android_glTexParameterfv__II_3FI 2660 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 2661 jint _exception = 0; 2662 const char * _exceptionType = NULL; 2663 const char * _exceptionMessage = NULL; 2664 GLfloat *params_base = (GLfloat *) 0; 2665 jint _remaining; 2666 GLfloat *params = (GLfloat *) 0; 2667 2668 if (!params_ref) { 2669 _exception = 1; 2670 _exceptionType = "java/lang/IllegalArgumentException"; 2671 _exceptionMessage = "params == null"; 2672 goto exit; 2673 } 2674 if (offset < 0) { 2675 _exception = 1; 2676 _exceptionType = "java/lang/IllegalArgumentException"; 2677 _exceptionMessage = "offset < 0"; 2678 goto exit; 2679 } 2680 _remaining = _env->GetArrayLength(params_ref) - offset; 2681 if (_remaining < 1) { 2682 _exception = 1; 2683 _exceptionType = "java/lang/IllegalArgumentException"; 2684 _exceptionMessage = "length - offset < 1 < needed"; 2685 goto exit; 2686 } 2687 params_base = (GLfloat *) 2688 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2689 params = params_base + offset; 2690 2691 glTexParameterfv( 2692 (GLenum)target, 2693 (GLenum)pname, 2694 (GLfloat *)params 2695 ); 2696 2697 exit: 2698 if (params_base) { 2699 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2700 JNI_ABORT); 2701 } 2702 if (_exception) { 2703 jniThrowException(_env, _exceptionType, _exceptionMessage); 2704 } 2705 } 2706 2707 /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 2708 static void 2709 android_glTexParameterfv__IILjava_nio_FloatBuffer_2 2710 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2711 jint _exception = 0; 2712 const char * _exceptionType = NULL; 2713 const char * _exceptionMessage = NULL; 2714 jarray _array = (jarray) 0; 2715 jint _bufferOffset = (jint) 0; 2716 jint _remaining; 2717 GLfloat *params = (GLfloat *) 0; 2718 2719 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2720 if (_remaining < 1) { 2721 _exception = 1; 2722 _exceptionType = "java/lang/IllegalArgumentException"; 2723 _exceptionMessage = "remaining() < 1 < needed"; 2724 goto exit; 2725 } 2726 if (params == NULL) { 2727 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2728 params = (GLfloat *) (_paramsBase + _bufferOffset); 2729 } 2730 glTexParameterfv( 2731 (GLenum)target, 2732 (GLenum)pname, 2733 (GLfloat *)params 2734 ); 2735 2736 exit: 2737 if (_array) { 2738 releasePointer(_env, _array, params, JNI_FALSE); 2739 } 2740 if (_exception) { 2741 jniThrowException(_env, _exceptionType, _exceptionMessage); 2742 } 2743 } 2744 2745 /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ 2746 static void 2747 android_glTexParameteri__III 2748 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 2749 glTexParameteri( 2750 (GLenum)target, 2751 (GLenum)pname, 2752 (GLint)param 2753 ); 2754 } 2755 2756 /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 2757 static void 2758 android_glTexParameteriv__II_3II 2759 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2760 jint _exception = 0; 2761 const char * _exceptionType = NULL; 2762 const char * _exceptionMessage = NULL; 2763 GLint *params_base = (GLint *) 0; 2764 jint _remaining; 2765 GLint *params = (GLint *) 0; 2766 2767 if (!params_ref) { 2768 _exception = 1; 2769 _exceptionType = "java/lang/IllegalArgumentException"; 2770 _exceptionMessage = "params == null"; 2771 goto exit; 2772 } 2773 if (offset < 0) { 2774 _exception = 1; 2775 _exceptionType = "java/lang/IllegalArgumentException"; 2776 _exceptionMessage = "offset < 0"; 2777 goto exit; 2778 } 2779 _remaining = _env->GetArrayLength(params_ref) - offset; 2780 if (_remaining < 1) { 2781 _exception = 1; 2782 _exceptionType = "java/lang/IllegalArgumentException"; 2783 _exceptionMessage = "length - offset < 1 < needed"; 2784 goto exit; 2785 } 2786 params_base = (GLint *) 2787 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2788 params = params_base + offset; 2789 2790 glTexParameteriv( 2791 (GLenum)target, 2792 (GLenum)pname, 2793 (GLint *)params 2794 ); 2795 2796 exit: 2797 if (params_base) { 2798 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2799 JNI_ABORT); 2800 } 2801 if (_exception) { 2802 jniThrowException(_env, _exceptionType, _exceptionMessage); 2803 } 2804 } 2805 2806 /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 2807 static void 2808 android_glTexParameteriv__IILjava_nio_IntBuffer_2 2809 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2810 jint _exception = 0; 2811 const char * _exceptionType = NULL; 2812 const char * _exceptionMessage = NULL; 2813 jarray _array = (jarray) 0; 2814 jint _bufferOffset = (jint) 0; 2815 jint _remaining; 2816 GLint *params = (GLint *) 0; 2817 2818 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2819 if (_remaining < 1) { 2820 _exception = 1; 2821 _exceptionType = "java/lang/IllegalArgumentException"; 2822 _exceptionMessage = "remaining() < 1 < needed"; 2823 goto exit; 2824 } 2825 if (params == NULL) { 2826 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2827 params = (GLint *) (_paramsBase + _bufferOffset); 2828 } 2829 glTexParameteriv( 2830 (GLenum)target, 2831 (GLenum)pname, 2832 (GLint *)params 2833 ); 2834 2835 exit: 2836 if (_array) { 2837 releasePointer(_env, _array, params, JNI_FALSE); 2838 } 2839 if (_exception) { 2840 jniThrowException(_env, _exceptionType, _exceptionMessage); 2841 } 2842 } 2843 2844 /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ 2845 static void 2846 android_glTexParameterxv__II_3II 2847 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2848 jint _exception = 0; 2849 const char * _exceptionType = NULL; 2850 const char * _exceptionMessage = NULL; 2851 GLfixed *params_base = (GLfixed *) 0; 2852 jint _remaining; 2853 GLfixed *params = (GLfixed *) 0; 2854 2855 if (!params_ref) { 2856 _exception = 1; 2857 _exceptionType = "java/lang/IllegalArgumentException"; 2858 _exceptionMessage = "params == null"; 2859 goto exit; 2860 } 2861 if (offset < 0) { 2862 _exception = 1; 2863 _exceptionType = "java/lang/IllegalArgumentException"; 2864 _exceptionMessage = "offset < 0"; 2865 goto exit; 2866 } 2867 _remaining = _env->GetArrayLength(params_ref) - offset; 2868 if (_remaining < 1) { 2869 _exception = 1; 2870 _exceptionType = "java/lang/IllegalArgumentException"; 2871 _exceptionMessage = "length - offset < 1 < needed"; 2872 goto exit; 2873 } 2874 params_base = (GLfixed *) 2875 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2876 params = params_base + offset; 2877 2878 glTexParameterxv( 2879 (GLenum)target, 2880 (GLenum)pname, 2881 (GLfixed *)params 2882 ); 2883 2884 exit: 2885 if (params_base) { 2886 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2887 JNI_ABORT); 2888 } 2889 if (_exception) { 2890 jniThrowException(_env, _exceptionType, _exceptionMessage); 2891 } 2892 } 2893 2894 /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ 2895 static void 2896 android_glTexParameterxv__IILjava_nio_IntBuffer_2 2897 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2898 jint _exception = 0; 2899 const char * _exceptionType = NULL; 2900 const char * _exceptionMessage = NULL; 2901 jarray _array = (jarray) 0; 2902 jint _bufferOffset = (jint) 0; 2903 jint _remaining; 2904 GLfixed *params = (GLfixed *) 0; 2905 2906 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 2907 if (_remaining < 1) { 2908 _exception = 1; 2909 _exceptionType = "java/lang/IllegalArgumentException"; 2910 _exceptionMessage = "remaining() < 1 < needed"; 2911 goto exit; 2912 } 2913 if (params == NULL) { 2914 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 2915 params = (GLfixed *) (_paramsBase + _bufferOffset); 2916 } 2917 glTexParameterxv( 2918 (GLenum)target, 2919 (GLenum)pname, 2920 (GLfixed *)params 2921 ); 2922 2923 exit: 2924 if (_array) { 2925 releasePointer(_env, _array, params, JNI_FALSE); 2926 } 2927 if (_exception) { 2928 jniThrowException(_env, _exceptionType, _exceptionMessage); 2929 } 2930 } 2931 2932 /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 2933 static void 2934 android_glVertexPointer__IIII 2935 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 2936 glVertexPointer( 2937 (GLint)size, 2938 (GLenum)type, 2939 (GLsizei)stride, 2940 (GLvoid *)offset 2941 ); 2942 } 2943 2944 static const char *classPathName = "android/opengl/GLES11"; 2945 2946 static JNINativeMethod methods[] = { 2947 {"_nativeClassInit", "()V", (void*)nativeClassInit }, 2948 {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, 2949 {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, 2950 {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, 2951 {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, 2952 {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, 2953 {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, 2954 {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, 2955 {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, 2956 {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, 2957 {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, 2958 {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, 2959 {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, 2960 {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, 2961 {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, 2962 {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, 2963 {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, 2964 {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, 2965 {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, 2966 {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, 2967 {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, 2968 {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, 2969 {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, 2970 {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, 2971 {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, 2972 {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, 2973 {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, 2974 {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, 2975 {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, 2976 {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, 2977 {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, 2978 {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, 2979 {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, 2980 {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, 2981 {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, 2982 {"glGetTexEnvfv", "(II[FI)V", (void *) android_glGetTexEnvfv__II_3FI }, 2983 {"glGetTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 }, 2984 {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, 2985 {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, 2986 {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, 2987 {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, 2988 {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, 2989 {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, 2990 {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, 2991 {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, 2992 {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, 2993 {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, 2994 {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, 2995 {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, 2996 {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, 2997 {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, 2998 {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, 2999 {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, 3000 {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, 3001 {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, 3002 {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, 3003 {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, 3004 {"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I }, 3005 {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, 3006 {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, 3007 {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, 3008 {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, 3009 {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, 3010 {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, 3011 {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, 3012 {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, 3013 {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, 3014 {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, 3015 {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, 3016 {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, 3017 }; 3018 3019 int register_android_opengl_jni_GLES11(JNIEnv *_env) 3020 { 3021 int err; 3022 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); 3023 return err; 3024 } 3025