android_opengl_GLES11.cpp revision be509c9c7de5929d014dfe6d45e71cc8454ede0f
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 <android_runtime/AndroidRuntime.h> 21#include <utils/misc.h> 22 23#include <assert.h> 24#include <GLES/gl.h> 25#include <GLES/glext.h> 26 27static int initialized = 0; 28 29static jclass nioAccessClass; 30static jclass bufferClass; 31static jclass OOMEClass; 32static jclass UOEClass; 33static jclass IAEClass; 34static jclass AIOOBEClass; 35static jmethodID getBasePointerID; 36static jmethodID getBaseArrayID; 37static jmethodID getBaseArrayOffsetID; 38static jfieldID positionID; 39static jfieldID limitID; 40static jfieldID elementSizeShiftID; 41 42/* Cache method IDs each time the class is loaded. */ 43 44static void 45nativeClassInitBuffer(JNIEnv *_env) 46{ 47 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); 48 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); 49 50 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); 51 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); 52 53 getBasePointerID = _env->GetStaticMethodID(nioAccessClass, 54 "getBasePointer", "(Ljava/nio/Buffer;)J"); 55 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, 56 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); 57 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, 58 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); 59 60 positionID = _env->GetFieldID(bufferClass, "position", "I"); 61 limitID = _env->GetFieldID(bufferClass, "limit", "I"); 62 elementSizeShiftID = 63 _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); 64} 65 66 67static void 68nativeClassInit(JNIEnv *_env, jclass glImplClass) 69{ 70 nativeClassInitBuffer(_env); 71 72 jclass IAEClassLocal = 73 _env->FindClass("java/lang/IllegalArgumentException"); 74 jclass OOMEClassLocal = 75 _env->FindClass("java/lang/OutOfMemoryError"); 76 jclass UOEClassLocal = 77 _env->FindClass("java/lang/UnsupportedOperationException"); 78 jclass AIOOBEClassLocal = 79 _env->FindClass("java/lang/ArrayIndexOutOfBoundsException"); 80 81 IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); 82 OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); 83 UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); 84 AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal); 85} 86 87static void * 88getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) 89{ 90 jint position; 91 jint limit; 92 jint elementSizeShift; 93 jlong pointer; 94 jint offset; 95 void *data; 96 97 position = _env->GetIntField(buffer, positionID); 98 limit = _env->GetIntField(buffer, limitID); 99 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 100 *remaining = (limit - position) << elementSizeShift; 101 pointer = _env->CallStaticLongMethod(nioAccessClass, 102 getBasePointerID, buffer); 103 if (pointer != 0L) { 104 *array = NULL; 105 return (void *) (jint) pointer; 106 } 107 108 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, 109 getBaseArrayID, buffer); 110 offset = _env->CallStaticIntMethod(nioAccessClass, 111 getBaseArrayOffsetID, buffer); 112 data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); 113 114 return (void *) ((char *) data + offset); 115} 116 117 118static void 119releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 120{ 121 _env->ReleasePrimitiveArrayCritical(array, data, 122 commit ? 0 : JNI_ABORT); 123} 124 125// -------------------------------------------------------------------------- 126 127/* void glBindBuffer ( GLenum target, GLuint buffer ) */ 128static void 129android_glBindBuffer__II 130 (JNIEnv *_env, jobject _this, jint target, jint buffer) { 131 glBindBuffer( 132 (GLenum)target, 133 (GLuint)buffer 134 ); 135} 136 137/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ 138static void 139android_glBufferData__IILjava_nio_Buffer_2I 140 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { 141 jarray _array = (jarray) 0; 142 jint _remaining; 143 GLvoid *data = (GLvoid *) 0; 144 145 if (data_buf) { 146 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); 147 } 148 glBufferData( 149 (GLenum)target, 150 (GLsizeiptr)size, 151 (GLvoid *)data, 152 (GLenum)usage 153 ); 154 if (_array) { 155 releasePointer(_env, _array, data, JNI_FALSE); 156 } 157} 158 159/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ 160static void 161android_glBufferSubData__IIILjava_nio_Buffer_2 162 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { 163 jarray _array = (jarray) 0; 164 jint _remaining; 165 GLvoid *data = (GLvoid *) 0; 166 167 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); 168 glBufferSubData( 169 (GLenum)target, 170 (GLintptr)offset, 171 (GLsizeiptr)size, 172 (GLvoid *)data 173 ); 174 if (_array) { 175 releasePointer(_env, _array, data, JNI_FALSE); 176 } 177} 178 179/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ 180static void 181android_glClipPlanef__I_3FI 182 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { 183 GLfloat *equation_base = (GLfloat *) 0; 184 jint _remaining; 185 GLfloat *equation = (GLfloat *) 0; 186 187 if (!equation_ref) { 188 _env->ThrowNew(IAEClass, "equation == null"); 189 goto exit; 190 } 191 if (offset < 0) { 192 _env->ThrowNew(IAEClass, "offset < 0"); 193 goto exit; 194 } 195 _remaining = _env->GetArrayLength(equation_ref) - offset; 196 equation_base = (GLfloat *) 197 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); 198 equation = equation_base + offset; 199 200 glClipPlanef( 201 (GLenum)plane, 202 (GLfloat *)equation 203 ); 204 205exit: 206 if (equation_base) { 207 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, 208 JNI_ABORT); 209 } 210} 211 212/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ 213static void 214android_glClipPlanef__ILjava_nio_FloatBuffer_2 215 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { 216 jarray _array = (jarray) 0; 217 jint _remaining; 218 GLfloat *equation = (GLfloat *) 0; 219 220 equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining); 221 glClipPlanef( 222 (GLenum)plane, 223 (GLfloat *)equation 224 ); 225 if (_array) { 226 releasePointer(_env, _array, equation, JNI_FALSE); 227 } 228} 229 230/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ 231static void 232android_glClipPlanex__I_3II 233 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { 234 GLfixed *equation_base = (GLfixed *) 0; 235 jint _remaining; 236 GLfixed *equation = (GLfixed *) 0; 237 238 if (!equation_ref) { 239 _env->ThrowNew(IAEClass, "equation == null"); 240 goto exit; 241 } 242 if (offset < 0) { 243 _env->ThrowNew(IAEClass, "offset < 0"); 244 goto exit; 245 } 246 _remaining = _env->GetArrayLength(equation_ref) - offset; 247 equation_base = (GLfixed *) 248 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0); 249 equation = equation_base + offset; 250 251 glClipPlanex( 252 (GLenum)plane, 253 (GLfixed *)equation 254 ); 255 256exit: 257 if (equation_base) { 258 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base, 259 JNI_ABORT); 260 } 261} 262 263/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ 264static void 265android_glClipPlanex__ILjava_nio_IntBuffer_2 266 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { 267 jarray _array = (jarray) 0; 268 jint _remaining; 269 GLfixed *equation = (GLfixed *) 0; 270 271 equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining); 272 glClipPlanex( 273 (GLenum)plane, 274 (GLfixed *)equation 275 ); 276 if (_array) { 277 releasePointer(_env, _array, equation, JNI_FALSE); 278 } 279} 280 281/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ 282static void 283android_glColor4ub__BBBB 284 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { 285 glColor4ub( 286 (GLubyte)red, 287 (GLubyte)green, 288 (GLubyte)blue, 289 (GLubyte)alpha 290 ); 291} 292 293/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 294static void 295android_glColorPointer__IIII 296 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 297 glColorPointer( 298 (GLint)size, 299 (GLenum)type, 300 (GLsizei)stride, 301 (const GLvoid *)offset 302 ); 303} 304 305/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 306static void 307android_glDeleteBuffers__I_3II 308 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 309 GLuint *buffers_base = (GLuint *) 0; 310 jint _remaining; 311 GLuint *buffers = (GLuint *) 0; 312 313 if (!buffers_ref) { 314 _env->ThrowNew(IAEClass, "buffers == null"); 315 goto exit; 316 } 317 if (offset < 0) { 318 _env->ThrowNew(IAEClass, "offset < 0"); 319 goto exit; 320 } 321 _remaining = _env->GetArrayLength(buffers_ref) - offset; 322 if (_remaining < n) { 323 _env->ThrowNew(IAEClass, "length - offset < n"); 324 goto exit; 325 } 326 buffers_base = (GLuint *) 327 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); 328 buffers = buffers_base + offset; 329 330 glDeleteBuffers( 331 (GLsizei)n, 332 (GLuint *)buffers 333 ); 334 335exit: 336 if (buffers_base) { 337 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, 338 JNI_ABORT); 339 } 340} 341 342/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 343static void 344android_glDeleteBuffers__ILjava_nio_IntBuffer_2 345 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 346 jarray _array = (jarray) 0; 347 jint _remaining; 348 GLuint *buffers = (GLuint *) 0; 349 350 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); 351 if (_remaining < n) { 352 _env->ThrowNew(IAEClass, "remaining() < n"); 353 goto exit; 354 } 355 glDeleteBuffers( 356 (GLsizei)n, 357 (GLuint *)buffers 358 ); 359 360exit: 361 if (_array) { 362 releasePointer(_env, _array, buffers, JNI_FALSE); 363 } 364} 365 366/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ 367static void 368android_glDrawElements__IIII 369 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { 370 glDrawElements( 371 (GLenum)mode, 372 (GLsizei)count, 373 (GLenum)type, 374 (const GLvoid *)offset 375 ); 376} 377 378/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 379static void 380android_glGenBuffers__I_3II 381 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 382 jint _exception = 0; 383 GLuint *buffers_base = (GLuint *) 0; 384 jint _remaining; 385 GLuint *buffers = (GLuint *) 0; 386 387 if (!buffers_ref) { 388 _exception = 1; 389 _env->ThrowNew(IAEClass, "buffers == null"); 390 goto exit; 391 } 392 if (offset < 0) { 393 _exception = 1; 394 _env->ThrowNew(IAEClass, "offset < 0"); 395 goto exit; 396 } 397 _remaining = _env->GetArrayLength(buffers_ref) - offset; 398 if (_remaining < n) { 399 _exception = 1; 400 _env->ThrowNew(IAEClass, "length - offset < n"); 401 goto exit; 402 } 403 buffers_base = (GLuint *) 404 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0); 405 buffers = buffers_base + offset; 406 407 glGenBuffers( 408 (GLsizei)n, 409 (GLuint *)buffers 410 ); 411 412exit: 413 if (buffers_base) { 414 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base, 415 _exception ? JNI_ABORT: 0); 416 } 417} 418 419/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 420static void 421android_glGenBuffers__ILjava_nio_IntBuffer_2 422 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 423 jint _exception = 0; 424 jarray _array = (jarray) 0; 425 jint _remaining; 426 GLuint *buffers = (GLuint *) 0; 427 428 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining); 429 if (_remaining < n) { 430 _exception = 1; 431 _env->ThrowNew(IAEClass, "remaining() < n"); 432 goto exit; 433 } 434 glGenBuffers( 435 (GLsizei)n, 436 (GLuint *)buffers 437 ); 438 439exit: 440 if (_array) { 441 releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE); 442 } 443} 444 445/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 446static void 447android_glGetBooleanv__I_3ZI 448 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { 449 jint _exception = 0; 450 GLboolean *params_base = (GLboolean *) 0; 451 jint _remaining; 452 GLboolean *params = (GLboolean *) 0; 453 454 if (!params_ref) { 455 _exception = 1; 456 _env->ThrowNew(IAEClass, "params == null"); 457 goto exit; 458 } 459 if (offset < 0) { 460 _exception = 1; 461 _env->ThrowNew(IAEClass, "offset < 0"); 462 goto exit; 463 } 464 _remaining = _env->GetArrayLength(params_ref) - offset; 465 params_base = (GLboolean *) 466 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 467 params = params_base + offset; 468 469 glGetBooleanv( 470 (GLenum)pname, 471 (GLboolean *)params 472 ); 473 474exit: 475 if (params_base) { 476 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 477 _exception ? JNI_ABORT: 0); 478 } 479} 480 481/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 482static void 483android_glGetBooleanv__ILjava_nio_IntBuffer_2 484 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 485 jint _exception = 0; 486 jarray _array = (jarray) 0; 487 jint _remaining; 488 GLboolean *params = (GLboolean *) 0; 489 490 params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining); 491 glGetBooleanv( 492 (GLenum)pname, 493 (GLboolean *)params 494 ); 495 if (_array) { 496 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 497 } 498} 499 500/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 501static void 502android_glGetBufferParameteriv__II_3II 503 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 504 _env->ThrowNew(UOEClass, 505 "glGetBufferParameteriv"); 506} 507 508/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 509static void 510android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 511 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 512 _env->ThrowNew(UOEClass, 513 "glGetBufferParameteriv"); 514} 515 516/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ 517static void 518android_glGetClipPlanef__I_3FI 519 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { 520 jint _exception = 0; 521 GLfloat *eqn_base = (GLfloat *) 0; 522 jint _remaining; 523 GLfloat *eqn = (GLfloat *) 0; 524 525 if (!eqn_ref) { 526 _exception = 1; 527 _env->ThrowNew(IAEClass, "eqn == null"); 528 goto exit; 529 } 530 if (offset < 0) { 531 _exception = 1; 532 _env->ThrowNew(IAEClass, "offset < 0"); 533 goto exit; 534 } 535 _remaining = _env->GetArrayLength(eqn_ref) - offset; 536 eqn_base = (GLfloat *) 537 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); 538 eqn = eqn_base + offset; 539 540 glGetClipPlanef( 541 (GLenum)pname, 542 (GLfloat *)eqn 543 ); 544 545exit: 546 if (eqn_base) { 547 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, 548 _exception ? JNI_ABORT: 0); 549 } 550} 551 552/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ 553static void 554android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 555 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { 556 jint _exception = 0; 557 jarray _array = (jarray) 0; 558 jint _remaining; 559 GLfloat *eqn = (GLfloat *) 0; 560 561 eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining); 562 glGetClipPlanef( 563 (GLenum)pname, 564 (GLfloat *)eqn 565 ); 566 if (_array) { 567 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE); 568 } 569} 570 571/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ 572static void 573android_glGetClipPlanex__I_3II 574 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { 575 jint _exception = 0; 576 GLfixed *eqn_base = (GLfixed *) 0; 577 jint _remaining; 578 GLfixed *eqn = (GLfixed *) 0; 579 580 if (!eqn_ref) { 581 _exception = 1; 582 _env->ThrowNew(IAEClass, "eqn == null"); 583 goto exit; 584 } 585 if (offset < 0) { 586 _exception = 1; 587 _env->ThrowNew(IAEClass, "offset < 0"); 588 goto exit; 589 } 590 _remaining = _env->GetArrayLength(eqn_ref) - offset; 591 eqn_base = (GLfixed *) 592 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0); 593 eqn = eqn_base + offset; 594 595 glGetClipPlanex( 596 (GLenum)pname, 597 (GLfixed *)eqn 598 ); 599 600exit: 601 if (eqn_base) { 602 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base, 603 _exception ? JNI_ABORT: 0); 604 } 605} 606 607/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ 608static void 609android_glGetClipPlanex__ILjava_nio_IntBuffer_2 610 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { 611 jint _exception = 0; 612 jarray _array = (jarray) 0; 613 jint _remaining; 614 GLfixed *eqn = (GLfixed *) 0; 615 616 eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining); 617 glGetClipPlanex( 618 (GLenum)pname, 619 (GLfixed *)eqn 620 ); 621 if (_array) { 622 releasePointer(_env, _array, eqn, _exception ? JNI_FALSE : JNI_TRUE); 623 } 624} 625 626/* void glGetFixedv ( GLenum pname, GLfixed *params ) */ 627static void 628android_glGetFixedv__I_3II 629 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 630 jint _exception = 0; 631 GLfixed *params_base = (GLfixed *) 0; 632 jint _remaining; 633 GLfixed *params = (GLfixed *) 0; 634 635 if (!params_ref) { 636 _exception = 1; 637 _env->ThrowNew(IAEClass, "params == null"); 638 goto exit; 639 } 640 if (offset < 0) { 641 _exception = 1; 642 _env->ThrowNew(IAEClass, "offset < 0"); 643 goto exit; 644 } 645 _remaining = _env->GetArrayLength(params_ref) - offset; 646 params_base = (GLfixed *) 647 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 648 params = params_base + offset; 649 650 glGetFixedv( 651 (GLenum)pname, 652 (GLfixed *)params 653 ); 654 655exit: 656 if (params_base) { 657 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 658 _exception ? JNI_ABORT: 0); 659 } 660} 661 662/* void glGetFixedv ( GLenum pname, GLfixed *params ) */ 663static void 664android_glGetFixedv__ILjava_nio_IntBuffer_2 665 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 666 jint _exception = 0; 667 jarray _array = (jarray) 0; 668 jint _remaining; 669 GLfixed *params = (GLfixed *) 0; 670 671 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 672 glGetFixedv( 673 (GLenum)pname, 674 (GLfixed *)params 675 ); 676 if (_array) { 677 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 678 } 679} 680 681/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 682static void 683android_glGetFloatv__I_3FI 684 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 685 jint _exception = 0; 686 GLfloat *params_base = (GLfloat *) 0; 687 jint _remaining; 688 GLfloat *params = (GLfloat *) 0; 689 690 if (!params_ref) { 691 _exception = 1; 692 _env->ThrowNew(IAEClass, "params == null"); 693 goto exit; 694 } 695 if (offset < 0) { 696 _exception = 1; 697 _env->ThrowNew(IAEClass, "offset < 0"); 698 goto exit; 699 } 700 _remaining = _env->GetArrayLength(params_ref) - offset; 701 params_base = (GLfloat *) 702 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 703 params = params_base + offset; 704 705 glGetFloatv( 706 (GLenum)pname, 707 (GLfloat *)params 708 ); 709 710exit: 711 if (params_base) { 712 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 713 _exception ? JNI_ABORT: 0); 714 } 715} 716 717/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 718static void 719android_glGetFloatv__ILjava_nio_FloatBuffer_2 720 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 721 jint _exception = 0; 722 jarray _array = (jarray) 0; 723 jint _remaining; 724 GLfloat *params = (GLfloat *) 0; 725 726 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 727 glGetFloatv( 728 (GLenum)pname, 729 (GLfloat *)params 730 ); 731 if (_array) { 732 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 733 } 734} 735 736/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ 737static void 738android_glGetLightfv__II_3FI 739 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { 740 jint _exception = 0; 741 GLfloat *params_base = (GLfloat *) 0; 742 jint _remaining; 743 GLfloat *params = (GLfloat *) 0; 744 745 if (!params_ref) { 746 _exception = 1; 747 _env->ThrowNew(IAEClass, "params == null"); 748 goto exit; 749 } 750 if (offset < 0) { 751 _exception = 1; 752 _env->ThrowNew(IAEClass, "offset < 0"); 753 goto exit; 754 } 755 _remaining = _env->GetArrayLength(params_ref) - offset; 756 int _needed; 757 switch (pname) { 758#if defined(GL_SPOT_EXPONENT) 759 case GL_SPOT_EXPONENT: 760#endif // defined(GL_SPOT_EXPONENT) 761#if defined(GL_SPOT_CUTOFF) 762 case GL_SPOT_CUTOFF: 763#endif // defined(GL_SPOT_CUTOFF) 764#if defined(GL_CONSTANT_ATTENUATION) 765 case GL_CONSTANT_ATTENUATION: 766#endif // defined(GL_CONSTANT_ATTENUATION) 767#if defined(GL_LINEAR_ATTENUATION) 768 case GL_LINEAR_ATTENUATION: 769#endif // defined(GL_LINEAR_ATTENUATION) 770#if defined(GL_QUADRATIC_ATTENUATION) 771 case GL_QUADRATIC_ATTENUATION: 772#endif // defined(GL_QUADRATIC_ATTENUATION) 773 _needed = 1; 774 break; 775#if defined(GL_SPOT_DIRECTION) 776 case GL_SPOT_DIRECTION: 777#endif // defined(GL_SPOT_DIRECTION) 778 _needed = 3; 779 break; 780#if defined(GL_AMBIENT) 781 case GL_AMBIENT: 782#endif // defined(GL_AMBIENT) 783#if defined(GL_DIFFUSE) 784 case GL_DIFFUSE: 785#endif // defined(GL_DIFFUSE) 786#if defined(GL_SPECULAR) 787 case GL_SPECULAR: 788#endif // defined(GL_SPECULAR) 789#if defined(GL_EMISSION) 790 case GL_EMISSION: 791#endif // defined(GL_EMISSION) 792 _needed = 4; 793 break; 794 default: 795 _needed = 0; 796 break; 797 } 798 if (_remaining < _needed) { 799 _exception = 1; 800 _env->ThrowNew(IAEClass, "length - offset < needed"); 801 goto exit; 802 } 803 params_base = (GLfloat *) 804 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 805 params = params_base + offset; 806 807 glGetLightfv( 808 (GLenum)light, 809 (GLenum)pname, 810 (GLfloat *)params 811 ); 812 813exit: 814 if (params_base) { 815 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 816 _exception ? JNI_ABORT: 0); 817 } 818} 819 820/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ 821static void 822android_glGetLightfv__IILjava_nio_FloatBuffer_2 823 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { 824 jint _exception = 0; 825 jarray _array = (jarray) 0; 826 jint _remaining; 827 GLfloat *params = (GLfloat *) 0; 828 829 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 830 int _needed; 831 switch (pname) { 832#if defined(GL_SPOT_EXPONENT) 833 case GL_SPOT_EXPONENT: 834#endif // defined(GL_SPOT_EXPONENT) 835#if defined(GL_SPOT_CUTOFF) 836 case GL_SPOT_CUTOFF: 837#endif // defined(GL_SPOT_CUTOFF) 838#if defined(GL_CONSTANT_ATTENUATION) 839 case GL_CONSTANT_ATTENUATION: 840#endif // defined(GL_CONSTANT_ATTENUATION) 841#if defined(GL_LINEAR_ATTENUATION) 842 case GL_LINEAR_ATTENUATION: 843#endif // defined(GL_LINEAR_ATTENUATION) 844#if defined(GL_QUADRATIC_ATTENUATION) 845 case GL_QUADRATIC_ATTENUATION: 846#endif // defined(GL_QUADRATIC_ATTENUATION) 847 _needed = 1; 848 break; 849#if defined(GL_SPOT_DIRECTION) 850 case GL_SPOT_DIRECTION: 851#endif // defined(GL_SPOT_DIRECTION) 852 _needed = 3; 853 break; 854#if defined(GL_AMBIENT) 855 case GL_AMBIENT: 856#endif // defined(GL_AMBIENT) 857#if defined(GL_DIFFUSE) 858 case GL_DIFFUSE: 859#endif // defined(GL_DIFFUSE) 860#if defined(GL_SPECULAR) 861 case GL_SPECULAR: 862#endif // defined(GL_SPECULAR) 863#if defined(GL_EMISSION) 864 case GL_EMISSION: 865#endif // defined(GL_EMISSION) 866 _needed = 4; 867 break; 868 default: 869 _needed = 0; 870 break; 871 } 872 if (_remaining < _needed) { 873 _exception = 1; 874 _env->ThrowNew(IAEClass, "remaining() < needed"); 875 goto exit; 876 } 877 glGetLightfv( 878 (GLenum)light, 879 (GLenum)pname, 880 (GLfloat *)params 881 ); 882 883exit: 884 if (_array) { 885 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 886 } 887} 888 889/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ 890static void 891android_glGetLightxv__II_3II 892 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { 893 jint _exception = 0; 894 GLfixed *params_base = (GLfixed *) 0; 895 jint _remaining; 896 GLfixed *params = (GLfixed *) 0; 897 898 if (!params_ref) { 899 _exception = 1; 900 _env->ThrowNew(IAEClass, "params == null"); 901 goto exit; 902 } 903 if (offset < 0) { 904 _exception = 1; 905 _env->ThrowNew(IAEClass, "offset < 0"); 906 goto exit; 907 } 908 _remaining = _env->GetArrayLength(params_ref) - offset; 909 int _needed; 910 switch (pname) { 911#if defined(GL_SPOT_EXPONENT) 912 case GL_SPOT_EXPONENT: 913#endif // defined(GL_SPOT_EXPONENT) 914#if defined(GL_SPOT_CUTOFF) 915 case GL_SPOT_CUTOFF: 916#endif // defined(GL_SPOT_CUTOFF) 917#if defined(GL_CONSTANT_ATTENUATION) 918 case GL_CONSTANT_ATTENUATION: 919#endif // defined(GL_CONSTANT_ATTENUATION) 920#if defined(GL_LINEAR_ATTENUATION) 921 case GL_LINEAR_ATTENUATION: 922#endif // defined(GL_LINEAR_ATTENUATION) 923#if defined(GL_QUADRATIC_ATTENUATION) 924 case GL_QUADRATIC_ATTENUATION: 925#endif // defined(GL_QUADRATIC_ATTENUATION) 926 _needed = 1; 927 break; 928#if defined(GL_SPOT_DIRECTION) 929 case GL_SPOT_DIRECTION: 930#endif // defined(GL_SPOT_DIRECTION) 931 _needed = 3; 932 break; 933#if defined(GL_AMBIENT) 934 case GL_AMBIENT: 935#endif // defined(GL_AMBIENT) 936#if defined(GL_DIFFUSE) 937 case GL_DIFFUSE: 938#endif // defined(GL_DIFFUSE) 939#if defined(GL_SPECULAR) 940 case GL_SPECULAR: 941#endif // defined(GL_SPECULAR) 942#if defined(GL_EMISSION) 943 case GL_EMISSION: 944#endif // defined(GL_EMISSION) 945 _needed = 4; 946 break; 947 default: 948 _needed = 0; 949 break; 950 } 951 if (_remaining < _needed) { 952 _exception = 1; 953 _env->ThrowNew(IAEClass, "length - offset < needed"); 954 goto exit; 955 } 956 params_base = (GLfixed *) 957 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 958 params = params_base + offset; 959 960 glGetLightxv( 961 (GLenum)light, 962 (GLenum)pname, 963 (GLfixed *)params 964 ); 965 966exit: 967 if (params_base) { 968 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 969 _exception ? JNI_ABORT: 0); 970 } 971} 972 973/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ 974static void 975android_glGetLightxv__IILjava_nio_IntBuffer_2 976 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { 977 jint _exception = 0; 978 jarray _array = (jarray) 0; 979 jint _remaining; 980 GLfixed *params = (GLfixed *) 0; 981 982 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 983 int _needed; 984 switch (pname) { 985#if defined(GL_SPOT_EXPONENT) 986 case GL_SPOT_EXPONENT: 987#endif // defined(GL_SPOT_EXPONENT) 988#if defined(GL_SPOT_CUTOFF) 989 case GL_SPOT_CUTOFF: 990#endif // defined(GL_SPOT_CUTOFF) 991#if defined(GL_CONSTANT_ATTENUATION) 992 case GL_CONSTANT_ATTENUATION: 993#endif // defined(GL_CONSTANT_ATTENUATION) 994#if defined(GL_LINEAR_ATTENUATION) 995 case GL_LINEAR_ATTENUATION: 996#endif // defined(GL_LINEAR_ATTENUATION) 997#if defined(GL_QUADRATIC_ATTENUATION) 998 case GL_QUADRATIC_ATTENUATION: 999#endif // defined(GL_QUADRATIC_ATTENUATION) 1000 _needed = 1; 1001 break; 1002#if defined(GL_SPOT_DIRECTION) 1003 case GL_SPOT_DIRECTION: 1004#endif // defined(GL_SPOT_DIRECTION) 1005 _needed = 3; 1006 break; 1007#if defined(GL_AMBIENT) 1008 case GL_AMBIENT: 1009#endif // defined(GL_AMBIENT) 1010#if defined(GL_DIFFUSE) 1011 case GL_DIFFUSE: 1012#endif // defined(GL_DIFFUSE) 1013#if defined(GL_SPECULAR) 1014 case GL_SPECULAR: 1015#endif // defined(GL_SPECULAR) 1016#if defined(GL_EMISSION) 1017 case GL_EMISSION: 1018#endif // defined(GL_EMISSION) 1019 _needed = 4; 1020 break; 1021 default: 1022 _needed = 0; 1023 break; 1024 } 1025 if (_remaining < _needed) { 1026 _exception = 1; 1027 _env->ThrowNew(IAEClass, "remaining() < needed"); 1028 goto exit; 1029 } 1030 glGetLightxv( 1031 (GLenum)light, 1032 (GLenum)pname, 1033 (GLfixed *)params 1034 ); 1035 1036exit: 1037 if (_array) { 1038 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1039 } 1040} 1041 1042/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ 1043static void 1044android_glGetMaterialfv__II_3FI 1045 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { 1046 jint _exception = 0; 1047 GLfloat *params_base = (GLfloat *) 0; 1048 jint _remaining; 1049 GLfloat *params = (GLfloat *) 0; 1050 1051 if (!params_ref) { 1052 _exception = 1; 1053 _env->ThrowNew(IAEClass, "params == null"); 1054 goto exit; 1055 } 1056 if (offset < 0) { 1057 _exception = 1; 1058 _env->ThrowNew(IAEClass, "offset < 0"); 1059 goto exit; 1060 } 1061 _remaining = _env->GetArrayLength(params_ref) - offset; 1062 int _needed; 1063 switch (pname) { 1064#if defined(GL_SHININESS) 1065 case GL_SHININESS: 1066#endif // defined(GL_SHININESS) 1067 _needed = 1; 1068 break; 1069#if defined(GL_AMBIENT) 1070 case GL_AMBIENT: 1071#endif // defined(GL_AMBIENT) 1072#if defined(GL_DIFFUSE) 1073 case GL_DIFFUSE: 1074#endif // defined(GL_DIFFUSE) 1075#if defined(GL_SPECULAR) 1076 case GL_SPECULAR: 1077#endif // defined(GL_SPECULAR) 1078#if defined(GL_EMISSION) 1079 case GL_EMISSION: 1080#endif // defined(GL_EMISSION) 1081#if defined(GL_AMBIENT_AND_DIFFUSE) 1082 case GL_AMBIENT_AND_DIFFUSE: 1083#endif // defined(GL_AMBIENT_AND_DIFFUSE) 1084 _needed = 4; 1085 break; 1086 default: 1087 _needed = 0; 1088 break; 1089 } 1090 if (_remaining < _needed) { 1091 _exception = 1; 1092 _env->ThrowNew(IAEClass, "length - offset < needed"); 1093 goto exit; 1094 } 1095 params_base = (GLfloat *) 1096 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1097 params = params_base + offset; 1098 1099 glGetMaterialfv( 1100 (GLenum)face, 1101 (GLenum)pname, 1102 (GLfloat *)params 1103 ); 1104 1105exit: 1106 if (params_base) { 1107 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1108 _exception ? JNI_ABORT: 0); 1109 } 1110} 1111 1112/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ 1113static void 1114android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 1115 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { 1116 jint _exception = 0; 1117 jarray _array = (jarray) 0; 1118 jint _remaining; 1119 GLfloat *params = (GLfloat *) 0; 1120 1121 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 1122 int _needed; 1123 switch (pname) { 1124#if defined(GL_SHININESS) 1125 case GL_SHININESS: 1126#endif // defined(GL_SHININESS) 1127 _needed = 1; 1128 break; 1129#if defined(GL_AMBIENT) 1130 case GL_AMBIENT: 1131#endif // defined(GL_AMBIENT) 1132#if defined(GL_DIFFUSE) 1133 case GL_DIFFUSE: 1134#endif // defined(GL_DIFFUSE) 1135#if defined(GL_SPECULAR) 1136 case GL_SPECULAR: 1137#endif // defined(GL_SPECULAR) 1138#if defined(GL_EMISSION) 1139 case GL_EMISSION: 1140#endif // defined(GL_EMISSION) 1141#if defined(GL_AMBIENT_AND_DIFFUSE) 1142 case GL_AMBIENT_AND_DIFFUSE: 1143#endif // defined(GL_AMBIENT_AND_DIFFUSE) 1144 _needed = 4; 1145 break; 1146 default: 1147 _needed = 0; 1148 break; 1149 } 1150 if (_remaining < _needed) { 1151 _exception = 1; 1152 _env->ThrowNew(IAEClass, "remaining() < needed"); 1153 goto exit; 1154 } 1155 glGetMaterialfv( 1156 (GLenum)face, 1157 (GLenum)pname, 1158 (GLfloat *)params 1159 ); 1160 1161exit: 1162 if (_array) { 1163 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1164 } 1165} 1166 1167/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ 1168static void 1169android_glGetMaterialxv__II_3II 1170 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { 1171 jint _exception = 0; 1172 GLfixed *params_base = (GLfixed *) 0; 1173 jint _remaining; 1174 GLfixed *params = (GLfixed *) 0; 1175 1176 if (!params_ref) { 1177 _exception = 1; 1178 _env->ThrowNew(IAEClass, "params == null"); 1179 goto exit; 1180 } 1181 if (offset < 0) { 1182 _exception = 1; 1183 _env->ThrowNew(IAEClass, "offset < 0"); 1184 goto exit; 1185 } 1186 _remaining = _env->GetArrayLength(params_ref) - offset; 1187 int _needed; 1188 switch (pname) { 1189#if defined(GL_SHININESS) 1190 case GL_SHININESS: 1191#endif // defined(GL_SHININESS) 1192 _needed = 1; 1193 break; 1194#if defined(GL_AMBIENT) 1195 case GL_AMBIENT: 1196#endif // defined(GL_AMBIENT) 1197#if defined(GL_DIFFUSE) 1198 case GL_DIFFUSE: 1199#endif // defined(GL_DIFFUSE) 1200#if defined(GL_SPECULAR) 1201 case GL_SPECULAR: 1202#endif // defined(GL_SPECULAR) 1203#if defined(GL_EMISSION) 1204 case GL_EMISSION: 1205#endif // defined(GL_EMISSION) 1206#if defined(GL_AMBIENT_AND_DIFFUSE) 1207 case GL_AMBIENT_AND_DIFFUSE: 1208#endif // defined(GL_AMBIENT_AND_DIFFUSE) 1209 _needed = 4; 1210 break; 1211 default: 1212 _needed = 0; 1213 break; 1214 } 1215 if (_remaining < _needed) { 1216 _exception = 1; 1217 _env->ThrowNew(IAEClass, "length - offset < needed"); 1218 goto exit; 1219 } 1220 params_base = (GLfixed *) 1221 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1222 params = params_base + offset; 1223 1224 glGetMaterialxv( 1225 (GLenum)face, 1226 (GLenum)pname, 1227 (GLfixed *)params 1228 ); 1229 1230exit: 1231 if (params_base) { 1232 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1233 _exception ? JNI_ABORT: 0); 1234 } 1235} 1236 1237/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ 1238static void 1239android_glGetMaterialxv__IILjava_nio_IntBuffer_2 1240 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { 1241 jint _exception = 0; 1242 jarray _array = (jarray) 0; 1243 jint _remaining; 1244 GLfixed *params = (GLfixed *) 0; 1245 1246 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 1247 int _needed; 1248 switch (pname) { 1249#if defined(GL_SHININESS) 1250 case GL_SHININESS: 1251#endif // defined(GL_SHININESS) 1252 _needed = 1; 1253 break; 1254#if defined(GL_AMBIENT) 1255 case GL_AMBIENT: 1256#endif // defined(GL_AMBIENT) 1257#if defined(GL_DIFFUSE) 1258 case GL_DIFFUSE: 1259#endif // defined(GL_DIFFUSE) 1260#if defined(GL_SPECULAR) 1261 case GL_SPECULAR: 1262#endif // defined(GL_SPECULAR) 1263#if defined(GL_EMISSION) 1264 case GL_EMISSION: 1265#endif // defined(GL_EMISSION) 1266#if defined(GL_AMBIENT_AND_DIFFUSE) 1267 case GL_AMBIENT_AND_DIFFUSE: 1268#endif // defined(GL_AMBIENT_AND_DIFFUSE) 1269 _needed = 4; 1270 break; 1271 default: 1272 _needed = 0; 1273 break; 1274 } 1275 if (_remaining < _needed) { 1276 _exception = 1; 1277 _env->ThrowNew(IAEClass, "remaining() < needed"); 1278 goto exit; 1279 } 1280 glGetMaterialxv( 1281 (GLenum)face, 1282 (GLenum)pname, 1283 (GLfixed *)params 1284 ); 1285 1286exit: 1287 if (_array) { 1288 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1289 } 1290} 1291 1292/* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */ 1293static void 1294android_glGetTexEnvfv__II_3FI 1295 (JNIEnv *_env, jobject _this, jint env, jint pname, jfloatArray params_ref, jint offset) { 1296 jint _exception = 0; 1297 GLfloat *params_base = (GLfloat *) 0; 1298 jint _remaining; 1299 GLfloat *params = (GLfloat *) 0; 1300 1301 if (!params_ref) { 1302 _exception = 1; 1303 _env->ThrowNew(IAEClass, "params == null"); 1304 goto exit; 1305 } 1306 if (offset < 0) { 1307 _exception = 1; 1308 _env->ThrowNew(IAEClass, "offset < 0"); 1309 goto exit; 1310 } 1311 _remaining = _env->GetArrayLength(params_ref) - offset; 1312 int _needed; 1313 switch (pname) { 1314#if defined(GL_TEXTURE_ENV_MODE) 1315 case GL_TEXTURE_ENV_MODE: 1316#endif // defined(GL_TEXTURE_ENV_MODE) 1317#if defined(GL_COMBINE_RGB) 1318 case GL_COMBINE_RGB: 1319#endif // defined(GL_COMBINE_RGB) 1320#if defined(GL_COMBINE_ALPHA) 1321 case GL_COMBINE_ALPHA: 1322#endif // defined(GL_COMBINE_ALPHA) 1323 _needed = 1; 1324 break; 1325#if defined(GL_TEXTURE_ENV_COLOR) 1326 case GL_TEXTURE_ENV_COLOR: 1327#endif // defined(GL_TEXTURE_ENV_COLOR) 1328 _needed = 4; 1329 break; 1330 default: 1331 _needed = 0; 1332 break; 1333 } 1334 if (_remaining < _needed) { 1335 _exception = 1; 1336 _env->ThrowNew(IAEClass, "length - offset < needed"); 1337 goto exit; 1338 } 1339 params_base = (GLfloat *) 1340 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1341 params = params_base + offset; 1342 1343 glGetTexEnvfv( 1344 (GLenum)env, 1345 (GLenum)pname, 1346 (GLfloat *)params 1347 ); 1348 1349exit: 1350 if (params_base) { 1351 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1352 _exception ? JNI_ABORT: 0); 1353 } 1354} 1355 1356/* void glGetTexEnvfv ( GLenum env, GLenum pname, GLfloat *params ) */ 1357static void 1358android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 1359 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1360 jint _exception = 0; 1361 jarray _array = (jarray) 0; 1362 jint _remaining; 1363 GLfloat *params = (GLfloat *) 0; 1364 1365 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 1366 int _needed; 1367 switch (pname) { 1368#if defined(GL_TEXTURE_ENV_MODE) 1369 case GL_TEXTURE_ENV_MODE: 1370#endif // defined(GL_TEXTURE_ENV_MODE) 1371#if defined(GL_COMBINE_RGB) 1372 case GL_COMBINE_RGB: 1373#endif // defined(GL_COMBINE_RGB) 1374#if defined(GL_COMBINE_ALPHA) 1375 case GL_COMBINE_ALPHA: 1376#endif // defined(GL_COMBINE_ALPHA) 1377 _needed = 1; 1378 break; 1379#if defined(GL_TEXTURE_ENV_COLOR) 1380 case GL_TEXTURE_ENV_COLOR: 1381#endif // defined(GL_TEXTURE_ENV_COLOR) 1382 _needed = 4; 1383 break; 1384 default: 1385 _needed = 0; 1386 break; 1387 } 1388 if (_remaining < _needed) { 1389 _exception = 1; 1390 _env->ThrowNew(IAEClass, "remaining() < needed"); 1391 goto exit; 1392 } 1393 glGetTexEnvfv( 1394 (GLenum)env, 1395 (GLenum)pname, 1396 (GLfloat *)params 1397 ); 1398 1399exit: 1400 if (_array) { 1401 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1402 } 1403} 1404 1405/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ 1406static void 1407android_glGetTexEnviv__II_3II 1408 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { 1409 jint _exception = 0; 1410 GLint *params_base = (GLint *) 0; 1411 jint _remaining; 1412 GLint *params = (GLint *) 0; 1413 1414 if (!params_ref) { 1415 _exception = 1; 1416 _env->ThrowNew(IAEClass, "params == null"); 1417 goto exit; 1418 } 1419 if (offset < 0) { 1420 _exception = 1; 1421 _env->ThrowNew(IAEClass, "offset < 0"); 1422 goto exit; 1423 } 1424 _remaining = _env->GetArrayLength(params_ref) - offset; 1425 int _needed; 1426 switch (pname) { 1427#if defined(GL_TEXTURE_ENV_MODE) 1428 case GL_TEXTURE_ENV_MODE: 1429#endif // defined(GL_TEXTURE_ENV_MODE) 1430#if defined(GL_COMBINE_RGB) 1431 case GL_COMBINE_RGB: 1432#endif // defined(GL_COMBINE_RGB) 1433#if defined(GL_COMBINE_ALPHA) 1434 case GL_COMBINE_ALPHA: 1435#endif // defined(GL_COMBINE_ALPHA) 1436 _needed = 1; 1437 break; 1438#if defined(GL_TEXTURE_ENV_COLOR) 1439 case GL_TEXTURE_ENV_COLOR: 1440#endif // defined(GL_TEXTURE_ENV_COLOR) 1441 _needed = 4; 1442 break; 1443 default: 1444 _needed = 0; 1445 break; 1446 } 1447 if (_remaining < _needed) { 1448 _exception = 1; 1449 _env->ThrowNew(IAEClass, "length - offset < needed"); 1450 goto exit; 1451 } 1452 params_base = (GLint *) 1453 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1454 params = params_base + offset; 1455 1456 glGetTexEnviv( 1457 (GLenum)env, 1458 (GLenum)pname, 1459 (GLint *)params 1460 ); 1461 1462exit: 1463 if (params_base) { 1464 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1465 _exception ? JNI_ABORT: 0); 1466 } 1467} 1468 1469/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ 1470static void 1471android_glGetTexEnviv__IILjava_nio_IntBuffer_2 1472 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1473 jint _exception = 0; 1474 jarray _array = (jarray) 0; 1475 jint _remaining; 1476 GLint *params = (GLint *) 0; 1477 1478 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); 1479 int _needed; 1480 switch (pname) { 1481#if defined(GL_TEXTURE_ENV_MODE) 1482 case GL_TEXTURE_ENV_MODE: 1483#endif // defined(GL_TEXTURE_ENV_MODE) 1484#if defined(GL_COMBINE_RGB) 1485 case GL_COMBINE_RGB: 1486#endif // defined(GL_COMBINE_RGB) 1487#if defined(GL_COMBINE_ALPHA) 1488 case GL_COMBINE_ALPHA: 1489#endif // defined(GL_COMBINE_ALPHA) 1490 _needed = 1; 1491 break; 1492#if defined(GL_TEXTURE_ENV_COLOR) 1493 case GL_TEXTURE_ENV_COLOR: 1494#endif // defined(GL_TEXTURE_ENV_COLOR) 1495 _needed = 4; 1496 break; 1497 default: 1498 _needed = 0; 1499 break; 1500 } 1501 if (_remaining < _needed) { 1502 _exception = 1; 1503 _env->ThrowNew(IAEClass, "remaining() < needed"); 1504 goto exit; 1505 } 1506 glGetTexEnviv( 1507 (GLenum)env, 1508 (GLenum)pname, 1509 (GLint *)params 1510 ); 1511 1512exit: 1513 if (_array) { 1514 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1515 } 1516} 1517 1518/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ 1519static void 1520android_glGetTexEnvxv__II_3II 1521 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { 1522 jint _exception = 0; 1523 GLfixed *params_base = (GLfixed *) 0; 1524 jint _remaining; 1525 GLfixed *params = (GLfixed *) 0; 1526 1527 if (!params_ref) { 1528 _exception = 1; 1529 _env->ThrowNew(IAEClass, "params == null"); 1530 goto exit; 1531 } 1532 if (offset < 0) { 1533 _exception = 1; 1534 _env->ThrowNew(IAEClass, "offset < 0"); 1535 goto exit; 1536 } 1537 _remaining = _env->GetArrayLength(params_ref) - offset; 1538 int _needed; 1539 switch (pname) { 1540#if defined(GL_TEXTURE_ENV_MODE) 1541 case GL_TEXTURE_ENV_MODE: 1542#endif // defined(GL_TEXTURE_ENV_MODE) 1543#if defined(GL_COMBINE_RGB) 1544 case GL_COMBINE_RGB: 1545#endif // defined(GL_COMBINE_RGB) 1546#if defined(GL_COMBINE_ALPHA) 1547 case GL_COMBINE_ALPHA: 1548#endif // defined(GL_COMBINE_ALPHA) 1549 _needed = 1; 1550 break; 1551#if defined(GL_TEXTURE_ENV_COLOR) 1552 case GL_TEXTURE_ENV_COLOR: 1553#endif // defined(GL_TEXTURE_ENV_COLOR) 1554 _needed = 4; 1555 break; 1556 default: 1557 _needed = 0; 1558 break; 1559 } 1560 if (_remaining < _needed) { 1561 _exception = 1; 1562 _env->ThrowNew(IAEClass, "length - offset < needed"); 1563 goto exit; 1564 } 1565 params_base = (GLfixed *) 1566 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1567 params = params_base + offset; 1568 1569 glGetTexEnvxv( 1570 (GLenum)env, 1571 (GLenum)pname, 1572 (GLfixed *)params 1573 ); 1574 1575exit: 1576 if (params_base) { 1577 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1578 _exception ? JNI_ABORT: 0); 1579 } 1580} 1581 1582/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ 1583static void 1584android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 1585 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { 1586 jint _exception = 0; 1587 jarray _array = (jarray) 0; 1588 jint _remaining; 1589 GLfixed *params = (GLfixed *) 0; 1590 1591 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 1592 int _needed; 1593 switch (pname) { 1594#if defined(GL_TEXTURE_ENV_MODE) 1595 case GL_TEXTURE_ENV_MODE: 1596#endif // defined(GL_TEXTURE_ENV_MODE) 1597#if defined(GL_COMBINE_RGB) 1598 case GL_COMBINE_RGB: 1599#endif // defined(GL_COMBINE_RGB) 1600#if defined(GL_COMBINE_ALPHA) 1601 case GL_COMBINE_ALPHA: 1602#endif // defined(GL_COMBINE_ALPHA) 1603 _needed = 1; 1604 break; 1605#if defined(GL_TEXTURE_ENV_COLOR) 1606 case GL_TEXTURE_ENV_COLOR: 1607#endif // defined(GL_TEXTURE_ENV_COLOR) 1608 _needed = 4; 1609 break; 1610 default: 1611 _needed = 0; 1612 break; 1613 } 1614 if (_remaining < _needed) { 1615 _exception = 1; 1616 _env->ThrowNew(IAEClass, "remaining() < needed"); 1617 goto exit; 1618 } 1619 glGetTexEnvxv( 1620 (GLenum)env, 1621 (GLenum)pname, 1622 (GLfixed *)params 1623 ); 1624 1625exit: 1626 if (_array) { 1627 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1628 } 1629} 1630 1631/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 1632static void 1633android_glGetTexParameterfv__II_3FI 1634 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 1635 jint _exception = 0; 1636 GLfloat *params_base = (GLfloat *) 0; 1637 jint _remaining; 1638 GLfloat *params = (GLfloat *) 0; 1639 1640 if (!params_ref) { 1641 _exception = 1; 1642 _env->ThrowNew(IAEClass, "params == null"); 1643 goto exit; 1644 } 1645 if (offset < 0) { 1646 _exception = 1; 1647 _env->ThrowNew(IAEClass, "offset < 0"); 1648 goto exit; 1649 } 1650 _remaining = _env->GetArrayLength(params_ref) - offset; 1651 if (_remaining < 1) { 1652 _exception = 1; 1653 _env->ThrowNew(IAEClass, "length - offset < 1"); 1654 goto exit; 1655 } 1656 params_base = (GLfloat *) 1657 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1658 params = params_base + offset; 1659 1660 glGetTexParameterfv( 1661 (GLenum)target, 1662 (GLenum)pname, 1663 (GLfloat *)params 1664 ); 1665 1666exit: 1667 if (params_base) { 1668 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1669 _exception ? JNI_ABORT: 0); 1670 } 1671} 1672 1673/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 1674static void 1675android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 1676 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 1677 jint _exception = 0; 1678 jarray _array = (jarray) 0; 1679 jint _remaining; 1680 GLfloat *params = (GLfloat *) 0; 1681 1682 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 1683 if (_remaining < 1) { 1684 _exception = 1; 1685 _env->ThrowNew(IAEClass, "remaining() < 1"); 1686 goto exit; 1687 } 1688 glGetTexParameterfv( 1689 (GLenum)target, 1690 (GLenum)pname, 1691 (GLfloat *)params 1692 ); 1693 1694exit: 1695 if (_array) { 1696 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1697 } 1698} 1699 1700/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 1701static void 1702android_glGetTexParameteriv__II_3II 1703 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 1704 jint _exception = 0; 1705 GLint *params_base = (GLint *) 0; 1706 jint _remaining; 1707 GLint *params = (GLint *) 0; 1708 1709 if (!params_ref) { 1710 _exception = 1; 1711 _env->ThrowNew(IAEClass, "params == null"); 1712 goto exit; 1713 } 1714 if (offset < 0) { 1715 _exception = 1; 1716 _env->ThrowNew(IAEClass, "offset < 0"); 1717 goto exit; 1718 } 1719 _remaining = _env->GetArrayLength(params_ref) - offset; 1720 if (_remaining < 1) { 1721 _exception = 1; 1722 _env->ThrowNew(IAEClass, "length - offset < 1"); 1723 goto exit; 1724 } 1725 params_base = (GLint *) 1726 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1727 params = params_base + offset; 1728 1729 glGetTexParameteriv( 1730 (GLenum)target, 1731 (GLenum)pname, 1732 (GLint *)params 1733 ); 1734 1735exit: 1736 if (params_base) { 1737 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1738 _exception ? JNI_ABORT: 0); 1739 } 1740} 1741 1742/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 1743static void 1744android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 1745 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 1746 jint _exception = 0; 1747 jarray _array = (jarray) 0; 1748 jint _remaining; 1749 GLint *params = (GLint *) 0; 1750 1751 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); 1752 if (_remaining < 1) { 1753 _exception = 1; 1754 _env->ThrowNew(IAEClass, "remaining() < 1"); 1755 goto exit; 1756 } 1757 glGetTexParameteriv( 1758 (GLenum)target, 1759 (GLenum)pname, 1760 (GLint *)params 1761 ); 1762 1763exit: 1764 if (_array) { 1765 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1766 } 1767} 1768 1769/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ 1770static void 1771android_glGetTexParameterxv__II_3II 1772 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 1773 jint _exception = 0; 1774 GLfixed *params_base = (GLfixed *) 0; 1775 jint _remaining; 1776 GLfixed *params = (GLfixed *) 0; 1777 1778 if (!params_ref) { 1779 _exception = 1; 1780 _env->ThrowNew(IAEClass, "params == null"); 1781 goto exit; 1782 } 1783 if (offset < 0) { 1784 _exception = 1; 1785 _env->ThrowNew(IAEClass, "offset < 0"); 1786 goto exit; 1787 } 1788 _remaining = _env->GetArrayLength(params_ref) - offset; 1789 if (_remaining < 1) { 1790 _exception = 1; 1791 _env->ThrowNew(IAEClass, "length - offset < 1"); 1792 goto exit; 1793 } 1794 params_base = (GLfixed *) 1795 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1796 params = params_base + offset; 1797 1798 glGetTexParameterxv( 1799 (GLenum)target, 1800 (GLenum)pname, 1801 (GLfixed *)params 1802 ); 1803 1804exit: 1805 if (params_base) { 1806 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1807 _exception ? JNI_ABORT: 0); 1808 } 1809} 1810 1811/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ 1812static void 1813android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 1814 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 1815 jint _exception = 0; 1816 jarray _array = (jarray) 0; 1817 jint _remaining; 1818 GLfixed *params = (GLfixed *) 0; 1819 1820 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 1821 if (_remaining < 1) { 1822 _exception = 1; 1823 _env->ThrowNew(IAEClass, "remaining() < 1"); 1824 goto exit; 1825 } 1826 glGetTexParameterxv( 1827 (GLenum)target, 1828 (GLenum)pname, 1829 (GLfixed *)params 1830 ); 1831 1832exit: 1833 if (_array) { 1834 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 1835 } 1836} 1837 1838/* GLboolean glIsBuffer ( GLuint buffer ) */ 1839static jboolean 1840android_glIsBuffer__I 1841 (JNIEnv *_env, jobject _this, jint buffer) { 1842 GLboolean _returnValue; 1843 _returnValue = glIsBuffer( 1844 (GLuint)buffer 1845 ); 1846 return _returnValue; 1847} 1848 1849/* GLboolean glIsEnabled ( GLenum cap ) */ 1850static jboolean 1851android_glIsEnabled__I 1852 (JNIEnv *_env, jobject _this, jint cap) { 1853 GLboolean _returnValue; 1854 _returnValue = glIsEnabled( 1855 (GLenum)cap 1856 ); 1857 return _returnValue; 1858} 1859 1860/* GLboolean glIsTexture ( GLuint texture ) */ 1861static jboolean 1862android_glIsTexture__I 1863 (JNIEnv *_env, jobject _this, jint texture) { 1864 GLboolean _returnValue; 1865 _returnValue = glIsTexture( 1866 (GLuint)texture 1867 ); 1868 return _returnValue; 1869} 1870 1871/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ 1872static void 1873android_glNormalPointer__III 1874 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { 1875 glNormalPointer( 1876 (GLenum)type, 1877 (GLsizei)stride, 1878 (const GLvoid *)offset 1879 ); 1880} 1881 1882/* void glPointParameterf ( GLenum pname, GLfloat param ) */ 1883static void 1884android_glPointParameterf__IF 1885 (JNIEnv *_env, jobject _this, jint pname, jfloat param) { 1886 glPointParameterf( 1887 (GLenum)pname, 1888 (GLfloat)param 1889 ); 1890} 1891 1892/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ 1893static void 1894android_glPointParameterfv__I_3FI 1895 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 1896 GLfloat *params_base = (GLfloat *) 0; 1897 jint _remaining; 1898 GLfloat *params = (GLfloat *) 0; 1899 1900 if (!params_ref) { 1901 _env->ThrowNew(IAEClass, "params == null"); 1902 goto exit; 1903 } 1904 if (offset < 0) { 1905 _env->ThrowNew(IAEClass, "offset < 0"); 1906 goto exit; 1907 } 1908 _remaining = _env->GetArrayLength(params_ref) - offset; 1909 if (_remaining < 1) { 1910 _env->ThrowNew(IAEClass, "length - offset < 1"); 1911 goto exit; 1912 } 1913 params_base = (GLfloat *) 1914 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1915 params = params_base + offset; 1916 1917 glPointParameterfv( 1918 (GLenum)pname, 1919 (GLfloat *)params 1920 ); 1921 1922exit: 1923 if (params_base) { 1924 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1925 JNI_ABORT); 1926 } 1927} 1928 1929/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ 1930static void 1931android_glPointParameterfv__ILjava_nio_FloatBuffer_2 1932 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 1933 jarray _array = (jarray) 0; 1934 jint _remaining; 1935 GLfloat *params = (GLfloat *) 0; 1936 1937 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 1938 if (_remaining < 1) { 1939 _env->ThrowNew(IAEClass, "remaining() < 1"); 1940 goto exit; 1941 } 1942 glPointParameterfv( 1943 (GLenum)pname, 1944 (GLfloat *)params 1945 ); 1946 1947exit: 1948 if (_array) { 1949 releasePointer(_env, _array, params, JNI_FALSE); 1950 } 1951} 1952 1953/* void glPointParameterx ( GLenum pname, GLfixed param ) */ 1954static void 1955android_glPointParameterx__II 1956 (JNIEnv *_env, jobject _this, jint pname, jint param) { 1957 glPointParameterx( 1958 (GLenum)pname, 1959 (GLfixed)param 1960 ); 1961} 1962 1963/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ 1964static void 1965android_glPointParameterxv__I_3II 1966 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 1967 GLfixed *params_base = (GLfixed *) 0; 1968 jint _remaining; 1969 GLfixed *params = (GLfixed *) 0; 1970 1971 if (!params_ref) { 1972 _env->ThrowNew(IAEClass, "params == null"); 1973 goto exit; 1974 } 1975 if (offset < 0) { 1976 _env->ThrowNew(IAEClass, "offset < 0"); 1977 goto exit; 1978 } 1979 _remaining = _env->GetArrayLength(params_ref) - offset; 1980 if (_remaining < 1) { 1981 _env->ThrowNew(IAEClass, "length - offset < 1"); 1982 goto exit; 1983 } 1984 params_base = (GLfixed *) 1985 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1986 params = params_base + offset; 1987 1988 glPointParameterxv( 1989 (GLenum)pname, 1990 (GLfixed *)params 1991 ); 1992 1993exit: 1994 if (params_base) { 1995 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1996 JNI_ABORT); 1997 } 1998} 1999 2000/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ 2001static void 2002android_glPointParameterxv__ILjava_nio_IntBuffer_2 2003 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2004 jarray _array = (jarray) 0; 2005 jint _remaining; 2006 GLfixed *params = (GLfixed *) 0; 2007 2008 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 2009 if (_remaining < 1) { 2010 _env->ThrowNew(IAEClass, "remaining() < 1"); 2011 goto exit; 2012 } 2013 glPointParameterxv( 2014 (GLenum)pname, 2015 (GLfixed *)params 2016 ); 2017 2018exit: 2019 if (_array) { 2020 releasePointer(_env, _array, params, JNI_FALSE); 2021 } 2022} 2023 2024/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ 2025static void 2026android_glPointSizePointerOES__IILjava_nio_Buffer_2 2027 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf) { 2028 jarray _array = (jarray) 0; 2029 jint _remaining; 2030 GLvoid *pointer = (GLvoid *) 0; 2031 2032 pointer = (GLvoid *)getPointer(_env, pointer_buf, &_array, &_remaining); 2033 glPointSizePointerOES( 2034 (GLenum)type, 2035 (GLsizei)stride, 2036 (GLvoid *)pointer 2037 ); 2038 if (_array) { 2039 releasePointer(_env, _array, pointer, JNI_FALSE); 2040 } 2041} 2042 2043/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 2044static void 2045android_glTexCoordPointer__IIII 2046 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 2047 glTexCoordPointer( 2048 (GLint)size, 2049 (GLenum)type, 2050 (GLsizei)stride, 2051 (const GLvoid *)offset 2052 ); 2053} 2054 2055/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ 2056static void 2057android_glTexEnvi__III 2058 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 2059 glTexEnvi( 2060 (GLenum)target, 2061 (GLenum)pname, 2062 (GLint)param 2063 ); 2064} 2065 2066/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ 2067static void 2068android_glTexEnviv__II_3II 2069 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2070 GLint *params_base = (GLint *) 0; 2071 jint _remaining; 2072 GLint *params = (GLint *) 0; 2073 2074 if (!params_ref) { 2075 _env->ThrowNew(IAEClass, "params == null"); 2076 goto exit; 2077 } 2078 if (offset < 0) { 2079 _env->ThrowNew(IAEClass, "offset < 0"); 2080 goto exit; 2081 } 2082 _remaining = _env->GetArrayLength(params_ref) - offset; 2083 int _needed; 2084 switch (pname) { 2085#if defined(GL_TEXTURE_ENV_MODE) 2086 case GL_TEXTURE_ENV_MODE: 2087#endif // defined(GL_TEXTURE_ENV_MODE) 2088#if defined(GL_COMBINE_RGB) 2089 case GL_COMBINE_RGB: 2090#endif // defined(GL_COMBINE_RGB) 2091#if defined(GL_COMBINE_ALPHA) 2092 case GL_COMBINE_ALPHA: 2093#endif // defined(GL_COMBINE_ALPHA) 2094 _needed = 1; 2095 break; 2096#if defined(GL_TEXTURE_ENV_COLOR) 2097 case GL_TEXTURE_ENV_COLOR: 2098#endif // defined(GL_TEXTURE_ENV_COLOR) 2099 _needed = 4; 2100 break; 2101 default: 2102 _needed = 0; 2103 break; 2104 } 2105 if (_remaining < _needed) { 2106 _env->ThrowNew(IAEClass, "length - offset < needed"); 2107 goto exit; 2108 } 2109 params_base = (GLint *) 2110 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2111 params = params_base + offset; 2112 2113 glTexEnviv( 2114 (GLenum)target, 2115 (GLenum)pname, 2116 (GLint *)params 2117 ); 2118 2119exit: 2120 if (params_base) { 2121 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2122 JNI_ABORT); 2123 } 2124} 2125 2126/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ 2127static void 2128android_glTexEnviv__IILjava_nio_IntBuffer_2 2129 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2130 jarray _array = (jarray) 0; 2131 jint _remaining; 2132 GLint *params = (GLint *) 0; 2133 2134 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); 2135 int _needed; 2136 switch (pname) { 2137#if defined(GL_TEXTURE_ENV_MODE) 2138 case GL_TEXTURE_ENV_MODE: 2139#endif // defined(GL_TEXTURE_ENV_MODE) 2140#if defined(GL_COMBINE_RGB) 2141 case GL_COMBINE_RGB: 2142#endif // defined(GL_COMBINE_RGB) 2143#if defined(GL_COMBINE_ALPHA) 2144 case GL_COMBINE_ALPHA: 2145#endif // defined(GL_COMBINE_ALPHA) 2146 _needed = 1; 2147 break; 2148#if defined(GL_TEXTURE_ENV_COLOR) 2149 case GL_TEXTURE_ENV_COLOR: 2150#endif // defined(GL_TEXTURE_ENV_COLOR) 2151 _needed = 4; 2152 break; 2153 default: 2154 _needed = 0; 2155 break; 2156 } 2157 if (_remaining < _needed) { 2158 _env->ThrowNew(IAEClass, "remaining() < needed"); 2159 goto exit; 2160 } 2161 glTexEnviv( 2162 (GLenum)target, 2163 (GLenum)pname, 2164 (GLint *)params 2165 ); 2166 2167exit: 2168 if (_array) { 2169 releasePointer(_env, _array, params, JNI_FALSE); 2170 } 2171} 2172 2173/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 2174static void 2175android_glTexParameterfv__II_3FI 2176 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 2177 GLfloat *params_base = (GLfloat *) 0; 2178 jint _remaining; 2179 GLfloat *params = (GLfloat *) 0; 2180 2181 if (!params_ref) { 2182 _env->ThrowNew(IAEClass, "params == null"); 2183 goto exit; 2184 } 2185 if (offset < 0) { 2186 _env->ThrowNew(IAEClass, "offset < 0"); 2187 goto exit; 2188 } 2189 _remaining = _env->GetArrayLength(params_ref) - offset; 2190 if (_remaining < 1) { 2191 _env->ThrowNew(IAEClass, "length - offset < 1"); 2192 goto exit; 2193 } 2194 params_base = (GLfloat *) 2195 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2196 params = params_base + offset; 2197 2198 glTexParameterfv( 2199 (GLenum)target, 2200 (GLenum)pname, 2201 (GLfloat *)params 2202 ); 2203 2204exit: 2205 if (params_base) { 2206 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2207 JNI_ABORT); 2208 } 2209} 2210 2211/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 2212static void 2213android_glTexParameterfv__IILjava_nio_FloatBuffer_2 2214 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2215 jarray _array = (jarray) 0; 2216 jint _remaining; 2217 GLfloat *params = (GLfloat *) 0; 2218 2219 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining); 2220 if (_remaining < 1) { 2221 _env->ThrowNew(IAEClass, "remaining() < 1"); 2222 goto exit; 2223 } 2224 glTexParameterfv( 2225 (GLenum)target, 2226 (GLenum)pname, 2227 (GLfloat *)params 2228 ); 2229 2230exit: 2231 if (_array) { 2232 releasePointer(_env, _array, params, JNI_FALSE); 2233 } 2234} 2235 2236/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ 2237static void 2238android_glTexParameteri__III 2239 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 2240 glTexParameteri( 2241 (GLenum)target, 2242 (GLenum)pname, 2243 (GLint)param 2244 ); 2245} 2246 2247/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 2248static void 2249android_glTexParameteriv__II_3II 2250 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2251 GLint *params_base = (GLint *) 0; 2252 jint _remaining; 2253 GLint *params = (GLint *) 0; 2254 2255 if (!params_ref) { 2256 _env->ThrowNew(IAEClass, "params == null"); 2257 goto exit; 2258 } 2259 if (offset < 0) { 2260 _env->ThrowNew(IAEClass, "offset < 0"); 2261 goto exit; 2262 } 2263 _remaining = _env->GetArrayLength(params_ref) - offset; 2264 if (_remaining < 1) { 2265 _env->ThrowNew(IAEClass, "length - offset < 1"); 2266 goto exit; 2267 } 2268 params_base = (GLint *) 2269 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2270 params = params_base + offset; 2271 2272 glTexParameteriv( 2273 (GLenum)target, 2274 (GLenum)pname, 2275 (GLint *)params 2276 ); 2277 2278exit: 2279 if (params_base) { 2280 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2281 JNI_ABORT); 2282 } 2283} 2284 2285/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 2286static void 2287android_glTexParameteriv__IILjava_nio_IntBuffer_2 2288 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2289 jarray _array = (jarray) 0; 2290 jint _remaining; 2291 GLint *params = (GLint *) 0; 2292 2293 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining); 2294 if (_remaining < 1) { 2295 _env->ThrowNew(IAEClass, "remaining() < 1"); 2296 goto exit; 2297 } 2298 glTexParameteriv( 2299 (GLenum)target, 2300 (GLenum)pname, 2301 (GLint *)params 2302 ); 2303 2304exit: 2305 if (_array) { 2306 releasePointer(_env, _array, params, JNI_FALSE); 2307 } 2308} 2309 2310/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ 2311static void 2312android_glTexParameterxv__II_3II 2313 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2314 GLfixed *params_base = (GLfixed *) 0; 2315 jint _remaining; 2316 GLfixed *params = (GLfixed *) 0; 2317 2318 if (!params_ref) { 2319 _env->ThrowNew(IAEClass, "params == null"); 2320 goto exit; 2321 } 2322 if (offset < 0) { 2323 _env->ThrowNew(IAEClass, "offset < 0"); 2324 goto exit; 2325 } 2326 _remaining = _env->GetArrayLength(params_ref) - offset; 2327 if (_remaining < 1) { 2328 _env->ThrowNew(IAEClass, "length - offset < 1"); 2329 goto exit; 2330 } 2331 params_base = (GLfixed *) 2332 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 2333 params = params_base + offset; 2334 2335 glTexParameterxv( 2336 (GLenum)target, 2337 (GLenum)pname, 2338 (GLfixed *)params 2339 ); 2340 2341exit: 2342 if (params_base) { 2343 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 2344 JNI_ABORT); 2345 } 2346} 2347 2348/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ 2349static void 2350android_glTexParameterxv__IILjava_nio_IntBuffer_2 2351 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2352 jarray _array = (jarray) 0; 2353 jint _remaining; 2354 GLfixed *params = (GLfixed *) 0; 2355 2356 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining); 2357 if (_remaining < 1) { 2358 _env->ThrowNew(IAEClass, "remaining() < 1"); 2359 goto exit; 2360 } 2361 glTexParameterxv( 2362 (GLenum)target, 2363 (GLenum)pname, 2364 (GLfixed *)params 2365 ); 2366 2367exit: 2368 if (_array) { 2369 releasePointer(_env, _array, params, JNI_FALSE); 2370 } 2371} 2372 2373/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ 2374static void 2375android_glVertexPointer__IIII 2376 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { 2377 glVertexPointer( 2378 (GLint)size, 2379 (GLenum)type, 2380 (GLsizei)stride, 2381 (const GLvoid *)offset 2382 ); 2383} 2384 2385static const char *classPathName = "android/opengl/GLES11"; 2386 2387static JNINativeMethod methods[] = { 2388{"_nativeClassInit", "()V", (void*)nativeClassInit }, 2389{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, 2390{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, 2391{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, 2392{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, 2393{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, 2394{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, 2395{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, 2396{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, 2397{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, 2398{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, 2399{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, 2400{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, 2401{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, 2402{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, 2403{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, 2404{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, 2405{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, 2406{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, 2407{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, 2408{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, 2409{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, 2410{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, 2411{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, 2412{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, 2413{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, 2414{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, 2415{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, 2416{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, 2417{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, 2418{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, 2419{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, 2420{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, 2421{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, 2422{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, 2423{"glGetTexEnvfv", "(II[FI)V", (void *) android_glGetTexEnvfv__II_3FI }, 2424{"glGetTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexEnvfv__IILjava_nio_FloatBuffer_2 }, 2425{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, 2426{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, 2427{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, 2428{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, 2429{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, 2430{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, 2431{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, 2432{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, 2433{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, 2434{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, 2435{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, 2436{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, 2437{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, 2438{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, 2439{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, 2440{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, 2441{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, 2442{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, 2443{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, 2444{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, 2445{"glPointSizePointerOES", "(IILjava/nio/Buffer;)V", (void *) android_glPointSizePointerOES__IILjava_nio_Buffer_2 }, 2446{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, 2447{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, 2448{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, 2449{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, 2450{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, 2451{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, 2452{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, 2453{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, 2454{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, 2455{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, 2456{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, 2457{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, 2458}; 2459 2460int register_android_opengl_jni_GLES11(JNIEnv *_env) 2461{ 2462 int err; 2463 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); 2464 return err; 2465} 2466