1 #include "AndroidGL20.h" 2 #include <android/log.h> 3 #include <GLES2/gl2.h> 4 #include <GLES2/gl2ext.h> 5 6 static int initialized = 0; 7 8 static jclass nioAccessClass; 9 static jclass bufferClass; 10 static jclass OOMEClass; 11 static jclass UOEClass; 12 static jclass IAEClass; 13 14 static jmethodID getBasePointerID; 15 static jmethodID getBaseArrayID; 16 static jmethodID getBaseArrayOffsetID; 17 static jmethodID allowIndirectBuffersID; 18 static jfieldID positionID; 19 static jfieldID limitID; 20 static jfieldID elementSizeShiftID; 21 22 23 static void 24 nativeClassInitBuffer(JNIEnv *_env) 25 { 26 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); 27 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); 28 29 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); 30 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); 31 32 getBasePointerID = _env->GetStaticMethodID(nioAccessClass, "getBasePointer", "(Ljava/nio/Buffer;)J"); 33 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); 34 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,"getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); 35 positionID = _env->GetFieldID(bufferClass, "position", "I"); 36 limitID = _env->GetFieldID(bufferClass, "limit", "I"); 37 elementSizeShiftID = _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); 38 } 39 40 static void 41 nativeClassInit(JNIEnv *_env) 42 { 43 nativeClassInitBuffer(_env); 44 45 jclass IAEClassLocal = 46 _env->FindClass("java/lang/IllegalArgumentException"); 47 jclass OOMEClassLocal = 48 _env->FindClass("java/lang/OutOfMemoryError"); 49 jclass UOEClassLocal = 50 _env->FindClass("java/lang/UnsupportedOperationException"); 51 52 IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal); 53 OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal); 54 UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal); 55 } 56 57 static void * 58 getDirectBufferPointer(JNIEnv *_env, jobject buffer) { 59 if (!buffer) { 60 return NULL; 61 } 62 void* buf = _env->GetDirectBufferAddress(buffer); 63 if (buf) { 64 jint position = _env->GetIntField(buffer, positionID); 65 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 66 buf = ((char*) buf) + (position << elementSizeShift); 67 } else { 68 _env->ThrowNew(IAEClass, "Must use a native order direct Buffer"); 69 } 70 return buf; 71 } 72 73 static const char* getString( JNIEnv *env, jstring string ) 74 { 75 return (const char*)env->GetStringUTFChars(string, NULL); 76 } 77 78 static void releaseString( JNIEnv *env, jstring string, const char* cString ) 79 { 80 env->ReleaseStringUTFChars(string, cString); 81 } 82 83 static void * 84 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining) 85 { 86 jint position; 87 jint limit; 88 jint elementSizeShift; 89 jlong pointer; 90 jint offset; 91 void *data; 92 93 position = _env->GetIntField(buffer, positionID); 94 limit = _env->GetIntField(buffer, limitID); 95 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 96 *remaining = (limit - position) << elementSizeShift; 97 pointer = _env->CallStaticLongMethod(nioAccessClass, 98 getBasePointerID, buffer); 99 if (pointer != 0L) { 100 *array = NULL; 101 return (void *) pointer; 102 } 103 104 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, 105 getBaseArrayID, buffer); 106 if (*array == NULL) { 107 return (void*) NULL; 108 } 109 offset = _env->CallStaticIntMethod(nioAccessClass, 110 getBaseArrayOffsetID, buffer); 111 data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0); 112 113 return (void *) ((char *) data + offset); 114 } 115 116 static void 117 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 118 { 119 _env->ReleasePrimitiveArrayCritical(array, data, 120 commit ? 0 : JNI_ABORT); 121 } 122 123 static int 124 getNumCompressedTextureFormats() { 125 int numCompressedTextureFormats = 0; 126 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); 127 return numCompressedTextureFormats; 128 } 129 130 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_init 131 (JNIEnv *env, jclass) 132 { 133 nativeClassInit( env ); 134 __android_log_print(ANDROID_LOG_INFO, "GL2", "all initialized %d", 2); 135 } 136 137 /* 138 * Class: com_badlogic_gdx_backends_android_AndroidGL20 139 * Method: glActiveTexture 140 * Signature: (I)V 141 */ 142 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glActiveTexture 143 (JNIEnv *, jobject, jint texture) 144 { 145 glActiveTexture( texture ); 146 } 147 148 /* 149 * Class: com_badlogic_gdx_backends_android_AndroidGL20 150 * Method: glAttachShader 151 * Signature: (II)V 152 */ 153 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glAttachShader 154 (JNIEnv *, jobject, jint program, jint shader) 155 { 156 glAttachShader( program, shader ); 157 } 158 159 /* 160 * Class: com_badlogic_gdx_backends_android_AndroidGL20 161 * Method: glBindAttribLocation 162 * Signature: (IILjava/lang/String;)V 163 */ 164 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBindAttribLocation 165 (JNIEnv *env, jobject, jint program, jint index, jstring name) 166 { 167 const char* namePtr = getString( env, name ); 168 glBindAttribLocation( program, index, namePtr ); 169 releaseString( env, name, namePtr ); 170 } 171 172 /* 173 * Class: com_badlogic_gdx_backends_android_AndroidGL20 174 * Method: glBindBuffer 175 * Signature: (II)V 176 */ 177 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBindBuffer 178 (JNIEnv *env, jobject, jint target, jint buffer) 179 { 180 glBindBuffer( target, buffer ); 181 } 182 183 /* 184 * Class: com_badlogic_gdx_backends_android_AndroidGL20 185 * Method: glBindFramebuffer 186 * Signature: (II)V 187 */ 188 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBindFramebuffer 189 (JNIEnv *env, jobject, jint target, jint framebuffer) 190 { 191 glBindFramebuffer( target, framebuffer ); 192 } 193 194 /* 195 * Class: com_badlogic_gdx_backends_android_AndroidGL20 196 * Method: glBindRenderbuffer 197 * Signature: (II)V 198 */ 199 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBindRenderbuffer 200 (JNIEnv *env, jobject, jint target, jint renderbuffer) 201 { 202 glBindRenderbuffer( target, renderbuffer ); 203 } 204 205 /* 206 * Class: com_badlogic_gdx_backends_android_AndroidGL20 207 * Method: glBindTexture 208 * Signature: (II)V 209 */ 210 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBindTexture 211 (JNIEnv *env, jobject, jint target, jint texture) 212 { 213 glBindTexture( target, texture ); 214 } 215 216 /* 217 * Class: com_badlogic_gdx_backends_android_AndroidGL20 218 * Method: glBlendColor 219 * Signature: (FFFF)V 220 */ 221 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBlendColor 222 (JNIEnv *env, jobject, jfloat red, jfloat green, jfloat blue, jfloat alpha) 223 { 224 glBlendColor( red, green, blue, alpha ); 225 } 226 227 /* 228 * Class: com_badlogic_gdx_backends_android_AndroidGL20 229 * Method: glBlendEquation 230 * Signature: (I)V 231 */ 232 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBlendEquation 233 (JNIEnv *env, jobject, jint mode) 234 { 235 glBlendEquation( mode ); 236 } 237 238 /* 239 * Class: com_badlogic_gdx_backends_android_AndroidGL20 240 * Method: glBlendEquationSeparate 241 * Signature: (II)V 242 */ 243 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBlendEquationSeparate 244 (JNIEnv *env, jobject, jint modeRGB, jint modeAlpha) 245 { 246 glBlendEquationSeparate( modeRGB, modeAlpha ); 247 } 248 249 /* 250 * Class: com_badlogic_gdx_backends_android_AndroidGL20 251 * Method: glBlendFunc 252 * Signature: (II)V 253 */ 254 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBlendFunc 255 (JNIEnv *env, jobject, jint sfactor, jint dfactor) 256 { 257 glBlendFunc( sfactor, dfactor ); 258 } 259 260 /* 261 * Class: com_badlogic_gdx_backends_android_AndroidGL20 262 * Method: glBlendFuncSeparate 263 * Signature: (IIII)V 264 */ 265 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBlendFuncSeparate 266 (JNIEnv *env, jobject, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) 267 { 268 glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha); 269 } 270 271 /* 272 * Class: com_badlogic_gdx_backends_android_AndroidGL20 273 * Method: glBufferData 274 * Signature: (IILjava/nio/Buffer;I)V 275 */ 276 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBufferData 277 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { 278 jarray _array = (jarray) 0; 279 jint _remaining; 280 GLvoid *data = (GLvoid *) 0; 281 282 if (data_buf) { 283 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); 284 if (_remaining < size) { 285 _env->ThrowNew(IAEClass, "remaining() < size"); 286 goto exit; 287 } 288 } 289 glBufferData( 290 (GLenum)target, 291 (GLsizeiptr)size, 292 (GLvoid *)data, 293 (GLenum)usage 294 ); 295 296 exit: 297 if (_array) { 298 releasePointer(_env, _array, data, JNI_FALSE); 299 } 300 } 301 302 /* 303 * Class: com_badlogic_gdx_backends_android_AndroidGL20 304 * Method: glBufferSubData 305 * Signature: (IIILjava/nio/Buffer;)V 306 */ 307 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glBufferSubData 308 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { 309 jarray _array = (jarray) 0; 310 jint _remaining; 311 GLvoid *data = (GLvoid *) 0; 312 313 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining); 314 if (_remaining < size) { 315 _env->ThrowNew(IAEClass, "remaining() < size"); 316 goto exit; 317 } 318 glBufferSubData( 319 (GLenum)target, 320 (GLintptr)offset, 321 (GLsizeiptr)size, 322 (GLvoid *)data 323 ); 324 325 exit: 326 if (_array) { 327 releasePointer(_env, _array, data, JNI_FALSE); 328 } 329 } 330 331 /* 332 * Class: com_badlogic_gdx_backends_android_AndroidGL20 333 * Method: glCheckFramebufferStatus 334 * Signature: (I)I 335 */ 336 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCheckFramebufferStatus 337 (JNIEnv *env, jobject, jint target) 338 { 339 return glCheckFramebufferStatus( target ); 340 } 341 342 /* 343 * Class: com_badlogic_gdx_backends_android_AndroidGL20 344 * Method: glClear 345 * Signature: (I)V 346 */ 347 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glClear 348 (JNIEnv *env, jobject, jint mask) 349 { 350 glClear( mask ); 351 } 352 353 /* 354 * Class: com_badlogic_gdx_backends_android_AndroidGL20 355 * Method: glClearColor 356 * Signature: (FFFF)V 357 */ 358 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glClearColor 359 (JNIEnv *env, jobject, jfloat red, jfloat green, jfloat blue, jfloat alpha) 360 { 361 glClearColor( red, green, blue, alpha ); 362 } 363 364 /* 365 * Class: com_badlogic_gdx_backends_android_AndroidGL20 366 * Method: glClearDepthf 367 * Signature: (F)V 368 */ 369 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glClearDepthf 370 (JNIEnv *env, jobject, jfloat depth) 371 { 372 glClearDepthf( depth ); 373 } 374 375 /* 376 * Class: com_badlogic_gdx_backends_android_AndroidGL20 377 * Method: glClearStencil 378 * Signature: (I)V 379 */ 380 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glClearStencil 381 (JNIEnv *env, jobject, jint s) 382 { 383 glClearStencil( s ); 384 } 385 386 /* 387 * Class: com_badlogic_gdx_backends_android_AndroidGL20 388 * Method: glColorMask 389 * Signature: (ZZZZ)V 390 */ 391 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glColorMask 392 (JNIEnv *env, jobject, jboolean red, jboolean green, jboolean blue, jboolean alpha) 393 { 394 glColorMask( red, green, blue, alpha ); 395 } 396 397 /* 398 * Class: com_badlogic_gdx_backends_android_AndroidGL20 399 * Method: glCompileShader 400 * Signature: (I)V 401 */ 402 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCompileShader 403 (JNIEnv *env, jobject, jint shader) 404 { 405 glCompileShader( shader ); 406 } 407 408 /* 409 * Class: com_badlogic_gdx_backends_android_AndroidGL20 410 * Method: glCompressedTexImage2D 411 * Signature: (IIIIIIILjava/nio/Buffer;)V 412 */ 413 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCompressedTexImage2D 414 (JNIEnv *env, jobject, jint target, jint level, jint internalFormat, jint width, jint height, jint border, jint imageSize, jobject data) 415 { 416 void* dataPtr = getDirectBufferPointer( env, data ); 417 glCompressedTexImage2D( target, level, internalFormat, width, height, border, imageSize, dataPtr ); 418 } 419 420 /* 421 * Class: com_badlogic_gdx_backends_android_AndroidGL20 422 * Method: glCompressedTexSubImage2D 423 * Signature: (IIIIIIIILjava/nio/Buffer;)V 424 */ 425 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCompressedTexSubImage2D 426 (JNIEnv *env, jobject, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data) 427 { 428 void* dataPtr = getDirectBufferPointer( env, data ); 429 glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, dataPtr ); 430 } 431 432 /* 433 * Class: com_badlogic_gdx_backends_android_AndroidGL20 434 * Method: glCopyTexImage2D 435 * Signature: (IIIIIIII)V 436 */ 437 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCopyTexImage2D 438 (JNIEnv *env, jobject, jint target, jint level, jint internalFormat, jint x, jint y, jint width, jint height, jint border) 439 { 440 glCopyTexImage2D( target, level, internalFormat, x, y, width, height, border ); 441 } 442 443 /* 444 * Class: com_badlogic_gdx_backends_android_AndroidGL20 445 * Method: glCopyTexSubImage2D 446 * Signature: (IIIIIIII)V 447 */ 448 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCopyTexSubImage2D 449 (JNIEnv *env, jobject, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) 450 { 451 glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height ); 452 } 453 454 /* 455 * Class: com_badlogic_gdx_backends_android_AndroidGL20 456 * Method: glCreateProgram 457 * Signature: ()I 458 */ 459 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCreateProgram 460 (JNIEnv *env, jobject) 461 { 462 return glCreateProgram( ); 463 } 464 465 /* 466 * Class: com_badlogic_gdx_backends_android_AndroidGL20 467 * Method: glCreateShader 468 * Signature: (I)I 469 */ 470 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCreateShader 471 (JNIEnv *env, jobject, jint type) 472 { 473 return glCreateShader( type ); 474 } 475 476 /* 477 * Class: com_badlogic_gdx_backends_android_AndroidGL20 478 * Method: glCullFace 479 * Signature: (I)V 480 */ 481 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glCullFace 482 (JNIEnv *env, jobject, jint mode) 483 { 484 glCullFace( mode ); 485 } 486 487 /* 488 * Class: com_badlogic_gdx_backends_android_AndroidGL20 489 * Method: glDeleteBuffers 490 * Signature: (ILjava/nio/IntBuffer;)V 491 */ 492 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteBuffers 493 (JNIEnv *env, jobject, jint n, jobject buffers) 494 { 495 void* dataPtr = getDirectBufferPointer( env, buffers ); 496 glDeleteBuffers( n, (GLuint*)dataPtr ); 497 } 498 499 /* 500 * Class: com_badlogic_gdx_backends_android_AndroidGL20 501 * Method: glDeleteBuffer 502 * Signature: (I)V 503 */ 504 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteBuffer 505 (JNIEnv *, jobject, jint buffer) 506 { 507 GLuint buf = buffer; 508 glDeleteBuffers(1, &buf); 509 } 510 511 /* 512 * Class: com_badlogic_gdx_backends_android_AndroidGL20 513 * Method: glDeleteFramebuffers 514 * Signature: (ILjava/nio/IntBuffer;)V 515 */ 516 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteFramebuffers 517 (JNIEnv *env, jobject, jint n, jobject framebuffers) 518 { 519 void* dataPtr = getDirectBufferPointer( env, framebuffers ); 520 glDeleteFramebuffers( n, (GLuint*)dataPtr ); 521 } 522 523 /* 524 * Class: com_badlogic_gdx_backends_android_AndroidGL20 525 * Method: glDeleteFramebuffer 526 * Signature: (I)V 527 */ 528 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteFramebuffer 529 (JNIEnv *, jobject, jint buffer) 530 { 531 GLuint buf = buffer; 532 glDeleteFramebuffers(1, &buf); 533 } 534 535 /* 536 * Class: com_badlogic_gdx_backends_android_AndroidGL20 537 * Method: glDeleteProgram 538 * Signature: (I)V 539 */ 540 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteProgram 541 (JNIEnv *env, jobject, jint program) 542 { 543 glDeleteProgram( program ); 544 } 545 546 /* 547 * Class: com_badlogic_gdx_backends_android_AndroidGL20 548 * Method: glDeleteRenderbuffers 549 * Signature: (ILjava/nio/IntBuffer;)V 550 */ 551 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteRenderbuffers 552 (JNIEnv *env, jobject, jint n, jobject renderbuffers) 553 { 554 void* dataPtr = getDirectBufferPointer( env, renderbuffers ); 555 glDeleteRenderbuffers( n, (GLuint*)dataPtr ); 556 } 557 558 /* 559 * Class: com_badlogic_gdx_backends_android_AndroidGL20 560 * Method: glDeleteRenderbuffer 561 * Signature: (I)V 562 */ 563 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteRenderbuffer 564 (JNIEnv *, jobject, jint buffer) 565 { 566 GLuint buf = buffer; 567 glDeleteRenderbuffers(1, &buf); 568 } 569 570 /* 571 * Class: com_badlogic_gdx_backends_android_AndroidGL20 572 * Method: glDeleteShader 573 * Signature: (I)V 574 */ 575 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteShader 576 (JNIEnv *env, jobject, jint shader) 577 { 578 glDeleteShader( shader ); 579 } 580 581 /* 582 * Class: com_badlogic_gdx_backends_android_AndroidGL20 583 * Method: glDeleteTextures 584 * Signature: (ILjava/nio/IntBuffer;)V 585 */ 586 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteTextures 587 (JNIEnv *env, jobject, jint n, jobject textures) 588 { 589 void* dataPtr = getDirectBufferPointer( env, textures ); 590 glDeleteTextures( n, (GLuint*)dataPtr ); 591 } 592 593 /* 594 * Class: com_badlogic_gdx_backends_android_AndroidGL20 595 * Method: glDeleteTexture 596 * Signature: (I)V 597 */ 598 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDeleteTexture 599 (JNIEnv *, jobject, jint buffer) 600 { 601 GLuint buf = buffer; 602 glDeleteTextures( 1, &buf); 603 } 604 605 /* 606 * Class: com_badlogic_gdx_backends_android_AndroidGL20 607 * Method: glDepthFunc 608 * Signature: (I)V 609 */ 610 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDepthFunc 611 (JNIEnv *env, jobject, jint func) 612 { 613 glDepthFunc( func ); 614 } 615 616 /* 617 * Class: com_badlogic_gdx_backends_android_AndroidGL20 618 * Method: glDepthMask 619 * Signature: (Z)V 620 */ 621 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDepthMask 622 (JNIEnv *env, jobject, jboolean flag) 623 { 624 glDepthMask( flag ); 625 } 626 627 /* 628 * Class: com_badlogic_gdx_backends_android_AndroidGL20 629 * Method: glDepthRangef 630 * Signature: (FF)V 631 */ 632 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDepthRangef 633 (JNIEnv *env, jobject, jfloat zNear, jfloat zFar) 634 { 635 glDepthRangef( zNear, zFar ); 636 } 637 638 /* 639 * Class: com_badlogic_gdx_backends_android_AndroidGL20 640 * Method: glDetachShader 641 * Signature: (II)V 642 */ 643 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDetachShader 644 (JNIEnv *env, jobject, jint program, jint shader) 645 { 646 glDetachShader( program, shader ); 647 } 648 649 /* 650 * Class: com_badlogic_gdx_backends_android_AndroidGL20 651 * Method: glDisable 652 * Signature: (I)V 653 */ 654 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDisable 655 (JNIEnv *env, jobject, jint cap) 656 { 657 glDisable( cap ); 658 } 659 660 /* 661 * Class: com_badlogic_gdx_backends_android_AndroidGL20 662 * Method: glDisableVertexAttribArray 663 * Signature: (I)V 664 */ 665 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDisableVertexAttribArray 666 (JNIEnv *env, jobject, jint index) 667 { 668 glDisableVertexAttribArray( index ); 669 } 670 671 /* 672 * Class: com_badlogic_gdx_backends_android_AndroidGL20 673 * Method: glDrawArrays 674 * Signature: (III)V 675 */ 676 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDrawArrays 677 (JNIEnv *env, jobject, jint mode, jint first, jint count) 678 { 679 glDrawArrays( mode, first, count ); 680 } 681 682 /* 683 * Class: com_badlogic_gdx_backends_android_AndroidGL20 684 * Method: glDrawElements 685 * Signature: (IIILjava/nio/Buffer;)V 686 */ 687 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDrawElements__IIILjava_nio_Buffer_2 688 (JNIEnv *env, jobject, jint mode, jint count, jint type, jobject indices) 689 { 690 void* dataPtr = getDirectBufferPointer( env, indices ); 691 //__android_log_print(ANDROID_LOG_INFO, "GL2", "drawelements"); 692 glDrawElements( mode, count, type, dataPtr ); 693 } 694 695 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glDrawElements__IIII 696 (JNIEnv *, jobject, jint mode, jint count, jint type, jint indices) 697 { 698 glDrawElements( mode, count, type, (const void*)(uintptr_t)indices ); 699 } 700 701 /* 702 * Class: com_badlogic_gdx_backends_android_AndroidGL20 703 * Method: glEnable 704 * Signature: (I)V 705 */ 706 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glEnable 707 (JNIEnv *env, jobject, jint cap) 708 { 709 glEnable( cap ); 710 } 711 712 /* 713 * Class: com_badlogic_gdx_backends_android_AndroidGL20 714 * Method: glEnableVertexAttribArray 715 * Signature: (I)V 716 */ 717 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glEnableVertexAttribArray 718 (JNIEnv *env, jobject, jint index) 719 { 720 glEnableVertexAttribArray( index ); 721 } 722 723 /* 724 * Class: com_badlogic_gdx_backends_android_AndroidGL20 725 * Method: glFinish 726 * Signature: ()V 727 */ 728 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glFinish 729 (JNIEnv *env, jobject) 730 { 731 glFinish(); 732 } 733 734 /* 735 * Class: com_badlogic_gdx_backends_android_AndroidGL20 736 * Method: glFlush 737 * Signature: ()V 738 */ 739 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glFlush 740 (JNIEnv *env, jobject) 741 { 742 glFlush(); 743 } 744 745 /* 746 * Class: com_badlogic_gdx_backends_android_AndroidGL20 747 * Method: glFramebufferRenderbuffer 748 * Signature: (IIII)V 749 */ 750 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glFramebufferRenderbuffer 751 (JNIEnv *env, jobject, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) 752 { 753 glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer ); 754 } 755 756 /* 757 * Class: com_badlogic_gdx_backends_android_AndroidGL20 758 * Method: glFramebufferTexture2D 759 * Signature: (IIIII)V 760 */ 761 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glFramebufferTexture2D 762 (JNIEnv *env, jobject, jint target, jint attachment, jint textarget, jint texture, jint level) 763 { 764 glFramebufferTexture2D( target, attachment, textarget, texture, level ); 765 } 766 767 /* 768 * Class: com_badlogic_gdx_backends_android_AndroidGL20 769 * Method: glFrontFace 770 * Signature: (I)V 771 */ 772 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glFrontFace 773 (JNIEnv *env, jobject, jint mode) 774 { //XXXX 775 glFrontFace( mode ); 776 } 777 778 /* 779 * Class: com_badlogic_gdx_backends_android_AndroidGL20 780 * Method: glGenBuffers 781 * Signature: (ILjava/nio/IntBuffer;)V 782 */ 783 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenBuffers 784 (JNIEnv *env, jobject, jint n, jobject buffers) 785 { 786 void* dataPtr = getDirectBufferPointer( env, buffers ); 787 glGenBuffers( n, (GLuint*)dataPtr ); 788 } 789 790 /* 791 * Class: com_badlogic_gdx_backends_android_AndroidGL20 792 * Method: glGenBuffer 793 * Signature: ()I 794 */ 795 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenBuffer 796 (JNIEnv *, jobject) 797 { 798 GLuint result; 799 glGenBuffers( 1, &result); 800 return result; 801 } 802 803 /* 804 * Class: com_badlogic_gdx_backends_android_AndroidGL20 805 * Method: glGenerateMipmap 806 * Signature: (I)V 807 */ 808 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenerateMipmap 809 (JNIEnv *env, jobject, jint target) 810 { 811 glGenerateMipmap( target ); 812 } 813 814 /* 815 * Class: com_badlogic_gdx_backends_android_AndroidGL20 816 * Method: glGenFramebuffers 817 * Signature: (ILjava/nio/IntBuffer;)V 818 */ 819 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenFramebuffers 820 (JNIEnv *env, jobject, jint n, jobject framebuffers) 821 { 822 void* dataPtr = getDirectBufferPointer( env, framebuffers ); 823 glGenFramebuffers( n, (GLuint*)dataPtr ); 824 } 825 826 /* 827 * Class: com_badlogic_gdx_backends_android_AndroidGL20 828 * Method: glGenFramebuffer 829 * Signature: ()I 830 */ 831 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenFramebuffer 832 (JNIEnv *, jobject) 833 { 834 GLuint result; 835 glGenFramebuffers(1, &result); 836 return result; 837 } 838 839 /* 840 * Class: com_badlogic_gdx_backends_android_AndroidGL20 841 * Method: glGenRenderbuffers 842 * Signature: (ILjava/nio/IntBuffer;)V 843 */ 844 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenRenderbuffers 845 (JNIEnv *env, jobject, jint n, jobject renderbuffers) 846 { 847 void* dataPtr = getDirectBufferPointer( env, renderbuffers ); 848 glGenRenderbuffers( n, (GLuint*)dataPtr ); 849 } 850 851 /* 852 * Class: com_badlogic_gdx_backends_android_AndroidGL20 853 * Method: glGenRenderbuffer 854 * Signature: ()I 855 */ 856 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenRenderbuffer 857 (JNIEnv *, jobject) 858 { 859 GLuint result; 860 glGenRenderbuffers( 1, &result); 861 return result; 862 } 863 864 /* 865 * Class: com_badlogic_gdx_backends_android_AndroidGL20 866 * Method: glGenTextures 867 * Signature: (ILjava/nio/IntBuffer;)V 868 */ 869 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenTextures 870 (JNIEnv *env, jobject, jint n, jobject textures) 871 { 872 void* dataPtr = getDirectBufferPointer( env, textures ); 873 glGenTextures( n, (GLuint*)dataPtr ); 874 } 875 876 /* 877 * Class: com_badlogic_gdx_backends_android_AndroidGL20 878 * Method: glGenTexture 879 * Signature: ()I 880 */ 881 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGenTexture 882 (JNIEnv *, jobject) 883 { 884 GLuint result; 885 glGenTextures(1, &result); 886 return result; 887 } 888 889 /* 890 * Class: com_badlogic_gdx_backends_android_AndroidGL20 891 * Method: glGetActiveAttrib 892 * Signature: (IIILjava/nio/Buffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;Ljava/lang/String;)V 893 */ 894 JNIEXPORT jstring JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetActiveAttrib 895 (JNIEnv *env, jobject, jint program, jint index, jobject size, jobject type ) 896 { 897 // FIXME is this wrong? 898 char cname[2048]; 899 void* sizePtr = getDirectBufferPointer( env, size ); 900 void* typePtr = getDirectBufferPointer( env, type ); 901 glGetActiveAttrib( program, index, 2048, NULL, (GLint*)sizePtr, (GLenum*)typePtr, cname ); 902 903 return env->NewStringUTF( cname ); 904 } 905 906 /* 907 * Class: com_badlogic_gdx_backends_android_AndroidGL20 908 * Method: glGetActiveUniform 909 * Signature: (IIILjava/nio/Buffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;Ljava/lang/String;)V 910 */ 911 JNIEXPORT jstring JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetActiveUniform 912 (JNIEnv *env, jobject, jint program, jint index, jobject size, jobject type) 913 { 914 // FIXME is this wrong? 915 char cname[2048]; 916 void* sizePtr = getDirectBufferPointer( env, size ); 917 void* typePtr = getDirectBufferPointer( env, type ); 918 glGetActiveUniform( program, index, 2048, NULL, (GLint*)sizePtr, (GLenum*)typePtr, cname ); 919 920 return env->NewStringUTF( cname ); 921 } 922 923 /* 924 * Class: com_badlogic_gdx_backends_android_AndroidGL20 925 * Method: glGetAttachedShaders 926 * Signature: (IILjava/nio/Buffer;Ljava/nio/IntBuffer;)V 927 */ 928 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetAttachedShaders 929 (JNIEnv *env, jobject, jint program, jint maxcount, jobject count, jobject shaders) 930 { 931 void* countPtr = getDirectBufferPointer( env, count ); 932 void* shaderPtr = getDirectBufferPointer( env, shaders ); 933 glGetAttachedShaders( program, maxcount, (GLsizei*)countPtr, (GLuint*)shaderPtr ); 934 } 935 936 /* 937 * Class: com_badlogic_gdx_backends_android_AndroidGL20 938 * Method: glGetAttribLocation 939 * Signature: (ILjava/lang/String;)I 940 */ 941 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetAttribLocation 942 (JNIEnv *env, jobject, jint program, jstring name) 943 { 944 const char* cname = getString( env, name ); 945 int loc = glGetAttribLocation( program, cname ); 946 releaseString( env, name, cname ); 947 return loc; 948 } 949 950 /* 951 * Class: com_badlogic_gdx_backends_android_AndroidGL20 952 * Method: glGetBooleanv 953 * Signature: (ILjava/nio/Buffer;)V 954 */ 955 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetBooleanv 956 (JNIEnv *env, jobject, jint program, jobject params) 957 { 958 void* dataPtr = getDirectBufferPointer( env, params ); 959 glGetBooleanv( program, (GLboolean*)dataPtr ); 960 } 961 962 /* 963 * Class: com_badlogic_gdx_backends_android_AndroidGL20 964 * Method: glGetBufferParameteriv 965 * Signature: (IILjava/nio/IntBuffer;)V 966 */ 967 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetBufferParameteriv 968 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 969 { 970 void* dataPtr = getDirectBufferPointer( env, params ); 971 glGetBufferParameteriv( target, pname, (GLint*)dataPtr ); 972 } 973 974 /* 975 * Class: com_badlogic_gdx_backends_android_AndroidGL20 976 * Method: glGetError 977 * Signature: ()I 978 */ 979 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetError 980 (JNIEnv *env, jobject) 981 { 982 return glGetError(); 983 } 984 985 /* 986 * Class: com_badlogic_gdx_backends_android_AndroidGL20 987 * Method: glGetFloatv 988 * Signature: (ILjava/nio/FloatBuffer;)V 989 */ 990 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetFloatv 991 (JNIEnv *env, jobject, jint pname, jobject params) 992 { 993 void* dataPtr = getDirectBufferPointer( env, params ); 994 glGetFloatv( pname, (GLfloat*)dataPtr ); 995 } 996 997 /* 998 * Class: com_badlogic_gdx_backends_android_AndroidGL20 999 * Method: glGetFramebufferAttachmentParameteriv 1000 * Signature: (IIILjava/nio/IntBuffer;)V 1001 */ 1002 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetFramebufferAttachmentParameteriv 1003 (JNIEnv *env, jobject, jint target, jint attachment, jint pname, jobject params) 1004 { 1005 void* dataPtr = getDirectBufferPointer( env, params ); 1006 glGetFramebufferAttachmentParameteriv( target, attachment, pname, (GLint*)dataPtr ); 1007 } 1008 1009 /* 1010 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1011 * Method: glGetIntegerv 1012 * Signature: (ILjava/nio/IntBuffer;)V 1013 */ 1014 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetIntegerv 1015 (JNIEnv *env, jobject, jint pname, jobject params) 1016 { 1017 void* dataPtr = getDirectBufferPointer( env, params ); 1018 glGetIntegerv( pname, (GLint*)dataPtr); 1019 } 1020 1021 /* 1022 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1023 * Method: glGetProgramiv 1024 * Signature: (IILjava/nio/IntBuffer;)V 1025 */ 1026 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetProgramiv 1027 (JNIEnv *env, jobject, jint program, jint pname, jobject params) 1028 { 1029 void *dataPtr = getDirectBufferPointer( env, params ); 1030 glGetProgramiv( program, pname, (GLint*)dataPtr ); 1031 } 1032 1033 /* 1034 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1035 * Method: glGetProgramInfoLog 1036 * Signature: (IILjava/nio/Buffer;Ljava/lang/String;)V 1037 */ 1038 JNIEXPORT jstring JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetProgramInfoLog 1039 (JNIEnv *env, jobject, jint program ) 1040 { 1041 char info[1024*10]; // FIXME 10k limit should suffice 1042 int length = 0; 1043 glGetProgramInfoLog( program, 1024*10, &length, info ); 1044 return env->NewStringUTF( info ); 1045 } 1046 1047 /* 1048 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1049 * Method: glGetRenderbufferParameteriv 1050 * Signature: (IILjava/nio/IntBuffer;)V 1051 */ 1052 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetRenderbufferParameteriv 1053 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 1054 { 1055 void* dataPtr = getDirectBufferPointer( env, params ); 1056 glGetRenderbufferParameteriv( target, pname, (GLint*)dataPtr ); 1057 } 1058 1059 /* 1060 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1061 * Method: glGetShaderiv 1062 * Signature: (IILjava/nio/IntBuffer;)V 1063 */ 1064 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetShaderiv 1065 (JNIEnv *env, jobject, jint shader, jint pname, jobject params) 1066 { 1067 void* dataPtr = getDirectBufferPointer( env, params ); 1068 glGetShaderiv( shader, pname, (GLint*)dataPtr ); 1069 } 1070 1071 /* 1072 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1073 * Method: glGetShaderInfoLog 1074 * Signature: (IILjava/nio/Buffer;Ljava/lang/String;)V 1075 */ 1076 JNIEXPORT jstring JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetShaderInfoLog 1077 (JNIEnv *env, jobject, jint shader ) 1078 { 1079 char info[1024*10]; // FIXME 10k limit should suffice 1080 int length = 0; 1081 glGetShaderInfoLog( shader, 1024*10, &length, info ); 1082 return env->NewStringUTF( info ); 1083 } 1084 1085 /* 1086 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1087 * Method: glGetShaderPrecisionFormat 1088 * Signature: (IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V 1089 */ 1090 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetShaderPrecisionFormat 1091 (JNIEnv *env, jobject, jint shadertype, jint precisiontype, jobject range, jobject precision) 1092 { 1093 void* rangePtr = getDirectBufferPointer( env, range ); 1094 void* precisionPtr = getDirectBufferPointer( env, precision ); 1095 glGetShaderPrecisionFormat( shadertype, precisiontype, (GLint*)rangePtr, (GLint*)precisionPtr ); 1096 } 1097 1098 /* 1099 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1100 * Method: glGetShaderSource 1101 * Signature: (IILjava/nio/Buffer;Ljava/lang/String;)V 1102 */ 1103 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetShaderSource 1104 (JNIEnv *env, jobject, jint shader, jint bufsize, jobject length, jstring source) 1105 { 1106 env->ThrowNew(UOEClass, "This method is not supported"); // FIXME won't implement this shit. 1107 } 1108 1109 /* 1110 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1111 * Method: glGetString 1112 * Signature: (I)Ljava/lang/String; 1113 */ 1114 JNIEXPORT jstring JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetString 1115 (JNIEnv *env, jobject, jint name) 1116 { 1117 const char * chars = (const char *)glGetString((GLenum)name); 1118 jstring output = env->NewStringUTF(chars); 1119 return output; 1120 } 1121 1122 /* 1123 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1124 * Method: glGetTexParameterfv 1125 * Signature: (IILjava/nio/FloatBuffer;)V 1126 */ 1127 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetTexParameterfv 1128 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 1129 { 1130 void* dataPtr = getDirectBufferPointer( env, params ); 1131 glGetTexParameterfv( target, pname, (GLfloat*)dataPtr ); 1132 } 1133 1134 /* 1135 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1136 * Method: glGetTexParameteriv 1137 * Signature: (IILjava/nio/IntBuffer;)V 1138 */ 1139 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetTexParameteriv 1140 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 1141 { 1142 void* dataPtr = getDirectBufferPointer( env, params ); 1143 glGetTexParameteriv( target, pname, (GLint*)dataPtr ); 1144 } 1145 1146 /* 1147 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1148 * Method: glGetUniformfv 1149 * Signature: (IILjava/nio/FloatBuffer;)V 1150 */ 1151 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetUniformfv 1152 (JNIEnv *env, jobject, jint program, jint location, jobject params) 1153 { 1154 void* dataPtr = getDirectBufferPointer( env, params ); 1155 glGetUniformfv( program, location, (GLfloat*)dataPtr ); 1156 } 1157 1158 /* 1159 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1160 * Method: glGetUniformiv 1161 * Signature: (IILjava/nio/IntBuffer;)V 1162 */ 1163 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetUniformiv 1164 (JNIEnv *env, jobject, jint program, jint location, jobject params) 1165 { 1166 void* dataPtr = getDirectBufferPointer( env, params ); 1167 glGetUniformiv( program, location, (GLint*)dataPtr ); 1168 } 1169 1170 /* 1171 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1172 * Method: glGetUniformLocation 1173 * Signature: (ILjava/lang/String;)I 1174 */ 1175 JNIEXPORT jint JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetUniformLocation 1176 (JNIEnv *env, jobject, jint program, jstring name) 1177 { 1178 const char* cname = getString( env, name ); 1179 int location = glGetUniformLocation( program, cname ); 1180 releaseString( env, name, cname ); 1181 return location; 1182 } 1183 1184 /* 1185 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1186 * Method: glGetVertexAttribfv 1187 * Signature: (IILjava/nio/FloatBuffer;)V 1188 */ 1189 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetVertexAttribfv 1190 (JNIEnv *env, jobject, jint index, jint pname, jobject params) 1191 { 1192 void* dataPtr = getDirectBufferPointer( env, params ); 1193 glGetVertexAttribfv( index, pname, (GLfloat*)dataPtr ); 1194 } 1195 1196 /* 1197 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1198 * Method: glGetVertexAttribiv 1199 * Signature: (IILjava/nio/IntBuffer;)V 1200 */ 1201 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetVertexAttribiv 1202 (JNIEnv *env, jobject, jint index, jint pname, jobject params) 1203 { 1204 void* dataPtr = getDirectBufferPointer( env, params ); 1205 glGetVertexAttribiv( index, pname, (GLint*)dataPtr ); 1206 } 1207 1208 /* 1209 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1210 * Method: glGetVertexAttribPointerv 1211 * Signature: (IILjava/nio/Buffer;)V 1212 */ 1213 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glGetVertexAttribPointerv 1214 (JNIEnv *env, jobject, jint index, jint pname, jobject pointer) 1215 { 1216 env->ThrowNew(UOEClass, "This method is not supported"); // FIXME won't implement this shit 1217 } 1218 1219 /* 1220 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1221 * Method: glHint 1222 * Signature: (II)V 1223 */ 1224 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glHint 1225 (JNIEnv *env, jobject, jint target, jint mode) 1226 { 1227 glHint( target, mode ); 1228 } 1229 1230 /* 1231 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1232 * Method: glIsBuffer 1233 * Signature: (I)C 1234 */ 1235 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsBuffer 1236 (JNIEnv *env, jobject, jint buffer) 1237 { 1238 return glIsBuffer( buffer ); 1239 } 1240 1241 /* 1242 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1243 * Method: glIsEnabled 1244 * Signature: (I)C 1245 */ 1246 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsEnabled 1247 (JNIEnv *env, jobject, jint cap) 1248 { 1249 return glIsEnabled( cap ); 1250 } 1251 1252 /* 1253 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1254 * Method: glIsFramebuffer 1255 * Signature: (I)C 1256 */ 1257 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsFramebuffer 1258 (JNIEnv *env, jobject, jint framebuffer) 1259 { 1260 return glIsFramebuffer( framebuffer ); 1261 } 1262 1263 /* 1264 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1265 * Method: glIsProgram 1266 * Signature: (I)C 1267 */ 1268 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsProgram 1269 (JNIEnv *env, jobject, jint program) 1270 { 1271 return glIsProgram( program ); 1272 } 1273 1274 /* 1275 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1276 * Method: glIsRenderbuffer 1277 * Signature: (I)C 1278 */ 1279 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsRenderbuffer 1280 (JNIEnv *env, jobject, jint renderbuffer) 1281 { 1282 return glIsRenderbuffer( renderbuffer ); 1283 } 1284 1285 /* 1286 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1287 * Method: glIsShader 1288 * Signature: (I)C 1289 */ 1290 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsShader 1291 (JNIEnv *env, jobject, jint shader) 1292 { 1293 return glIsShader( shader ); 1294 } 1295 1296 /* 1297 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1298 * Method: glIsTexture 1299 * Signature: (I)C 1300 */ 1301 JNIEXPORT jboolean JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glIsTexture 1302 (JNIEnv *env, jobject, jint texture) 1303 { 1304 return glIsTexture( texture ); 1305 } 1306 1307 /* 1308 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1309 * Method: glLineWidth 1310 * Signature: (F)V 1311 */ 1312 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glLineWidth 1313 (JNIEnv *env, jobject, jfloat width) 1314 { 1315 glLineWidth( width ); 1316 } 1317 1318 /* 1319 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1320 * Method: glLinkProgram 1321 * Signature: (I)V 1322 */ 1323 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glLinkProgram 1324 (JNIEnv *env, jobject, jint program) 1325 { 1326 glLinkProgram( program ); 1327 } 1328 1329 /* 1330 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1331 * Method: glPixelStorei 1332 * Signature: (II)V 1333 */ 1334 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glPixelStorei 1335 (JNIEnv *env, jobject, jint pname, jint param) 1336 { 1337 glPixelStorei( pname, param ); 1338 } 1339 1340 /* 1341 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1342 * Method: glPolygonOffset 1343 * Signature: (FF)V 1344 */ 1345 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glPolygonOffset 1346 (JNIEnv *env, jobject, jfloat factor, jfloat units) 1347 { 1348 glPolygonOffset( factor, units ); 1349 } 1350 1351 /* 1352 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1353 * Method: glReadPixels 1354 * Signature: (IIIIIILjava/nio/Buffer;)V 1355 */ 1356 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glReadPixels 1357 (JNIEnv *env, jobject, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels) 1358 { 1359 void* dataPtr = getDirectBufferPointer( env, pixels ); 1360 glReadPixels( x, y, width, height, format, type, dataPtr ); 1361 } 1362 1363 /* 1364 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1365 * Method: glReleaseShaderCompiler 1366 * Signature: ()V 1367 */ 1368 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glReleaseShaderCompiler 1369 (JNIEnv *env, jobject) 1370 { 1371 glReleaseShaderCompiler(); 1372 } 1373 1374 /* 1375 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1376 * Method: glRenderbufferStorage 1377 * Signature: (IIII)V 1378 */ 1379 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glRenderbufferStorage 1380 (JNIEnv *env, jobject, jint target, jint internalFormat, jint width, jint height) 1381 { 1382 glRenderbufferStorage( target, internalFormat, width, height ); 1383 } 1384 1385 /* 1386 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1387 * Method: glSampleCoverage 1388 * Signature: (FZ)V 1389 */ 1390 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glSampleCoverage 1391 (JNIEnv *env, jobject, jfloat value, jboolean inver) 1392 { 1393 glSampleCoverage( value, inver ); 1394 } 1395 1396 /* 1397 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1398 * Method: glScissor 1399 * Signature: (IIII)V 1400 */ 1401 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glScissor 1402 (JNIEnv *env, jobject, jint x, jint y, jint width, jint height) 1403 { 1404 glScissor( x, y, width, height ); 1405 } 1406 1407 /* 1408 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1409 * Method: glShaderBinary 1410 * Signature: (ILjava/nio/IntBuffer;ILjava/nio/Buffer;I)V 1411 */ 1412 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glShaderBinary 1413 (JNIEnv *env, jobject, jint n, jobject shaders, jint binaryformat, jobject binary, jint length) 1414 { 1415 void* shaderPtr = getDirectBufferPointer( env, shaders ); 1416 void* binaryPtr = getDirectBufferPointer( env, binary ); 1417 glShaderBinary( n, (GLuint*)shaderPtr, binaryformat, binaryPtr, length ); 1418 } 1419 1420 /* 1421 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1422 * Method: glShaderSource 1423 * Signature: (IILjava/lang/String;Ljava/nio/IntBuffer;)V 1424 */ 1425 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glShaderSource 1426 (JNIEnv *env, jobject, jint shader, jstring string ) 1427 { 1428 const char* cstring = getString( env, string ); 1429 glShaderSource( shader, 1, &cstring, NULL ); 1430 releaseString( env, string, cstring ); 1431 } 1432 1433 /* 1434 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1435 * Method: glStencilFunc 1436 * Signature: (III)V 1437 */ 1438 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilFunc 1439 (JNIEnv *env, jobject, jint func, jint ref, jint mask) 1440 { 1441 glStencilFunc( func, ref, mask ); 1442 } 1443 1444 /* 1445 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1446 * Method: glStencilFuncSeparate 1447 * Signature: (IIII)V 1448 */ 1449 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilFuncSeparate 1450 (JNIEnv *env, jobject, jint face, jint func, jint ref, jint mask) 1451 { 1452 glStencilFuncSeparate( face, func, ref, mask ); 1453 } 1454 1455 /* 1456 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1457 * Method: glStencilMask 1458 * Signature: (I)V 1459 */ 1460 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilMask 1461 (JNIEnv *env, jobject, jint mask) 1462 { 1463 glStencilMask( mask ); 1464 } 1465 1466 /* 1467 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1468 * Method: glStencilMaskSeparate 1469 * Signature: (II)V 1470 */ 1471 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilMaskSeparate 1472 (JNIEnv *env, jobject, jint face, jint mask) 1473 { 1474 glStencilMaskSeparate( face, mask ); 1475 } 1476 1477 /* 1478 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1479 * Method: glStencilOp 1480 * Signature: (III)V 1481 */ 1482 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilOp 1483 (JNIEnv *env, jobject, jint fail, jint zFail, jint zpass) 1484 { 1485 glStencilOp( fail, zFail, zpass ); 1486 } 1487 1488 /* 1489 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1490 * Method: glStencilOpSeparate 1491 * Signature: (IIII)V 1492 */ 1493 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glStencilOpSeparate 1494 (JNIEnv *env, jobject, jint face, jint fail, jint zFail, jint zPass) 1495 { 1496 glStencilOpSeparate( face, fail, zFail, zPass ); 1497 } 1498 1499 /* 1500 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1501 * Method: glTexImage2D 1502 * Signature: (IIIIIIIILjava/nio/Buffer;)V 1503 */ 1504 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexImage2D 1505 (JNIEnv *env, jobject, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels) 1506 { 1507 void* dataPtr = getDirectBufferPointer( env, pixels ); 1508 glTexImage2D( target, level, internalformat, width, height, border, format, type, dataPtr ); 1509 } 1510 1511 /* 1512 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1513 * Method: glTexParameterf 1514 * Signature: (IIF)V 1515 */ 1516 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexParameterf 1517 (JNIEnv *env, jobject, jint target, jint pname, jfloat param) 1518 { 1519 glTexParameterf( target, pname, param ); 1520 } 1521 1522 /* 1523 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1524 * Method: glTexParameterfv 1525 * Signature: (IILjava/nio/FloatBuffer;)V 1526 */ 1527 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexParameterfv 1528 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 1529 { 1530 void* dataPtr = getDirectBufferPointer( env, params ); 1531 glTexParameterfv( target, pname, (GLfloat*)dataPtr ); 1532 } 1533 1534 /* 1535 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1536 * Method: glTexParameteri 1537 * Signature: (III)V 1538 */ 1539 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexParameteri 1540 (JNIEnv *env, jobject, jint target, jint pname, jint param) 1541 { 1542 glTexParameteri( target, pname, param ); 1543 } 1544 1545 /* 1546 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1547 * Method: glTexParameteriv 1548 * Signature: (IILjava/nio/IntBuffer;)V 1549 */ 1550 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexParameteriv 1551 (JNIEnv *env, jobject, jint target, jint pname, jobject params) 1552 { 1553 void* dataPtr = getDirectBufferPointer( env, params ); 1554 glTexParameteriv( target, pname, (GLint*)dataPtr ); 1555 } 1556 1557 /* 1558 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1559 * Method: glTexSubImage2D 1560 * Signature: (IIIIIIIILjava/nio/Buffer;)V 1561 */ 1562 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glTexSubImage2D 1563 (JNIEnv *env, jobject, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels) 1564 { 1565 void* dataPtr = getDirectBufferPointer( env, pixels ); 1566 glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, dataPtr ); 1567 } 1568 1569 /* 1570 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1571 * Method: glUniform1f 1572 * Signature: (IF)V 1573 */ 1574 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1f 1575 (JNIEnv *env, jobject, jint location, jfloat x) 1576 { 1577 glUniform1f( location, x ); 1578 } 1579 1580 /* 1581 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1582 * Method: glUniform1fv 1583 * Signature: (IILjava/nio/FloatBuffer;)V 1584 */ 1585 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1fv__IILjava_nio_FloatBuffer_2 1586 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1587 { 1588 void* dataPtr = getDirectBufferPointer( env, v ); 1589 glUniform1fv( location, count, (GLfloat*)dataPtr ); 1590 } 1591 1592 /* 1593 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1594 * Method: glUniform1fv 1595 * Signature: (II[FI)V 1596 */ 1597 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1fv__II_3FI 1598 (JNIEnv *env, jobject, jint location, jint count, jfloatArray value, jint offset) 1599 { 1600 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1601 glUniform1fv( location, count, (GLfloat*)&v[offset] ); 1602 env->ReleasePrimitiveArrayCritical(value, v, 0); 1603 } 1604 1605 /* 1606 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1607 * Method: glUniform1i 1608 * Signature: (II)V 1609 */ 1610 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1i 1611 (JNIEnv *env, jobject, jint location, jint x) 1612 { 1613 glUniform1i( location, x ); 1614 } 1615 1616 /* 1617 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1618 * Method: glUniform1iv 1619 * Signature: (IILjava/nio/IntBuffer;)V 1620 */ 1621 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1iv__IILjava_nio_IntBuffer_2 1622 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1623 { 1624 void* dataPtr = getDirectBufferPointer( env, v ); 1625 glUniform1iv( location, count, (GLint*)dataPtr ); 1626 } 1627 1628 /* 1629 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1630 * Method: glUniform1iv 1631 * Signature: (II[II)V 1632 */ 1633 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform1iv__II_3II 1634 (JNIEnv *env, jobject, jint location, jint count, jintArray value, jint offset) 1635 { 1636 int* v = (int*)env->GetPrimitiveArrayCritical(value, 0); 1637 glUniform1iv( location, count, (GLint*)&v[offset] ); 1638 env->ReleasePrimitiveArrayCritical(value, v, 0); 1639 } 1640 1641 /* 1642 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1643 * Method: glUniform2f 1644 * Signature: (IFF)V 1645 */ 1646 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2f 1647 (JNIEnv *env, jobject, jint location, jfloat x, jfloat y) 1648 { 1649 glUniform2f( location, x, y ); 1650 } 1651 1652 /* 1653 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1654 * Method: glUniform2fv 1655 * Signature: (IILjava/nio/FloatBuffer;)V 1656 */ 1657 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2fv__IILjava_nio_FloatBuffer_2 1658 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1659 { 1660 void* dataPtr = getDirectBufferPointer( env, v ); 1661 glUniform2fv( location, count, (GLfloat*)dataPtr ); 1662 } 1663 1664 /* 1665 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1666 * Method: glUniform2fv 1667 * Signature: (II[FI)V 1668 */ 1669 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2fv__II_3FI 1670 (JNIEnv *env, jobject, jint location, jint count, jfloatArray value, jint offset) 1671 { 1672 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1673 glUniform2fv( location, count, (GLfloat*)&v[offset] ); 1674 env->ReleasePrimitiveArrayCritical(value, v, 0); 1675 } 1676 1677 /* 1678 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1679 * Method: glUniform2i 1680 * Signature: (III)V 1681 */ 1682 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2i 1683 (JNIEnv *env, jobject, jint location, jint x, jint y) 1684 { 1685 glUniform2i( location, x, y ); 1686 } 1687 1688 /* 1689 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1690 * Method: glUniform2iv 1691 * Signature: (IILjava/nio/IntBuffer;)V 1692 */ 1693 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2iv__IILjava_nio_IntBuffer_2 1694 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1695 { 1696 void* dataPtr = getDirectBufferPointer( env, v ); 1697 glUniform2iv( location, count, (GLint*)dataPtr ); 1698 } 1699 1700 /* 1701 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1702 * Method: glUniform2iv 1703 * Signature: (II[II)V 1704 */ 1705 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform2iv__II_3II 1706 (JNIEnv *env, jobject, jint location, jint count, jintArray value, jint offset) 1707 { 1708 int* v = (int*)env->GetPrimitiveArrayCritical(value, 0); 1709 glUniform2iv( location, count, (GLint*)&v[offset] ); 1710 env->ReleasePrimitiveArrayCritical(value, v, 0); 1711 } 1712 1713 /* 1714 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1715 * Method: glUniform3f 1716 * Signature: (IFFF)V 1717 */ 1718 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3f 1719 (JNIEnv *env, jobject, jint location, jfloat x, jfloat y, jfloat z) 1720 { 1721 glUniform3f( location, x, y, z ); 1722 } 1723 1724 /* 1725 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1726 * Method: glUniform3fv 1727 * Signature: (IILjava/nio/FloatBuffer;)V 1728 */ 1729 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3fv__IILjava_nio_FloatBuffer_2 1730 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1731 { 1732 void* dataPtr = getDirectBufferPointer( env, v ); 1733 glUniform3fv( location, count, (GLfloat*)dataPtr ); 1734 } 1735 1736 /* 1737 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1738 * Method: glUniform3fv 1739 * Signature: (II[FI)V 1740 */ 1741 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3fv__II_3FI 1742 (JNIEnv *env, jobject, jint location, jint count, jfloatArray value, jint offset) 1743 { 1744 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1745 glUniform3fv( location, count, (GLfloat*)&v[offset] ); 1746 env->ReleasePrimitiveArrayCritical(value, v, 0); 1747 } 1748 1749 /* 1750 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1751 * Method: glUniform3i 1752 * Signature: (IIII)V 1753 */ 1754 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3i 1755 (JNIEnv *env, jobject, jint location, jint x, jint y, jint z) 1756 { 1757 glUniform3i( location, x, y, z ); 1758 } 1759 1760 /* 1761 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1762 * Method: glUniform3iv 1763 * Signature: (IILjava/nio/IntBuffer;)V 1764 */ 1765 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3iv__IILjava_nio_IntBuffer_2 1766 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1767 { 1768 void* dataPtr = getDirectBufferPointer( env, v ); 1769 glUniform3iv( location, count, (GLint*)dataPtr ); 1770 } 1771 1772 /* 1773 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1774 * Method: glUniform3iv 1775 * Signature: (II[II)V 1776 */ 1777 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform3iv__II_3II 1778 (JNIEnv *env, jobject, jint location, jint count, jintArray value, jint offset) 1779 { 1780 int* v = (int*)env->GetPrimitiveArrayCritical(value, 0); 1781 glUniform3iv( location, count, (GLint*)&v[offset] ); 1782 env->ReleasePrimitiveArrayCritical(value, v, 0); 1783 } 1784 1785 /* 1786 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1787 * Method: glUniform4f 1788 * Signature: (IFFFF)V 1789 */ 1790 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4f 1791 (JNIEnv *env, jobject, jint location, jfloat x, jfloat y, jfloat z, jfloat w) 1792 { 1793 glUniform4f( location, x, y, z, w ); 1794 } 1795 1796 /* 1797 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1798 * Method: glUniform4fv 1799 * Signature: (IILjava/nio/FloatBuffer;)V 1800 */ 1801 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4fv__IILjava_nio_FloatBuffer_2 1802 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1803 { 1804 void* dataPtr = getDirectBufferPointer( env, v ); 1805 glUniform4fv( location, count, (GLfloat*)dataPtr ); 1806 } 1807 1808 /* 1809 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1810 * Method: glUniform4fv 1811 * Signature: (II[FI)V 1812 */ 1813 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4fv__II_3FI 1814 (JNIEnv *env, jobject, jint location, jint count, jfloatArray value, jint offset) 1815 { 1816 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1817 glUniform4fv( location, count, (GLfloat*)&v[offset] ); 1818 env->ReleasePrimitiveArrayCritical(value, v, 0); 1819 } 1820 1821 /* 1822 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1823 * Method: glUniform4i 1824 * Signature: (IIIII)V 1825 */ 1826 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4i 1827 (JNIEnv *env, jobject, jint location, jint x, jint y, jint z, jint w) 1828 { 1829 glUniform4i( location, x, y, z, w ); 1830 } 1831 1832 /* 1833 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1834 * Method: glUniform4iv 1835 * Signature: (IILjava/nio/IntBuffer;)V 1836 */ 1837 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4iv__IILjava_nio_IntBuffer_2 1838 (JNIEnv *env, jobject, jint location, jint count, jobject v) 1839 { 1840 void* dataPtr = getDirectBufferPointer( env, v ); 1841 glUniform4iv( location, count, (GLint*)dataPtr ); 1842 } 1843 1844 /* 1845 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1846 * Method: glUniform4iv 1847 * Signature: (II[II)V 1848 */ 1849 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniform4iv__II_3II 1850 (JNIEnv *env, jobject, jint location, jint count, jintArray value, jint offset) 1851 { 1852 int* v = (int*)env->GetPrimitiveArrayCritical(value, 0); 1853 glUniform4iv( location, count, (GLint*)&v[offset] ); 1854 env->ReleasePrimitiveArrayCritical(value, v, 0); 1855 } 1856 1857 /* 1858 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1859 * Method: glUniformMatrix2fv 1860 * Signature: (IIZLjava/nio/FloatBuffer;)V 1861 */ 1862 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 1863 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jobject value) 1864 { 1865 void* dataPtr = getDirectBufferPointer( env, value ); 1866 glUniformMatrix2fv( location, count, transpose, (GLfloat*)dataPtr ); 1867 } 1868 1869 /* 1870 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1871 * Method: glUniformMatrix2fv 1872 * Signature: (IIZ[FI)V 1873 */ 1874 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix2fv__IIZ_3FI 1875 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jfloatArray value, jint offset) 1876 { 1877 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1878 glUniformMatrix2fv( location, count, transpose, (GLfloat*)&v[offset] ); 1879 env->ReleasePrimitiveArrayCritical(value, v, 0); 1880 } 1881 1882 /* 1883 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1884 * Method: glUniformMatrix3fv 1885 * Signature: (IIZLjava/nio/FloatBuffer;)V 1886 */ 1887 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 1888 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jobject value) 1889 { 1890 void* dataPtr = getDirectBufferPointer( env, value ); 1891 glUniformMatrix3fv( location, count, transpose, (GLfloat*)dataPtr ); 1892 } 1893 1894 /* 1895 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1896 * Method: glUniformMatrix3fv 1897 * Signature: (IIZ[FI)V 1898 */ 1899 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix3fv__IIZ_3FI 1900 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jfloatArray value, jint offset) 1901 { 1902 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1903 glUniformMatrix3fv( location, count, transpose, (GLfloat*)&v[offset] ); 1904 env->ReleasePrimitiveArrayCritical(value, v, 0); 1905 } 1906 1907 /* 1908 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1909 * Method: glUniformMatrix4fv 1910 * Signature: (IIZLjava/nio/FloatBuffer;)V 1911 */ 1912 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 1913 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jobject value) 1914 { 1915 void* dataPtr = getDirectBufferPointer( env, value ); 1916 glUniformMatrix4fv( location, count, transpose, (GLfloat*)dataPtr ); 1917 } 1918 1919 /* 1920 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1921 * Method: glUniformMatrix4fv 1922 * Signature: (IIZ[FI)V 1923 */ 1924 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUniformMatrix4fv__IIZ_3FI 1925 (JNIEnv *env, jobject, jint location, jint count, jboolean transpose, jfloatArray value, jint offset) 1926 { 1927 float* v = (float*)env->GetPrimitiveArrayCritical(value, 0); 1928 glUniformMatrix4fv( location, count, transpose, (GLfloat*)&v[offset] ); 1929 env->ReleasePrimitiveArrayCritical(value, v, 0); 1930 } 1931 1932 /* 1933 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1934 * Method: glUseProgram 1935 * Signature: (I)V 1936 */ 1937 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glUseProgram 1938 (JNIEnv *env, jobject, jint program) 1939 { 1940 glUseProgram( program ); 1941 } 1942 1943 /* 1944 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1945 * Method: glValidateProgram 1946 * Signature: (I)V 1947 */ 1948 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glValidateProgram 1949 (JNIEnv *env, jobject, jint program) 1950 { 1951 glValidateProgram( program ); 1952 } 1953 1954 /* 1955 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1956 * Method: glVertexAttrib1f 1957 * Signature: (IF)V 1958 */ 1959 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib1f 1960 (JNIEnv *env, jobject, jint indx, jfloat x) 1961 { 1962 glVertexAttrib1f( indx, x ); 1963 } 1964 1965 /* 1966 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1967 * Method: glVertexAttrib1fv 1968 * Signature: (ILjava/nio/FloatBuffer;)V 1969 */ 1970 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib1fv 1971 (JNIEnv *env, jobject, jint indx, jobject values) 1972 { 1973 void* dataPtr = getDirectBufferPointer( env, values ); 1974 glVertexAttrib1fv( indx, (GLfloat*)dataPtr ); 1975 } 1976 1977 /* 1978 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1979 * Method: glVertexAttrib2f 1980 * Signature: (IFF)V 1981 */ 1982 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib2f 1983 (JNIEnv *env, jobject, jint indx, jfloat x, jfloat y) 1984 { 1985 glVertexAttrib2f( indx, x, y ); 1986 } 1987 1988 /* 1989 * Class: com_badlogic_gdx_backends_android_AndroidGL20 1990 * Method: glVertexAttrib2fv 1991 * Signature: (ILjava/nio/FloatBuffer;)V 1992 */ 1993 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib2fv 1994 (JNIEnv *env, jobject, jint indx, jobject values) 1995 { 1996 void* dataPtr = getDirectBufferPointer( env, values ); 1997 glVertexAttrib2fv( indx, (GLfloat*)dataPtr ); 1998 } 1999 2000 /* 2001 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2002 * Method: glVertexAttrib3f 2003 * Signature: (IFFF)V 2004 */ 2005 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib3f 2006 (JNIEnv *env, jobject, jint indx, jfloat x, jfloat y, jfloat z) 2007 { 2008 glVertexAttrib3f( indx, x, y, z ); 2009 } 2010 2011 /* 2012 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2013 * Method: glVertexAttrib3fv 2014 * Signature: (ILjava/nio/FloatBuffer;)V 2015 */ 2016 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib3fv 2017 (JNIEnv *env, jobject, jint indx, jobject values) 2018 { 2019 void* dataPtr = getDirectBufferPointer( env, values ); 2020 glVertexAttrib3fv( indx, (GLfloat*)dataPtr ); 2021 } 2022 2023 /* 2024 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2025 * Method: glVertexAttrib4f 2026 * Signature: (IFFFF)V 2027 */ 2028 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib4f 2029 (JNIEnv *env, jobject, jint indx, jfloat x, jfloat y, jfloat z, jfloat w) 2030 { 2031 glVertexAttrib4f( indx, x, y, z, w ); 2032 } 2033 2034 /* 2035 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2036 * Method: glVertexAttrib4fv 2037 * Signature: (ILjava/nio/FloatBuffer;)V 2038 */ 2039 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttrib4fv 2040 (JNIEnv *env, jobject, jint indx, jobject values) 2041 { 2042 void* dataPtr = getDirectBufferPointer( env, values ); 2043 glVertexAttrib4fv( indx, (GLfloat*)dataPtr ); 2044 } 2045 2046 /* 2047 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2048 * Method: glVertexAttribPointer 2049 * Signature: (IIIZILjava/nio/Buffer;)V 2050 */ 2051 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttribPointer__IIIZILjava_nio_Buffer_2 2052 (JNIEnv *env, jobject, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr) 2053 { 2054 void* dataPtr = getDirectBufferPointer( env, ptr ); 2055 glVertexAttribPointer( indx, size, type, normalized, stride, dataPtr ); 2056 } 2057 2058 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glVertexAttribPointer__IIIZII 2059 (JNIEnv *, jobject, jint indx, jint size, jint type, jboolean normalized, jint stride, jint ptr) 2060 { 2061 glVertexAttribPointer( indx, size, type, normalized, stride, (const void*)(uintptr_t)ptr ); 2062 } 2063 2064 /* 2065 * Class: com_badlogic_gdx_backends_android_AndroidGL20 2066 * Method: glViewport 2067 * Signature: (IIII)V 2068 */ 2069 JNIEXPORT void JNICALL Java_com_badlogic_gdx_backends_android_AndroidGL20_glViewport 2070 (JNIEnv *env, jobject, jint x, jint y, jint width, jint height) 2071 { 2072 glViewport( x, y, width, height ); 2073 } 2074