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