android_opengl_GLES20.cpp revision 84cac20dfdff35932901e978e6b6d3da843a2fa7
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 <GLES2/gl2.h> 25#include <GLES2/gl2ext.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 129class ByteArrayGetter { 130public: 131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { 132 return _env->GetByteArrayElements(array, is_copy); 133 } 134}; 135class BooleanArrayGetter { 136public: 137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { 138 return _env->GetBooleanArrayElements(array, is_copy); 139 } 140}; 141class CharArrayGetter { 142public: 143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { 144 return _env->GetCharArrayElements(array, is_copy); 145 } 146}; 147class ShortArrayGetter { 148public: 149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { 150 return _env->GetShortArrayElements(array, is_copy); 151 } 152}; 153class IntArrayGetter { 154public: 155 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) { 156 return _env->GetIntArrayElements(array, is_copy); 157 } 158}; 159class LongArrayGetter { 160public: 161 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) { 162 return _env->GetLongArrayElements(array, is_copy); 163 } 164}; 165class FloatArrayGetter { 166public: 167 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) { 168 return _env->GetFloatArrayElements(array, is_copy); 169 } 170}; 171class DoubleArrayGetter { 172public: 173 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) { 174 return _env->GetDoubleArrayElements(array, is_copy); 175 } 176}; 177 178template<typename JTYPEARRAY, typename ARRAYGETTER> 179static void* 180getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) { 181 return ARRAYGETTER::Get(_env, array, is_copy); 182} 183 184class ByteArrayReleaser { 185public: 186 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) { 187 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT); 188 } 189}; 190class BooleanArrayReleaser { 191public: 192 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) { 193 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT); 194 } 195}; 196class CharArrayReleaser { 197public: 198 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) { 199 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT); 200 } 201}; 202class ShortArrayReleaser { 203public: 204 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) { 205 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT); 206 } 207}; 208class IntArrayReleaser { 209public: 210 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) { 211 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT); 212 } 213}; 214class LongArrayReleaser { 215public: 216 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) { 217 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT); 218 } 219}; 220class FloatArrayReleaser { 221public: 222 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) { 223 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT); 224 } 225}; 226class DoubleArrayReleaser { 227public: 228 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) { 229 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT); 230 } 231}; 232 233template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER> 234static void 235releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) { 236 ARRAYRELEASER::Release(_env, array, data, commit); 237} 238 239static void 240releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 241{ 242 _env->ReleasePrimitiveArrayCritical(array, data, 243 commit ? 0 : JNI_ABORT); 244} 245 246static void * 247getDirectBufferPointer(JNIEnv *_env, jobject buffer) { 248 char* buf = (char*) _env->GetDirectBufferAddress(buffer); 249 if (buf) { 250 jint position = _env->GetIntField(buffer, positionID); 251 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 252 buf += position << elementSizeShift; 253 } else { 254 jniThrowException(_env, "java/lang/IllegalArgumentException", 255 "Must use a native order direct Buffer"); 256 } 257 return (void*) buf; 258} 259 260// -------------------------------------------------------------------------- 261 262/* 263 * returns the number of values glGet returns for a given pname. 264 * 265 * The code below is written such that pnames requiring only one values 266 * are the default (and are not explicitely tested for). This makes the 267 * checking code much shorter/readable/efficient. 268 * 269 * This means that unknown pnames (e.g.: extensions) will default to 1. If 270 * that unknown pname needs more than 1 value, then the validation check 271 * is incomplete and the app may crash if it passed the wrong number params. 272 */ 273static int getNeededCount(GLint pname) { 274 int needed = 1; 275#ifdef GL_ES_VERSION_2_0 276 // GLES 2.x pnames 277 switch (pname) { 278 case GL_ALIASED_LINE_WIDTH_RANGE: 279 case GL_ALIASED_POINT_SIZE_RANGE: 280 needed = 2; 281 break; 282 283 case GL_BLEND_COLOR: 284 case GL_COLOR_CLEAR_VALUE: 285 case GL_COLOR_WRITEMASK: 286 case GL_SCISSOR_BOX: 287 case GL_VIEWPORT: 288 needed = 4; 289 break; 290 291 case GL_COMPRESSED_TEXTURE_FORMATS: 292 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 293 break; 294 295 case GL_SHADER_BINARY_FORMATS: 296 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); 297 break; 298 } 299#endif 300 301#ifdef GL_VERSION_ES_CM_1_1 302 // GLES 1.x pnames 303 switch (pname) { 304 case GL_ALIASED_LINE_WIDTH_RANGE: 305 case GL_ALIASED_POINT_SIZE_RANGE: 306 case GL_DEPTH_RANGE: 307 case GL_SMOOTH_LINE_WIDTH_RANGE: 308 case GL_SMOOTH_POINT_SIZE_RANGE: 309 needed = 2; 310 break; 311 312 case GL_CURRENT_NORMAL: 313 case GL_POINT_DISTANCE_ATTENUATION: 314 needed = 3; 315 break; 316 317 case GL_COLOR_CLEAR_VALUE: 318 case GL_COLOR_WRITEMASK: 319 case GL_CURRENT_COLOR: 320 case GL_CURRENT_TEXTURE_COORDS: 321 case GL_FOG_COLOR: 322 case GL_LIGHT_MODEL_AMBIENT: 323 case GL_SCISSOR_BOX: 324 case GL_VIEWPORT: 325 needed = 4; 326 break; 327 328 case GL_MODELVIEW_MATRIX: 329 case GL_PROJECTION_MATRIX: 330 case GL_TEXTURE_MATRIX: 331 needed = 16; 332 break; 333 334 case GL_COMPRESSED_TEXTURE_FORMATS: 335 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 336 break; 337 } 338#endif 339 return needed; 340} 341 342template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, 343 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)> 344static void 345get 346 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { 347 jint _exception = 0; 348 const char * _exceptionType; 349 const char * _exceptionMessage; 350 CTYPE *params_base = (CTYPE *) 0; 351 jint _remaining; 352 CTYPE *params = (CTYPE *) 0; 353 int _needed = 0; 354 355 if (!params_ref) { 356 _exception = 1; 357 _exceptionType = "java/lang/IllegalArgumentException"; 358 _exceptionMessage = "params == null"; 359 goto exit; 360 } 361 if (offset < 0) { 362 _exception = 1; 363 _exceptionType = "java/lang/IllegalArgumentException"; 364 _exceptionMessage = "offset < 0"; 365 goto exit; 366 } 367 _remaining = _env->GetArrayLength(params_ref) - offset; 368 _needed = getNeededCount(pname); 369 // if we didn't find this pname, we just assume the user passed 370 // an array of the right size -- this might happen with extensions 371 // or if we forget an enum here. 372 if (_remaining < _needed) { 373 _exception = 1; 374 _exceptionType = "java/lang/IllegalArgumentException"; 375 _exceptionMessage = "length - offset < needed"; 376 goto exit; 377 } 378 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( 379 _env, params_ref, (jboolean *)0); 380 params = params_base + offset; 381 382 GET( 383 (GLenum)pname, 384 (CTYPE *)params 385 ); 386 387exit: 388 if (params_base) { 389 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( 390 _env, params_ref, params_base, !_exception); 391 } 392 if (_exception) { 393 jniThrowException(_env, _exceptionType, _exceptionMessage); 394 } 395} 396 397 398template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, 399 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)> 400static void 401getarray 402 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 403 jint _exception = 0; 404 const char * _exceptionType; 405 const char * _exceptionMessage; 406 JTYPEARRAY _array = (JTYPEARRAY) 0; 407 jint _bufferOffset = (jint) 0; 408 jint _remaining; 409 CTYPE *params = (CTYPE *) 0; 410 int _needed = 0; 411 412 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 413 _remaining /= sizeof(CTYPE); // convert from bytes to item count 414 _needed = getNeededCount(pname); 415 // if we didn't find this pname, we just assume the user passed 416 // an array of the right size -- this might happen with extensions 417 // or if we forget an enum here. 418 if (_needed>0 && _remaining < _needed) { 419 _exception = 1; 420 _exceptionType = "java/lang/IllegalArgumentException"; 421 _exceptionMessage = "remaining() < needed"; 422 goto exit; 423 } 424 if (params == NULL) { 425 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( 426 _env, _array, (jboolean *) 0); 427 params = (CTYPE *) (_paramsBase + _bufferOffset); 428 } 429 GET( 430 (GLenum)pname, 431 (CTYPE *)params 432 ); 433 434exit: 435 if (_array) { 436 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( 437 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE); 438 } 439 if (_exception) { 440 jniThrowException(_env, _exceptionType, _exceptionMessage); 441 } 442} 443 444// -------------------------------------------------------------------------- 445/* void glActiveTexture ( GLenum texture ) */ 446static void 447android_glActiveTexture__I 448 (JNIEnv *_env, jobject _this, jint texture) { 449 glActiveTexture( 450 (GLenum)texture 451 ); 452} 453 454/* void glAttachShader ( GLuint program, GLuint shader ) */ 455static void 456android_glAttachShader__II 457 (JNIEnv *_env, jobject _this, jint program, jint shader) { 458 glAttachShader( 459 (GLuint)program, 460 (GLuint)shader 461 ); 462} 463 464/* void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) */ 465static void 466android_glBindAttribLocation__IILjava_lang_String_2 467 (JNIEnv *_env, jobject _this, jint program, jint index, jstring name) { 468 jint _exception = 0; 469 const char * _exceptionType = NULL; 470 const char * _exceptionMessage = NULL; 471 const char* _nativename = 0; 472 473 if (!name) { 474 _exception = 1; 475 _exceptionType = "java/lang/IllegalArgumentException"; 476 _exceptionMessage = "name == null"; 477 goto exit; 478 } 479 _nativename = _env->GetStringUTFChars(name, 0); 480 481 glBindAttribLocation( 482 (GLuint)program, 483 (GLuint)index, 484 (char *)_nativename 485 ); 486 487exit: 488 if (_nativename) { 489 _env->ReleaseStringUTFChars(name, _nativename); 490 } 491 492 if (_exception) { 493 jniThrowException(_env, _exceptionType, _exceptionMessage); 494 } 495} 496 497/* void glBindBuffer ( GLenum target, GLuint buffer ) */ 498static void 499android_glBindBuffer__II 500 (JNIEnv *_env, jobject _this, jint target, jint buffer) { 501 glBindBuffer( 502 (GLenum)target, 503 (GLuint)buffer 504 ); 505} 506 507/* void glBindFramebuffer ( GLenum target, GLuint framebuffer ) */ 508static void 509android_glBindFramebuffer__II 510 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { 511 glBindFramebuffer( 512 (GLenum)target, 513 (GLuint)framebuffer 514 ); 515} 516 517/* void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) */ 518static void 519android_glBindRenderbuffer__II 520 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { 521 glBindRenderbuffer( 522 (GLenum)target, 523 (GLuint)renderbuffer 524 ); 525} 526 527/* void glBindTexture ( GLenum target, GLuint texture ) */ 528static void 529android_glBindTexture__II 530 (JNIEnv *_env, jobject _this, jint target, jint texture) { 531 glBindTexture( 532 (GLenum)target, 533 (GLuint)texture 534 ); 535} 536 537/* void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ 538static void 539android_glBlendColor__FFFF 540 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { 541 glBlendColor( 542 (GLclampf)red, 543 (GLclampf)green, 544 (GLclampf)blue, 545 (GLclampf)alpha 546 ); 547} 548 549/* void glBlendEquation ( GLenum mode ) */ 550static void 551android_glBlendEquation__I 552 (JNIEnv *_env, jobject _this, jint mode) { 553 glBlendEquation( 554 (GLenum)mode 555 ); 556} 557 558/* void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) */ 559static void 560android_glBlendEquationSeparate__II 561 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { 562 glBlendEquationSeparate( 563 (GLenum)modeRGB, 564 (GLenum)modeAlpha 565 ); 566} 567 568/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ 569static void 570android_glBlendFunc__II 571 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { 572 glBlendFunc( 573 (GLenum)sfactor, 574 (GLenum)dfactor 575 ); 576} 577 578/* void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */ 579static void 580android_glBlendFuncSeparate__IIII 581 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { 582 glBlendFuncSeparate( 583 (GLenum)srcRGB, 584 (GLenum)dstRGB, 585 (GLenum)srcAlpha, 586 (GLenum)dstAlpha 587 ); 588} 589 590/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ 591static void 592android_glBufferData__IILjava_nio_Buffer_2I 593 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { 594 jint _exception = 0; 595 const char * _exceptionType = NULL; 596 const char * _exceptionMessage = NULL; 597 jarray _array = (jarray) 0; 598 jint _bufferOffset = (jint) 0; 599 jint _remaining; 600 GLvoid *data = (GLvoid *) 0; 601 602 if (data_buf) { 603 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 604 if (_remaining < size) { 605 _exception = 1; 606 _exceptionType = "java/lang/IllegalArgumentException"; 607 _exceptionMessage = "remaining() < size < needed"; 608 goto exit; 609 } 610 } 611 if (data_buf && data == NULL) { 612 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 613 data = (GLvoid *) (_dataBase + _bufferOffset); 614 } 615 glBufferData( 616 (GLenum)target, 617 (GLsizeiptr)size, 618 (GLvoid *)data, 619 (GLenum)usage 620 ); 621 622exit: 623 if (_array) { 624 releasePointer(_env, _array, data, JNI_FALSE); 625 } 626 if (_exception) { 627 jniThrowException(_env, _exceptionType, _exceptionMessage); 628 } 629} 630 631/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ 632static void 633android_glBufferSubData__IIILjava_nio_Buffer_2 634 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { 635 jint _exception = 0; 636 const char * _exceptionType = NULL; 637 const char * _exceptionMessage = NULL; 638 jarray _array = (jarray) 0; 639 jint _bufferOffset = (jint) 0; 640 jint _remaining; 641 GLvoid *data = (GLvoid *) 0; 642 643 if (!data_buf) { 644 _exception = 1; 645 _exceptionType = "java/lang/IllegalArgumentException"; 646 _exceptionMessage = "data == null"; 647 goto exit; 648 } 649 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 650 if (_remaining < size) { 651 _exception = 1; 652 _exceptionType = "java/lang/IllegalArgumentException"; 653 _exceptionMessage = "remaining() < size < needed"; 654 goto exit; 655 } 656 if (data == NULL) { 657 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 658 data = (GLvoid *) (_dataBase + _bufferOffset); 659 } 660 glBufferSubData( 661 (GLenum)target, 662 (GLintptr)offset, 663 (GLsizeiptr)size, 664 (GLvoid *)data 665 ); 666 667exit: 668 if (_array) { 669 releasePointer(_env, _array, data, JNI_FALSE); 670 } 671 if (_exception) { 672 jniThrowException(_env, _exceptionType, _exceptionMessage); 673 } 674} 675 676/* GLenum glCheckFramebufferStatus ( GLenum target ) */ 677static jint 678android_glCheckFramebufferStatus__I 679 (JNIEnv *_env, jobject _this, jint target) { 680 GLenum _returnValue; 681 _returnValue = glCheckFramebufferStatus( 682 (GLenum)target 683 ); 684 return (jint)_returnValue; 685} 686 687/* void glClear ( GLbitfield mask ) */ 688static void 689android_glClear__I 690 (JNIEnv *_env, jobject _this, jint mask) { 691 glClear( 692 (GLbitfield)mask 693 ); 694} 695 696/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ 697static void 698android_glClearColor__FFFF 699 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { 700 glClearColor( 701 (GLclampf)red, 702 (GLclampf)green, 703 (GLclampf)blue, 704 (GLclampf)alpha 705 ); 706} 707 708/* void glClearDepthf ( GLclampf depth ) */ 709static void 710android_glClearDepthf__F 711 (JNIEnv *_env, jobject _this, jfloat depth) { 712 glClearDepthf( 713 (GLclampf)depth 714 ); 715} 716 717/* void glClearStencil ( GLint s ) */ 718static void 719android_glClearStencil__I 720 (JNIEnv *_env, jobject _this, jint s) { 721 glClearStencil( 722 (GLint)s 723 ); 724} 725 726/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ 727static void 728android_glColorMask__ZZZZ 729 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { 730 glColorMask( 731 (GLboolean)red, 732 (GLboolean)green, 733 (GLboolean)blue, 734 (GLboolean)alpha 735 ); 736} 737 738/* void glCompileShader ( GLuint shader ) */ 739static void 740android_glCompileShader__I 741 (JNIEnv *_env, jobject _this, jint shader) { 742 glCompileShader( 743 (GLuint)shader 744 ); 745} 746 747/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ 748static void 749android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 750 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { 751 jint _exception = 0; 752 const char * _exceptionType = NULL; 753 const char * _exceptionMessage = NULL; 754 jarray _array = (jarray) 0; 755 jint _bufferOffset = (jint) 0; 756 jint _remaining; 757 GLvoid *data = (GLvoid *) 0; 758 759 if (!data_buf) { 760 _exception = 1; 761 _exceptionType = "java/lang/IllegalArgumentException"; 762 _exceptionMessage = "data == null"; 763 goto exit; 764 } 765 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 766 if (data == NULL) { 767 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 768 data = (GLvoid *) (_dataBase + _bufferOffset); 769 } 770 glCompressedTexImage2D( 771 (GLenum)target, 772 (GLint)level, 773 (GLenum)internalformat, 774 (GLsizei)width, 775 (GLsizei)height, 776 (GLint)border, 777 (GLsizei)imageSize, 778 (GLvoid *)data 779 ); 780 781exit: 782 if (_array) { 783 releasePointer(_env, _array, data, JNI_FALSE); 784 } 785 if (_exception) { 786 jniThrowException(_env, _exceptionType, _exceptionMessage); 787 } 788} 789 790/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ 791static void 792android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 793 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { 794 jint _exception = 0; 795 const char * _exceptionType = NULL; 796 const char * _exceptionMessage = NULL; 797 jarray _array = (jarray) 0; 798 jint _bufferOffset = (jint) 0; 799 jint _remaining; 800 GLvoid *data = (GLvoid *) 0; 801 802 if (!data_buf) { 803 _exception = 1; 804 _exceptionType = "java/lang/IllegalArgumentException"; 805 _exceptionMessage = "data == null"; 806 goto exit; 807 } 808 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 809 if (data == NULL) { 810 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 811 data = (GLvoid *) (_dataBase + _bufferOffset); 812 } 813 glCompressedTexSubImage2D( 814 (GLenum)target, 815 (GLint)level, 816 (GLint)xoffset, 817 (GLint)yoffset, 818 (GLsizei)width, 819 (GLsizei)height, 820 (GLenum)format, 821 (GLsizei)imageSize, 822 (GLvoid *)data 823 ); 824 825exit: 826 if (_array) { 827 releasePointer(_env, _array, data, JNI_FALSE); 828 } 829 if (_exception) { 830 jniThrowException(_env, _exceptionType, _exceptionMessage); 831 } 832} 833 834/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ 835static void 836android_glCopyTexImage2D__IIIIIIII 837 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { 838 glCopyTexImage2D( 839 (GLenum)target, 840 (GLint)level, 841 (GLenum)internalformat, 842 (GLint)x, 843 (GLint)y, 844 (GLsizei)width, 845 (GLsizei)height, 846 (GLint)border 847 ); 848} 849 850/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ 851static void 852android_glCopyTexSubImage2D__IIIIIIII 853 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { 854 glCopyTexSubImage2D( 855 (GLenum)target, 856 (GLint)level, 857 (GLint)xoffset, 858 (GLint)yoffset, 859 (GLint)x, 860 (GLint)y, 861 (GLsizei)width, 862 (GLsizei)height 863 ); 864} 865 866/* GLuint glCreateProgram ( void ) */ 867static jint 868android_glCreateProgram__ 869 (JNIEnv *_env, jobject _this) { 870 GLuint _returnValue; 871 _returnValue = glCreateProgram(); 872 return (jint)_returnValue; 873} 874 875/* GLuint glCreateShader ( GLenum type ) */ 876static jint 877android_glCreateShader__I 878 (JNIEnv *_env, jobject _this, jint type) { 879 GLuint _returnValue; 880 _returnValue = glCreateShader( 881 (GLenum)type 882 ); 883 return (jint)_returnValue; 884} 885 886/* void glCullFace ( GLenum mode ) */ 887static void 888android_glCullFace__I 889 (JNIEnv *_env, jobject _this, jint mode) { 890 glCullFace( 891 (GLenum)mode 892 ); 893} 894 895/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 896static void 897android_glDeleteBuffers__I_3II 898 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 899 jint _exception = 0; 900 const char * _exceptionType = NULL; 901 const char * _exceptionMessage = NULL; 902 GLuint *buffers_base = (GLuint *) 0; 903 jint _remaining; 904 GLuint *buffers = (GLuint *) 0; 905 906 if (!buffers_ref) { 907 _exception = 1; 908 _exceptionType = "java/lang/IllegalArgumentException"; 909 _exceptionMessage = "buffers == null"; 910 goto exit; 911 } 912 if (offset < 0) { 913 _exception = 1; 914 _exceptionType = "java/lang/IllegalArgumentException"; 915 _exceptionMessage = "offset < 0"; 916 goto exit; 917 } 918 _remaining = _env->GetArrayLength(buffers_ref) - offset; 919 if (_remaining < n) { 920 _exception = 1; 921 _exceptionType = "java/lang/IllegalArgumentException"; 922 _exceptionMessage = "length - offset < n < needed"; 923 goto exit; 924 } 925 buffers_base = (GLuint *) 926 _env->GetIntArrayElements(buffers_ref, (jboolean *)0); 927 buffers = buffers_base + offset; 928 929 glDeleteBuffers( 930 (GLsizei)n, 931 (GLuint *)buffers 932 ); 933 934exit: 935 if (buffers_base) { 936 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, 937 JNI_ABORT); 938 } 939 if (_exception) { 940 jniThrowException(_env, _exceptionType, _exceptionMessage); 941 } 942} 943 944/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 945static void 946android_glDeleteBuffers__ILjava_nio_IntBuffer_2 947 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 948 jint _exception = 0; 949 const char * _exceptionType = NULL; 950 const char * _exceptionMessage = NULL; 951 jintArray _array = (jintArray) 0; 952 jint _bufferOffset = (jint) 0; 953 jint _remaining; 954 GLuint *buffers = (GLuint *) 0; 955 956 if (!buffers_buf) { 957 _exception = 1; 958 _exceptionType = "java/lang/IllegalArgumentException"; 959 _exceptionMessage = "buffers == null"; 960 goto exit; 961 } 962 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 963 if (_remaining < n) { 964 _exception = 1; 965 _exceptionType = "java/lang/IllegalArgumentException"; 966 _exceptionMessage = "remaining() < n < needed"; 967 goto exit; 968 } 969 if (buffers == NULL) { 970 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 971 buffers = (GLuint *) (_buffersBase + _bufferOffset); 972 } 973 glDeleteBuffers( 974 (GLsizei)n, 975 (GLuint *)buffers 976 ); 977 978exit: 979 if (_array) { 980 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT); 981 } 982 if (_exception) { 983 jniThrowException(_env, _exceptionType, _exceptionMessage); 984 } 985} 986 987/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ 988static void 989android_glDeleteFramebuffers__I_3II 990 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { 991 jint _exception = 0; 992 const char * _exceptionType = NULL; 993 const char * _exceptionMessage = NULL; 994 GLuint *framebuffers_base = (GLuint *) 0; 995 jint _remaining; 996 GLuint *framebuffers = (GLuint *) 0; 997 998 if (!framebuffers_ref) { 999 _exception = 1; 1000 _exceptionType = "java/lang/IllegalArgumentException"; 1001 _exceptionMessage = "framebuffers == null"; 1002 goto exit; 1003 } 1004 if (offset < 0) { 1005 _exception = 1; 1006 _exceptionType = "java/lang/IllegalArgumentException"; 1007 _exceptionMessage = "offset < 0"; 1008 goto exit; 1009 } 1010 _remaining = _env->GetArrayLength(framebuffers_ref) - offset; 1011 if (_remaining < n) { 1012 _exception = 1; 1013 _exceptionType = "java/lang/IllegalArgumentException"; 1014 _exceptionMessage = "length - offset < n < needed"; 1015 goto exit; 1016 } 1017 framebuffers_base = (GLuint *) 1018 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); 1019 framebuffers = framebuffers_base + offset; 1020 1021 glDeleteFramebuffers( 1022 (GLsizei)n, 1023 (GLuint *)framebuffers 1024 ); 1025 1026exit: 1027 if (framebuffers_base) { 1028 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, 1029 JNI_ABORT); 1030 } 1031 if (_exception) { 1032 jniThrowException(_env, _exceptionType, _exceptionMessage); 1033 } 1034} 1035 1036/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ 1037static void 1038android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 1039 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { 1040 jint _exception = 0; 1041 const char * _exceptionType = NULL; 1042 const char * _exceptionMessage = NULL; 1043 jintArray _array = (jintArray) 0; 1044 jint _bufferOffset = (jint) 0; 1045 jint _remaining; 1046 GLuint *framebuffers = (GLuint *) 0; 1047 1048 if (!framebuffers_buf) { 1049 _exception = 1; 1050 _exceptionType = "java/lang/IllegalArgumentException"; 1051 _exceptionMessage = "framebuffers == null"; 1052 goto exit; 1053 } 1054 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1055 if (_remaining < n) { 1056 _exception = 1; 1057 _exceptionType = "java/lang/IllegalArgumentException"; 1058 _exceptionMessage = "remaining() < n < needed"; 1059 goto exit; 1060 } 1061 if (framebuffers == NULL) { 1062 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1063 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); 1064 } 1065 glDeleteFramebuffers( 1066 (GLsizei)n, 1067 (GLuint *)framebuffers 1068 ); 1069 1070exit: 1071 if (_array) { 1072 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, JNI_ABORT); 1073 } 1074 if (_exception) { 1075 jniThrowException(_env, _exceptionType, _exceptionMessage); 1076 } 1077} 1078 1079/* void glDeleteProgram ( GLuint program ) */ 1080static void 1081android_glDeleteProgram__I 1082 (JNIEnv *_env, jobject _this, jint program) { 1083 glDeleteProgram( 1084 (GLuint)program 1085 ); 1086} 1087 1088/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ 1089static void 1090android_glDeleteRenderbuffers__I_3II 1091 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { 1092 jint _exception = 0; 1093 const char * _exceptionType = NULL; 1094 const char * _exceptionMessage = NULL; 1095 GLuint *renderbuffers_base = (GLuint *) 0; 1096 jint _remaining; 1097 GLuint *renderbuffers = (GLuint *) 0; 1098 1099 if (!renderbuffers_ref) { 1100 _exception = 1; 1101 _exceptionType = "java/lang/IllegalArgumentException"; 1102 _exceptionMessage = "renderbuffers == null"; 1103 goto exit; 1104 } 1105 if (offset < 0) { 1106 _exception = 1; 1107 _exceptionType = "java/lang/IllegalArgumentException"; 1108 _exceptionMessage = "offset < 0"; 1109 goto exit; 1110 } 1111 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; 1112 if (_remaining < n) { 1113 _exception = 1; 1114 _exceptionType = "java/lang/IllegalArgumentException"; 1115 _exceptionMessage = "length - offset < n < needed"; 1116 goto exit; 1117 } 1118 renderbuffers_base = (GLuint *) 1119 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); 1120 renderbuffers = renderbuffers_base + offset; 1121 1122 glDeleteRenderbuffers( 1123 (GLsizei)n, 1124 (GLuint *)renderbuffers 1125 ); 1126 1127exit: 1128 if (renderbuffers_base) { 1129 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, 1130 JNI_ABORT); 1131 } 1132 if (_exception) { 1133 jniThrowException(_env, _exceptionType, _exceptionMessage); 1134 } 1135} 1136 1137/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ 1138static void 1139android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 1140 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { 1141 jint _exception = 0; 1142 const char * _exceptionType = NULL; 1143 const char * _exceptionMessage = NULL; 1144 jintArray _array = (jintArray) 0; 1145 jint _bufferOffset = (jint) 0; 1146 jint _remaining; 1147 GLuint *renderbuffers = (GLuint *) 0; 1148 1149 if (!renderbuffers_buf) { 1150 _exception = 1; 1151 _exceptionType = "java/lang/IllegalArgumentException"; 1152 _exceptionMessage = "renderbuffers == null"; 1153 goto exit; 1154 } 1155 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1156 if (_remaining < n) { 1157 _exception = 1; 1158 _exceptionType = "java/lang/IllegalArgumentException"; 1159 _exceptionMessage = "remaining() < n < needed"; 1160 goto exit; 1161 } 1162 if (renderbuffers == NULL) { 1163 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1164 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); 1165 } 1166 glDeleteRenderbuffers( 1167 (GLsizei)n, 1168 (GLuint *)renderbuffers 1169 ); 1170 1171exit: 1172 if (_array) { 1173 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, JNI_ABORT); 1174 } 1175 if (_exception) { 1176 jniThrowException(_env, _exceptionType, _exceptionMessage); 1177 } 1178} 1179 1180/* void glDeleteShader ( GLuint shader ) */ 1181static void 1182android_glDeleteShader__I 1183 (JNIEnv *_env, jobject _this, jint shader) { 1184 glDeleteShader( 1185 (GLuint)shader 1186 ); 1187} 1188 1189/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ 1190static void 1191android_glDeleteTextures__I_3II 1192 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { 1193 jint _exception = 0; 1194 const char * _exceptionType = NULL; 1195 const char * _exceptionMessage = NULL; 1196 GLuint *textures_base = (GLuint *) 0; 1197 jint _remaining; 1198 GLuint *textures = (GLuint *) 0; 1199 1200 if (!textures_ref) { 1201 _exception = 1; 1202 _exceptionType = "java/lang/IllegalArgumentException"; 1203 _exceptionMessage = "textures == null"; 1204 goto exit; 1205 } 1206 if (offset < 0) { 1207 _exception = 1; 1208 _exceptionType = "java/lang/IllegalArgumentException"; 1209 _exceptionMessage = "offset < 0"; 1210 goto exit; 1211 } 1212 _remaining = _env->GetArrayLength(textures_ref) - offset; 1213 if (_remaining < n) { 1214 _exception = 1; 1215 _exceptionType = "java/lang/IllegalArgumentException"; 1216 _exceptionMessage = "length - offset < n < needed"; 1217 goto exit; 1218 } 1219 textures_base = (GLuint *) 1220 _env->GetIntArrayElements(textures_ref, (jboolean *)0); 1221 textures = textures_base + offset; 1222 1223 glDeleteTextures( 1224 (GLsizei)n, 1225 (GLuint *)textures 1226 ); 1227 1228exit: 1229 if (textures_base) { 1230 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, 1231 JNI_ABORT); 1232 } 1233 if (_exception) { 1234 jniThrowException(_env, _exceptionType, _exceptionMessage); 1235 } 1236} 1237 1238/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ 1239static void 1240android_glDeleteTextures__ILjava_nio_IntBuffer_2 1241 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { 1242 jint _exception = 0; 1243 const char * _exceptionType = NULL; 1244 const char * _exceptionMessage = NULL; 1245 jintArray _array = (jintArray) 0; 1246 jint _bufferOffset = (jint) 0; 1247 jint _remaining; 1248 GLuint *textures = (GLuint *) 0; 1249 1250 if (!textures_buf) { 1251 _exception = 1; 1252 _exceptionType = "java/lang/IllegalArgumentException"; 1253 _exceptionMessage = "textures == null"; 1254 goto exit; 1255 } 1256 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1257 if (_remaining < n) { 1258 _exception = 1; 1259 _exceptionType = "java/lang/IllegalArgumentException"; 1260 _exceptionMessage = "remaining() < n < needed"; 1261 goto exit; 1262 } 1263 if (textures == NULL) { 1264 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1265 textures = (GLuint *) (_texturesBase + _bufferOffset); 1266 } 1267 glDeleteTextures( 1268 (GLsizei)n, 1269 (GLuint *)textures 1270 ); 1271 1272exit: 1273 if (_array) { 1274 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT); 1275 } 1276 if (_exception) { 1277 jniThrowException(_env, _exceptionType, _exceptionMessage); 1278 } 1279} 1280 1281/* void glDepthFunc ( GLenum func ) */ 1282static void 1283android_glDepthFunc__I 1284 (JNIEnv *_env, jobject _this, jint func) { 1285 glDepthFunc( 1286 (GLenum)func 1287 ); 1288} 1289 1290/* void glDepthMask ( GLboolean flag ) */ 1291static void 1292android_glDepthMask__Z 1293 (JNIEnv *_env, jobject _this, jboolean flag) { 1294 glDepthMask( 1295 (GLboolean)flag 1296 ); 1297} 1298 1299/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ 1300static void 1301android_glDepthRangef__FF 1302 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { 1303 glDepthRangef( 1304 (GLclampf)zNear, 1305 (GLclampf)zFar 1306 ); 1307} 1308 1309/* void glDetachShader ( GLuint program, GLuint shader ) */ 1310static void 1311android_glDetachShader__II 1312 (JNIEnv *_env, jobject _this, jint program, jint shader) { 1313 glDetachShader( 1314 (GLuint)program, 1315 (GLuint)shader 1316 ); 1317} 1318 1319/* void glDisable ( GLenum cap ) */ 1320static void 1321android_glDisable__I 1322 (JNIEnv *_env, jobject _this, jint cap) { 1323 glDisable( 1324 (GLenum)cap 1325 ); 1326} 1327 1328/* void glDisableVertexAttribArray ( GLuint index ) */ 1329static void 1330android_glDisableVertexAttribArray__I 1331 (JNIEnv *_env, jobject _this, jint index) { 1332 glDisableVertexAttribArray( 1333 (GLuint)index 1334 ); 1335} 1336 1337/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ 1338static void 1339android_glDrawArrays__III 1340 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { 1341 glDrawArrays( 1342 (GLenum)mode, 1343 (GLint)first, 1344 (GLsizei)count 1345 ); 1346} 1347 1348/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ 1349static void 1350android_glDrawElements__IIII 1351 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { 1352 jint _exception = 0; 1353 const char * _exceptionType = NULL; 1354 const char * _exceptionMessage = NULL; 1355 glDrawElements( 1356 (GLenum)mode, 1357 (GLsizei)count, 1358 (GLenum)type, 1359 reinterpret_cast<GLvoid *>(offset) 1360 ); 1361 if (_exception) { 1362 jniThrowException(_env, _exceptionType, _exceptionMessage); 1363 } 1364} 1365 1366/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ 1367static void 1368android_glDrawElements__IIILjava_nio_Buffer_2 1369 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) { 1370 jint _exception = 0; 1371 const char * _exceptionType = NULL; 1372 const char * _exceptionMessage = NULL; 1373 jarray _array = (jarray) 0; 1374 jint _bufferOffset = (jint) 0; 1375 jint _remaining; 1376 GLvoid *indices = (GLvoid *) 0; 1377 1378 if (!indices_buf) { 1379 _exception = 1; 1380 _exceptionType = "java/lang/IllegalArgumentException"; 1381 _exceptionMessage = "indices == null"; 1382 goto exit; 1383 } 1384 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1385 if (_remaining < count) { 1386 _exception = 1; 1387 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; 1388 _exceptionMessage = "remaining() < count < needed"; 1389 goto exit; 1390 } 1391 if (indices == NULL) { 1392 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1393 indices = (GLvoid *) (_indicesBase + _bufferOffset); 1394 } 1395 glDrawElements( 1396 (GLenum)mode, 1397 (GLsizei)count, 1398 (GLenum)type, 1399 (GLvoid *)indices 1400 ); 1401 1402exit: 1403 if (_array) { 1404 releasePointer(_env, _array, indices, JNI_FALSE); 1405 } 1406 if (_exception) { 1407 jniThrowException(_env, _exceptionType, _exceptionMessage); 1408 } 1409} 1410 1411/* void glEnable ( GLenum cap ) */ 1412static void 1413android_glEnable__I 1414 (JNIEnv *_env, jobject _this, jint cap) { 1415 glEnable( 1416 (GLenum)cap 1417 ); 1418} 1419 1420/* void glEnableVertexAttribArray ( GLuint index ) */ 1421static void 1422android_glEnableVertexAttribArray__I 1423 (JNIEnv *_env, jobject _this, jint index) { 1424 glEnableVertexAttribArray( 1425 (GLuint)index 1426 ); 1427} 1428 1429/* void glFinish ( void ) */ 1430static void 1431android_glFinish__ 1432 (JNIEnv *_env, jobject _this) { 1433 glFinish(); 1434} 1435 1436/* void glFlush ( void ) */ 1437static void 1438android_glFlush__ 1439 (JNIEnv *_env, jobject _this) { 1440 glFlush(); 1441} 1442 1443/* void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) */ 1444static void 1445android_glFramebufferRenderbuffer__IIII 1446 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { 1447 glFramebufferRenderbuffer( 1448 (GLenum)target, 1449 (GLenum)attachment, 1450 (GLenum)renderbuffertarget, 1451 (GLuint)renderbuffer 1452 ); 1453} 1454 1455/* void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) */ 1456static void 1457android_glFramebufferTexture2D__IIIII 1458 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { 1459 glFramebufferTexture2D( 1460 (GLenum)target, 1461 (GLenum)attachment, 1462 (GLenum)textarget, 1463 (GLuint)texture, 1464 (GLint)level 1465 ); 1466} 1467 1468/* void glFrontFace ( GLenum mode ) */ 1469static void 1470android_glFrontFace__I 1471 (JNIEnv *_env, jobject _this, jint mode) { 1472 glFrontFace( 1473 (GLenum)mode 1474 ); 1475} 1476 1477/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 1478static void 1479android_glGenBuffers__I_3II 1480 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 1481 jint _exception = 0; 1482 const char * _exceptionType = NULL; 1483 const char * _exceptionMessage = NULL; 1484 GLuint *buffers_base = (GLuint *) 0; 1485 jint _remaining; 1486 GLuint *buffers = (GLuint *) 0; 1487 1488 if (!buffers_ref) { 1489 _exception = 1; 1490 _exceptionType = "java/lang/IllegalArgumentException"; 1491 _exceptionMessage = "buffers == 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(buffers_ref) - offset; 1501 if (_remaining < n) { 1502 _exception = 1; 1503 _exceptionType = "java/lang/IllegalArgumentException"; 1504 _exceptionMessage = "length - offset < n < needed"; 1505 goto exit; 1506 } 1507 buffers_base = (GLuint *) 1508 _env->GetIntArrayElements(buffers_ref, (jboolean *)0); 1509 buffers = buffers_base + offset; 1510 1511 glGenBuffers( 1512 (GLsizei)n, 1513 (GLuint *)buffers 1514 ); 1515 1516exit: 1517 if (buffers_base) { 1518 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, 1519 _exception ? JNI_ABORT: 0); 1520 } 1521 if (_exception) { 1522 jniThrowException(_env, _exceptionType, _exceptionMessage); 1523 } 1524} 1525 1526/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 1527static void 1528android_glGenBuffers__ILjava_nio_IntBuffer_2 1529 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 1530 jint _exception = 0; 1531 const char * _exceptionType = NULL; 1532 const char * _exceptionMessage = NULL; 1533 jintArray _array = (jintArray) 0; 1534 jint _bufferOffset = (jint) 0; 1535 jint _remaining; 1536 GLuint *buffers = (GLuint *) 0; 1537 1538 if (!buffers_buf) { 1539 _exception = 1; 1540 _exceptionType = "java/lang/IllegalArgumentException"; 1541 _exceptionMessage = "buffers == null"; 1542 goto exit; 1543 } 1544 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1545 if (_remaining < n) { 1546 _exception = 1; 1547 _exceptionType = "java/lang/IllegalArgumentException"; 1548 _exceptionMessage = "remaining() < n < needed"; 1549 goto exit; 1550 } 1551 if (buffers == NULL) { 1552 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1553 buffers = (GLuint *) (_buffersBase + _bufferOffset); 1554 } 1555 glGenBuffers( 1556 (GLsizei)n, 1557 (GLuint *)buffers 1558 ); 1559 1560exit: 1561 if (_array) { 1562 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0); 1563 } 1564 if (_exception) { 1565 jniThrowException(_env, _exceptionType, _exceptionMessage); 1566 } 1567} 1568 1569/* void glGenerateMipmap ( GLenum target ) */ 1570static void 1571android_glGenerateMipmap__I 1572 (JNIEnv *_env, jobject _this, jint target) { 1573 glGenerateMipmap( 1574 (GLenum)target 1575 ); 1576} 1577 1578/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ 1579static void 1580android_glGenFramebuffers__I_3II 1581 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { 1582 jint _exception = 0; 1583 const char * _exceptionType = NULL; 1584 const char * _exceptionMessage = NULL; 1585 GLuint *framebuffers_base = (GLuint *) 0; 1586 jint _remaining; 1587 GLuint *framebuffers = (GLuint *) 0; 1588 1589 if (!framebuffers_ref) { 1590 _exception = 1; 1591 _exceptionType = "java/lang/IllegalArgumentException"; 1592 _exceptionMessage = "framebuffers == null"; 1593 goto exit; 1594 } 1595 if (offset < 0) { 1596 _exception = 1; 1597 _exceptionType = "java/lang/IllegalArgumentException"; 1598 _exceptionMessage = "offset < 0"; 1599 goto exit; 1600 } 1601 _remaining = _env->GetArrayLength(framebuffers_ref) - offset; 1602 if (_remaining < n) { 1603 _exception = 1; 1604 _exceptionType = "java/lang/IllegalArgumentException"; 1605 _exceptionMessage = "length - offset < n < needed"; 1606 goto exit; 1607 } 1608 framebuffers_base = (GLuint *) 1609 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); 1610 framebuffers = framebuffers_base + offset; 1611 1612 glGenFramebuffers( 1613 (GLsizei)n, 1614 (GLuint *)framebuffers 1615 ); 1616 1617exit: 1618 if (framebuffers_base) { 1619 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, 1620 _exception ? JNI_ABORT: 0); 1621 } 1622 if (_exception) { 1623 jniThrowException(_env, _exceptionType, _exceptionMessage); 1624 } 1625} 1626 1627/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ 1628static void 1629android_glGenFramebuffers__ILjava_nio_IntBuffer_2 1630 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { 1631 jint _exception = 0; 1632 const char * _exceptionType = NULL; 1633 const char * _exceptionMessage = NULL; 1634 jintArray _array = (jintArray) 0; 1635 jint _bufferOffset = (jint) 0; 1636 jint _remaining; 1637 GLuint *framebuffers = (GLuint *) 0; 1638 1639 if (!framebuffers_buf) { 1640 _exception = 1; 1641 _exceptionType = "java/lang/IllegalArgumentException"; 1642 _exceptionMessage = "framebuffers == null"; 1643 goto exit; 1644 } 1645 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1646 if (_remaining < n) { 1647 _exception = 1; 1648 _exceptionType = "java/lang/IllegalArgumentException"; 1649 _exceptionMessage = "remaining() < n < needed"; 1650 goto exit; 1651 } 1652 if (framebuffers == NULL) { 1653 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1654 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); 1655 } 1656 glGenFramebuffers( 1657 (GLsizei)n, 1658 (GLuint *)framebuffers 1659 ); 1660 1661exit: 1662 if (_array) { 1663 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); 1664 } 1665 if (_exception) { 1666 jniThrowException(_env, _exceptionType, _exceptionMessage); 1667 } 1668} 1669 1670/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ 1671static void 1672android_glGenRenderbuffers__I_3II 1673 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { 1674 jint _exception = 0; 1675 const char * _exceptionType = NULL; 1676 const char * _exceptionMessage = NULL; 1677 GLuint *renderbuffers_base = (GLuint *) 0; 1678 jint _remaining; 1679 GLuint *renderbuffers = (GLuint *) 0; 1680 1681 if (!renderbuffers_ref) { 1682 _exception = 1; 1683 _exceptionType = "java/lang/IllegalArgumentException"; 1684 _exceptionMessage = "renderbuffers == null"; 1685 goto exit; 1686 } 1687 if (offset < 0) { 1688 _exception = 1; 1689 _exceptionType = "java/lang/IllegalArgumentException"; 1690 _exceptionMessage = "offset < 0"; 1691 goto exit; 1692 } 1693 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; 1694 if (_remaining < n) { 1695 _exception = 1; 1696 _exceptionType = "java/lang/IllegalArgumentException"; 1697 _exceptionMessage = "length - offset < n < needed"; 1698 goto exit; 1699 } 1700 renderbuffers_base = (GLuint *) 1701 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); 1702 renderbuffers = renderbuffers_base + offset; 1703 1704 glGenRenderbuffers( 1705 (GLsizei)n, 1706 (GLuint *)renderbuffers 1707 ); 1708 1709exit: 1710 if (renderbuffers_base) { 1711 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, 1712 _exception ? JNI_ABORT: 0); 1713 } 1714 if (_exception) { 1715 jniThrowException(_env, _exceptionType, _exceptionMessage); 1716 } 1717} 1718 1719/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ 1720static void 1721android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 1722 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { 1723 jint _exception = 0; 1724 const char * _exceptionType = NULL; 1725 const char * _exceptionMessage = NULL; 1726 jintArray _array = (jintArray) 0; 1727 jint _bufferOffset = (jint) 0; 1728 jint _remaining; 1729 GLuint *renderbuffers = (GLuint *) 0; 1730 1731 if (!renderbuffers_buf) { 1732 _exception = 1; 1733 _exceptionType = "java/lang/IllegalArgumentException"; 1734 _exceptionMessage = "renderbuffers == null"; 1735 goto exit; 1736 } 1737 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1738 if (_remaining < n) { 1739 _exception = 1; 1740 _exceptionType = "java/lang/IllegalArgumentException"; 1741 _exceptionMessage = "remaining() < n < needed"; 1742 goto exit; 1743 } 1744 if (renderbuffers == NULL) { 1745 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1746 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); 1747 } 1748 glGenRenderbuffers( 1749 (GLsizei)n, 1750 (GLuint *)renderbuffers 1751 ); 1752 1753exit: 1754 if (_array) { 1755 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); 1756 } 1757 if (_exception) { 1758 jniThrowException(_env, _exceptionType, _exceptionMessage); 1759 } 1760} 1761 1762/* void glGenTextures ( GLsizei n, GLuint *textures ) */ 1763static void 1764android_glGenTextures__I_3II 1765 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { 1766 jint _exception = 0; 1767 const char * _exceptionType = NULL; 1768 const char * _exceptionMessage = NULL; 1769 GLuint *textures_base = (GLuint *) 0; 1770 jint _remaining; 1771 GLuint *textures = (GLuint *) 0; 1772 1773 if (!textures_ref) { 1774 _exception = 1; 1775 _exceptionType = "java/lang/IllegalArgumentException"; 1776 _exceptionMessage = "textures == null"; 1777 goto exit; 1778 } 1779 if (offset < 0) { 1780 _exception = 1; 1781 _exceptionType = "java/lang/IllegalArgumentException"; 1782 _exceptionMessage = "offset < 0"; 1783 goto exit; 1784 } 1785 _remaining = _env->GetArrayLength(textures_ref) - offset; 1786 if (_remaining < n) { 1787 _exception = 1; 1788 _exceptionType = "java/lang/IllegalArgumentException"; 1789 _exceptionMessage = "length - offset < n < needed"; 1790 goto exit; 1791 } 1792 textures_base = (GLuint *) 1793 _env->GetIntArrayElements(textures_ref, (jboolean *)0); 1794 textures = textures_base + offset; 1795 1796 glGenTextures( 1797 (GLsizei)n, 1798 (GLuint *)textures 1799 ); 1800 1801exit: 1802 if (textures_base) { 1803 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, 1804 _exception ? JNI_ABORT: 0); 1805 } 1806 if (_exception) { 1807 jniThrowException(_env, _exceptionType, _exceptionMessage); 1808 } 1809} 1810 1811/* void glGenTextures ( GLsizei n, GLuint *textures ) */ 1812static void 1813android_glGenTextures__ILjava_nio_IntBuffer_2 1814 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { 1815 jint _exception = 0; 1816 const char * _exceptionType = NULL; 1817 const char * _exceptionMessage = NULL; 1818 jintArray _array = (jintArray) 0; 1819 jint _bufferOffset = (jint) 0; 1820 jint _remaining; 1821 GLuint *textures = (GLuint *) 0; 1822 1823 if (!textures_buf) { 1824 _exception = 1; 1825 _exceptionType = "java/lang/IllegalArgumentException"; 1826 _exceptionMessage = "textures == null"; 1827 goto exit; 1828 } 1829 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1830 if (_remaining < n) { 1831 _exception = 1; 1832 _exceptionType = "java/lang/IllegalArgumentException"; 1833 _exceptionMessage = "remaining() < n < needed"; 1834 goto exit; 1835 } 1836 if (textures == NULL) { 1837 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 1838 textures = (GLuint *) (_texturesBase + _bufferOffset); 1839 } 1840 glGenTextures( 1841 (GLsizei)n, 1842 (GLuint *)textures 1843 ); 1844 1845exit: 1846 if (_array) { 1847 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0); 1848 } 1849 if (_exception) { 1850 jniThrowException(_env, _exceptionType, _exceptionMessage); 1851 } 1852} 1853 1854/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 1855static void 1856android_glGetActiveAttrib__III_3II_3II_3II_3BI 1857 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { 1858 jint _exception = 0; 1859 const char * _exceptionType; 1860 const char * _exceptionMessage; 1861 GLsizei *length_base = (GLsizei *) 0; 1862 jint _lengthRemaining; 1863 GLsizei *length = (GLsizei *) 0; 1864 GLint *size_base = (GLint *) 0; 1865 jint _sizeRemaining; 1866 GLint *size = (GLint *) 0; 1867 GLenum *type_base = (GLenum *) 0; 1868 jint _typeRemaining; 1869 GLenum *type = (GLenum *) 0; 1870 char *name_base = (char *) 0; 1871 jint _nameRemaining; 1872 char *name = (char *) 0; 1873 1874 if (length_ref) { 1875 if (lengthOffset < 0) { 1876 _exception = 1; 1877 _exceptionType = "java/lang/IllegalArgumentException"; 1878 _exceptionMessage = "lengthOffset < 0"; 1879 goto exit; 1880 } 1881 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 1882 length_base = (GLsizei *) 1883 _env->GetIntArrayElements(length_ref, (jboolean *)0); 1884 length = length_base + lengthOffset; 1885 } 1886 1887 if (!size_ref) { 1888 _exception = 1; 1889 _exceptionType = "java/lang/IllegalArgumentException"; 1890 _exceptionMessage = "size == null"; 1891 goto exit; 1892 } 1893 if (sizeOffset < 0) { 1894 _exception = 1; 1895 _exceptionType = "java/lang/IllegalArgumentException"; 1896 _exceptionMessage = "sizeOffset < 0"; 1897 goto exit; 1898 } 1899 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 1900 size_base = (GLint *) 1901 _env->GetIntArrayElements(size_ref, (jboolean *)0); 1902 size = size_base + sizeOffset; 1903 1904 if (!type_ref) { 1905 _exception = 1; 1906 _exceptionType = "java/lang/IllegalArgumentException"; 1907 _exceptionMessage = "type == null"; 1908 goto exit; 1909 } 1910 if (typeOffset < 0) { 1911 _exception = 1; 1912 _exceptionType = "java/lang/IllegalArgumentException"; 1913 _exceptionMessage = "typeOffset < 0"; 1914 goto exit; 1915 } 1916 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 1917 type_base = (GLenum *) 1918 _env->GetIntArrayElements(type_ref, (jboolean *)0); 1919 type = type_base + typeOffset; 1920 1921 if (!name_ref) { 1922 _exception = 1; 1923 _exceptionType = "java/lang/IllegalArgumentException"; 1924 _exceptionMessage = "name == null"; 1925 goto exit; 1926 } 1927 if (nameOffset < 0) { 1928 _exception = 1; 1929 _exceptionType = "java/lang/IllegalArgumentException"; 1930 _exceptionMessage = "nameOffset < 0"; 1931 goto exit; 1932 } 1933 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; 1934 name_base = (char *) 1935 _env->GetByteArrayElements(name_ref, (jboolean *)0); 1936 name = name_base + nameOffset; 1937 1938 glGetActiveAttrib( 1939 (GLuint)program, 1940 (GLuint)index, 1941 (GLsizei)bufsize, 1942 (GLsizei *)length, 1943 (GLint *)size, 1944 (GLenum *)type, 1945 (char *)name 1946 ); 1947 1948exit: 1949 if (name_base) { 1950 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base, 1951 _exception ? JNI_ABORT: 0); 1952 } 1953 if (type_base) { 1954 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 1955 _exception ? JNI_ABORT: 0); 1956 } 1957 if (size_base) { 1958 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 1959 _exception ? JNI_ABORT: 0); 1960 } 1961 if (length_base) { 1962 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 1963 _exception ? JNI_ABORT: 0); 1964 } 1965 if (_exception) { 1966 jniThrowException(_env, _exceptionType, _exceptionMessage); 1967 } 1968} 1969 1970/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 1971static void 1972android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B 1973 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { 1974 jintArray _lengthArray = (jintArray) 0; 1975 jint _lengthBufferOffset = (jint) 0; 1976 jintArray _sizeArray = (jintArray) 0; 1977 jint _sizeBufferOffset = (jint) 0; 1978 jintArray _typeArray = (jintArray) 0; 1979 jint _typeBufferOffset = (jint) 0; 1980 jint _lengthRemaining; 1981 GLsizei *length = (GLsizei *) 0; 1982 jint _sizeRemaining; 1983 GLint *size = (GLint *) 0; 1984 jint _typeRemaining; 1985 GLenum *type = (GLenum *) 0; 1986 1987 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset); 1988 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 1989 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 1990 if (length == NULL) { 1991 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0); 1992 length = (GLsizei *) (_lengthBase + _lengthBufferOffset); 1993 } 1994 if (size == NULL) { 1995 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 1996 size = (GLint *) (_sizeBase + _sizeBufferOffset); 1997 } 1998 if (type == NULL) { 1999 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2000 type = (GLenum *) (_typeBase + _typeBufferOffset); 2001 } 2002 glGetActiveAttrib( 2003 (GLuint)program, 2004 (GLuint)index, 2005 (GLsizei)bufsize, 2006 (GLsizei *)length, 2007 (GLint *)size, 2008 (GLenum *)type, 2009 reinterpret_cast<char *>(name) 2010 ); 2011 if (_typeArray) { 2012 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2013 } 2014 if (_sizeArray) { 2015 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2016 } 2017 if (_lengthArray) { 2018 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE); 2019 } 2020} 2021 2022/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2023static jstring 2024android_glGetActiveAttrib1 2025 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { 2026 jint _exception = 0; 2027 const char * _exceptionType; 2028 const char * _exceptionMessage; 2029 GLint *size_base = (GLint *) 0; 2030 jint _sizeRemaining; 2031 GLint *size = (GLint *) 0; 2032 GLenum *type_base = (GLenum *) 0; 2033 jint _typeRemaining; 2034 GLenum *type = (GLenum *) 0; 2035 2036 jstring result = 0; 2037 2038 GLint len = 0; 2039 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); 2040 if (!len) { 2041 return _env->NewStringUTF(""); 2042 } 2043 char* buf = (char*) malloc(len); 2044 2045 if (buf == NULL) { 2046 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2047 return NULL; 2048 } 2049 if (!size_ref) { 2050 _exception = 1; 2051 _exceptionType = "java/lang/IllegalArgumentException"; 2052 _exceptionMessage = "size == null"; 2053 goto exit; 2054 } 2055 if (sizeOffset < 0) { 2056 _exception = 1; 2057 _exceptionType = "java/lang/IllegalArgumentException"; 2058 _exceptionMessage = "sizeOffset < 0"; 2059 goto exit; 2060 } 2061 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 2062 size_base = (GLint *) 2063 _env->GetIntArrayElements(size_ref, (jboolean *)0); 2064 size = size_base + sizeOffset; 2065 2066 if (!type_ref) { 2067 _exception = 1; 2068 _exceptionType = "java/lang/IllegalArgumentException"; 2069 _exceptionMessage = "type == null"; 2070 goto exit; 2071 } 2072 if (typeOffset < 0) { 2073 _exception = 1; 2074 _exceptionType = "java/lang/IllegalArgumentException"; 2075 _exceptionMessage = "typeOffset < 0"; 2076 goto exit; 2077 } 2078 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 2079 type_base = (GLenum *) 2080 _env->GetIntArrayElements(type_ref, (jboolean *)0); 2081 type = type_base + typeOffset; 2082 2083 glGetActiveAttrib( 2084 (GLuint)program, 2085 (GLuint)index, 2086 (GLsizei)len, 2087 NULL, 2088 (GLint *)size, 2089 (GLenum *)type, 2090 (char *)buf 2091 ); 2092exit: 2093 if (type_base) { 2094 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2095 _exception ? JNI_ABORT: 0); 2096 } 2097 if (size_base) { 2098 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2099 _exception ? JNI_ABORT: 0); 2100 } 2101 if (_exception != 1) { 2102 result = _env->NewStringUTF(buf); 2103 } 2104 if (buf) { 2105 free(buf); 2106 } 2107 if (_exception) { 2108 jniThrowException(_env, _exceptionType, _exceptionMessage); 2109 } 2110 if (result == 0) { 2111 result = _env->NewStringUTF(""); 2112 } 2113 2114 return result; 2115} 2116 2117/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2118static jstring 2119android_glGetActiveAttrib2 2120 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { 2121 jintArray _sizeArray = (jintArray) 0; 2122 jint _sizeBufferOffset = (jint) 0; 2123 jintArray _typeArray = (jintArray) 0; 2124 jint _typeBufferOffset = (jint) 0; 2125 jint _lengthRemaining; 2126 GLsizei *length = (GLsizei *) 0; 2127 jint _sizeRemaining; 2128 GLint *size = (GLint *) 0; 2129 jint _typeRemaining; 2130 GLenum *type = (GLenum *) 0; 2131 2132 jstring result = 0; 2133 2134 GLint len = 0; 2135 glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); 2136 if (!len) { 2137 return _env->NewStringUTF(""); 2138 } 2139 char* buf = (char*) malloc(len); 2140 2141 if (buf == NULL) { 2142 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2143 return NULL; 2144 } 2145 2146 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 2147 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 2148 if (size == NULL) { 2149 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 2150 size = (GLint *) (_sizeBase + _sizeBufferOffset); 2151 } 2152 if (type == NULL) { 2153 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2154 type = (GLenum *) (_typeBase + _typeBufferOffset); 2155 } 2156 glGetActiveAttrib( 2157 (GLuint)program, 2158 (GLuint)index, 2159 (GLsizei)len, 2160 NULL, 2161 (GLint *)size, 2162 (GLenum *)type, 2163 (char *)buf 2164 ); 2165 2166 if (_typeArray) { 2167 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2168 } 2169 if (_sizeArray) { 2170 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2171 } 2172 result = _env->NewStringUTF(buf); 2173 if (buf) { 2174 free(buf); 2175 } 2176 return result; 2177} 2178/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2179static void 2180android_glGetActiveUniform__III_3II_3II_3II_3BI 2181 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { 2182 jint _exception = 0; 2183 const char * _exceptionType; 2184 const char * _exceptionMessage; 2185 GLsizei *length_base = (GLsizei *) 0; 2186 jint _lengthRemaining; 2187 GLsizei *length = (GLsizei *) 0; 2188 GLint *size_base = (GLint *) 0; 2189 jint _sizeRemaining; 2190 GLint *size = (GLint *) 0; 2191 GLenum *type_base = (GLenum *) 0; 2192 jint _typeRemaining; 2193 GLenum *type = (GLenum *) 0; 2194 char *name_base = (char *) 0; 2195 jint _nameRemaining; 2196 char *name = (char *) 0; 2197 2198 if (length_ref) { 2199 if (lengthOffset < 0) { 2200 _exception = 1; 2201 _exceptionType = "java/lang/IllegalArgumentException"; 2202 _exceptionMessage = "lengthOffset < 0"; 2203 goto exit; 2204 } 2205 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 2206 length_base = (GLsizei *) 2207 _env->GetIntArrayElements(length_ref, (jboolean *)0); 2208 length = length_base + lengthOffset; 2209 } 2210 2211 if (!size_ref) { 2212 _exception = 1; 2213 _exceptionType = "java/lang/IllegalArgumentException"; 2214 _exceptionMessage = "size == null"; 2215 goto exit; 2216 } 2217 if (sizeOffset < 0) { 2218 _exception = 1; 2219 _exceptionType = "java/lang/IllegalArgumentException"; 2220 _exceptionMessage = "sizeOffset < 0"; 2221 goto exit; 2222 } 2223 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 2224 size_base = (GLint *) 2225 _env->GetIntArrayElements(size_ref, (jboolean *)0); 2226 size = size_base + sizeOffset; 2227 2228 if (!type_ref) { 2229 _exception = 1; 2230 _exceptionType = "java/lang/IllegalArgumentException"; 2231 _exceptionMessage = "type == null"; 2232 goto exit; 2233 } 2234 if (typeOffset < 0) { 2235 _exception = 1; 2236 _exceptionType = "java/lang/IllegalArgumentException"; 2237 _exceptionMessage = "typeOffset < 0"; 2238 goto exit; 2239 } 2240 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 2241 type_base = (GLenum *) 2242 _env->GetIntArrayElements(type_ref, (jboolean *)0); 2243 type = type_base + typeOffset; 2244 2245 if (!name_ref) { 2246 _exception = 1; 2247 _exceptionType = "java/lang/IllegalArgumentException"; 2248 _exceptionMessage = "name == null"; 2249 goto exit; 2250 } 2251 if (nameOffset < 0) { 2252 _exception = 1; 2253 _exceptionType = "java/lang/IllegalArgumentException"; 2254 _exceptionMessage = "nameOffset < 0"; 2255 goto exit; 2256 } 2257 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; 2258 name_base = (char *) 2259 _env->GetByteArrayElements(name_ref, (jboolean *)0); 2260 name = name_base + nameOffset; 2261 2262 glGetActiveUniform( 2263 (GLuint)program, 2264 (GLuint)index, 2265 (GLsizei)bufsize, 2266 (GLsizei *)length, 2267 (GLint *)size, 2268 (GLenum *)type, 2269 (char *)name 2270 ); 2271 2272exit: 2273 if (name_base) { 2274 _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base, 2275 _exception ? JNI_ABORT: 0); 2276 } 2277 if (type_base) { 2278 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2279 _exception ? JNI_ABORT: 0); 2280 } 2281 if (size_base) { 2282 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2283 _exception ? JNI_ABORT: 0); 2284 } 2285 if (length_base) { 2286 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 2287 _exception ? JNI_ABORT: 0); 2288 } 2289 if (_exception) { 2290 jniThrowException(_env, _exceptionType, _exceptionMessage); 2291 } 2292} 2293 2294/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2295static void 2296android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B 2297 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { 2298 jintArray _lengthArray = (jintArray) 0; 2299 jint _lengthBufferOffset = (jint) 0; 2300 jintArray _sizeArray = (jintArray) 0; 2301 jint _sizeBufferOffset = (jint) 0; 2302 jintArray _typeArray = (jintArray) 0; 2303 jint _typeBufferOffset = (jint) 0; 2304 jint _lengthRemaining; 2305 GLsizei *length = (GLsizei *) 0; 2306 jint _sizeRemaining; 2307 GLint *size = (GLint *) 0; 2308 jint _typeRemaining; 2309 GLenum *type = (GLenum *) 0; 2310 2311 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset); 2312 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 2313 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 2314 if (length == NULL) { 2315 char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0); 2316 length = (GLsizei *) (_lengthBase + _lengthBufferOffset); 2317 } 2318 if (size == NULL) { 2319 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 2320 size = (GLint *) (_sizeBase + _sizeBufferOffset); 2321 } 2322 if (type == NULL) { 2323 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2324 type = (GLenum *) (_typeBase + _typeBufferOffset); 2325 } 2326 glGetActiveUniform( 2327 (GLuint)program, 2328 (GLuint)index, 2329 (GLsizei)bufsize, 2330 (GLsizei *)length, 2331 (GLint *)size, 2332 (GLenum *)type, 2333 reinterpret_cast<char *>(name) 2334 ); 2335 if (_typeArray) { 2336 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2337 } 2338 if (_sizeArray) { 2339 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2340 } 2341 if (_lengthArray) { 2342 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE); 2343 } 2344} 2345 2346/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2347static jstring 2348android_glGetActiveUniform1 2349 (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { 2350 jint _exception = 0; 2351 const char * _exceptionType; 2352 const char * _exceptionMessage; 2353 2354 GLint *size_base = (GLint *) 0; 2355 jint _sizeRemaining; 2356 GLint *size = (GLint *) 0; 2357 2358 GLenum *type_base = (GLenum *) 0; 2359 jint _typeRemaining; 2360 GLenum *type = (GLenum *) 0; 2361 2362 jstring result = 0; 2363 2364 GLint len = 0; 2365 glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len); 2366 if (!len) { 2367 return _env->NewStringUTF(""); 2368 } 2369 char* buf = (char*) malloc(len); 2370 2371 if (buf == NULL) { 2372 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2373 return NULL; 2374 } 2375 2376 if (!size_ref) { 2377 _exception = 1; 2378 _exceptionType = "java/lang/IllegalArgumentException"; 2379 _exceptionMessage = "size == null"; 2380 goto exit; 2381 } 2382 if (sizeOffset < 0) { 2383 _exception = 1; 2384 _exceptionType = "java/lang/IllegalArgumentException"; 2385 _exceptionMessage = "sizeOffset < 0"; 2386 goto exit; 2387 } 2388 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 2389 size_base = (GLint *) 2390 _env->GetIntArrayElements(size_ref, (jboolean *)0); 2391 size = size_base + sizeOffset; 2392 2393 if (!type_ref) { 2394 _exception = 1; 2395 _exceptionType = "java/lang/IllegalArgumentException"; 2396 _exceptionMessage = "type == null"; 2397 goto exit; 2398 } 2399 if (typeOffset < 0) { 2400 _exception = 1; 2401 _exceptionType = "java/lang/IllegalArgumentException"; 2402 _exceptionMessage = "typeOffset < 0"; 2403 goto exit; 2404 } 2405 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 2406 type_base = (GLenum *) 2407 _env->GetIntArrayElements(type_ref, (jboolean *)0); 2408 type = type_base + typeOffset; 2409 2410 glGetActiveUniform( 2411 (GLuint)program, 2412 (GLuint)index, 2413 (GLsizei)len, 2414 NULL, 2415 (GLint *)size, 2416 (GLenum *)type, 2417 (char *)buf 2418 ); 2419 2420exit: 2421 if (type_base) { 2422 _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2423 _exception ? JNI_ABORT: 0); 2424 } 2425 if (size_base) { 2426 _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2427 _exception ? JNI_ABORT: 0); 2428 } 2429 if (_exception != 1) { 2430 result = _env->NewStringUTF(buf); 2431 } 2432 if (buf) { 2433 free(buf); 2434 } 2435 if (_exception) { 2436 jniThrowException(_env, _exceptionType, _exceptionMessage); 2437 } 2438 if (result == 0) { 2439 result = _env->NewStringUTF(""); 2440 } 2441 return result; 2442} 2443 2444/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2445static jstring 2446android_glGetActiveUniform2 2447 (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { 2448 jintArray _sizeArray = (jintArray) 0; 2449 jint _sizeBufferOffset = (jint) 0; 2450 jintArray _typeArray = (jintArray) 0; 2451 jint _typeBufferOffset = (jint) 0; 2452 jint _sizeRemaining; 2453 GLint *size = (GLint *) 0; 2454 jint _typeRemaining; 2455 GLenum *type = (GLenum *) 0; 2456 2457 jstring result = 0; 2458 GLint len = 0; 2459 glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len); 2460 if (!len) { 2461 return _env->NewStringUTF(""); 2462 } 2463 char* buf = (char*) malloc(len); 2464 2465 if (buf == NULL) { 2466 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2467 return NULL; 2468 } 2469 2470 size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 2471 type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 2472 2473 if (size == NULL) { 2474 char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 2475 size = (GLint *) (_sizeBase + _sizeBufferOffset); 2476 } 2477 if (type == NULL) { 2478 char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2479 type = (GLenum *) (_typeBase + _typeBufferOffset); 2480 } 2481 glGetActiveUniform( 2482 (GLuint)program, 2483 (GLuint)index, 2484 len, 2485 NULL, 2486 (GLint *)size, 2487 (GLenum *)type, 2488 (char *)buf 2489 ); 2490 2491 if (_typeArray) { 2492 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2493 } 2494 if (_sizeArray) { 2495 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2496 } 2497 result = _env->NewStringUTF(buf); 2498 if (buf) { 2499 free(buf); 2500 } 2501 return result; 2502} 2503/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ 2504static void 2505android_glGetAttachedShaders__II_3II_3II 2506 (JNIEnv *_env, jobject _this, jint program, jint maxcount, jintArray count_ref, jint countOffset, jintArray shaders_ref, jint shadersOffset) { 2507 jint _exception = 0; 2508 const char * _exceptionType = NULL; 2509 const char * _exceptionMessage = NULL; 2510 GLsizei *count_base = (GLsizei *) 0; 2511 jint _countRemaining; 2512 GLsizei *count = (GLsizei *) 0; 2513 GLuint *shaders_base = (GLuint *) 0; 2514 jint _shadersRemaining; 2515 GLuint *shaders = (GLuint *) 0; 2516 2517 if (count_ref) { 2518 if (countOffset < 0) { 2519 _exception = 1; 2520 _exceptionType = "java/lang/IllegalArgumentException"; 2521 _exceptionMessage = "countOffset < 0"; 2522 goto exit; 2523 } 2524 _countRemaining = _env->GetArrayLength(count_ref) - countOffset; 2525 if (_countRemaining < 1) { 2526 _exception = 1; 2527 _exceptionType = "java/lang/IllegalArgumentException"; 2528 _exceptionMessage = "length - countOffset < 1 < needed"; 2529 goto exit; 2530 } 2531 count_base = (GLsizei *) 2532 _env->GetIntArrayElements(count_ref, (jboolean *)0); 2533 count = count_base + countOffset; 2534 } 2535 2536 if (!shaders_ref) { 2537 _exception = 1; 2538 _exceptionType = "java/lang/IllegalArgumentException"; 2539 _exceptionMessage = "shaders == null"; 2540 goto exit; 2541 } 2542 if (shadersOffset < 0) { 2543 _exception = 1; 2544 _exceptionType = "java/lang/IllegalArgumentException"; 2545 _exceptionMessage = "shadersOffset < 0"; 2546 goto exit; 2547 } 2548 _shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset; 2549 if (_shadersRemaining < maxcount) { 2550 _exception = 1; 2551 _exceptionType = "java/lang/IllegalArgumentException"; 2552 _exceptionMessage = "length - shadersOffset < maxcount < needed"; 2553 goto exit; 2554 } 2555 shaders_base = (GLuint *) 2556 _env->GetIntArrayElements(shaders_ref, (jboolean *)0); 2557 shaders = shaders_base + shadersOffset; 2558 2559 glGetAttachedShaders( 2560 (GLuint)program, 2561 (GLsizei)maxcount, 2562 (GLsizei *)count, 2563 (GLuint *)shaders 2564 ); 2565 2566exit: 2567 if (shaders_base) { 2568 _env->ReleaseIntArrayElements(shaders_ref, (jint*)shaders_base, 2569 _exception ? JNI_ABORT: 0); 2570 } 2571 if (count_base) { 2572 _env->ReleaseIntArrayElements(count_ref, (jint*)count_base, 2573 _exception ? JNI_ABORT: 0); 2574 } 2575 if (_exception) { 2576 jniThrowException(_env, _exceptionType, _exceptionMessage); 2577 } 2578} 2579 2580/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ 2581static void 2582android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 2583 (JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) { 2584 jint _exception = 0; 2585 const char * _exceptionType = NULL; 2586 const char * _exceptionMessage = NULL; 2587 jintArray _countArray = (jintArray) 0; 2588 jint _countBufferOffset = (jint) 0; 2589 jintArray _shadersArray = (jintArray) 0; 2590 jint _shadersBufferOffset = (jint) 0; 2591 jint _countRemaining; 2592 GLsizei *count = (GLsizei *) 0; 2593 jint _shadersRemaining; 2594 GLuint *shaders = (GLuint *) 0; 2595 2596 if (count_buf) { 2597 count = (GLsizei *)getPointer(_env, count_buf, (jarray*)&_countArray, &_countRemaining, &_countBufferOffset); 2598 if (_countRemaining < 1) { 2599 _exception = 1; 2600 _exceptionType = "java/lang/IllegalArgumentException"; 2601 _exceptionMessage = "remaining() < 1 < needed"; 2602 goto exit; 2603 } 2604 } 2605 if (!shaders_buf) { 2606 _exception = 1; 2607 _exceptionType = "java/lang/IllegalArgumentException"; 2608 _exceptionMessage = "shaders == null"; 2609 goto exit; 2610 } 2611 shaders = (GLuint *)getPointer(_env, shaders_buf, (jarray*)&_shadersArray, &_shadersRemaining, &_shadersBufferOffset); 2612 if (_shadersRemaining < maxcount) { 2613 _exception = 1; 2614 _exceptionType = "java/lang/IllegalArgumentException"; 2615 _exceptionMessage = "remaining() < maxcount < needed"; 2616 goto exit; 2617 } 2618 if (count_buf && count == NULL) { 2619 char * _countBase = (char *)_env->GetIntArrayElements(_countArray, (jboolean *) 0); 2620 count = (GLsizei *) (_countBase + _countBufferOffset); 2621 } 2622 if (shaders == NULL) { 2623 char * _shadersBase = (char *)_env->GetIntArrayElements(_shadersArray, (jboolean *) 0); 2624 shaders = (GLuint *) (_shadersBase + _shadersBufferOffset); 2625 } 2626 glGetAttachedShaders( 2627 (GLuint)program, 2628 (GLsizei)maxcount, 2629 (GLsizei *)count, 2630 (GLuint *)shaders 2631 ); 2632 2633exit: 2634 if (_shadersArray) { 2635 _env->ReleaseIntArrayElements(_shadersArray, (jint*)shaders, _exception ? JNI_ABORT : 0); 2636 } 2637 if (_countArray) { 2638 _env->ReleaseIntArrayElements(_countArray, (jint*)count, _exception ? JNI_ABORT : 0); 2639 } 2640 if (_exception) { 2641 jniThrowException(_env, _exceptionType, _exceptionMessage); 2642 } 2643} 2644 2645/* GLint glGetAttribLocation ( GLuint program, const char *name ) */ 2646static jint 2647android_glGetAttribLocation__ILjava_lang_String_2 2648 (JNIEnv *_env, jobject _this, jint program, jstring name) { 2649 jint _exception = 0; 2650 const char * _exceptionType = NULL; 2651 const char * _exceptionMessage = NULL; 2652 GLint _returnValue = 0; 2653 const char* _nativename = 0; 2654 2655 if (!name) { 2656 _exception = 1; 2657 _exceptionType = "java/lang/IllegalArgumentException"; 2658 _exceptionMessage = "name == null"; 2659 goto exit; 2660 } 2661 _nativename = _env->GetStringUTFChars(name, 0); 2662 2663 _returnValue = glGetAttribLocation( 2664 (GLuint)program, 2665 (char *)_nativename 2666 ); 2667 2668exit: 2669 if (_nativename) { 2670 _env->ReleaseStringUTFChars(name, _nativename); 2671 } 2672 2673 if (_exception) { 2674 jniThrowException(_env, _exceptionType, _exceptionMessage); 2675 } 2676 return (jint)_returnValue; 2677} 2678 2679/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 2680static void 2681android_glGetBooleanv__I_3ZI 2682 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { 2683 get<jbooleanArray, BooleanArrayGetter, jboolean*, BooleanArrayReleaser, GLboolean, glGetBooleanv>( 2684 _env, _this, pname, params_ref, offset); 2685} 2686 2687/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 2688static void 2689android_glGetBooleanv__ILjava_nio_IntBuffer_2 2690 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2691 getarray<GLboolean, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetBooleanv>( 2692 _env, _this, pname, params_buf); 2693} 2694/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2695static void 2696android_glGetBufferParameteriv__II_3II 2697 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2698 jint _exception = 0; 2699 const char * _exceptionType = NULL; 2700 const char * _exceptionMessage = NULL; 2701 GLint *params_base = (GLint *) 0; 2702 jint _remaining; 2703 GLint *params = (GLint *) 0; 2704 2705 if (!params_ref) { 2706 _exception = 1; 2707 _exceptionType = "java/lang/IllegalArgumentException"; 2708 _exceptionMessage = "params == null"; 2709 goto exit; 2710 } 2711 if (offset < 0) { 2712 _exception = 1; 2713 _exceptionType = "java/lang/IllegalArgumentException"; 2714 _exceptionMessage = "offset < 0"; 2715 goto exit; 2716 } 2717 _remaining = _env->GetArrayLength(params_ref) - offset; 2718 if (_remaining < 1) { 2719 _exception = 1; 2720 _exceptionType = "java/lang/IllegalArgumentException"; 2721 _exceptionMessage = "length - offset < 1 < needed"; 2722 goto exit; 2723 } 2724 params_base = (GLint *) 2725 _env->GetIntArrayElements(params_ref, (jboolean *)0); 2726 params = params_base + offset; 2727 2728 glGetBufferParameteriv( 2729 (GLenum)target, 2730 (GLenum)pname, 2731 (GLint *)params 2732 ); 2733 2734exit: 2735 if (params_base) { 2736 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2737 _exception ? JNI_ABORT: 0); 2738 } 2739 if (_exception) { 2740 jniThrowException(_env, _exceptionType, _exceptionMessage); 2741 } 2742} 2743 2744/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2745static void 2746android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 2747 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 2748 jint _exception = 0; 2749 const char * _exceptionType = NULL; 2750 const char * _exceptionMessage = NULL; 2751 jintArray _array = (jintArray) 0; 2752 jint _bufferOffset = (jint) 0; 2753 jint _remaining; 2754 GLint *params = (GLint *) 0; 2755 2756 if (!params_buf) { 2757 _exception = 1; 2758 _exceptionType = "java/lang/IllegalArgumentException"; 2759 _exceptionMessage = "params == null"; 2760 goto exit; 2761 } 2762 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 2763 if (_remaining < 1) { 2764 _exception = 1; 2765 _exceptionType = "java/lang/IllegalArgumentException"; 2766 _exceptionMessage = "remaining() < 1 < needed"; 2767 goto exit; 2768 } 2769 if (params == NULL) { 2770 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 2771 params = (GLint *) (_paramsBase + _bufferOffset); 2772 } 2773 glGetBufferParameteriv( 2774 (GLenum)target, 2775 (GLenum)pname, 2776 (GLint *)params 2777 ); 2778 2779exit: 2780 if (_array) { 2781 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 2782 } 2783 if (_exception) { 2784 jniThrowException(_env, _exceptionType, _exceptionMessage); 2785 } 2786} 2787 2788/* GLenum glGetError ( void ) */ 2789static jint 2790android_glGetError__ 2791 (JNIEnv *_env, jobject _this) { 2792 GLenum _returnValue; 2793 _returnValue = glGetError(); 2794 return (jint)_returnValue; 2795} 2796 2797/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 2798static void 2799android_glGetFloatv__I_3FI 2800 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 2801 get<jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, GLfloat, glGetFloatv>( 2802 _env, _this, pname, params_ref, offset); 2803} 2804 2805/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 2806static void 2807android_glGetFloatv__ILjava_nio_FloatBuffer_2 2808 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2809 getarray<GLfloat, jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, glGetFloatv>( 2810 _env, _this, pname, params_buf); 2811} 2812/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ 2813static void 2814android_glGetFramebufferAttachmentParameteriv__III_3II 2815 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { 2816 jint _exception = 0; 2817 const char * _exceptionType = NULL; 2818 const char * _exceptionMessage = NULL; 2819 GLint *params_base = (GLint *) 0; 2820 jint _remaining; 2821 GLint *params = (GLint *) 0; 2822 2823 if (!params_ref) { 2824 _exception = 1; 2825 _exceptionType = "java/lang/IllegalArgumentException"; 2826 _exceptionMessage = "params == null"; 2827 goto exit; 2828 } 2829 if (offset < 0) { 2830 _exception = 1; 2831 _exceptionType = "java/lang/IllegalArgumentException"; 2832 _exceptionMessage = "offset < 0"; 2833 goto exit; 2834 } 2835 _remaining = _env->GetArrayLength(params_ref) - offset; 2836 params_base = (GLint *) 2837 _env->GetIntArrayElements(params_ref, (jboolean *)0); 2838 params = params_base + offset; 2839 2840 glGetFramebufferAttachmentParameteriv( 2841 (GLenum)target, 2842 (GLenum)attachment, 2843 (GLenum)pname, 2844 (GLint *)params 2845 ); 2846 2847exit: 2848 if (params_base) { 2849 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2850 _exception ? JNI_ABORT: 0); 2851 } 2852 if (_exception) { 2853 jniThrowException(_env, _exceptionType, _exceptionMessage); 2854 } 2855} 2856 2857/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ 2858static void 2859android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 2860 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { 2861 jint _exception = 0; 2862 const char * _exceptionType = NULL; 2863 const char * _exceptionMessage = NULL; 2864 jintArray _array = (jintArray) 0; 2865 jint _bufferOffset = (jint) 0; 2866 jint _remaining; 2867 GLint *params = (GLint *) 0; 2868 2869 if (!params_buf) { 2870 _exception = 1; 2871 _exceptionType = "java/lang/IllegalArgumentException"; 2872 _exceptionMessage = "params == null"; 2873 goto exit; 2874 } 2875 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 2876 if (params == NULL) { 2877 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 2878 params = (GLint *) (_paramsBase + _bufferOffset); 2879 } 2880 glGetFramebufferAttachmentParameteriv( 2881 (GLenum)target, 2882 (GLenum)attachment, 2883 (GLenum)pname, 2884 (GLint *)params 2885 ); 2886 2887exit: 2888 if (_array) { 2889 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 2890 } 2891 if (_exception) { 2892 jniThrowException(_env, _exceptionType, _exceptionMessage); 2893 } 2894} 2895 2896/* void glGetIntegerv ( GLenum pname, GLint *params ) */ 2897static void 2898android_glGetIntegerv__I_3II 2899 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 2900 get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>( 2901 _env, _this, pname, params_ref, offset); 2902} 2903 2904/* void glGetIntegerv ( GLenum pname, GLint *params ) */ 2905static void 2906android_glGetIntegerv__ILjava_nio_IntBuffer_2 2907 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 2908 getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>( 2909 _env, _this, pname, params_buf); 2910} 2911/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ 2912static void 2913android_glGetProgramiv__II_3II 2914 (JNIEnv *_env, jobject _this, jint program, jint pname, jintArray params_ref, jint offset) { 2915 jint _exception = 0; 2916 const char * _exceptionType = NULL; 2917 const char * _exceptionMessage = NULL; 2918 GLint *params_base = (GLint *) 0; 2919 jint _remaining; 2920 GLint *params = (GLint *) 0; 2921 2922 if (!params_ref) { 2923 _exception = 1; 2924 _exceptionType = "java/lang/IllegalArgumentException"; 2925 _exceptionMessage = "params == null"; 2926 goto exit; 2927 } 2928 if (offset < 0) { 2929 _exception = 1; 2930 _exceptionType = "java/lang/IllegalArgumentException"; 2931 _exceptionMessage = "offset < 0"; 2932 goto exit; 2933 } 2934 _remaining = _env->GetArrayLength(params_ref) - offset; 2935 if (_remaining < 1) { 2936 _exception = 1; 2937 _exceptionType = "java/lang/IllegalArgumentException"; 2938 _exceptionMessage = "length - offset < 1 < needed"; 2939 goto exit; 2940 } 2941 params_base = (GLint *) 2942 _env->GetIntArrayElements(params_ref, (jboolean *)0); 2943 params = params_base + offset; 2944 2945 glGetProgramiv( 2946 (GLuint)program, 2947 (GLenum)pname, 2948 (GLint *)params 2949 ); 2950 2951exit: 2952 if (params_base) { 2953 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2954 _exception ? JNI_ABORT: 0); 2955 } 2956 if (_exception) { 2957 jniThrowException(_env, _exceptionType, _exceptionMessage); 2958 } 2959} 2960 2961/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ 2962static void 2963android_glGetProgramiv__IILjava_nio_IntBuffer_2 2964 (JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) { 2965 jint _exception = 0; 2966 const char * _exceptionType = NULL; 2967 const char * _exceptionMessage = NULL; 2968 jintArray _array = (jintArray) 0; 2969 jint _bufferOffset = (jint) 0; 2970 jint _remaining; 2971 GLint *params = (GLint *) 0; 2972 2973 if (!params_buf) { 2974 _exception = 1; 2975 _exceptionType = "java/lang/IllegalArgumentException"; 2976 _exceptionMessage = "params == null"; 2977 goto exit; 2978 } 2979 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 2980 if (_remaining < 1) { 2981 _exception = 1; 2982 _exceptionType = "java/lang/IllegalArgumentException"; 2983 _exceptionMessage = "remaining() < 1 < needed"; 2984 goto exit; 2985 } 2986 if (params == NULL) { 2987 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 2988 params = (GLint *) (_paramsBase + _bufferOffset); 2989 } 2990 glGetProgramiv( 2991 (GLuint)program, 2992 (GLenum)pname, 2993 (GLint *)params 2994 ); 2995 2996exit: 2997 if (_array) { 2998 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 2999 } 3000 if (_exception) { 3001 jniThrowException(_env, _exceptionType, _exceptionMessage); 3002 } 3003} 3004 3005#include <stdlib.h> 3006 3007/* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ 3008static jstring android_glGetProgramInfoLog(JNIEnv *_env, jobject, jint shader) { 3009 GLint infoLen = 0; 3010 glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen); 3011 if (!infoLen) { 3012 return _env->NewStringUTF(""); 3013 } 3014 char* buf = (char*) malloc(infoLen); 3015 if (buf == NULL) { 3016 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 3017 return NULL; 3018 } 3019 glGetProgramInfoLog(shader, infoLen, NULL, buf); 3020 jstring result = _env->NewStringUTF(buf); 3021 free(buf); 3022 return result; 3023} 3024/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3025static void 3026android_glGetRenderbufferParameteriv__II_3II 3027 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 3028 jint _exception = 0; 3029 const char * _exceptionType = NULL; 3030 const char * _exceptionMessage = NULL; 3031 GLint *params_base = (GLint *) 0; 3032 jint _remaining; 3033 GLint *params = (GLint *) 0; 3034 3035 if (!params_ref) { 3036 _exception = 1; 3037 _exceptionType = "java/lang/IllegalArgumentException"; 3038 _exceptionMessage = "params == null"; 3039 goto exit; 3040 } 3041 if (offset < 0) { 3042 _exception = 1; 3043 _exceptionType = "java/lang/IllegalArgumentException"; 3044 _exceptionMessage = "offset < 0"; 3045 goto exit; 3046 } 3047 _remaining = _env->GetArrayLength(params_ref) - offset; 3048 if (_remaining < 1) { 3049 _exception = 1; 3050 _exceptionType = "java/lang/IllegalArgumentException"; 3051 _exceptionMessage = "length - offset < 1 < needed"; 3052 goto exit; 3053 } 3054 params_base = (GLint *) 3055 _env->GetIntArrayElements(params_ref, (jboolean *)0); 3056 params = params_base + offset; 3057 3058 glGetRenderbufferParameteriv( 3059 (GLenum)target, 3060 (GLenum)pname, 3061 (GLint *)params 3062 ); 3063 3064exit: 3065 if (params_base) { 3066 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3067 _exception ? JNI_ABORT: 0); 3068 } 3069 if (_exception) { 3070 jniThrowException(_env, _exceptionType, _exceptionMessage); 3071 } 3072} 3073 3074/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3075static void 3076android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 3077 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 3078 jint _exception = 0; 3079 const char * _exceptionType = NULL; 3080 const char * _exceptionMessage = NULL; 3081 jintArray _array = (jintArray) 0; 3082 jint _bufferOffset = (jint) 0; 3083 jint _remaining; 3084 GLint *params = (GLint *) 0; 3085 3086 if (!params_buf) { 3087 _exception = 1; 3088 _exceptionType = "java/lang/IllegalArgumentException"; 3089 _exceptionMessage = "params == null"; 3090 goto exit; 3091 } 3092 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3093 if (_remaining < 1) { 3094 _exception = 1; 3095 _exceptionType = "java/lang/IllegalArgumentException"; 3096 _exceptionMessage = "remaining() < 1 < needed"; 3097 goto exit; 3098 } 3099 if (params == NULL) { 3100 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 3101 params = (GLint *) (_paramsBase + _bufferOffset); 3102 } 3103 glGetRenderbufferParameteriv( 3104 (GLenum)target, 3105 (GLenum)pname, 3106 (GLint *)params 3107 ); 3108 3109exit: 3110 if (_array) { 3111 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 3112 } 3113 if (_exception) { 3114 jniThrowException(_env, _exceptionType, _exceptionMessage); 3115 } 3116} 3117 3118/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ 3119static void 3120android_glGetShaderiv__II_3II 3121 (JNIEnv *_env, jobject _this, jint shader, jint pname, jintArray params_ref, jint offset) { 3122 jint _exception = 0; 3123 const char * _exceptionType = NULL; 3124 const char * _exceptionMessage = NULL; 3125 GLint *params_base = (GLint *) 0; 3126 jint _remaining; 3127 GLint *params = (GLint *) 0; 3128 3129 if (!params_ref) { 3130 _exception = 1; 3131 _exceptionType = "java/lang/IllegalArgumentException"; 3132 _exceptionMessage = "params == null"; 3133 goto exit; 3134 } 3135 if (offset < 0) { 3136 _exception = 1; 3137 _exceptionType = "java/lang/IllegalArgumentException"; 3138 _exceptionMessage = "offset < 0"; 3139 goto exit; 3140 } 3141 _remaining = _env->GetArrayLength(params_ref) - offset; 3142 if (_remaining < 1) { 3143 _exception = 1; 3144 _exceptionType = "java/lang/IllegalArgumentException"; 3145 _exceptionMessage = "length - offset < 1 < needed"; 3146 goto exit; 3147 } 3148 params_base = (GLint *) 3149 _env->GetIntArrayElements(params_ref, (jboolean *)0); 3150 params = params_base + offset; 3151 3152 glGetShaderiv( 3153 (GLuint)shader, 3154 (GLenum)pname, 3155 (GLint *)params 3156 ); 3157 3158exit: 3159 if (params_base) { 3160 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3161 _exception ? JNI_ABORT: 0); 3162 } 3163 if (_exception) { 3164 jniThrowException(_env, _exceptionType, _exceptionMessage); 3165 } 3166} 3167 3168/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ 3169static void 3170android_glGetShaderiv__IILjava_nio_IntBuffer_2 3171 (JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) { 3172 jint _exception = 0; 3173 const char * _exceptionType = NULL; 3174 const char * _exceptionMessage = NULL; 3175 jintArray _array = (jintArray) 0; 3176 jint _bufferOffset = (jint) 0; 3177 jint _remaining; 3178 GLint *params = (GLint *) 0; 3179 3180 if (!params_buf) { 3181 _exception = 1; 3182 _exceptionType = "java/lang/IllegalArgumentException"; 3183 _exceptionMessage = "params == null"; 3184 goto exit; 3185 } 3186 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3187 if (_remaining < 1) { 3188 _exception = 1; 3189 _exceptionType = "java/lang/IllegalArgumentException"; 3190 _exceptionMessage = "remaining() < 1 < needed"; 3191 goto exit; 3192 } 3193 if (params == NULL) { 3194 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 3195 params = (GLint *) (_paramsBase + _bufferOffset); 3196 } 3197 glGetShaderiv( 3198 (GLuint)shader, 3199 (GLenum)pname, 3200 (GLint *)params 3201 ); 3202 3203exit: 3204 if (_array) { 3205 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 3206 } 3207 if (_exception) { 3208 jniThrowException(_env, _exceptionType, _exceptionMessage); 3209 } 3210} 3211 3212#include <stdlib.h> 3213 3214/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ 3215static jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) { 3216 GLint infoLen = 0; 3217 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); 3218 if (!infoLen) { 3219 infoLen = 512; 3220 } 3221 char* buf = (char*) malloc(infoLen); 3222 if (buf == NULL) { 3223 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 3224 return NULL; 3225 } 3226 GLsizei outLen = 0; 3227 glGetShaderInfoLog(shader, infoLen, &outLen, buf); 3228 jstring result = _env->NewStringUTF(outLen == 0 ? "" : buf); 3229 free(buf); 3230 return result; 3231} 3232/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ 3233static void 3234android_glGetShaderPrecisionFormat__II_3II_3II 3235 (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jintArray range_ref, jint rangeOffset, jintArray precision_ref, jint precisionOffset) { 3236 jint _exception = 0; 3237 const char * _exceptionType = NULL; 3238 const char * _exceptionMessage = NULL; 3239 GLint *range_base = (GLint *) 0; 3240 jint _rangeRemaining; 3241 GLint *range = (GLint *) 0; 3242 GLint *precision_base = (GLint *) 0; 3243 jint _precisionRemaining; 3244 GLint *precision = (GLint *) 0; 3245 3246 if (!range_ref) { 3247 _exception = 1; 3248 _exceptionType = "java/lang/IllegalArgumentException"; 3249 _exceptionMessage = "range == null"; 3250 goto exit; 3251 } 3252 if (rangeOffset < 0) { 3253 _exception = 1; 3254 _exceptionType = "java/lang/IllegalArgumentException"; 3255 _exceptionMessage = "rangeOffset < 0"; 3256 goto exit; 3257 } 3258 _rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset; 3259 if (_rangeRemaining < 1) { 3260 _exception = 1; 3261 _exceptionType = "java/lang/IllegalArgumentException"; 3262 _exceptionMessage = "length - rangeOffset < 1 < needed"; 3263 goto exit; 3264 } 3265 range_base = (GLint *) 3266 _env->GetIntArrayElements(range_ref, (jboolean *)0); 3267 range = range_base + rangeOffset; 3268 3269 if (!precision_ref) { 3270 _exception = 1; 3271 _exceptionType = "java/lang/IllegalArgumentException"; 3272 _exceptionMessage = "precision == null"; 3273 goto exit; 3274 } 3275 if (precisionOffset < 0) { 3276 _exception = 1; 3277 _exceptionType = "java/lang/IllegalArgumentException"; 3278 _exceptionMessage = "precisionOffset < 0"; 3279 goto exit; 3280 } 3281 _precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset; 3282 if (_precisionRemaining < 1) { 3283 _exception = 1; 3284 _exceptionType = "java/lang/IllegalArgumentException"; 3285 _exceptionMessage = "length - precisionOffset < 1 < needed"; 3286 goto exit; 3287 } 3288 precision_base = (GLint *) 3289 _env->GetIntArrayElements(precision_ref, (jboolean *)0); 3290 precision = precision_base + precisionOffset; 3291 3292 glGetShaderPrecisionFormat( 3293 (GLenum)shadertype, 3294 (GLenum)precisiontype, 3295 (GLint *)range, 3296 (GLint *)precision 3297 ); 3298 3299exit: 3300 if (precision_base) { 3301 _env->ReleaseIntArrayElements(precision_ref, (jint*)precision_base, 3302 _exception ? JNI_ABORT: 0); 3303 } 3304 if (range_base) { 3305 _env->ReleaseIntArrayElements(range_ref, (jint*)range_base, 3306 _exception ? JNI_ABORT: 0); 3307 } 3308 if (_exception) { 3309 jniThrowException(_env, _exceptionType, _exceptionMessage); 3310 } 3311} 3312 3313/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ 3314static void 3315android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 3316 (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) { 3317 jint _exception = 0; 3318 const char * _exceptionType = NULL; 3319 const char * _exceptionMessage = NULL; 3320 jintArray _rangeArray = (jintArray) 0; 3321 jint _rangeBufferOffset = (jint) 0; 3322 jintArray _precisionArray = (jintArray) 0; 3323 jint _precisionBufferOffset = (jint) 0; 3324 jint _rangeRemaining; 3325 GLint *range = (GLint *) 0; 3326 jint _precisionRemaining; 3327 GLint *precision = (GLint *) 0; 3328 3329 if (!range_buf) { 3330 _exception = 1; 3331 _exceptionType = "java/lang/IllegalArgumentException"; 3332 _exceptionMessage = "range == null"; 3333 goto exit; 3334 } 3335 range = (GLint *)getPointer(_env, range_buf, (jarray*)&_rangeArray, &_rangeRemaining, &_rangeBufferOffset); 3336 if (_rangeRemaining < 1) { 3337 _exception = 1; 3338 _exceptionType = "java/lang/IllegalArgumentException"; 3339 _exceptionMessage = "remaining() < 1 < needed"; 3340 goto exit; 3341 } 3342 if (!precision_buf) { 3343 _exception = 1; 3344 _exceptionType = "java/lang/IllegalArgumentException"; 3345 _exceptionMessage = "precision == null"; 3346 goto exit; 3347 } 3348 precision = (GLint *)getPointer(_env, precision_buf, (jarray*)&_precisionArray, &_precisionRemaining, &_precisionBufferOffset); 3349 if (_precisionRemaining < 1) { 3350 _exception = 1; 3351 _exceptionType = "java/lang/IllegalArgumentException"; 3352 _exceptionMessage = "remaining() < 1 < needed"; 3353 goto exit; 3354 } 3355 if (range == NULL) { 3356 char * _rangeBase = (char *)_env->GetIntArrayElements(_rangeArray, (jboolean *) 0); 3357 range = (GLint *) (_rangeBase + _rangeBufferOffset); 3358 } 3359 if (precision == NULL) { 3360 char * _precisionBase = (char *)_env->GetIntArrayElements(_precisionArray, (jboolean *) 0); 3361 precision = (GLint *) (_precisionBase + _precisionBufferOffset); 3362 } 3363 glGetShaderPrecisionFormat( 3364 (GLenum)shadertype, 3365 (GLenum)precisiontype, 3366 (GLint *)range, 3367 (GLint *)precision 3368 ); 3369 3370exit: 3371 if (_precisionArray) { 3372 _env->ReleaseIntArrayElements(_precisionArray, (jint*)precision, _exception ? JNI_ABORT : 0); 3373 } 3374 if (_rangeArray) { 3375 _env->ReleaseIntArrayElements(_rangeArray, (jint*)range, _exception ? JNI_ABORT : 0); 3376 } 3377 if (_exception) { 3378 jniThrowException(_env, _exceptionType, _exceptionMessage); 3379 } 3380} 3381 3382/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3383static void 3384android_glGetShaderSource__II_3II_3BI 3385 (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jintArray length_ref, jint lengthOffset, jbyteArray source_ref, jint sourceOffset) { 3386 jint _exception = 0; 3387 const char * _exceptionType; 3388 const char * _exceptionMessage; 3389 GLsizei *length_base = (GLsizei *) 0; 3390 jint _lengthRemaining; 3391 GLsizei *length = (GLsizei *) 0; 3392 char *source_base = (char *) 0; 3393 jint _sourceRemaining; 3394 char *source = (char *) 0; 3395 3396 if (length_ref) { 3397 if (lengthOffset < 0) { 3398 _exception = 1; 3399 _exceptionType = "java/lang/IllegalArgumentException"; 3400 _exceptionMessage = "lengthOffset < 0"; 3401 goto exit; 3402 } 3403 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 3404 length_base = (GLsizei *) 3405 _env->GetIntArrayElements(length_ref, (jboolean *)0); 3406 length = length_base + lengthOffset; 3407 } 3408 3409 if (!source_ref) { 3410 _exception = 1; 3411 _exceptionType = "java/lang/IllegalArgumentException"; 3412 _exceptionMessage = "source == null"; 3413 goto exit; 3414 } 3415 if (sourceOffset < 0) { 3416 _exception = 1; 3417 _exceptionType = "java/lang/IllegalArgumentException"; 3418 _exceptionMessage = "sourceOffset < 0"; 3419 goto exit; 3420 } 3421 _sourceRemaining = _env->GetArrayLength(source_ref) - sourceOffset; 3422 source_base = (char *) 3423 _env->GetByteArrayElements(source_ref, (jboolean *)0); 3424 source = source_base + sourceOffset; 3425 3426 glGetShaderSource( 3427 (GLuint)shader, 3428 (GLsizei)bufsize, 3429 (GLsizei *)length, 3430 (char *)source 3431 ); 3432 3433exit: 3434 if (source_base) { 3435 _env->ReleaseByteArrayElements(source_ref, (jbyte*)source_base, 3436 _exception ? JNI_ABORT: 0); 3437 } 3438 if (length_base) { 3439 _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 3440 _exception ? JNI_ABORT: 0); 3441 } 3442 if (_exception) { 3443 jniThrowException(_env, _exceptionType, _exceptionMessage); 3444 } 3445} 3446 3447/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3448static void 3449android_glGetShaderSource__IILjava_nio_IntBuffer_2B 3450 (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jobject length_buf, jbyte source) { 3451 jintArray _array = (jintArray) 0; 3452 jint _bufferOffset = (jint) 0; 3453 jint _remaining; 3454 GLsizei *length = (GLsizei *) 0; 3455 3456 length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3457 if (length == NULL) { 3458 char * _lengthBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 3459 length = (GLsizei *) (_lengthBase + _bufferOffset); 3460 } 3461 glGetShaderSource( 3462 (GLuint)shader, 3463 (GLsizei)bufsize, 3464 (GLsizei *)length, 3465 reinterpret_cast<char *>(source) 3466 ); 3467 if (_array) { 3468 releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _array, (jint*)length, JNI_TRUE); 3469 } 3470} 3471 3472/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3473static jstring android_glGetShaderSource(JNIEnv *_env, jobject, jint shader) { 3474 GLint shaderLen = 0; 3475 glGetShaderiv((GLuint)shader, GL_SHADER_SOURCE_LENGTH, &shaderLen); 3476 if (!shaderLen) { 3477 return _env->NewStringUTF(""); 3478 } 3479 char* buf = (char*) malloc(shaderLen); 3480 if (buf == NULL) { 3481 jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 3482 return NULL; 3483 } 3484 glGetShaderSource(shader, shaderLen, NULL, buf); 3485 jstring result = _env->NewStringUTF(buf); 3486 free(buf); 3487 return result; 3488} 3489/* const GLubyte * glGetString ( GLenum name ) */ 3490static jstring android_glGetString(JNIEnv* _env, jobject, jint name) { 3491 const char* chars = (const char*) glGetString((GLenum) name); 3492 return _env->NewStringUTF(chars); 3493} 3494/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 3495static void 3496android_glGetTexParameterfv__II_3FI 3497 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 3498 jint _exception = 0; 3499 const char * _exceptionType = NULL; 3500 const char * _exceptionMessage = NULL; 3501 GLfloat *params_base = (GLfloat *) 0; 3502 jint _remaining; 3503 GLfloat *params = (GLfloat *) 0; 3504 3505 if (!params_ref) { 3506 _exception = 1; 3507 _exceptionType = "java/lang/IllegalArgumentException"; 3508 _exceptionMessage = "params == null"; 3509 goto exit; 3510 } 3511 if (offset < 0) { 3512 _exception = 1; 3513 _exceptionType = "java/lang/IllegalArgumentException"; 3514 _exceptionMessage = "offset < 0"; 3515 goto exit; 3516 } 3517 _remaining = _env->GetArrayLength(params_ref) - offset; 3518 if (_remaining < 1) { 3519 _exception = 1; 3520 _exceptionType = "java/lang/IllegalArgumentException"; 3521 _exceptionMessage = "length - offset < 1 < needed"; 3522 goto exit; 3523 } 3524 params_base = (GLfloat *) 3525 _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3526 params = params_base + offset; 3527 3528 glGetTexParameterfv( 3529 (GLenum)target, 3530 (GLenum)pname, 3531 (GLfloat *)params 3532 ); 3533 3534exit: 3535 if (params_base) { 3536 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3537 _exception ? JNI_ABORT: 0); 3538 } 3539 if (_exception) { 3540 jniThrowException(_env, _exceptionType, _exceptionMessage); 3541 } 3542} 3543 3544/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 3545static void 3546android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 3547 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 3548 jint _exception = 0; 3549 const char * _exceptionType = NULL; 3550 const char * _exceptionMessage = NULL; 3551 jfloatArray _array = (jfloatArray) 0; 3552 jint _bufferOffset = (jint) 0; 3553 jint _remaining; 3554 GLfloat *params = (GLfloat *) 0; 3555 3556 if (!params_buf) { 3557 _exception = 1; 3558 _exceptionType = "java/lang/IllegalArgumentException"; 3559 _exceptionMessage = "params == null"; 3560 goto exit; 3561 } 3562 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3563 if (_remaining < 1) { 3564 _exception = 1; 3565 _exceptionType = "java/lang/IllegalArgumentException"; 3566 _exceptionMessage = "remaining() < 1 < needed"; 3567 goto exit; 3568 } 3569 if (params == NULL) { 3570 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 3571 params = (GLfloat *) (_paramsBase + _bufferOffset); 3572 } 3573 glGetTexParameterfv( 3574 (GLenum)target, 3575 (GLenum)pname, 3576 (GLfloat *)params 3577 ); 3578 3579exit: 3580 if (_array) { 3581 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 3582 } 3583 if (_exception) { 3584 jniThrowException(_env, _exceptionType, _exceptionMessage); 3585 } 3586} 3587 3588/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3589static void 3590android_glGetTexParameteriv__II_3II 3591 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 3592 jint _exception = 0; 3593 const char * _exceptionType = NULL; 3594 const char * _exceptionMessage = NULL; 3595 GLint *params_base = (GLint *) 0; 3596 jint _remaining; 3597 GLint *params = (GLint *) 0; 3598 3599 if (!params_ref) { 3600 _exception = 1; 3601 _exceptionType = "java/lang/IllegalArgumentException"; 3602 _exceptionMessage = "params == null"; 3603 goto exit; 3604 } 3605 if (offset < 0) { 3606 _exception = 1; 3607 _exceptionType = "java/lang/IllegalArgumentException"; 3608 _exceptionMessage = "offset < 0"; 3609 goto exit; 3610 } 3611 _remaining = _env->GetArrayLength(params_ref) - offset; 3612 if (_remaining < 1) { 3613 _exception = 1; 3614 _exceptionType = "java/lang/IllegalArgumentException"; 3615 _exceptionMessage = "length - offset < 1 < needed"; 3616 goto exit; 3617 } 3618 params_base = (GLint *) 3619 _env->GetIntArrayElements(params_ref, (jboolean *)0); 3620 params = params_base + offset; 3621 3622 glGetTexParameteriv( 3623 (GLenum)target, 3624 (GLenum)pname, 3625 (GLint *)params 3626 ); 3627 3628exit: 3629 if (params_base) { 3630 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3631 _exception ? JNI_ABORT: 0); 3632 } 3633 if (_exception) { 3634 jniThrowException(_env, _exceptionType, _exceptionMessage); 3635 } 3636} 3637 3638/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3639static void 3640android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 3641 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 3642 jint _exception = 0; 3643 const char * _exceptionType = NULL; 3644 const char * _exceptionMessage = NULL; 3645 jintArray _array = (jintArray) 0; 3646 jint _bufferOffset = (jint) 0; 3647 jint _remaining; 3648 GLint *params = (GLint *) 0; 3649 3650 if (!params_buf) { 3651 _exception = 1; 3652 _exceptionType = "java/lang/IllegalArgumentException"; 3653 _exceptionMessage = "params == null"; 3654 goto exit; 3655 } 3656 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3657 if (_remaining < 1) { 3658 _exception = 1; 3659 _exceptionType = "java/lang/IllegalArgumentException"; 3660 _exceptionMessage = "remaining() < 1 < needed"; 3661 goto exit; 3662 } 3663 if (params == NULL) { 3664 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 3665 params = (GLint *) (_paramsBase + _bufferOffset); 3666 } 3667 glGetTexParameteriv( 3668 (GLenum)target, 3669 (GLenum)pname, 3670 (GLint *)params 3671 ); 3672 3673exit: 3674 if (_array) { 3675 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 3676 } 3677 if (_exception) { 3678 jniThrowException(_env, _exceptionType, _exceptionMessage); 3679 } 3680} 3681 3682/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ 3683static void 3684android_glGetUniformfv__II_3FI 3685 (JNIEnv *_env, jobject _this, jint program, jint location, jfloatArray params_ref, jint offset) { 3686 jint _exception = 0; 3687 const char * _exceptionType = NULL; 3688 const char * _exceptionMessage = NULL; 3689 GLfloat *params_base = (GLfloat *) 0; 3690 jint _remaining; 3691 GLfloat *params = (GLfloat *) 0; 3692 3693 if (!params_ref) { 3694 _exception = 1; 3695 _exceptionType = "java/lang/IllegalArgumentException"; 3696 _exceptionMessage = "params == null"; 3697 goto exit; 3698 } 3699 if (offset < 0) { 3700 _exception = 1; 3701 _exceptionType = "java/lang/IllegalArgumentException"; 3702 _exceptionMessage = "offset < 0"; 3703 goto exit; 3704 } 3705 _remaining = _env->GetArrayLength(params_ref) - offset; 3706 if (_remaining < 1) { 3707 _exception = 1; 3708 _exceptionType = "java/lang/IllegalArgumentException"; 3709 _exceptionMessage = "length - offset < 1 < needed"; 3710 goto exit; 3711 } 3712 params_base = (GLfloat *) 3713 _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3714 params = params_base + offset; 3715 3716 glGetUniformfv( 3717 (GLuint)program, 3718 (GLint)location, 3719 (GLfloat *)params 3720 ); 3721 3722exit: 3723 if (params_base) { 3724 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3725 _exception ? JNI_ABORT: 0); 3726 } 3727 if (_exception) { 3728 jniThrowException(_env, _exceptionType, _exceptionMessage); 3729 } 3730} 3731 3732/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ 3733static void 3734android_glGetUniformfv__IILjava_nio_FloatBuffer_2 3735 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { 3736 jint _exception = 0; 3737 const char * _exceptionType = NULL; 3738 const char * _exceptionMessage = NULL; 3739 jfloatArray _array = (jfloatArray) 0; 3740 jint _bufferOffset = (jint) 0; 3741 jint _remaining; 3742 GLfloat *params = (GLfloat *) 0; 3743 3744 if (!params_buf) { 3745 _exception = 1; 3746 _exceptionType = "java/lang/IllegalArgumentException"; 3747 _exceptionMessage = "params == null"; 3748 goto exit; 3749 } 3750 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3751 if (_remaining < 1) { 3752 _exception = 1; 3753 _exceptionType = "java/lang/IllegalArgumentException"; 3754 _exceptionMessage = "remaining() < 1 < needed"; 3755 goto exit; 3756 } 3757 if (params == NULL) { 3758 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 3759 params = (GLfloat *) (_paramsBase + _bufferOffset); 3760 } 3761 glGetUniformfv( 3762 (GLuint)program, 3763 (GLint)location, 3764 (GLfloat *)params 3765 ); 3766 3767exit: 3768 if (_array) { 3769 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 3770 } 3771 if (_exception) { 3772 jniThrowException(_env, _exceptionType, _exceptionMessage); 3773 } 3774} 3775 3776/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ 3777static void 3778android_glGetUniformiv__II_3II 3779 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) { 3780 jint _exception = 0; 3781 const char * _exceptionType = NULL; 3782 const char * _exceptionMessage = NULL; 3783 GLint *params_base = (GLint *) 0; 3784 jint _remaining; 3785 GLint *params = (GLint *) 0; 3786 3787 if (!params_ref) { 3788 _exception = 1; 3789 _exceptionType = "java/lang/IllegalArgumentException"; 3790 _exceptionMessage = "params == null"; 3791 goto exit; 3792 } 3793 if (offset < 0) { 3794 _exception = 1; 3795 _exceptionType = "java/lang/IllegalArgumentException"; 3796 _exceptionMessage = "offset < 0"; 3797 goto exit; 3798 } 3799 _remaining = _env->GetArrayLength(params_ref) - offset; 3800 if (_remaining < 1) { 3801 _exception = 1; 3802 _exceptionType = "java/lang/IllegalArgumentException"; 3803 _exceptionMessage = "length - offset < 1 < needed"; 3804 goto exit; 3805 } 3806 params_base = (GLint *) 3807 _env->GetIntArrayElements(params_ref, (jboolean *)0); 3808 params = params_base + offset; 3809 3810 glGetUniformiv( 3811 (GLuint)program, 3812 (GLint)location, 3813 (GLint *)params 3814 ); 3815 3816exit: 3817 if (params_base) { 3818 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3819 _exception ? JNI_ABORT: 0); 3820 } 3821 if (_exception) { 3822 jniThrowException(_env, _exceptionType, _exceptionMessage); 3823 } 3824} 3825 3826/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ 3827static void 3828android_glGetUniformiv__IILjava_nio_IntBuffer_2 3829 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { 3830 jint _exception = 0; 3831 const char * _exceptionType = NULL; 3832 const char * _exceptionMessage = NULL; 3833 jintArray _array = (jintArray) 0; 3834 jint _bufferOffset = (jint) 0; 3835 jint _remaining; 3836 GLint *params = (GLint *) 0; 3837 3838 if (!params_buf) { 3839 _exception = 1; 3840 _exceptionType = "java/lang/IllegalArgumentException"; 3841 _exceptionMessage = "params == null"; 3842 goto exit; 3843 } 3844 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3845 if (_remaining < 1) { 3846 _exception = 1; 3847 _exceptionType = "java/lang/IllegalArgumentException"; 3848 _exceptionMessage = "remaining() < 1 < needed"; 3849 goto exit; 3850 } 3851 if (params == NULL) { 3852 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 3853 params = (GLint *) (_paramsBase + _bufferOffset); 3854 } 3855 glGetUniformiv( 3856 (GLuint)program, 3857 (GLint)location, 3858 (GLint *)params 3859 ); 3860 3861exit: 3862 if (_array) { 3863 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 3864 } 3865 if (_exception) { 3866 jniThrowException(_env, _exceptionType, _exceptionMessage); 3867 } 3868} 3869 3870/* GLint glGetUniformLocation ( GLuint program, const char *name ) */ 3871static jint 3872android_glGetUniformLocation__ILjava_lang_String_2 3873 (JNIEnv *_env, jobject _this, jint program, jstring name) { 3874 jint _exception = 0; 3875 const char * _exceptionType = NULL; 3876 const char * _exceptionMessage = NULL; 3877 GLint _returnValue = 0; 3878 const char* _nativename = 0; 3879 3880 if (!name) { 3881 _exception = 1; 3882 _exceptionType = "java/lang/IllegalArgumentException"; 3883 _exceptionMessage = "name == null"; 3884 goto exit; 3885 } 3886 _nativename = _env->GetStringUTFChars(name, 0); 3887 3888 _returnValue = glGetUniformLocation( 3889 (GLuint)program, 3890 (char *)_nativename 3891 ); 3892 3893exit: 3894 if (_nativename) { 3895 _env->ReleaseStringUTFChars(name, _nativename); 3896 } 3897 3898 if (_exception) { 3899 jniThrowException(_env, _exceptionType, _exceptionMessage); 3900 } 3901 return (jint)_returnValue; 3902} 3903 3904/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ 3905static void 3906android_glGetVertexAttribfv__II_3FI 3907 (JNIEnv *_env, jobject _this, jint index, jint pname, jfloatArray params_ref, jint offset) { 3908 jint _exception = 0; 3909 const char * _exceptionType = NULL; 3910 const char * _exceptionMessage = NULL; 3911 GLfloat *params_base = (GLfloat *) 0; 3912 jint _remaining; 3913 GLfloat *params = (GLfloat *) 0; 3914 3915 if (!params_ref) { 3916 _exception = 1; 3917 _exceptionType = "java/lang/IllegalArgumentException"; 3918 _exceptionMessage = "params == null"; 3919 goto exit; 3920 } 3921 if (offset < 0) { 3922 _exception = 1; 3923 _exceptionType = "java/lang/IllegalArgumentException"; 3924 _exceptionMessage = "offset < 0"; 3925 goto exit; 3926 } 3927 _remaining = _env->GetArrayLength(params_ref) - offset; 3928 int _needed; 3929 switch (pname) { 3930#if defined(GL_CURRENT_VERTEX_ATTRIB) 3931 case GL_CURRENT_VERTEX_ATTRIB: 3932#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 3933 _needed = 4; 3934 break; 3935 default: 3936 _needed = 1; 3937 break; 3938 } 3939 if (_remaining < _needed) { 3940 _exception = 1; 3941 _exceptionType = "java/lang/IllegalArgumentException"; 3942 _exceptionMessage = "length - offset < needed"; 3943 goto exit; 3944 } 3945 params_base = (GLfloat *) 3946 _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3947 params = params_base + offset; 3948 3949 glGetVertexAttribfv( 3950 (GLuint)index, 3951 (GLenum)pname, 3952 (GLfloat *)params 3953 ); 3954 3955exit: 3956 if (params_base) { 3957 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3958 _exception ? JNI_ABORT: 0); 3959 } 3960 if (_exception) { 3961 jniThrowException(_env, _exceptionType, _exceptionMessage); 3962 } 3963} 3964 3965/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ 3966static void 3967android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 3968 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { 3969 jint _exception = 0; 3970 const char * _exceptionType = NULL; 3971 const char * _exceptionMessage = NULL; 3972 jfloatArray _array = (jfloatArray) 0; 3973 jint _bufferOffset = (jint) 0; 3974 jint _remaining; 3975 GLfloat *params = (GLfloat *) 0; 3976 3977 if (!params_buf) { 3978 _exception = 1; 3979 _exceptionType = "java/lang/IllegalArgumentException"; 3980 _exceptionMessage = "params == null"; 3981 goto exit; 3982 } 3983 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3984 int _needed; 3985 switch (pname) { 3986#if defined(GL_CURRENT_VERTEX_ATTRIB) 3987 case GL_CURRENT_VERTEX_ATTRIB: 3988#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 3989 _needed = 4; 3990 break; 3991 default: 3992 _needed = 1; 3993 break; 3994 } 3995 if (_remaining < _needed) { 3996 _exception = 1; 3997 _exceptionType = "java/lang/IllegalArgumentException"; 3998 _exceptionMessage = "remaining() < needed"; 3999 goto exit; 4000 } 4001 if (params == NULL) { 4002 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 4003 params = (GLfloat *) (_paramsBase + _bufferOffset); 4004 } 4005 glGetVertexAttribfv( 4006 (GLuint)index, 4007 (GLenum)pname, 4008 (GLfloat *)params 4009 ); 4010 4011exit: 4012 if (_array) { 4013 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 4014 } 4015 if (_exception) { 4016 jniThrowException(_env, _exceptionType, _exceptionMessage); 4017 } 4018} 4019 4020/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ 4021static void 4022android_glGetVertexAttribiv__II_3II 4023 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) { 4024 jint _exception = 0; 4025 const char * _exceptionType = NULL; 4026 const char * _exceptionMessage = NULL; 4027 GLint *params_base = (GLint *) 0; 4028 jint _remaining; 4029 GLint *params = (GLint *) 0; 4030 4031 if (!params_ref) { 4032 _exception = 1; 4033 _exceptionType = "java/lang/IllegalArgumentException"; 4034 _exceptionMessage = "params == null"; 4035 goto exit; 4036 } 4037 if (offset < 0) { 4038 _exception = 1; 4039 _exceptionType = "java/lang/IllegalArgumentException"; 4040 _exceptionMessage = "offset < 0"; 4041 goto exit; 4042 } 4043 _remaining = _env->GetArrayLength(params_ref) - offset; 4044 int _needed; 4045 switch (pname) { 4046#if defined(GL_CURRENT_VERTEX_ATTRIB) 4047 case GL_CURRENT_VERTEX_ATTRIB: 4048#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 4049 _needed = 4; 4050 break; 4051 default: 4052 _needed = 1; 4053 break; 4054 } 4055 if (_remaining < _needed) { 4056 _exception = 1; 4057 _exceptionType = "java/lang/IllegalArgumentException"; 4058 _exceptionMessage = "length - offset < needed"; 4059 goto exit; 4060 } 4061 params_base = (GLint *) 4062 _env->GetIntArrayElements(params_ref, (jboolean *)0); 4063 params = params_base + offset; 4064 4065 glGetVertexAttribiv( 4066 (GLuint)index, 4067 (GLenum)pname, 4068 (GLint *)params 4069 ); 4070 4071exit: 4072 if (params_base) { 4073 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 4074 _exception ? JNI_ABORT: 0); 4075 } 4076 if (_exception) { 4077 jniThrowException(_env, _exceptionType, _exceptionMessage); 4078 } 4079} 4080 4081/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ 4082static void 4083android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 4084 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { 4085 jint _exception = 0; 4086 const char * _exceptionType = NULL; 4087 const char * _exceptionMessage = NULL; 4088 jintArray _array = (jintArray) 0; 4089 jint _bufferOffset = (jint) 0; 4090 jint _remaining; 4091 GLint *params = (GLint *) 0; 4092 4093 if (!params_buf) { 4094 _exception = 1; 4095 _exceptionType = "java/lang/IllegalArgumentException"; 4096 _exceptionMessage = "params == null"; 4097 goto exit; 4098 } 4099 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4100 int _needed; 4101 switch (pname) { 4102#if defined(GL_CURRENT_VERTEX_ATTRIB) 4103 case GL_CURRENT_VERTEX_ATTRIB: 4104#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 4105 _needed = 4; 4106 break; 4107 default: 4108 _needed = 1; 4109 break; 4110 } 4111 if (_remaining < _needed) { 4112 _exception = 1; 4113 _exceptionType = "java/lang/IllegalArgumentException"; 4114 _exceptionMessage = "remaining() < needed"; 4115 goto exit; 4116 } 4117 if (params == NULL) { 4118 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 4119 params = (GLint *) (_paramsBase + _bufferOffset); 4120 } 4121 glGetVertexAttribiv( 4122 (GLuint)index, 4123 (GLenum)pname, 4124 (GLint *)params 4125 ); 4126 4127exit: 4128 if (_array) { 4129 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 4130 } 4131 if (_exception) { 4132 jniThrowException(_env, _exceptionType, _exceptionMessage); 4133 } 4134} 4135 4136/* void glHint ( GLenum target, GLenum mode ) */ 4137static void 4138android_glHint__II 4139 (JNIEnv *_env, jobject _this, jint target, jint mode) { 4140 glHint( 4141 (GLenum)target, 4142 (GLenum)mode 4143 ); 4144} 4145 4146/* GLboolean glIsBuffer ( GLuint buffer ) */ 4147static jboolean 4148android_glIsBuffer__I 4149 (JNIEnv *_env, jobject _this, jint buffer) { 4150 GLboolean _returnValue; 4151 _returnValue = glIsBuffer( 4152 (GLuint)buffer 4153 ); 4154 return (jboolean)_returnValue; 4155} 4156 4157/* GLboolean glIsEnabled ( GLenum cap ) */ 4158static jboolean 4159android_glIsEnabled__I 4160 (JNIEnv *_env, jobject _this, jint cap) { 4161 GLboolean _returnValue; 4162 _returnValue = glIsEnabled( 4163 (GLenum)cap 4164 ); 4165 return (jboolean)_returnValue; 4166} 4167 4168/* GLboolean glIsFramebuffer ( GLuint framebuffer ) */ 4169static jboolean 4170android_glIsFramebuffer__I 4171 (JNIEnv *_env, jobject _this, jint framebuffer) { 4172 GLboolean _returnValue; 4173 _returnValue = glIsFramebuffer( 4174 (GLuint)framebuffer 4175 ); 4176 return (jboolean)_returnValue; 4177} 4178 4179/* GLboolean glIsProgram ( GLuint program ) */ 4180static jboolean 4181android_glIsProgram__I 4182 (JNIEnv *_env, jobject _this, jint program) { 4183 GLboolean _returnValue; 4184 _returnValue = glIsProgram( 4185 (GLuint)program 4186 ); 4187 return (jboolean)_returnValue; 4188} 4189 4190/* GLboolean glIsRenderbuffer ( GLuint renderbuffer ) */ 4191static jboolean 4192android_glIsRenderbuffer__I 4193 (JNIEnv *_env, jobject _this, jint renderbuffer) { 4194 GLboolean _returnValue; 4195 _returnValue = glIsRenderbuffer( 4196 (GLuint)renderbuffer 4197 ); 4198 return (jboolean)_returnValue; 4199} 4200 4201/* GLboolean glIsShader ( GLuint shader ) */ 4202static jboolean 4203android_glIsShader__I 4204 (JNIEnv *_env, jobject _this, jint shader) { 4205 GLboolean _returnValue; 4206 _returnValue = glIsShader( 4207 (GLuint)shader 4208 ); 4209 return (jboolean)_returnValue; 4210} 4211 4212/* GLboolean glIsTexture ( GLuint texture ) */ 4213static jboolean 4214android_glIsTexture__I 4215 (JNIEnv *_env, jobject _this, jint texture) { 4216 GLboolean _returnValue; 4217 _returnValue = glIsTexture( 4218 (GLuint)texture 4219 ); 4220 return (jboolean)_returnValue; 4221} 4222 4223/* void glLineWidth ( GLfloat width ) */ 4224static void 4225android_glLineWidth__F 4226 (JNIEnv *_env, jobject _this, jfloat width) { 4227 glLineWidth( 4228 (GLfloat)width 4229 ); 4230} 4231 4232/* void glLinkProgram ( GLuint program ) */ 4233static void 4234android_glLinkProgram__I 4235 (JNIEnv *_env, jobject _this, jint program) { 4236 glLinkProgram( 4237 (GLuint)program 4238 ); 4239} 4240 4241/* void glPixelStorei ( GLenum pname, GLint param ) */ 4242static void 4243android_glPixelStorei__II 4244 (JNIEnv *_env, jobject _this, jint pname, jint param) { 4245 glPixelStorei( 4246 (GLenum)pname, 4247 (GLint)param 4248 ); 4249} 4250 4251/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ 4252static void 4253android_glPolygonOffset__FF 4254 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { 4255 glPolygonOffset( 4256 (GLfloat)factor, 4257 (GLfloat)units 4258 ); 4259} 4260 4261/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ 4262static void 4263android_glReadPixels__IIIIIILjava_nio_Buffer_2 4264 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { 4265 jint _exception = 0; 4266 const char * _exceptionType = NULL; 4267 const char * _exceptionMessage = NULL; 4268 jarray _array = (jarray) 0; 4269 jint _bufferOffset = (jint) 0; 4270 jint _remaining; 4271 GLvoid *pixels = (GLvoid *) 0; 4272 4273 if (!pixels_buf) { 4274 _exception = 1; 4275 _exceptionType = "java/lang/IllegalArgumentException"; 4276 _exceptionMessage = "pixels == null"; 4277 goto exit; 4278 } 4279 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4280 if (pixels == NULL) { 4281 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 4282 pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 4283 } 4284 glReadPixels( 4285 (GLint)x, 4286 (GLint)y, 4287 (GLsizei)width, 4288 (GLsizei)height, 4289 (GLenum)format, 4290 (GLenum)type, 4291 (GLvoid *)pixels 4292 ); 4293 4294exit: 4295 if (_array) { 4296 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE); 4297 } 4298 if (_exception) { 4299 jniThrowException(_env, _exceptionType, _exceptionMessage); 4300 } 4301} 4302 4303/* void glReleaseShaderCompiler ( void ) */ 4304static void 4305android_glReleaseShaderCompiler__ 4306 (JNIEnv *_env, jobject _this) { 4307 glReleaseShaderCompiler(); 4308} 4309 4310/* void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) */ 4311static void 4312android_glRenderbufferStorage__IIII 4313 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { 4314 glRenderbufferStorage( 4315 (GLenum)target, 4316 (GLenum)internalformat, 4317 (GLsizei)width, 4318 (GLsizei)height 4319 ); 4320} 4321 4322/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ 4323static void 4324android_glSampleCoverage__FZ 4325 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { 4326 glSampleCoverage( 4327 (GLclampf)value, 4328 (GLboolean)invert 4329 ); 4330} 4331 4332/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ 4333static void 4334android_glScissor__IIII 4335 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { 4336 glScissor( 4337 (GLint)x, 4338 (GLint)y, 4339 (GLsizei)width, 4340 (GLsizei)height 4341 ); 4342} 4343 4344/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ 4345static void 4346android_glShaderBinary__I_3IIILjava_nio_Buffer_2I 4347 (JNIEnv *_env, jobject _this, jint n, jintArray shaders_ref, jint offset, jint binaryformat, jobject binary_buf, jint length) { 4348 jint _exception = 0; 4349 const char * _exceptionType = NULL; 4350 const char * _exceptionMessage = NULL; 4351 jarray _array = (jarray) 0; 4352 jint _bufferOffset = (jint) 0; 4353 GLuint *shaders_base = (GLuint *) 0; 4354 jint _shadersRemaining; 4355 GLuint *shaders = (GLuint *) 0; 4356 jint _binaryRemaining; 4357 GLvoid *binary = (GLvoid *) 0; 4358 4359 if (!shaders_ref) { 4360 _exception = 1; 4361 _exceptionType = "java/lang/IllegalArgumentException"; 4362 _exceptionMessage = "shaders == null"; 4363 goto exit; 4364 } 4365 if (offset < 0) { 4366 _exception = 1; 4367 _exceptionType = "java/lang/IllegalArgumentException"; 4368 _exceptionMessage = "offset < 0"; 4369 goto exit; 4370 } 4371 _shadersRemaining = _env->GetArrayLength(shaders_ref) - offset; 4372 shaders_base = (GLuint *) 4373 _env->GetIntArrayElements(shaders_ref, (jboolean *)0); 4374 shaders = shaders_base + offset; 4375 4376 if (!binary_buf) { 4377 _exception = 1; 4378 _exceptionType = "java/lang/IllegalArgumentException"; 4379 _exceptionMessage = "binary == null"; 4380 goto exit; 4381 } 4382 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset); 4383 if (_binaryRemaining < length) { 4384 _exception = 1; 4385 _exceptionType = "java/lang/IllegalArgumentException"; 4386 _exceptionMessage = "remaining() < length < needed"; 4387 goto exit; 4388 } 4389 if (binary == NULL) { 4390 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 4391 binary = (GLvoid *) (_binaryBase + _bufferOffset); 4392 } 4393 glShaderBinary( 4394 (GLsizei)n, 4395 (GLuint *)shaders, 4396 (GLenum)binaryformat, 4397 (GLvoid *)binary, 4398 (GLsizei)length 4399 ); 4400 4401exit: 4402 if (_array) { 4403 releasePointer(_env, _array, binary, JNI_FALSE); 4404 } 4405 if (shaders_base) { 4406 _env->ReleaseIntArrayElements(shaders_ref, (jint*)shaders_base, 4407 JNI_ABORT); 4408 } 4409 if (_exception) { 4410 jniThrowException(_env, _exceptionType, _exceptionMessage); 4411 } 4412} 4413 4414/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ 4415static void 4416android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I 4417 (JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) { 4418 jint _exception = 0; 4419 const char * _exceptionType = NULL; 4420 const char * _exceptionMessage = NULL; 4421 jintArray _shadersArray = (jintArray) 0; 4422 jint _shadersBufferOffset = (jint) 0; 4423 jintArray _binaryArray = (jintArray) 0; 4424 jint _binaryBufferOffset = (jint) 0; 4425 jint _shadersRemaining; 4426 GLuint *shaders = (GLuint *) 0; 4427 jint _binaryRemaining; 4428 GLvoid *binary = (GLvoid *) 0; 4429 4430 if (!shaders_buf) { 4431 _exception = 1; 4432 _exceptionType = "java/lang/IllegalArgumentException"; 4433 _exceptionMessage = "shaders == null"; 4434 goto exit; 4435 } 4436 shaders = (GLuint *)getPointer(_env, shaders_buf, (jarray*)&_shadersArray, &_shadersRemaining, &_shadersBufferOffset); 4437 if (!binary_buf) { 4438 _exception = 1; 4439 _exceptionType = "java/lang/IllegalArgumentException"; 4440 _exceptionMessage = "binary == null"; 4441 goto exit; 4442 } 4443 binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset); 4444 if (_binaryRemaining < length) { 4445 _exception = 1; 4446 _exceptionType = "java/lang/IllegalArgumentException"; 4447 _exceptionMessage = "remaining() < length < needed"; 4448 goto exit; 4449 } 4450 if (shaders == NULL) { 4451 char * _shadersBase = (char *)_env->GetIntArrayElements(_shadersArray, (jboolean *) 0); 4452 shaders = (GLuint *) (_shadersBase + _shadersBufferOffset); 4453 } 4454 if (binary == NULL) { 4455 char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0); 4456 binary = (GLvoid *) (_binaryBase + _binaryBufferOffset); 4457 } 4458 glShaderBinary( 4459 (GLsizei)n, 4460 (GLuint *)shaders, 4461 (GLenum)binaryformat, 4462 (GLvoid *)binary, 4463 (GLsizei)length 4464 ); 4465 4466exit: 4467 if (_binaryArray) { 4468 releasePointer(_env, _binaryArray, binary, JNI_FALSE); 4469 } 4470 if (_shadersArray) { 4471 _env->ReleaseIntArrayElements(_shadersArray, (jint*)shaders, JNI_ABORT); 4472 } 4473 if (_exception) { 4474 jniThrowException(_env, _exceptionType, _exceptionMessage); 4475 } 4476} 4477 4478 4479/* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */ 4480static 4481void 4482android_glShaderSource 4483 (JNIEnv *_env, jobject _this, jint shader, jstring string) { 4484 4485 if (!string) { 4486 jniThrowException(_env, "java/lang/IllegalArgumentException", "string == null"); 4487 return; 4488 } 4489 4490 const char* nativeString = _env->GetStringUTFChars(string, 0); 4491 const char* strings[] = {nativeString}; 4492 glShaderSource(shader, 1, strings, 0); 4493 _env->ReleaseStringUTFChars(string, nativeString); 4494} 4495/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ 4496static void 4497android_glStencilFunc__III 4498 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { 4499 glStencilFunc( 4500 (GLenum)func, 4501 (GLint)ref, 4502 (GLuint)mask 4503 ); 4504} 4505 4506/* void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) */ 4507static void 4508android_glStencilFuncSeparate__IIII 4509 (JNIEnv *_env, jobject _this, jint face, jint func, jint ref, jint mask) { 4510 glStencilFuncSeparate( 4511 (GLenum)face, 4512 (GLenum)func, 4513 (GLint)ref, 4514 (GLuint)mask 4515 ); 4516} 4517 4518/* void glStencilMask ( GLuint mask ) */ 4519static void 4520android_glStencilMask__I 4521 (JNIEnv *_env, jobject _this, jint mask) { 4522 glStencilMask( 4523 (GLuint)mask 4524 ); 4525} 4526 4527/* void glStencilMaskSeparate ( GLenum face, GLuint mask ) */ 4528static void 4529android_glStencilMaskSeparate__II 4530 (JNIEnv *_env, jobject _this, jint face, jint mask) { 4531 glStencilMaskSeparate( 4532 (GLenum)face, 4533 (GLuint)mask 4534 ); 4535} 4536 4537/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ 4538static void 4539android_glStencilOp__III 4540 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { 4541 glStencilOp( 4542 (GLenum)fail, 4543 (GLenum)zfail, 4544 (GLenum)zpass 4545 ); 4546} 4547 4548/* void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) */ 4549static void 4550android_glStencilOpSeparate__IIII 4551 (JNIEnv *_env, jobject _this, jint face, jint fail, jint zfail, jint zpass) { 4552 glStencilOpSeparate( 4553 (GLenum)face, 4554 (GLenum)fail, 4555 (GLenum)zfail, 4556 (GLenum)zpass 4557 ); 4558} 4559 4560/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ 4561static void 4562android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 4563 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { 4564 jint _exception = 0; 4565 const char * _exceptionType = NULL; 4566 const char * _exceptionMessage = NULL; 4567 jarray _array = (jarray) 0; 4568 jint _bufferOffset = (jint) 0; 4569 jint _remaining; 4570 GLvoid *pixels = (GLvoid *) 0; 4571 4572 if (pixels_buf) { 4573 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4574 } 4575 if (pixels_buf && pixels == NULL) { 4576 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 4577 pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 4578 } 4579 glTexImage2D( 4580 (GLenum)target, 4581 (GLint)level, 4582 (GLint)internalformat, 4583 (GLsizei)width, 4584 (GLsizei)height, 4585 (GLint)border, 4586 (GLenum)format, 4587 (GLenum)type, 4588 (GLvoid *)pixels 4589 ); 4590 if (_array) { 4591 releasePointer(_env, _array, pixels, JNI_FALSE); 4592 } 4593 if (_exception) { 4594 jniThrowException(_env, _exceptionType, _exceptionMessage); 4595 } 4596} 4597 4598/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ 4599static void 4600android_glTexParameterf__IIF 4601 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { 4602 glTexParameterf( 4603 (GLenum)target, 4604 (GLenum)pname, 4605 (GLfloat)param 4606 ); 4607} 4608 4609/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 4610static void 4611android_glTexParameterfv__II_3FI 4612 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 4613 jint _exception = 0; 4614 const char * _exceptionType = NULL; 4615 const char * _exceptionMessage = NULL; 4616 GLfloat *params_base = (GLfloat *) 0; 4617 jint _remaining; 4618 GLfloat *params = (GLfloat *) 0; 4619 4620 if (!params_ref) { 4621 _exception = 1; 4622 _exceptionType = "java/lang/IllegalArgumentException"; 4623 _exceptionMessage = "params == null"; 4624 goto exit; 4625 } 4626 if (offset < 0) { 4627 _exception = 1; 4628 _exceptionType = "java/lang/IllegalArgumentException"; 4629 _exceptionMessage = "offset < 0"; 4630 goto exit; 4631 } 4632 _remaining = _env->GetArrayLength(params_ref) - offset; 4633 if (_remaining < 1) { 4634 _exception = 1; 4635 _exceptionType = "java/lang/IllegalArgumentException"; 4636 _exceptionMessage = "length - offset < 1 < needed"; 4637 goto exit; 4638 } 4639 params_base = (GLfloat *) 4640 _env->GetFloatArrayElements(params_ref, (jboolean *)0); 4641 params = params_base + offset; 4642 4643 glTexParameterfv( 4644 (GLenum)target, 4645 (GLenum)pname, 4646 (GLfloat *)params 4647 ); 4648 4649exit: 4650 if (params_base) { 4651 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 4652 JNI_ABORT); 4653 } 4654 if (_exception) { 4655 jniThrowException(_env, _exceptionType, _exceptionMessage); 4656 } 4657} 4658 4659/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 4660static void 4661android_glTexParameterfv__IILjava_nio_FloatBuffer_2 4662 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 4663 jint _exception = 0; 4664 const char * _exceptionType = NULL; 4665 const char * _exceptionMessage = NULL; 4666 jfloatArray _array = (jfloatArray) 0; 4667 jint _bufferOffset = (jint) 0; 4668 jint _remaining; 4669 GLfloat *params = (GLfloat *) 0; 4670 4671 if (!params_buf) { 4672 _exception = 1; 4673 _exceptionType = "java/lang/IllegalArgumentException"; 4674 _exceptionMessage = "params == null"; 4675 goto exit; 4676 } 4677 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4678 if (_remaining < 1) { 4679 _exception = 1; 4680 _exceptionType = "java/lang/IllegalArgumentException"; 4681 _exceptionMessage = "remaining() < 1 < needed"; 4682 goto exit; 4683 } 4684 if (params == NULL) { 4685 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 4686 params = (GLfloat *) (_paramsBase + _bufferOffset); 4687 } 4688 glTexParameterfv( 4689 (GLenum)target, 4690 (GLenum)pname, 4691 (GLfloat *)params 4692 ); 4693 4694exit: 4695 if (_array) { 4696 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); 4697 } 4698 if (_exception) { 4699 jniThrowException(_env, _exceptionType, _exceptionMessage); 4700 } 4701} 4702 4703/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ 4704static void 4705android_glTexParameteri__III 4706 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 4707 glTexParameteri( 4708 (GLenum)target, 4709 (GLenum)pname, 4710 (GLint)param 4711 ); 4712} 4713 4714/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 4715static void 4716android_glTexParameteriv__II_3II 4717 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 4718 jint _exception = 0; 4719 const char * _exceptionType = NULL; 4720 const char * _exceptionMessage = NULL; 4721 GLint *params_base = (GLint *) 0; 4722 jint _remaining; 4723 GLint *params = (GLint *) 0; 4724 4725 if (!params_ref) { 4726 _exception = 1; 4727 _exceptionType = "java/lang/IllegalArgumentException"; 4728 _exceptionMessage = "params == null"; 4729 goto exit; 4730 } 4731 if (offset < 0) { 4732 _exception = 1; 4733 _exceptionType = "java/lang/IllegalArgumentException"; 4734 _exceptionMessage = "offset < 0"; 4735 goto exit; 4736 } 4737 _remaining = _env->GetArrayLength(params_ref) - offset; 4738 if (_remaining < 1) { 4739 _exception = 1; 4740 _exceptionType = "java/lang/IllegalArgumentException"; 4741 _exceptionMessage = "length - offset < 1 < needed"; 4742 goto exit; 4743 } 4744 params_base = (GLint *) 4745 _env->GetIntArrayElements(params_ref, (jboolean *)0); 4746 params = params_base + offset; 4747 4748 glTexParameteriv( 4749 (GLenum)target, 4750 (GLenum)pname, 4751 (GLint *)params 4752 ); 4753 4754exit: 4755 if (params_base) { 4756 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 4757 JNI_ABORT); 4758 } 4759 if (_exception) { 4760 jniThrowException(_env, _exceptionType, _exceptionMessage); 4761 } 4762} 4763 4764/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 4765static void 4766android_glTexParameteriv__IILjava_nio_IntBuffer_2 4767 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 4768 jint _exception = 0; 4769 const char * _exceptionType = NULL; 4770 const char * _exceptionMessage = NULL; 4771 jintArray _array = (jintArray) 0; 4772 jint _bufferOffset = (jint) 0; 4773 jint _remaining; 4774 GLint *params = (GLint *) 0; 4775 4776 if (!params_buf) { 4777 _exception = 1; 4778 _exceptionType = "java/lang/IllegalArgumentException"; 4779 _exceptionMessage = "params == null"; 4780 goto exit; 4781 } 4782 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4783 if (_remaining < 1) { 4784 _exception = 1; 4785 _exceptionType = "java/lang/IllegalArgumentException"; 4786 _exceptionMessage = "remaining() < 1 < needed"; 4787 goto exit; 4788 } 4789 if (params == NULL) { 4790 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 4791 params = (GLint *) (_paramsBase + _bufferOffset); 4792 } 4793 glTexParameteriv( 4794 (GLenum)target, 4795 (GLenum)pname, 4796 (GLint *)params 4797 ); 4798 4799exit: 4800 if (_array) { 4801 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); 4802 } 4803 if (_exception) { 4804 jniThrowException(_env, _exceptionType, _exceptionMessage); 4805 } 4806} 4807 4808/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ 4809static void 4810android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 4811 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { 4812 jint _exception = 0; 4813 const char * _exceptionType = NULL; 4814 const char * _exceptionMessage = NULL; 4815 jarray _array = (jarray) 0; 4816 jint _bufferOffset = (jint) 0; 4817 jint _remaining; 4818 GLvoid *pixels = (GLvoid *) 0; 4819 4820 if (pixels_buf) { 4821 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4822 } 4823 if (pixels_buf && pixels == NULL) { 4824 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 4825 pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 4826 } 4827 glTexSubImage2D( 4828 (GLenum)target, 4829 (GLint)level, 4830 (GLint)xoffset, 4831 (GLint)yoffset, 4832 (GLsizei)width, 4833 (GLsizei)height, 4834 (GLenum)format, 4835 (GLenum)type, 4836 (GLvoid *)pixels 4837 ); 4838 if (_array) { 4839 releasePointer(_env, _array, pixels, JNI_FALSE); 4840 } 4841 if (_exception) { 4842 jniThrowException(_env, _exceptionType, _exceptionMessage); 4843 } 4844} 4845 4846/* void glUniform1f ( GLint location, GLfloat x ) */ 4847static void 4848android_glUniform1f__IF 4849 (JNIEnv *_env, jobject _this, jint location, jfloat x) { 4850 glUniform1f( 4851 (GLint)location, 4852 (GLfloat)x 4853 ); 4854} 4855 4856/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4857static void 4858android_glUniform1fv__II_3FI 4859 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 4860 jint _exception = 0; 4861 const char * _exceptionType = NULL; 4862 const char * _exceptionMessage = NULL; 4863 GLfloat *v_base = (GLfloat *) 0; 4864 jint _remaining; 4865 GLfloat *v = (GLfloat *) 0; 4866 4867 if (!v_ref) { 4868 _exception = 1; 4869 _exceptionType = "java/lang/IllegalArgumentException"; 4870 _exceptionMessage = "v == null"; 4871 goto exit; 4872 } 4873 if (offset < 0) { 4874 _exception = 1; 4875 _exceptionType = "java/lang/IllegalArgumentException"; 4876 _exceptionMessage = "offset < 0"; 4877 goto exit; 4878 } 4879 _remaining = _env->GetArrayLength(v_ref) - offset; 4880 if (_remaining < count) { 4881 _exception = 1; 4882 _exceptionType = "java/lang/IllegalArgumentException"; 4883 _exceptionMessage = "length - offset < count < needed"; 4884 goto exit; 4885 } 4886 v_base = (GLfloat *) 4887 _env->GetFloatArrayElements(v_ref, (jboolean *)0); 4888 v = v_base + offset; 4889 4890 glUniform1fv( 4891 (GLint)location, 4892 (GLsizei)count, 4893 (GLfloat *)v 4894 ); 4895 4896exit: 4897 if (v_base) { 4898 _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 4899 JNI_ABORT); 4900 } 4901 if (_exception) { 4902 jniThrowException(_env, _exceptionType, _exceptionMessage); 4903 } 4904} 4905 4906/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4907static void 4908android_glUniform1fv__IILjava_nio_FloatBuffer_2 4909 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 4910 jint _exception = 0; 4911 const char * _exceptionType = NULL; 4912 const char * _exceptionMessage = NULL; 4913 jfloatArray _array = (jfloatArray) 0; 4914 jint _bufferOffset = (jint) 0; 4915 jint _remaining; 4916 GLfloat *v = (GLfloat *) 0; 4917 4918 if (!v_buf) { 4919 _exception = 1; 4920 _exceptionType = "java/lang/IllegalArgumentException"; 4921 _exceptionMessage = "v == null"; 4922 goto exit; 4923 } 4924 v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4925 if (_remaining < count) { 4926 _exception = 1; 4927 _exceptionType = "java/lang/IllegalArgumentException"; 4928 _exceptionMessage = "remaining() < count < needed"; 4929 goto exit; 4930 } 4931 if (v == NULL) { 4932 char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 4933 v = (GLfloat *) (_vBase + _bufferOffset); 4934 } 4935 glUniform1fv( 4936 (GLint)location, 4937 (GLsizei)count, 4938 (GLfloat *)v 4939 ); 4940 4941exit: 4942 if (_array) { 4943 _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 4944 } 4945 if (_exception) { 4946 jniThrowException(_env, _exceptionType, _exceptionMessage); 4947 } 4948} 4949 4950/* void glUniform1i ( GLint location, GLint x ) */ 4951static void 4952android_glUniform1i__II 4953 (JNIEnv *_env, jobject _this, jint location, jint x) { 4954 glUniform1i( 4955 (GLint)location, 4956 (GLint)x 4957 ); 4958} 4959 4960/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ 4961static void 4962android_glUniform1iv__II_3II 4963 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 4964 jint _exception = 0; 4965 const char * _exceptionType = NULL; 4966 const char * _exceptionMessage = NULL; 4967 GLint *v_base = (GLint *) 0; 4968 jint _remaining; 4969 GLint *v = (GLint *) 0; 4970 4971 if (!v_ref) { 4972 _exception = 1; 4973 _exceptionType = "java/lang/IllegalArgumentException"; 4974 _exceptionMessage = "v == null"; 4975 goto exit; 4976 } 4977 if (offset < 0) { 4978 _exception = 1; 4979 _exceptionType = "java/lang/IllegalArgumentException"; 4980 _exceptionMessage = "offset < 0"; 4981 goto exit; 4982 } 4983 _remaining = _env->GetArrayLength(v_ref) - offset; 4984 if (_remaining < count) { 4985 _exception = 1; 4986 _exceptionType = "java/lang/IllegalArgumentException"; 4987 _exceptionMessage = "length - offset < count < needed"; 4988 goto exit; 4989 } 4990 v_base = (GLint *) 4991 _env->GetIntArrayElements(v_ref, (jboolean *)0); 4992 v = v_base + offset; 4993 4994 glUniform1iv( 4995 (GLint)location, 4996 (GLsizei)count, 4997 (GLint *)v 4998 ); 4999 5000exit: 5001 if (v_base) { 5002 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5003 JNI_ABORT); 5004 } 5005 if (_exception) { 5006 jniThrowException(_env, _exceptionType, _exceptionMessage); 5007 } 5008} 5009 5010/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ 5011static void 5012android_glUniform1iv__IILjava_nio_IntBuffer_2 5013 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5014 jint _exception = 0; 5015 const char * _exceptionType = NULL; 5016 const char * _exceptionMessage = NULL; 5017 jintArray _array = (jintArray) 0; 5018 jint _bufferOffset = (jint) 0; 5019 jint _remaining; 5020 GLint *v = (GLint *) 0; 5021 5022 if (!v_buf) { 5023 _exception = 1; 5024 _exceptionType = "java/lang/IllegalArgumentException"; 5025 _exceptionMessage = "v == null"; 5026 goto exit; 5027 } 5028 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5029 if (_remaining < count) { 5030 _exception = 1; 5031 _exceptionType = "java/lang/IllegalArgumentException"; 5032 _exceptionMessage = "remaining() < count < needed"; 5033 goto exit; 5034 } 5035 if (v == NULL) { 5036 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 5037 v = (GLint *) (_vBase + _bufferOffset); 5038 } 5039 glUniform1iv( 5040 (GLint)location, 5041 (GLsizei)count, 5042 (GLint *)v 5043 ); 5044 5045exit: 5046 if (_array) { 5047 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5048 } 5049 if (_exception) { 5050 jniThrowException(_env, _exceptionType, _exceptionMessage); 5051 } 5052} 5053 5054/* void glUniform2f ( GLint location, GLfloat x, GLfloat y ) */ 5055static void 5056android_glUniform2f__IFF 5057 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y) { 5058 glUniform2f( 5059 (GLint)location, 5060 (GLfloat)x, 5061 (GLfloat)y 5062 ); 5063} 5064 5065/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5066static void 5067android_glUniform2fv__II_3FI 5068 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 5069 jint _exception = 0; 5070 const char * _exceptionType = NULL; 5071 const char * _exceptionMessage = NULL; 5072 GLfloat *v_base = (GLfloat *) 0; 5073 jint _remaining; 5074 GLfloat *v = (GLfloat *) 0; 5075 5076 if (!v_ref) { 5077 _exception = 1; 5078 _exceptionType = "java/lang/IllegalArgumentException"; 5079 _exceptionMessage = "v == null"; 5080 goto exit; 5081 } 5082 if (offset < 0) { 5083 _exception = 1; 5084 _exceptionType = "java/lang/IllegalArgumentException"; 5085 _exceptionMessage = "offset < 0"; 5086 goto exit; 5087 } 5088 _remaining = _env->GetArrayLength(v_ref) - offset; 5089 if (_remaining < count*2) { 5090 _exception = 1; 5091 _exceptionType = "java/lang/IllegalArgumentException"; 5092 _exceptionMessage = "length - offset < count*2 < needed"; 5093 goto exit; 5094 } 5095 v_base = (GLfloat *) 5096 _env->GetFloatArrayElements(v_ref, (jboolean *)0); 5097 v = v_base + offset; 5098 5099 glUniform2fv( 5100 (GLint)location, 5101 (GLsizei)count, 5102 (GLfloat *)v 5103 ); 5104 5105exit: 5106 if (v_base) { 5107 _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 5108 JNI_ABORT); 5109 } 5110 if (_exception) { 5111 jniThrowException(_env, _exceptionType, _exceptionMessage); 5112 } 5113} 5114 5115/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5116static void 5117android_glUniform2fv__IILjava_nio_FloatBuffer_2 5118 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5119 jint _exception = 0; 5120 const char * _exceptionType = NULL; 5121 const char * _exceptionMessage = NULL; 5122 jfloatArray _array = (jfloatArray) 0; 5123 jint _bufferOffset = (jint) 0; 5124 jint _remaining; 5125 GLfloat *v = (GLfloat *) 0; 5126 5127 if (!v_buf) { 5128 _exception = 1; 5129 _exceptionType = "java/lang/IllegalArgumentException"; 5130 _exceptionMessage = "v == null"; 5131 goto exit; 5132 } 5133 v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5134 if (_remaining < count*2) { 5135 _exception = 1; 5136 _exceptionType = "java/lang/IllegalArgumentException"; 5137 _exceptionMessage = "remaining() < count*2 < needed"; 5138 goto exit; 5139 } 5140 if (v == NULL) { 5141 char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5142 v = (GLfloat *) (_vBase + _bufferOffset); 5143 } 5144 glUniform2fv( 5145 (GLint)location, 5146 (GLsizei)count, 5147 (GLfloat *)v 5148 ); 5149 5150exit: 5151 if (_array) { 5152 _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 5153 } 5154 if (_exception) { 5155 jniThrowException(_env, _exceptionType, _exceptionMessage); 5156 } 5157} 5158 5159/* void glUniform2i ( GLint location, GLint x, GLint y ) */ 5160static void 5161android_glUniform2i__III 5162 (JNIEnv *_env, jobject _this, jint location, jint x, jint y) { 5163 glUniform2i( 5164 (GLint)location, 5165 (GLint)x, 5166 (GLint)y 5167 ); 5168} 5169 5170/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ 5171static void 5172android_glUniform2iv__II_3II 5173 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 5174 jint _exception = 0; 5175 const char * _exceptionType = NULL; 5176 const char * _exceptionMessage = NULL; 5177 GLint *v_base = (GLint *) 0; 5178 jint _remaining; 5179 GLint *v = (GLint *) 0; 5180 5181 if (!v_ref) { 5182 _exception = 1; 5183 _exceptionType = "java/lang/IllegalArgumentException"; 5184 _exceptionMessage = "v == null"; 5185 goto exit; 5186 } 5187 if (offset < 0) { 5188 _exception = 1; 5189 _exceptionType = "java/lang/IllegalArgumentException"; 5190 _exceptionMessage = "offset < 0"; 5191 goto exit; 5192 } 5193 _remaining = _env->GetArrayLength(v_ref) - offset; 5194 if (_remaining < count*2) { 5195 _exception = 1; 5196 _exceptionType = "java/lang/IllegalArgumentException"; 5197 _exceptionMessage = "length - offset < count*2 < needed"; 5198 goto exit; 5199 } 5200 v_base = (GLint *) 5201 _env->GetIntArrayElements(v_ref, (jboolean *)0); 5202 v = v_base + offset; 5203 5204 glUniform2iv( 5205 (GLint)location, 5206 (GLsizei)count, 5207 (GLint *)v 5208 ); 5209 5210exit: 5211 if (v_base) { 5212 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5213 JNI_ABORT); 5214 } 5215 if (_exception) { 5216 jniThrowException(_env, _exceptionType, _exceptionMessage); 5217 } 5218} 5219 5220/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ 5221static void 5222android_glUniform2iv__IILjava_nio_IntBuffer_2 5223 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5224 jint _exception = 0; 5225 const char * _exceptionType = NULL; 5226 const char * _exceptionMessage = NULL; 5227 jintArray _array = (jintArray) 0; 5228 jint _bufferOffset = (jint) 0; 5229 jint _remaining; 5230 GLint *v = (GLint *) 0; 5231 5232 if (!v_buf) { 5233 _exception = 1; 5234 _exceptionType = "java/lang/IllegalArgumentException"; 5235 _exceptionMessage = "v == null"; 5236 goto exit; 5237 } 5238 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5239 if (_remaining < count*2) { 5240 _exception = 1; 5241 _exceptionType = "java/lang/IllegalArgumentException"; 5242 _exceptionMessage = "remaining() < count*2 < needed"; 5243 goto exit; 5244 } 5245 if (v == NULL) { 5246 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 5247 v = (GLint *) (_vBase + _bufferOffset); 5248 } 5249 glUniform2iv( 5250 (GLint)location, 5251 (GLsizei)count, 5252 (GLint *)v 5253 ); 5254 5255exit: 5256 if (_array) { 5257 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5258 } 5259 if (_exception) { 5260 jniThrowException(_env, _exceptionType, _exceptionMessage); 5261 } 5262} 5263 5264/* void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) */ 5265static void 5266android_glUniform3f__IFFF 5267 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z) { 5268 glUniform3f( 5269 (GLint)location, 5270 (GLfloat)x, 5271 (GLfloat)y, 5272 (GLfloat)z 5273 ); 5274} 5275 5276/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5277static void 5278android_glUniform3fv__II_3FI 5279 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 5280 jint _exception = 0; 5281 const char * _exceptionType = NULL; 5282 const char * _exceptionMessage = NULL; 5283 GLfloat *v_base = (GLfloat *) 0; 5284 jint _remaining; 5285 GLfloat *v = (GLfloat *) 0; 5286 5287 if (!v_ref) { 5288 _exception = 1; 5289 _exceptionType = "java/lang/IllegalArgumentException"; 5290 _exceptionMessage = "v == null"; 5291 goto exit; 5292 } 5293 if (offset < 0) { 5294 _exception = 1; 5295 _exceptionType = "java/lang/IllegalArgumentException"; 5296 _exceptionMessage = "offset < 0"; 5297 goto exit; 5298 } 5299 _remaining = _env->GetArrayLength(v_ref) - offset; 5300 if (_remaining < count*3) { 5301 _exception = 1; 5302 _exceptionType = "java/lang/IllegalArgumentException"; 5303 _exceptionMessage = "length - offset < count*3 < needed"; 5304 goto exit; 5305 } 5306 v_base = (GLfloat *) 5307 _env->GetFloatArrayElements(v_ref, (jboolean *)0); 5308 v = v_base + offset; 5309 5310 glUniform3fv( 5311 (GLint)location, 5312 (GLsizei)count, 5313 (GLfloat *)v 5314 ); 5315 5316exit: 5317 if (v_base) { 5318 _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 5319 JNI_ABORT); 5320 } 5321 if (_exception) { 5322 jniThrowException(_env, _exceptionType, _exceptionMessage); 5323 } 5324} 5325 5326/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5327static void 5328android_glUniform3fv__IILjava_nio_FloatBuffer_2 5329 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5330 jint _exception = 0; 5331 const char * _exceptionType = NULL; 5332 const char * _exceptionMessage = NULL; 5333 jfloatArray _array = (jfloatArray) 0; 5334 jint _bufferOffset = (jint) 0; 5335 jint _remaining; 5336 GLfloat *v = (GLfloat *) 0; 5337 5338 if (!v_buf) { 5339 _exception = 1; 5340 _exceptionType = "java/lang/IllegalArgumentException"; 5341 _exceptionMessage = "v == null"; 5342 goto exit; 5343 } 5344 v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5345 if (_remaining < count*3) { 5346 _exception = 1; 5347 _exceptionType = "java/lang/IllegalArgumentException"; 5348 _exceptionMessage = "remaining() < count*3 < needed"; 5349 goto exit; 5350 } 5351 if (v == NULL) { 5352 char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5353 v = (GLfloat *) (_vBase + _bufferOffset); 5354 } 5355 glUniform3fv( 5356 (GLint)location, 5357 (GLsizei)count, 5358 (GLfloat *)v 5359 ); 5360 5361exit: 5362 if (_array) { 5363 _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 5364 } 5365 if (_exception) { 5366 jniThrowException(_env, _exceptionType, _exceptionMessage); 5367 } 5368} 5369 5370/* void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) */ 5371static void 5372android_glUniform3i__IIII 5373 (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z) { 5374 glUniform3i( 5375 (GLint)location, 5376 (GLint)x, 5377 (GLint)y, 5378 (GLint)z 5379 ); 5380} 5381 5382/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ 5383static void 5384android_glUniform3iv__II_3II 5385 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 5386 jint _exception = 0; 5387 const char * _exceptionType = NULL; 5388 const char * _exceptionMessage = NULL; 5389 GLint *v_base = (GLint *) 0; 5390 jint _remaining; 5391 GLint *v = (GLint *) 0; 5392 5393 if (!v_ref) { 5394 _exception = 1; 5395 _exceptionType = "java/lang/IllegalArgumentException"; 5396 _exceptionMessage = "v == null"; 5397 goto exit; 5398 } 5399 if (offset < 0) { 5400 _exception = 1; 5401 _exceptionType = "java/lang/IllegalArgumentException"; 5402 _exceptionMessage = "offset < 0"; 5403 goto exit; 5404 } 5405 _remaining = _env->GetArrayLength(v_ref) - offset; 5406 if (_remaining < count*3) { 5407 _exception = 1; 5408 _exceptionType = "java/lang/IllegalArgumentException"; 5409 _exceptionMessage = "length - offset < count*3 < needed"; 5410 goto exit; 5411 } 5412 v_base = (GLint *) 5413 _env->GetIntArrayElements(v_ref, (jboolean *)0); 5414 v = v_base + offset; 5415 5416 glUniform3iv( 5417 (GLint)location, 5418 (GLsizei)count, 5419 (GLint *)v 5420 ); 5421 5422exit: 5423 if (v_base) { 5424 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5425 JNI_ABORT); 5426 } 5427 if (_exception) { 5428 jniThrowException(_env, _exceptionType, _exceptionMessage); 5429 } 5430} 5431 5432/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ 5433static void 5434android_glUniform3iv__IILjava_nio_IntBuffer_2 5435 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5436 jint _exception = 0; 5437 const char * _exceptionType = NULL; 5438 const char * _exceptionMessage = NULL; 5439 jintArray _array = (jintArray) 0; 5440 jint _bufferOffset = (jint) 0; 5441 jint _remaining; 5442 GLint *v = (GLint *) 0; 5443 5444 if (!v_buf) { 5445 _exception = 1; 5446 _exceptionType = "java/lang/IllegalArgumentException"; 5447 _exceptionMessage = "v == null"; 5448 goto exit; 5449 } 5450 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5451 if (_remaining < count*3) { 5452 _exception = 1; 5453 _exceptionType = "java/lang/IllegalArgumentException"; 5454 _exceptionMessage = "remaining() < count*3 < needed"; 5455 goto exit; 5456 } 5457 if (v == NULL) { 5458 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 5459 v = (GLint *) (_vBase + _bufferOffset); 5460 } 5461 glUniform3iv( 5462 (GLint)location, 5463 (GLsizei)count, 5464 (GLint *)v 5465 ); 5466 5467exit: 5468 if (_array) { 5469 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5470 } 5471 if (_exception) { 5472 jniThrowException(_env, _exceptionType, _exceptionMessage); 5473 } 5474} 5475 5476/* void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ 5477static void 5478android_glUniform4f__IFFFF 5479 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z, jfloat w) { 5480 glUniform4f( 5481 (GLint)location, 5482 (GLfloat)x, 5483 (GLfloat)y, 5484 (GLfloat)z, 5485 (GLfloat)w 5486 ); 5487} 5488 5489/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5490static void 5491android_glUniform4fv__II_3FI 5492 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 5493 jint _exception = 0; 5494 const char * _exceptionType = NULL; 5495 const char * _exceptionMessage = NULL; 5496 GLfloat *v_base = (GLfloat *) 0; 5497 jint _remaining; 5498 GLfloat *v = (GLfloat *) 0; 5499 5500 if (!v_ref) { 5501 _exception = 1; 5502 _exceptionType = "java/lang/IllegalArgumentException"; 5503 _exceptionMessage = "v == null"; 5504 goto exit; 5505 } 5506 if (offset < 0) { 5507 _exception = 1; 5508 _exceptionType = "java/lang/IllegalArgumentException"; 5509 _exceptionMessage = "offset < 0"; 5510 goto exit; 5511 } 5512 _remaining = _env->GetArrayLength(v_ref) - offset; 5513 if (_remaining < count*4) { 5514 _exception = 1; 5515 _exceptionType = "java/lang/IllegalArgumentException"; 5516 _exceptionMessage = "length - offset < count*4 < needed"; 5517 goto exit; 5518 } 5519 v_base = (GLfloat *) 5520 _env->GetFloatArrayElements(v_ref, (jboolean *)0); 5521 v = v_base + offset; 5522 5523 glUniform4fv( 5524 (GLint)location, 5525 (GLsizei)count, 5526 (GLfloat *)v 5527 ); 5528 5529exit: 5530 if (v_base) { 5531 _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 5532 JNI_ABORT); 5533 } 5534 if (_exception) { 5535 jniThrowException(_env, _exceptionType, _exceptionMessage); 5536 } 5537} 5538 5539/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5540static void 5541android_glUniform4fv__IILjava_nio_FloatBuffer_2 5542 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5543 jint _exception = 0; 5544 const char * _exceptionType = NULL; 5545 const char * _exceptionMessage = NULL; 5546 jfloatArray _array = (jfloatArray) 0; 5547 jint _bufferOffset = (jint) 0; 5548 jint _remaining; 5549 GLfloat *v = (GLfloat *) 0; 5550 5551 if (!v_buf) { 5552 _exception = 1; 5553 _exceptionType = "java/lang/IllegalArgumentException"; 5554 _exceptionMessage = "v == null"; 5555 goto exit; 5556 } 5557 v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5558 if (_remaining < count*4) { 5559 _exception = 1; 5560 _exceptionType = "java/lang/IllegalArgumentException"; 5561 _exceptionMessage = "remaining() < count*4 < needed"; 5562 goto exit; 5563 } 5564 if (v == NULL) { 5565 char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5566 v = (GLfloat *) (_vBase + _bufferOffset); 5567 } 5568 glUniform4fv( 5569 (GLint)location, 5570 (GLsizei)count, 5571 (GLfloat *)v 5572 ); 5573 5574exit: 5575 if (_array) { 5576 _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 5577 } 5578 if (_exception) { 5579 jniThrowException(_env, _exceptionType, _exceptionMessage); 5580 } 5581} 5582 5583/* void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) */ 5584static void 5585android_glUniform4i__IIIII 5586 (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z, jint w) { 5587 glUniform4i( 5588 (GLint)location, 5589 (GLint)x, 5590 (GLint)y, 5591 (GLint)z, 5592 (GLint)w 5593 ); 5594} 5595 5596/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ 5597static void 5598android_glUniform4iv__II_3II 5599 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 5600 jint _exception = 0; 5601 const char * _exceptionType = NULL; 5602 const char * _exceptionMessage = NULL; 5603 GLint *v_base = (GLint *) 0; 5604 jint _remaining; 5605 GLint *v = (GLint *) 0; 5606 5607 if (!v_ref) { 5608 _exception = 1; 5609 _exceptionType = "java/lang/IllegalArgumentException"; 5610 _exceptionMessage = "v == null"; 5611 goto exit; 5612 } 5613 if (offset < 0) { 5614 _exception = 1; 5615 _exceptionType = "java/lang/IllegalArgumentException"; 5616 _exceptionMessage = "offset < 0"; 5617 goto exit; 5618 } 5619 _remaining = _env->GetArrayLength(v_ref) - offset; 5620 if (_remaining < count*4) { 5621 _exception = 1; 5622 _exceptionType = "java/lang/IllegalArgumentException"; 5623 _exceptionMessage = "length - offset < count*4 < needed"; 5624 goto exit; 5625 } 5626 v_base = (GLint *) 5627 _env->GetIntArrayElements(v_ref, (jboolean *)0); 5628 v = v_base + offset; 5629 5630 glUniform4iv( 5631 (GLint)location, 5632 (GLsizei)count, 5633 (GLint *)v 5634 ); 5635 5636exit: 5637 if (v_base) { 5638 _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5639 JNI_ABORT); 5640 } 5641 if (_exception) { 5642 jniThrowException(_env, _exceptionType, _exceptionMessage); 5643 } 5644} 5645 5646/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ 5647static void 5648android_glUniform4iv__IILjava_nio_IntBuffer_2 5649 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 5650 jint _exception = 0; 5651 const char * _exceptionType = NULL; 5652 const char * _exceptionMessage = NULL; 5653 jintArray _array = (jintArray) 0; 5654 jint _bufferOffset = (jint) 0; 5655 jint _remaining; 5656 GLint *v = (GLint *) 0; 5657 5658 if (!v_buf) { 5659 _exception = 1; 5660 _exceptionType = "java/lang/IllegalArgumentException"; 5661 _exceptionMessage = "v == null"; 5662 goto exit; 5663 } 5664 v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5665 if (_remaining < count*4) { 5666 _exception = 1; 5667 _exceptionType = "java/lang/IllegalArgumentException"; 5668 _exceptionMessage = "remaining() < count*4 < needed"; 5669 goto exit; 5670 } 5671 if (v == NULL) { 5672 char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 5673 v = (GLint *) (_vBase + _bufferOffset); 5674 } 5675 glUniform4iv( 5676 (GLint)location, 5677 (GLsizei)count, 5678 (GLint *)v 5679 ); 5680 5681exit: 5682 if (_array) { 5683 _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5684 } 5685 if (_exception) { 5686 jniThrowException(_env, _exceptionType, _exceptionMessage); 5687 } 5688} 5689 5690/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5691static void 5692android_glUniformMatrix2fv__IIZ_3FI 5693 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 5694 jint _exception = 0; 5695 const char * _exceptionType = NULL; 5696 const char * _exceptionMessage = NULL; 5697 GLfloat *value_base = (GLfloat *) 0; 5698 jint _remaining; 5699 GLfloat *value = (GLfloat *) 0; 5700 5701 if (!value_ref) { 5702 _exception = 1; 5703 _exceptionType = "java/lang/IllegalArgumentException"; 5704 _exceptionMessage = "value == null"; 5705 goto exit; 5706 } 5707 if (offset < 0) { 5708 _exception = 1; 5709 _exceptionType = "java/lang/IllegalArgumentException"; 5710 _exceptionMessage = "offset < 0"; 5711 goto exit; 5712 } 5713 _remaining = _env->GetArrayLength(value_ref) - offset; 5714 if (_remaining < count*4) { 5715 _exception = 1; 5716 _exceptionType = "java/lang/IllegalArgumentException"; 5717 _exceptionMessage = "length - offset < count*4 < needed"; 5718 goto exit; 5719 } 5720 value_base = (GLfloat *) 5721 _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5722 value = value_base + offset; 5723 5724 glUniformMatrix2fv( 5725 (GLint)location, 5726 (GLsizei)count, 5727 (GLboolean)transpose, 5728 (GLfloat *)value 5729 ); 5730 5731exit: 5732 if (value_base) { 5733 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5734 JNI_ABORT); 5735 } 5736 if (_exception) { 5737 jniThrowException(_env, _exceptionType, _exceptionMessage); 5738 } 5739} 5740 5741/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5742static void 5743android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 5744 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 5745 jint _exception = 0; 5746 const char * _exceptionType = NULL; 5747 const char * _exceptionMessage = NULL; 5748 jfloatArray _array = (jfloatArray) 0; 5749 jint _bufferOffset = (jint) 0; 5750 jint _remaining; 5751 GLfloat *value = (GLfloat *) 0; 5752 5753 if (!value_buf) { 5754 _exception = 1; 5755 _exceptionType = "java/lang/IllegalArgumentException"; 5756 _exceptionMessage = "value == null"; 5757 goto exit; 5758 } 5759 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5760 if (_remaining < count*4) { 5761 _exception = 1; 5762 _exceptionType = "java/lang/IllegalArgumentException"; 5763 _exceptionMessage = "remaining() < count*4 < needed"; 5764 goto exit; 5765 } 5766 if (value == NULL) { 5767 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5768 value = (GLfloat *) (_valueBase + _bufferOffset); 5769 } 5770 glUniformMatrix2fv( 5771 (GLint)location, 5772 (GLsizei)count, 5773 (GLboolean)transpose, 5774 (GLfloat *)value 5775 ); 5776 5777exit: 5778 if (_array) { 5779 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5780 } 5781 if (_exception) { 5782 jniThrowException(_env, _exceptionType, _exceptionMessage); 5783 } 5784} 5785 5786/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5787static void 5788android_glUniformMatrix3fv__IIZ_3FI 5789 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 5790 jint _exception = 0; 5791 const char * _exceptionType = NULL; 5792 const char * _exceptionMessage = NULL; 5793 GLfloat *value_base = (GLfloat *) 0; 5794 jint _remaining; 5795 GLfloat *value = (GLfloat *) 0; 5796 5797 if (!value_ref) { 5798 _exception = 1; 5799 _exceptionType = "java/lang/IllegalArgumentException"; 5800 _exceptionMessage = "value == null"; 5801 goto exit; 5802 } 5803 if (offset < 0) { 5804 _exception = 1; 5805 _exceptionType = "java/lang/IllegalArgumentException"; 5806 _exceptionMessage = "offset < 0"; 5807 goto exit; 5808 } 5809 _remaining = _env->GetArrayLength(value_ref) - offset; 5810 if (_remaining < count*9) { 5811 _exception = 1; 5812 _exceptionType = "java/lang/IllegalArgumentException"; 5813 _exceptionMessage = "length - offset < count*9 < needed"; 5814 goto exit; 5815 } 5816 value_base = (GLfloat *) 5817 _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5818 value = value_base + offset; 5819 5820 glUniformMatrix3fv( 5821 (GLint)location, 5822 (GLsizei)count, 5823 (GLboolean)transpose, 5824 (GLfloat *)value 5825 ); 5826 5827exit: 5828 if (value_base) { 5829 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5830 JNI_ABORT); 5831 } 5832 if (_exception) { 5833 jniThrowException(_env, _exceptionType, _exceptionMessage); 5834 } 5835} 5836 5837/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5838static void 5839android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 5840 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 5841 jint _exception = 0; 5842 const char * _exceptionType = NULL; 5843 const char * _exceptionMessage = NULL; 5844 jfloatArray _array = (jfloatArray) 0; 5845 jint _bufferOffset = (jint) 0; 5846 jint _remaining; 5847 GLfloat *value = (GLfloat *) 0; 5848 5849 if (!value_buf) { 5850 _exception = 1; 5851 _exceptionType = "java/lang/IllegalArgumentException"; 5852 _exceptionMessage = "value == null"; 5853 goto exit; 5854 } 5855 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5856 if (_remaining < count*9) { 5857 _exception = 1; 5858 _exceptionType = "java/lang/IllegalArgumentException"; 5859 _exceptionMessage = "remaining() < count*9 < needed"; 5860 goto exit; 5861 } 5862 if (value == NULL) { 5863 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5864 value = (GLfloat *) (_valueBase + _bufferOffset); 5865 } 5866 glUniformMatrix3fv( 5867 (GLint)location, 5868 (GLsizei)count, 5869 (GLboolean)transpose, 5870 (GLfloat *)value 5871 ); 5872 5873exit: 5874 if (_array) { 5875 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5876 } 5877 if (_exception) { 5878 jniThrowException(_env, _exceptionType, _exceptionMessage); 5879 } 5880} 5881 5882/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5883static void 5884android_glUniformMatrix4fv__IIZ_3FI 5885 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 5886 jint _exception = 0; 5887 const char * _exceptionType = NULL; 5888 const char * _exceptionMessage = NULL; 5889 GLfloat *value_base = (GLfloat *) 0; 5890 jint _remaining; 5891 GLfloat *value = (GLfloat *) 0; 5892 5893 if (!value_ref) { 5894 _exception = 1; 5895 _exceptionType = "java/lang/IllegalArgumentException"; 5896 _exceptionMessage = "value == null"; 5897 goto exit; 5898 } 5899 if (offset < 0) { 5900 _exception = 1; 5901 _exceptionType = "java/lang/IllegalArgumentException"; 5902 _exceptionMessage = "offset < 0"; 5903 goto exit; 5904 } 5905 _remaining = _env->GetArrayLength(value_ref) - offset; 5906 if (_remaining < count*16) { 5907 _exception = 1; 5908 _exceptionType = "java/lang/IllegalArgumentException"; 5909 _exceptionMessage = "length - offset < count*16 < needed"; 5910 goto exit; 5911 } 5912 value_base = (GLfloat *) 5913 _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5914 value = value_base + offset; 5915 5916 glUniformMatrix4fv( 5917 (GLint)location, 5918 (GLsizei)count, 5919 (GLboolean)transpose, 5920 (GLfloat *)value 5921 ); 5922 5923exit: 5924 if (value_base) { 5925 _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5926 JNI_ABORT); 5927 } 5928 if (_exception) { 5929 jniThrowException(_env, _exceptionType, _exceptionMessage); 5930 } 5931} 5932 5933/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5934static void 5935android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 5936 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 5937 jint _exception = 0; 5938 const char * _exceptionType = NULL; 5939 const char * _exceptionMessage = NULL; 5940 jfloatArray _array = (jfloatArray) 0; 5941 jint _bufferOffset = (jint) 0; 5942 jint _remaining; 5943 GLfloat *value = (GLfloat *) 0; 5944 5945 if (!value_buf) { 5946 _exception = 1; 5947 _exceptionType = "java/lang/IllegalArgumentException"; 5948 _exceptionMessage = "value == null"; 5949 goto exit; 5950 } 5951 value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 5952 if (_remaining < count*16) { 5953 _exception = 1; 5954 _exceptionType = "java/lang/IllegalArgumentException"; 5955 _exceptionMessage = "remaining() < count*16 < needed"; 5956 goto exit; 5957 } 5958 if (value == NULL) { 5959 char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 5960 value = (GLfloat *) (_valueBase + _bufferOffset); 5961 } 5962 glUniformMatrix4fv( 5963 (GLint)location, 5964 (GLsizei)count, 5965 (GLboolean)transpose, 5966 (GLfloat *)value 5967 ); 5968 5969exit: 5970 if (_array) { 5971 _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5972 } 5973 if (_exception) { 5974 jniThrowException(_env, _exceptionType, _exceptionMessage); 5975 } 5976} 5977 5978/* void glUseProgram ( GLuint program ) */ 5979static void 5980android_glUseProgram__I 5981 (JNIEnv *_env, jobject _this, jint program) { 5982 glUseProgram( 5983 (GLuint)program 5984 ); 5985} 5986 5987/* void glValidateProgram ( GLuint program ) */ 5988static void 5989android_glValidateProgram__I 5990 (JNIEnv *_env, jobject _this, jint program) { 5991 glValidateProgram( 5992 (GLuint)program 5993 ); 5994} 5995 5996/* void glVertexAttrib1f ( GLuint indx, GLfloat x ) */ 5997static void 5998android_glVertexAttrib1f__IF 5999 (JNIEnv *_env, jobject _this, jint indx, jfloat x) { 6000 glVertexAttrib1f( 6001 (GLuint)indx, 6002 (GLfloat)x 6003 ); 6004} 6005 6006/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ 6007static void 6008android_glVertexAttrib1fv__I_3FI 6009 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 6010 jint _exception = 0; 6011 const char * _exceptionType = NULL; 6012 const char * _exceptionMessage = NULL; 6013 GLfloat *values_base = (GLfloat *) 0; 6014 jint _remaining; 6015 GLfloat *values = (GLfloat *) 0; 6016 6017 if (!values_ref) { 6018 _exception = 1; 6019 _exceptionType = "java/lang/IllegalArgumentException"; 6020 _exceptionMessage = "values == null"; 6021 goto exit; 6022 } 6023 if (offset < 0) { 6024 _exception = 1; 6025 _exceptionType = "java/lang/IllegalArgumentException"; 6026 _exceptionMessage = "offset < 0"; 6027 goto exit; 6028 } 6029 _remaining = _env->GetArrayLength(values_ref) - offset; 6030 if (_remaining < 1) { 6031 _exception = 1; 6032 _exceptionType = "java/lang/IllegalArgumentException"; 6033 _exceptionMessage = "length - offset < 1 < needed"; 6034 goto exit; 6035 } 6036 values_base = (GLfloat *) 6037 _env->GetFloatArrayElements(values_ref, (jboolean *)0); 6038 values = values_base + offset; 6039 6040 glVertexAttrib1fv( 6041 (GLuint)indx, 6042 (GLfloat *)values 6043 ); 6044 6045exit: 6046 if (values_base) { 6047 _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 6048 JNI_ABORT); 6049 } 6050 if (_exception) { 6051 jniThrowException(_env, _exceptionType, _exceptionMessage); 6052 } 6053} 6054 6055/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ 6056static void 6057android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 6058 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 6059 jint _exception = 0; 6060 const char * _exceptionType = NULL; 6061 const char * _exceptionMessage = NULL; 6062 jfloatArray _array = (jfloatArray) 0; 6063 jint _bufferOffset = (jint) 0; 6064 jint _remaining; 6065 GLfloat *values = (GLfloat *) 0; 6066 6067 if (!values_buf) { 6068 _exception = 1; 6069 _exceptionType = "java/lang/IllegalArgumentException"; 6070 _exceptionMessage = "values == null"; 6071 goto exit; 6072 } 6073 values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 6074 if (_remaining < 1) { 6075 _exception = 1; 6076 _exceptionType = "java/lang/IllegalArgumentException"; 6077 _exceptionMessage = "remaining() < 1 < needed"; 6078 goto exit; 6079 } 6080 if (values == NULL) { 6081 char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 6082 values = (GLfloat *) (_valuesBase + _bufferOffset); 6083 } 6084 glVertexAttrib1fv( 6085 (GLuint)indx, 6086 (GLfloat *)values 6087 ); 6088 6089exit: 6090 if (_array) { 6091 _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 6092 } 6093 if (_exception) { 6094 jniThrowException(_env, _exceptionType, _exceptionMessage); 6095 } 6096} 6097 6098/* void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) */ 6099static void 6100android_glVertexAttrib2f__IFF 6101 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y) { 6102 glVertexAttrib2f( 6103 (GLuint)indx, 6104 (GLfloat)x, 6105 (GLfloat)y 6106 ); 6107} 6108 6109/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ 6110static void 6111android_glVertexAttrib2fv__I_3FI 6112 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 6113 jint _exception = 0; 6114 const char * _exceptionType = NULL; 6115 const char * _exceptionMessage = NULL; 6116 GLfloat *values_base = (GLfloat *) 0; 6117 jint _remaining; 6118 GLfloat *values = (GLfloat *) 0; 6119 6120 if (!values_ref) { 6121 _exception = 1; 6122 _exceptionType = "java/lang/IllegalArgumentException"; 6123 _exceptionMessage = "values == null"; 6124 goto exit; 6125 } 6126 if (offset < 0) { 6127 _exception = 1; 6128 _exceptionType = "java/lang/IllegalArgumentException"; 6129 _exceptionMessage = "offset < 0"; 6130 goto exit; 6131 } 6132 _remaining = _env->GetArrayLength(values_ref) - offset; 6133 if (_remaining < 2) { 6134 _exception = 1; 6135 _exceptionType = "java/lang/IllegalArgumentException"; 6136 _exceptionMessage = "length - offset < 2 < needed"; 6137 goto exit; 6138 } 6139 values_base = (GLfloat *) 6140 _env->GetFloatArrayElements(values_ref, (jboolean *)0); 6141 values = values_base + offset; 6142 6143 glVertexAttrib2fv( 6144 (GLuint)indx, 6145 (GLfloat *)values 6146 ); 6147 6148exit: 6149 if (values_base) { 6150 _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 6151 JNI_ABORT); 6152 } 6153 if (_exception) { 6154 jniThrowException(_env, _exceptionType, _exceptionMessage); 6155 } 6156} 6157 6158/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ 6159static void 6160android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 6161 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 6162 jint _exception = 0; 6163 const char * _exceptionType = NULL; 6164 const char * _exceptionMessage = NULL; 6165 jfloatArray _array = (jfloatArray) 0; 6166 jint _bufferOffset = (jint) 0; 6167 jint _remaining; 6168 GLfloat *values = (GLfloat *) 0; 6169 6170 if (!values_buf) { 6171 _exception = 1; 6172 _exceptionType = "java/lang/IllegalArgumentException"; 6173 _exceptionMessage = "values == null"; 6174 goto exit; 6175 } 6176 values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 6177 if (_remaining < 2) { 6178 _exception = 1; 6179 _exceptionType = "java/lang/IllegalArgumentException"; 6180 _exceptionMessage = "remaining() < 2 < needed"; 6181 goto exit; 6182 } 6183 if (values == NULL) { 6184 char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 6185 values = (GLfloat *) (_valuesBase + _bufferOffset); 6186 } 6187 glVertexAttrib2fv( 6188 (GLuint)indx, 6189 (GLfloat *)values 6190 ); 6191 6192exit: 6193 if (_array) { 6194 _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 6195 } 6196 if (_exception) { 6197 jniThrowException(_env, _exceptionType, _exceptionMessage); 6198 } 6199} 6200 6201/* void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) */ 6202static void 6203android_glVertexAttrib3f__IFFF 6204 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z) { 6205 glVertexAttrib3f( 6206 (GLuint)indx, 6207 (GLfloat)x, 6208 (GLfloat)y, 6209 (GLfloat)z 6210 ); 6211} 6212 6213/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ 6214static void 6215android_glVertexAttrib3fv__I_3FI 6216 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 6217 jint _exception = 0; 6218 const char * _exceptionType = NULL; 6219 const char * _exceptionMessage = NULL; 6220 GLfloat *values_base = (GLfloat *) 0; 6221 jint _remaining; 6222 GLfloat *values = (GLfloat *) 0; 6223 6224 if (!values_ref) { 6225 _exception = 1; 6226 _exceptionType = "java/lang/IllegalArgumentException"; 6227 _exceptionMessage = "values == null"; 6228 goto exit; 6229 } 6230 if (offset < 0) { 6231 _exception = 1; 6232 _exceptionType = "java/lang/IllegalArgumentException"; 6233 _exceptionMessage = "offset < 0"; 6234 goto exit; 6235 } 6236 _remaining = _env->GetArrayLength(values_ref) - offset; 6237 if (_remaining < 3) { 6238 _exception = 1; 6239 _exceptionType = "java/lang/IllegalArgumentException"; 6240 _exceptionMessage = "length - offset < 3 < needed"; 6241 goto exit; 6242 } 6243 values_base = (GLfloat *) 6244 _env->GetFloatArrayElements(values_ref, (jboolean *)0); 6245 values = values_base + offset; 6246 6247 glVertexAttrib3fv( 6248 (GLuint)indx, 6249 (GLfloat *)values 6250 ); 6251 6252exit: 6253 if (values_base) { 6254 _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 6255 JNI_ABORT); 6256 } 6257 if (_exception) { 6258 jniThrowException(_env, _exceptionType, _exceptionMessage); 6259 } 6260} 6261 6262/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ 6263static void 6264android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 6265 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 6266 jint _exception = 0; 6267 const char * _exceptionType = NULL; 6268 const char * _exceptionMessage = NULL; 6269 jfloatArray _array = (jfloatArray) 0; 6270 jint _bufferOffset = (jint) 0; 6271 jint _remaining; 6272 GLfloat *values = (GLfloat *) 0; 6273 6274 if (!values_buf) { 6275 _exception = 1; 6276 _exceptionType = "java/lang/IllegalArgumentException"; 6277 _exceptionMessage = "values == null"; 6278 goto exit; 6279 } 6280 values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 6281 if (_remaining < 3) { 6282 _exception = 1; 6283 _exceptionType = "java/lang/IllegalArgumentException"; 6284 _exceptionMessage = "remaining() < 3 < needed"; 6285 goto exit; 6286 } 6287 if (values == NULL) { 6288 char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 6289 values = (GLfloat *) (_valuesBase + _bufferOffset); 6290 } 6291 glVertexAttrib3fv( 6292 (GLuint)indx, 6293 (GLfloat *)values 6294 ); 6295 6296exit: 6297 if (_array) { 6298 _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 6299 } 6300 if (_exception) { 6301 jniThrowException(_env, _exceptionType, _exceptionMessage); 6302 } 6303} 6304 6305/* void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ 6306static void 6307android_glVertexAttrib4f__IFFFF 6308 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z, jfloat w) { 6309 glVertexAttrib4f( 6310 (GLuint)indx, 6311 (GLfloat)x, 6312 (GLfloat)y, 6313 (GLfloat)z, 6314 (GLfloat)w 6315 ); 6316} 6317 6318/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ 6319static void 6320android_glVertexAttrib4fv__I_3FI 6321 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 6322 jint _exception = 0; 6323 const char * _exceptionType = NULL; 6324 const char * _exceptionMessage = NULL; 6325 GLfloat *values_base = (GLfloat *) 0; 6326 jint _remaining; 6327 GLfloat *values = (GLfloat *) 0; 6328 6329 if (!values_ref) { 6330 _exception = 1; 6331 _exceptionType = "java/lang/IllegalArgumentException"; 6332 _exceptionMessage = "values == null"; 6333 goto exit; 6334 } 6335 if (offset < 0) { 6336 _exception = 1; 6337 _exceptionType = "java/lang/IllegalArgumentException"; 6338 _exceptionMessage = "offset < 0"; 6339 goto exit; 6340 } 6341 _remaining = _env->GetArrayLength(values_ref) - offset; 6342 if (_remaining < 4) { 6343 _exception = 1; 6344 _exceptionType = "java/lang/IllegalArgumentException"; 6345 _exceptionMessage = "length - offset < 4 < needed"; 6346 goto exit; 6347 } 6348 values_base = (GLfloat *) 6349 _env->GetFloatArrayElements(values_ref, (jboolean *)0); 6350 values = values_base + offset; 6351 6352 glVertexAttrib4fv( 6353 (GLuint)indx, 6354 (GLfloat *)values 6355 ); 6356 6357exit: 6358 if (values_base) { 6359 _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 6360 JNI_ABORT); 6361 } 6362 if (_exception) { 6363 jniThrowException(_env, _exceptionType, _exceptionMessage); 6364 } 6365} 6366 6367/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ 6368static void 6369android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 6370 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 6371 jint _exception = 0; 6372 const char * _exceptionType = NULL; 6373 const char * _exceptionMessage = NULL; 6374 jfloatArray _array = (jfloatArray) 0; 6375 jint _bufferOffset = (jint) 0; 6376 jint _remaining; 6377 GLfloat *values = (GLfloat *) 0; 6378 6379 if (!values_buf) { 6380 _exception = 1; 6381 _exceptionType = "java/lang/IllegalArgumentException"; 6382 _exceptionMessage = "values == null"; 6383 goto exit; 6384 } 6385 values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 6386 if (_remaining < 4) { 6387 _exception = 1; 6388 _exceptionType = "java/lang/IllegalArgumentException"; 6389 _exceptionMessage = "remaining() < 4 < needed"; 6390 goto exit; 6391 } 6392 if (values == NULL) { 6393 char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 6394 values = (GLfloat *) (_valuesBase + _bufferOffset); 6395 } 6396 glVertexAttrib4fv( 6397 (GLuint)indx, 6398 (GLfloat *)values 6399 ); 6400 6401exit: 6402 if (_array) { 6403 _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 6404 } 6405 if (_exception) { 6406 jniThrowException(_env, _exceptionType, _exceptionMessage); 6407 } 6408} 6409 6410/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) */ 6411static void 6412android_glVertexAttribPointer__IIIZII 6413 (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jint offset) { 6414 glVertexAttribPointer( 6415 (GLuint)indx, 6416 (GLint)size, 6417 (GLenum)type, 6418 (GLboolean)normalized, 6419 (GLsizei)stride, 6420 reinterpret_cast<GLvoid *>(offset) 6421 ); 6422} 6423 6424/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) */ 6425static void 6426android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I 6427 (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr_buf, jint remaining) { 6428 jint _exception = 0; 6429 const char * _exceptionType = NULL; 6430 const char * _exceptionMessage = NULL; 6431 jarray _array = (jarray) 0; 6432 jint _bufferOffset = (jint) 0; 6433 jint _remaining; 6434 GLvoid *ptr = (GLvoid *) 0; 6435 6436 if (ptr_buf) { 6437 ptr = (GLvoid *) getDirectBufferPointer(_env, ptr_buf); 6438 if ( ! ptr ) { 6439 return; 6440 } 6441 } 6442 glVertexAttribPointerBounds( 6443 (GLuint)indx, 6444 (GLint)size, 6445 (GLenum)type, 6446 (GLboolean)normalized, 6447 (GLsizei)stride, 6448 (GLvoid *)ptr, 6449 (GLsizei)remaining 6450 ); 6451 if (_exception) { 6452 jniThrowException(_env, _exceptionType, _exceptionMessage); 6453 } 6454} 6455 6456/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ 6457static void 6458android_glViewport__IIII 6459 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { 6460 glViewport( 6461 (GLint)x, 6462 (GLint)y, 6463 (GLsizei)width, 6464 (GLsizei)height 6465 ); 6466} 6467 6468static const char *classPathName = "android/opengl/GLES20"; 6469 6470static const JNINativeMethod methods[] = { 6471{"_nativeClassInit", "()V", (void*)nativeClassInit }, 6472{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, 6473{"glAttachShader", "(II)V", (void *) android_glAttachShader__II }, 6474{"glBindAttribLocation", "(IILjava/lang/String;)V", (void *) android_glBindAttribLocation__IILjava_lang_String_2 }, 6475{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, 6476{"glBindFramebuffer", "(II)V", (void *) android_glBindFramebuffer__II }, 6477{"glBindRenderbuffer", "(II)V", (void *) android_glBindRenderbuffer__II }, 6478{"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, 6479{"glBlendColor", "(FFFF)V", (void *) android_glBlendColor__FFFF }, 6480{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, 6481{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, 6482{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, 6483{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, 6484{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, 6485{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, 6486{"glCheckFramebufferStatus", "(I)I", (void *) android_glCheckFramebufferStatus__I }, 6487{"glClear", "(I)V", (void *) android_glClear__I }, 6488{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, 6489{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, 6490{"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, 6491{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, 6492{"glCompileShader", "(I)V", (void *) android_glCompileShader__I }, 6493{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, 6494{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6495{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, 6496{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, 6497{"glCreateProgram", "()I", (void *) android_glCreateProgram__ }, 6498{"glCreateShader", "(I)I", (void *) android_glCreateShader__I }, 6499{"glCullFace", "(I)V", (void *) android_glCullFace__I }, 6500{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, 6501{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, 6502{"glDeleteFramebuffers", "(I[II)V", (void *) android_glDeleteFramebuffers__I_3II }, 6503{"glDeleteFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 }, 6504{"glDeleteProgram", "(I)V", (void *) android_glDeleteProgram__I }, 6505{"glDeleteRenderbuffers", "(I[II)V", (void *) android_glDeleteRenderbuffers__I_3II }, 6506{"glDeleteRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 }, 6507{"glDeleteShader", "(I)V", (void *) android_glDeleteShader__I }, 6508{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, 6509{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, 6510{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, 6511{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, 6512{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, 6513{"glDetachShader", "(II)V", (void *) android_glDetachShader__II }, 6514{"glDisable", "(I)V", (void *) android_glDisable__I }, 6515{"glDisableVertexAttribArray", "(I)V", (void *) android_glDisableVertexAttribArray__I }, 6516{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, 6517{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, 6518{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, 6519{"glEnable", "(I)V", (void *) android_glEnable__I }, 6520{"glEnableVertexAttribArray", "(I)V", (void *) android_glEnableVertexAttribArray__I }, 6521{"glFinish", "()V", (void *) android_glFinish__ }, 6522{"glFlush", "()V", (void *) android_glFlush__ }, 6523{"glFramebufferRenderbuffer", "(IIII)V", (void *) android_glFramebufferRenderbuffer__IIII }, 6524{"glFramebufferTexture2D", "(IIIII)V", (void *) android_glFramebufferTexture2D__IIIII }, 6525{"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, 6526{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, 6527{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, 6528{"glGenerateMipmap", "(I)V", (void *) android_glGenerateMipmap__I }, 6529{"glGenFramebuffers", "(I[II)V", (void *) android_glGenFramebuffers__I_3II }, 6530{"glGenFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffers__ILjava_nio_IntBuffer_2 }, 6531{"glGenRenderbuffers", "(I[II)V", (void *) android_glGenRenderbuffers__I_3II }, 6532{"glGenRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 }, 6533{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, 6534{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, 6535{"glGetActiveAttrib", "(III[II[II[II[BI)V", (void *) android_glGetActiveAttrib__III_3II_3II_3II_3BI }, 6536{"glGetActiveAttrib", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, 6537{"glGetActiveAttrib", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveAttrib1 }, 6538{"glGetActiveAttrib", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveAttrib2 }, 6539{"glGetActiveUniform", "(III[II[II[II[BI)V", (void *) android_glGetActiveUniform__III_3II_3II_3II_3BI }, 6540{"glGetActiveUniform", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveUniform1 }, 6541{"glGetActiveUniform", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, 6542{"glGetActiveUniform", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveUniform2 }, 6543{"glGetAttachedShaders", "(II[II[II)V", (void *) android_glGetAttachedShaders__II_3II_3II }, 6544{"glGetAttachedShaders", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, 6545{"glGetAttribLocation", "(ILjava/lang/String;)I", (void *) android_glGetAttribLocation__ILjava_lang_String_2 }, 6546{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, 6547{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, 6548{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, 6549{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, 6550{"glGetError", "()I", (void *) android_glGetError__ }, 6551{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, 6552{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, 6553{"glGetFramebufferAttachmentParameteriv", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameteriv__III_3II }, 6554{"glGetFramebufferAttachmentParameteriv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 }, 6555{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, 6556{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, 6557{"glGetProgramiv", "(II[II)V", (void *) android_glGetProgramiv__II_3II }, 6558{"glGetProgramiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetProgramiv__IILjava_nio_IntBuffer_2 }, 6559{"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog }, 6560{"glGetRenderbufferParameteriv", "(II[II)V", (void *) android_glGetRenderbufferParameteriv__II_3II }, 6561{"glGetRenderbufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 }, 6562{"glGetShaderiv", "(II[II)V", (void *) android_glGetShaderiv__II_3II }, 6563{"glGetShaderiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetShaderiv__IILjava_nio_IntBuffer_2 }, 6564{"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog }, 6565{"glGetShaderPrecisionFormat", "(II[II[II)V", (void *) android_glGetShaderPrecisionFormat__II_3II_3II }, 6566{"glGetShaderPrecisionFormat", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, 6567{"glGetShaderSource", "(II[II[BI)V", (void *) android_glGetShaderSource__II_3II_3BI }, 6568{"glGetShaderSource", "(IILjava/nio/IntBuffer;B)V", (void *) android_glGetShaderSource__IILjava_nio_IntBuffer_2B }, 6569{"glGetShaderSource", "(I)Ljava/lang/String;", (void *) android_glGetShaderSource }, 6570{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, 6571{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, 6572{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, 6573{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, 6574{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, 6575{"glGetUniformfv", "(II[FI)V", (void *) android_glGetUniformfv__II_3FI }, 6576{"glGetUniformfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetUniformfv__IILjava_nio_FloatBuffer_2 }, 6577{"glGetUniformiv", "(II[II)V", (void *) android_glGetUniformiv__II_3II }, 6578{"glGetUniformiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformiv__IILjava_nio_IntBuffer_2 }, 6579{"glGetUniformLocation", "(ILjava/lang/String;)I", (void *) android_glGetUniformLocation__ILjava_lang_String_2 }, 6580{"glGetVertexAttribfv", "(II[FI)V", (void *) android_glGetVertexAttribfv__II_3FI }, 6581{"glGetVertexAttribfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 }, 6582{"glGetVertexAttribiv", "(II[II)V", (void *) android_glGetVertexAttribiv__II_3II }, 6583{"glGetVertexAttribiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 }, 6584{"glHint", "(II)V", (void *) android_glHint__II }, 6585{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, 6586{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, 6587{"glIsFramebuffer", "(I)Z", (void *) android_glIsFramebuffer__I }, 6588{"glIsProgram", "(I)Z", (void *) android_glIsProgram__I }, 6589{"glIsRenderbuffer", "(I)Z", (void *) android_glIsRenderbuffer__I }, 6590{"glIsShader", "(I)Z", (void *) android_glIsShader__I }, 6591{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, 6592{"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, 6593{"glLinkProgram", "(I)V", (void *) android_glLinkProgram__I }, 6594{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, 6595{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, 6596{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, 6597{"glReleaseShaderCompiler", "()V", (void *) android_glReleaseShaderCompiler__ }, 6598{"glRenderbufferStorage", "(IIII)V", (void *) android_glRenderbufferStorage__IIII }, 6599{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, 6600{"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, 6601{"glShaderBinary", "(I[IIILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__I_3IIILjava_nio_Buffer_2I }, 6602{"glShaderBinary", "(ILjava/nio/IntBuffer;ILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I }, 6603{"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource }, 6604{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, 6605{"glStencilFuncSeparate", "(IIII)V", (void *) android_glStencilFuncSeparate__IIII }, 6606{"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, 6607{"glStencilMaskSeparate", "(II)V", (void *) android_glStencilMaskSeparate__II }, 6608{"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, 6609{"glStencilOpSeparate", "(IIII)V", (void *) android_glStencilOpSeparate__IIII }, 6610{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6611{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, 6612{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, 6613{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, 6614{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, 6615{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, 6616{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, 6617{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6618{"glUniform1f", "(IF)V", (void *) android_glUniform1f__IF }, 6619{"glUniform1fv", "(II[FI)V", (void *) android_glUniform1fv__II_3FI }, 6620{"glUniform1fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform1fv__IILjava_nio_FloatBuffer_2 }, 6621{"glUniform1i", "(II)V", (void *) android_glUniform1i__II }, 6622{"glUniform1iv", "(II[II)V", (void *) android_glUniform1iv__II_3II }, 6623{"glUniform1iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1iv__IILjava_nio_IntBuffer_2 }, 6624{"glUniform2f", "(IFF)V", (void *) android_glUniform2f__IFF }, 6625{"glUniform2fv", "(II[FI)V", (void *) android_glUniform2fv__II_3FI }, 6626{"glUniform2fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform2fv__IILjava_nio_FloatBuffer_2 }, 6627{"glUniform2i", "(III)V", (void *) android_glUniform2i__III }, 6628{"glUniform2iv", "(II[II)V", (void *) android_glUniform2iv__II_3II }, 6629{"glUniform2iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2iv__IILjava_nio_IntBuffer_2 }, 6630{"glUniform3f", "(IFFF)V", (void *) android_glUniform3f__IFFF }, 6631{"glUniform3fv", "(II[FI)V", (void *) android_glUniform3fv__II_3FI }, 6632{"glUniform3fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform3fv__IILjava_nio_FloatBuffer_2 }, 6633{"glUniform3i", "(IIII)V", (void *) android_glUniform3i__IIII }, 6634{"glUniform3iv", "(II[II)V", (void *) android_glUniform3iv__II_3II }, 6635{"glUniform3iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3iv__IILjava_nio_IntBuffer_2 }, 6636{"glUniform4f", "(IFFFF)V", (void *) android_glUniform4f__IFFFF }, 6637{"glUniform4fv", "(II[FI)V", (void *) android_glUniform4fv__II_3FI }, 6638{"glUniform4fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform4fv__IILjava_nio_FloatBuffer_2 }, 6639{"glUniform4i", "(IIIII)V", (void *) android_glUniform4i__IIIII }, 6640{"glUniform4iv", "(II[II)V", (void *) android_glUniform4iv__II_3II }, 6641{"glUniform4iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4iv__IILjava_nio_IntBuffer_2 }, 6642{"glUniformMatrix2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2fv__IIZ_3FI }, 6643{"glUniformMatrix2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 }, 6644{"glUniformMatrix3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3fv__IIZ_3FI }, 6645{"glUniformMatrix3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 }, 6646{"glUniformMatrix4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4fv__IIZ_3FI }, 6647{"glUniformMatrix4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 }, 6648{"glUseProgram", "(I)V", (void *) android_glUseProgram__I }, 6649{"glValidateProgram", "(I)V", (void *) android_glValidateProgram__I }, 6650{"glVertexAttrib1f", "(IF)V", (void *) android_glVertexAttrib1f__IF }, 6651{"glVertexAttrib1fv", "(I[FI)V", (void *) android_glVertexAttrib1fv__I_3FI }, 6652{"glVertexAttrib1fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 }, 6653{"glVertexAttrib2f", "(IFF)V", (void *) android_glVertexAttrib2f__IFF }, 6654{"glVertexAttrib2fv", "(I[FI)V", (void *) android_glVertexAttrib2fv__I_3FI }, 6655{"glVertexAttrib2fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 }, 6656{"glVertexAttrib3f", "(IFFF)V", (void *) android_glVertexAttrib3f__IFFF }, 6657{"glVertexAttrib3fv", "(I[FI)V", (void *) android_glVertexAttrib3fv__I_3FI }, 6658{"glVertexAttrib3fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 }, 6659{"glVertexAttrib4f", "(IFFFF)V", (void *) android_glVertexAttrib4f__IFFFF }, 6660{"glVertexAttrib4fv", "(I[FI)V", (void *) android_glVertexAttrib4fv__I_3FI }, 6661{"glVertexAttrib4fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 }, 6662{"glVertexAttribPointer", "(IIIZII)V", (void *) android_glVertexAttribPointer__IIIZII }, 6663{"glVertexAttribPointerBounds", "(IIIZILjava/nio/Buffer;I)V", (void *) android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I }, 6664{"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, 6665}; 6666 6667int register_android_opengl_jni_GLES20(JNIEnv *_env) 6668{ 6669 int err; 6670 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); 6671 return err; 6672} 6673