Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2013, 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 | |
Andreas Gampe | bfe6333 | 2014-11-12 14:12:45 -0800 | [diff] [blame] | 20 | #pragma GCC diagnostic ignored "-Wunused-variable" |
| 21 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable" |
| 22 | #pragma GCC diagnostic ignored "-Wunused-function" |
| 23 | |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 24 | #include <GLES3/gl3.h> |
| 25 | #include <GLES3/gl3ext.h> |
| 26 | |
Jesse Hall | 9626f82 | 2014-05-19 20:57:49 -0700 | [diff] [blame] | 27 | #include <jni.h> |
| 28 | #include <JNIHelp.h> |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 29 | #include <android_runtime/AndroidRuntime.h> |
| 30 | #include <utils/misc.h> |
| 31 | #include <assert.h> |
| 32 | |
| 33 | static int initialized = 0; |
| 34 | |
| 35 | static jclass nioAccessClass; |
| 36 | static jclass bufferClass; |
| 37 | static jmethodID getBasePointerID; |
| 38 | static jmethodID getBaseArrayID; |
| 39 | static jmethodID getBaseArrayOffsetID; |
| 40 | static jfieldID positionID; |
| 41 | static jfieldID limitID; |
| 42 | static jfieldID elementSizeShiftID; |
| 43 | |
| 44 | |
| 45 | /* special calls implemented in Android's GLES wrapper used to more |
| 46 | * efficiently bound-check passed arrays */ |
| 47 | extern "C" { |
| 48 | #ifdef GL_VERSION_ES_CM_1_1 |
| 49 | GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, |
| 50 | const GLvoid *ptr, GLsizei count); |
| 51 | GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, |
| 52 | const GLvoid *pointer, GLsizei count); |
| 53 | GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, |
| 54 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 55 | GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, |
| 56 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 57 | GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, |
| 58 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 59 | GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, |
| 60 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 61 | GL_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 |
| 65 | static 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 |
| 71 | static 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 | |
| 80 | static void |
| 81 | nativeClassInit(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 | |
| 102 | static void * |
| 103 | getPointer(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; |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 118 | return reinterpret_cast<void*>(pointer); |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 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 | |
| 129 | static void |
| 130 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 131 | { |
| 132 | _env->ReleasePrimitiveArrayCritical(array, data, |
| 133 | commit ? 0 : JNI_ABORT); |
| 134 | } |
| 135 | |
| 136 | static void * |
| 137 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
| 138 | char* buf = (char*) _env->GetDirectBufferAddress(buffer); |
| 139 | if (buf) { |
| 140 | jint position = _env->GetIntField(buffer, positionID); |
| 141 | jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 142 | buf += position << elementSizeShift; |
| 143 | } else { |
| 144 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 145 | "Must use a native order direct Buffer"); |
| 146 | } |
| 147 | return (void*) buf; |
| 148 | } |
| 149 | |
| 150 | // -------------------------------------------------------------------------- |
| 151 | |
| 152 | /* |
| 153 | * returns the number of values glGet returns for a given pname. |
| 154 | * |
| 155 | * The code below is written such that pnames requiring only one values |
| 156 | * are the default (and are not explicitely tested for). This makes the |
| 157 | * checking code much shorter/readable/efficient. |
| 158 | * |
| 159 | * This means that unknown pnames (e.g.: extensions) will default to 1. If |
| 160 | * that unknown pname needs more than 1 value, then the validation check |
| 161 | * is incomplete and the app may crash if it passed the wrong number params. |
| 162 | */ |
| 163 | static int getNeededCount(GLint pname) { |
| 164 | int needed = 1; |
| 165 | #ifdef GL_ES_VERSION_2_0 |
| 166 | // GLES 2.x pnames |
| 167 | switch (pname) { |
| 168 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 169 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 170 | needed = 2; |
| 171 | break; |
| 172 | |
| 173 | case GL_BLEND_COLOR: |
| 174 | case GL_COLOR_CLEAR_VALUE: |
| 175 | case GL_COLOR_WRITEMASK: |
| 176 | case GL_SCISSOR_BOX: |
| 177 | case GL_VIEWPORT: |
| 178 | needed = 4; |
| 179 | break; |
| 180 | |
| 181 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 182 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); |
| 183 | break; |
| 184 | |
| 185 | case GL_SHADER_BINARY_FORMATS: |
| 186 | glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); |
| 187 | break; |
| 188 | } |
| 189 | #endif |
| 190 | |
| 191 | #ifdef GL_VERSION_ES_CM_1_1 |
| 192 | // GLES 1.x pnames |
| 193 | switch (pname) { |
| 194 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 195 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 196 | case GL_DEPTH_RANGE: |
| 197 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 198 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 199 | needed = 2; |
| 200 | break; |
| 201 | |
| 202 | case GL_CURRENT_NORMAL: |
| 203 | case GL_POINT_DISTANCE_ATTENUATION: |
| 204 | needed = 3; |
| 205 | break; |
| 206 | |
| 207 | case GL_COLOR_CLEAR_VALUE: |
| 208 | case GL_COLOR_WRITEMASK: |
| 209 | case GL_CURRENT_COLOR: |
| 210 | case GL_CURRENT_TEXTURE_COORDS: |
| 211 | case GL_FOG_COLOR: |
| 212 | case GL_LIGHT_MODEL_AMBIENT: |
| 213 | case GL_SCISSOR_BOX: |
| 214 | case GL_VIEWPORT: |
| 215 | needed = 4; |
| 216 | break; |
| 217 | |
| 218 | case GL_MODELVIEW_MATRIX: |
| 219 | case GL_PROJECTION_MATRIX: |
| 220 | case GL_TEXTURE_MATRIX: |
| 221 | needed = 16; |
| 222 | break; |
| 223 | |
| 224 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 225 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); |
| 226 | break; |
| 227 | } |
| 228 | #endif |
| 229 | return needed; |
| 230 | } |
| 231 | |
| 232 | template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)> |
| 233 | static void |
| 234 | get |
| 235 | (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { |
| 236 | jint _exception = 0; |
| 237 | const char * _exceptionType; |
| 238 | const char * _exceptionMessage; |
| 239 | CTYPE *params_base = (CTYPE *) 0; |
| 240 | jint _remaining; |
| 241 | CTYPE *params = (CTYPE *) 0; |
| 242 | int _needed = 0; |
| 243 | |
| 244 | if (!params_ref) { |
| 245 | _exception = 1; |
| 246 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 247 | _exceptionMessage = "params == null"; |
| 248 | goto exit; |
| 249 | } |
| 250 | if (offset < 0) { |
| 251 | _exception = 1; |
| 252 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 253 | _exceptionMessage = "offset < 0"; |
| 254 | goto exit; |
| 255 | } |
| 256 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 257 | _needed = getNeededCount(pname); |
| 258 | // if we didn't find this pname, we just assume the user passed |
| 259 | // an array of the right size -- this might happen with extensions |
| 260 | // or if we forget an enum here. |
| 261 | if (_remaining < _needed) { |
| 262 | _exception = 1; |
| 263 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 264 | _exceptionMessage = "length - offset < needed"; |
| 265 | goto exit; |
| 266 | } |
| 267 | params_base = (CTYPE *) |
| 268 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 269 | params = params_base + offset; |
| 270 | |
| 271 | GET( |
| 272 | (GLenum)pname, |
| 273 | (CTYPE *)params |
| 274 | ); |
| 275 | |
| 276 | exit: |
| 277 | if (params_base) { |
| 278 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 279 | _exception ? JNI_ABORT: 0); |
| 280 | } |
| 281 | if (_exception) { |
| 282 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | |
| 287 | template <typename CTYPE, void GET(GLenum, CTYPE*)> |
| 288 | static void |
| 289 | getarray |
| 290 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 291 | jint _exception = 0; |
| 292 | const char * _exceptionType; |
| 293 | const char * _exceptionMessage; |
| 294 | jarray _array = (jarray) 0; |
| 295 | jint _bufferOffset = (jint) 0; |
| 296 | jint _remaining; |
| 297 | CTYPE *params = (CTYPE *) 0; |
| 298 | int _needed = 0; |
| 299 | |
| 300 | params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 301 | _remaining /= sizeof(CTYPE); // convert from bytes to item count |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 302 | _needed = getNeededCount(pname); |
| 303 | // if we didn't find this pname, we just assume the user passed |
| 304 | // an array of the right size -- this might happen with extensions |
| 305 | // or if we forget an enum here. |
| 306 | if (_needed>0 && _remaining < _needed) { |
| 307 | _exception = 1; |
| 308 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 309 | _exceptionMessage = "remaining() < needed"; |
| 310 | goto exit; |
| 311 | } |
| 312 | if (params == NULL) { |
| 313 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 314 | params = (CTYPE *) (_paramsBase + _bufferOffset); |
| 315 | } |
| 316 | GET( |
| 317 | (GLenum)pname, |
| 318 | (CTYPE *)params |
| 319 | ); |
| 320 | |
| 321 | exit: |
| 322 | if (_array) { |
| 323 | releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); |
| 324 | } |
| 325 | if (_exception) { |
| 326 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // -------------------------------------------------------------------------- |
| 331 | /* void glReadBuffer ( GLenum mode ) */ |
| 332 | static void |
| 333 | android_glReadBuffer__I |
| 334 | (JNIEnv *_env, jobject _this, jint mode) { |
| 335 | glReadBuffer( |
| 336 | (GLenum)mode |
| 337 | ); |
| 338 | } |
| 339 | |
| 340 | /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 341 | static void |
| 342 | android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 |
| 343 | (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) { |
| 344 | jarray _array = (jarray) 0; |
| 345 | jint _bufferOffset = (jint) 0; |
| 346 | jint _remaining; |
| 347 | GLvoid *indices = (GLvoid *) 0; |
| 348 | |
| 349 | indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset); |
| 350 | if (indices == NULL) { |
| 351 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 352 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 353 | } |
| 354 | glDrawRangeElements( |
| 355 | (GLenum)mode, |
| 356 | (GLuint)start, |
| 357 | (GLuint)end, |
| 358 | (GLsizei)count, |
| 359 | (GLenum)type, |
| 360 | (GLvoid *)indices |
| 361 | ); |
| 362 | if (_array) { |
| 363 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */ |
| 368 | static void |
| 369 | android_glDrawRangeElements__IIIIII |
| 370 | (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) { |
| 371 | glDrawRangeElements( |
| 372 | (GLenum)mode, |
| 373 | (GLuint)start, |
| 374 | (GLuint)end, |
| 375 | (GLsizei)count, |
| 376 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 377 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 378 | ); |
| 379 | } |
| 380 | |
| 381 | /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 382 | static void |
| 383 | android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 |
| 384 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jobject pixels_buf) { |
| 385 | jarray _array = (jarray) 0; |
| 386 | jint _bufferOffset = (jint) 0; |
| 387 | jint _remaining; |
| 388 | GLvoid *pixels = (GLvoid *) 0; |
| 389 | |
| 390 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset); |
| 391 | if (pixels == NULL) { |
| 392 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 393 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 394 | } |
| 395 | glTexImage3D( |
| 396 | (GLenum)target, |
| 397 | (GLint)level, |
| 398 | (GLint)internalformat, |
| 399 | (GLsizei)width, |
| 400 | (GLsizei)height, |
| 401 | (GLsizei)depth, |
| 402 | (GLint)border, |
| 403 | (GLenum)format, |
| 404 | (GLenum)type, |
| 405 | (GLvoid *)pixels |
| 406 | ); |
| 407 | if (_array) { |
| 408 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */ |
| 413 | static void |
| 414 | android_glTexImage3D__IIIIIIIIII |
| 415 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) { |
| 416 | glTexImage3D( |
| 417 | (GLenum)target, |
| 418 | (GLint)level, |
| 419 | (GLint)internalformat, |
| 420 | (GLsizei)width, |
| 421 | (GLsizei)height, |
| 422 | (GLsizei)depth, |
| 423 | (GLint)border, |
| 424 | (GLenum)format, |
| 425 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 426 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 427 | ); |
| 428 | } |
| 429 | |
| 430 | /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 431 | static void |
| 432 | android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 |
| 433 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jobject pixels_buf) { |
| 434 | jarray _array = (jarray) 0; |
| 435 | jint _bufferOffset = (jint) 0; |
| 436 | jint _remaining; |
| 437 | GLvoid *pixels = (GLvoid *) 0; |
| 438 | |
| 439 | pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset); |
| 440 | if (pixels == NULL) { |
| 441 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 442 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 443 | } |
| 444 | glTexSubImage3D( |
| 445 | (GLenum)target, |
| 446 | (GLint)level, |
| 447 | (GLint)xoffset, |
| 448 | (GLint)yoffset, |
| 449 | (GLint)zoffset, |
| 450 | (GLsizei)width, |
| 451 | (GLsizei)height, |
| 452 | (GLsizei)depth, |
| 453 | (GLenum)format, |
| 454 | (GLenum)type, |
| 455 | (GLvoid *)pixels |
| 456 | ); |
| 457 | if (_array) { |
| 458 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */ |
| 463 | static void |
| 464 | android_glTexSubImage3D__IIIIIIIIIII |
| 465 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint offset) { |
| 466 | glTexSubImage3D( |
| 467 | (GLenum)target, |
| 468 | (GLint)level, |
| 469 | (GLint)xoffset, |
| 470 | (GLint)yoffset, |
| 471 | (GLint)zoffset, |
| 472 | (GLsizei)width, |
| 473 | (GLsizei)height, |
| 474 | (GLsizei)depth, |
| 475 | (GLenum)format, |
| 476 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 477 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 478 | ); |
| 479 | } |
| 480 | |
| 481 | /* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 482 | static void |
| 483 | android_glCopyTexSubImage3D__IIIIIIIII |
| 484 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) { |
| 485 | glCopyTexSubImage3D( |
| 486 | (GLenum)target, |
| 487 | (GLint)level, |
| 488 | (GLint)xoffset, |
| 489 | (GLint)yoffset, |
| 490 | (GLint)zoffset, |
| 491 | (GLint)x, |
| 492 | (GLint)y, |
| 493 | (GLsizei)width, |
| 494 | (GLsizei)height |
| 495 | ); |
| 496 | } |
| 497 | |
| 498 | /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 499 | static void |
| 500 | android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 |
| 501 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jobject data_buf) { |
| 502 | jarray _array = (jarray) 0; |
| 503 | jint _bufferOffset = (jint) 0; |
| 504 | jint _remaining; |
| 505 | GLvoid *data = (GLvoid *) 0; |
| 506 | |
| 507 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 508 | if (data == NULL) { |
| 509 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 510 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 511 | } |
| 512 | glCompressedTexImage3D( |
| 513 | (GLenum)target, |
| 514 | (GLint)level, |
| 515 | (GLenum)internalformat, |
| 516 | (GLsizei)width, |
| 517 | (GLsizei)height, |
| 518 | (GLsizei)depth, |
| 519 | (GLint)border, |
| 520 | (GLsizei)imageSize, |
| 521 | (GLvoid *)data |
| 522 | ); |
| 523 | if (_array) { |
| 524 | releasePointer(_env, _array, data, JNI_FALSE); |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */ |
| 529 | static void |
| 530 | android_glCompressedTexImage3D__IIIIIIIII |
| 531 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) { |
| 532 | glCompressedTexImage3D( |
| 533 | (GLenum)target, |
| 534 | (GLint)level, |
| 535 | (GLenum)internalformat, |
| 536 | (GLsizei)width, |
| 537 | (GLsizei)height, |
| 538 | (GLsizei)depth, |
| 539 | (GLint)border, |
| 540 | (GLsizei)imageSize, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 541 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 542 | ); |
| 543 | } |
| 544 | |
| 545 | /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 546 | static void |
| 547 | android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 |
| 548 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jobject data_buf) { |
| 549 | jarray _array = (jarray) 0; |
| 550 | jint _bufferOffset = (jint) 0; |
| 551 | jint _remaining; |
| 552 | GLvoid *data = (GLvoid *) 0; |
| 553 | |
| 554 | data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 555 | if (data == NULL) { |
| 556 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 557 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 558 | } |
| 559 | glCompressedTexSubImage3D( |
| 560 | (GLenum)target, |
| 561 | (GLint)level, |
| 562 | (GLint)xoffset, |
| 563 | (GLint)yoffset, |
| 564 | (GLint)zoffset, |
| 565 | (GLsizei)width, |
| 566 | (GLsizei)height, |
| 567 | (GLsizei)depth, |
| 568 | (GLenum)format, |
| 569 | (GLsizei)imageSize, |
| 570 | (GLvoid *)data |
| 571 | ); |
| 572 | if (_array) { |
| 573 | releasePointer(_env, _array, data, JNI_FALSE); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */ |
| 578 | static void |
| 579 | android_glCompressedTexSubImage3D__IIIIIIIIIII |
| 580 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jint offset) { |
| 581 | glCompressedTexSubImage3D( |
| 582 | (GLenum)target, |
| 583 | (GLint)level, |
| 584 | (GLint)xoffset, |
| 585 | (GLint)yoffset, |
| 586 | (GLint)zoffset, |
| 587 | (GLsizei)width, |
| 588 | (GLsizei)height, |
| 589 | (GLsizei)depth, |
| 590 | (GLenum)format, |
| 591 | (GLsizei)imageSize, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 592 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 593 | ); |
| 594 | } |
| 595 | |
| 596 | /* void glGenQueries ( GLsizei n, GLuint *ids ) */ |
| 597 | static void |
| 598 | android_glGenQueries__I_3II |
| 599 | (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) { |
| 600 | jint _exception = 0; |
| 601 | const char * _exceptionType = NULL; |
| 602 | const char * _exceptionMessage = NULL; |
| 603 | GLuint *ids_base = (GLuint *) 0; |
| 604 | jint _remaining; |
| 605 | GLuint *ids = (GLuint *) 0; |
| 606 | |
| 607 | if (!ids_ref) { |
| 608 | _exception = 1; |
| 609 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 610 | _exceptionMessage = "ids == null"; |
| 611 | goto exit; |
| 612 | } |
| 613 | if (offset < 0) { |
| 614 | _exception = 1; |
| 615 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 616 | _exceptionMessage = "offset < 0"; |
| 617 | goto exit; |
| 618 | } |
| 619 | _remaining = _env->GetArrayLength(ids_ref) - offset; |
| 620 | ids_base = (GLuint *) |
| 621 | _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0); |
| 622 | ids = ids_base + offset; |
| 623 | |
| 624 | glGenQueries( |
| 625 | (GLsizei)n, |
| 626 | (GLuint *)ids |
| 627 | ); |
| 628 | |
| 629 | exit: |
| 630 | if (ids_base) { |
| 631 | _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base, |
| 632 | _exception ? JNI_ABORT: 0); |
| 633 | } |
| 634 | if (_exception) { |
| 635 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | /* void glGenQueries ( GLsizei n, GLuint *ids ) */ |
| 640 | static void |
| 641 | android_glGenQueries__ILjava_nio_IntBuffer_2 |
| 642 | (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) { |
| 643 | jarray _array = (jarray) 0; |
| 644 | jint _bufferOffset = (jint) 0; |
| 645 | jint _remaining; |
| 646 | GLuint *ids = (GLuint *) 0; |
| 647 | |
| 648 | ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset); |
| 649 | if (ids == NULL) { |
| 650 | char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 651 | ids = (GLuint *) (_idsBase + _bufferOffset); |
| 652 | } |
| 653 | glGenQueries( |
| 654 | (GLsizei)n, |
| 655 | (GLuint *)ids |
| 656 | ); |
| 657 | if (_array) { |
| 658 | releasePointer(_env, _array, ids, JNI_TRUE); |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */ |
| 663 | static void |
| 664 | android_glDeleteQueries__I_3II |
| 665 | (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) { |
| 666 | jint _exception = 0; |
| 667 | const char * _exceptionType = NULL; |
| 668 | const char * _exceptionMessage = NULL; |
| 669 | GLuint *ids_base = (GLuint *) 0; |
| 670 | jint _remaining; |
| 671 | GLuint *ids = (GLuint *) 0; |
| 672 | |
| 673 | if (!ids_ref) { |
| 674 | _exception = 1; |
| 675 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 676 | _exceptionMessage = "ids == null"; |
| 677 | goto exit; |
| 678 | } |
| 679 | if (offset < 0) { |
| 680 | _exception = 1; |
| 681 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 682 | _exceptionMessage = "offset < 0"; |
| 683 | goto exit; |
| 684 | } |
| 685 | _remaining = _env->GetArrayLength(ids_ref) - offset; |
| 686 | ids_base = (GLuint *) |
| 687 | _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0); |
| 688 | ids = ids_base + offset; |
| 689 | |
| 690 | glDeleteQueries( |
| 691 | (GLsizei)n, |
| 692 | (GLuint *)ids |
| 693 | ); |
| 694 | |
| 695 | exit: |
| 696 | if (ids_base) { |
| 697 | _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base, |
| 698 | JNI_ABORT); |
| 699 | } |
| 700 | if (_exception) { |
| 701 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 702 | } |
| 703 | } |
| 704 | |
| 705 | /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */ |
| 706 | static void |
| 707 | android_glDeleteQueries__ILjava_nio_IntBuffer_2 |
| 708 | (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) { |
| 709 | jarray _array = (jarray) 0; |
| 710 | jint _bufferOffset = (jint) 0; |
| 711 | jint _remaining; |
| 712 | GLuint *ids = (GLuint *) 0; |
| 713 | |
| 714 | ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset); |
| 715 | if (ids == NULL) { |
| 716 | char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 717 | ids = (GLuint *) (_idsBase + _bufferOffset); |
| 718 | } |
| 719 | glDeleteQueries( |
| 720 | (GLsizei)n, |
| 721 | (GLuint *)ids |
| 722 | ); |
| 723 | if (_array) { |
| 724 | releasePointer(_env, _array, ids, JNI_FALSE); |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | /* GLboolean glIsQuery ( GLuint id ) */ |
| 729 | static jboolean |
| 730 | android_glIsQuery__I |
| 731 | (JNIEnv *_env, jobject _this, jint id) { |
| 732 | GLboolean _returnValue; |
| 733 | _returnValue = glIsQuery( |
| 734 | (GLuint)id |
| 735 | ); |
| 736 | return (jboolean)_returnValue; |
| 737 | } |
| 738 | |
| 739 | /* void glBeginQuery ( GLenum target, GLuint id ) */ |
| 740 | static void |
| 741 | android_glBeginQuery__II |
| 742 | (JNIEnv *_env, jobject _this, jint target, jint id) { |
| 743 | glBeginQuery( |
| 744 | (GLenum)target, |
| 745 | (GLuint)id |
| 746 | ); |
| 747 | } |
| 748 | |
| 749 | /* void glEndQuery ( GLenum target ) */ |
| 750 | static void |
| 751 | android_glEndQuery__I |
| 752 | (JNIEnv *_env, jobject _this, jint target) { |
| 753 | glEndQuery( |
| 754 | (GLenum)target |
| 755 | ); |
| 756 | } |
| 757 | |
| 758 | /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */ |
| 759 | static void |
| 760 | android_glGetQueryiv__II_3II |
| 761 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 762 | jint _exception = 0; |
| 763 | const char * _exceptionType = NULL; |
| 764 | const char * _exceptionMessage = NULL; |
| 765 | GLint *params_base = (GLint *) 0; |
| 766 | jint _remaining; |
| 767 | GLint *params = (GLint *) 0; |
| 768 | |
| 769 | if (!params_ref) { |
| 770 | _exception = 1; |
| 771 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 772 | _exceptionMessage = "params == null"; |
| 773 | goto exit; |
| 774 | } |
| 775 | if (offset < 0) { |
| 776 | _exception = 1; |
| 777 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 778 | _exceptionMessage = "offset < 0"; |
| 779 | goto exit; |
| 780 | } |
| 781 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 782 | params_base = (GLint *) |
| 783 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 784 | params = params_base + offset; |
| 785 | |
| 786 | glGetQueryiv( |
| 787 | (GLenum)target, |
| 788 | (GLenum)pname, |
| 789 | (GLint *)params |
| 790 | ); |
| 791 | |
| 792 | exit: |
| 793 | if (params_base) { |
| 794 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 795 | _exception ? JNI_ABORT: 0); |
| 796 | } |
| 797 | if (_exception) { |
| 798 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 799 | } |
| 800 | } |
| 801 | |
| 802 | /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */ |
| 803 | static void |
| 804 | android_glGetQueryiv__IILjava_nio_IntBuffer_2 |
| 805 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 806 | jarray _array = (jarray) 0; |
| 807 | jint _bufferOffset = (jint) 0; |
| 808 | jint _remaining; |
| 809 | GLint *params = (GLint *) 0; |
| 810 | |
| 811 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 812 | if (params == NULL) { |
| 813 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 814 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 815 | } |
| 816 | glGetQueryiv( |
| 817 | (GLenum)target, |
| 818 | (GLenum)pname, |
| 819 | (GLint *)params |
| 820 | ); |
| 821 | if (_array) { |
| 822 | releasePointer(_env, _array, params, JNI_TRUE); |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */ |
| 827 | static void |
| 828 | android_glGetQueryObjectuiv__II_3II |
| 829 | (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) { |
| 830 | jint _exception = 0; |
| 831 | const char * _exceptionType = NULL; |
| 832 | const char * _exceptionMessage = NULL; |
| 833 | GLuint *params_base = (GLuint *) 0; |
| 834 | jint _remaining; |
| 835 | GLuint *params = (GLuint *) 0; |
| 836 | |
| 837 | if (!params_ref) { |
| 838 | _exception = 1; |
| 839 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 840 | _exceptionMessage = "params == null"; |
| 841 | goto exit; |
| 842 | } |
| 843 | if (offset < 0) { |
| 844 | _exception = 1; |
| 845 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 846 | _exceptionMessage = "offset < 0"; |
| 847 | goto exit; |
| 848 | } |
| 849 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 850 | params_base = (GLuint *) |
| 851 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 852 | params = params_base + offset; |
| 853 | |
| 854 | glGetQueryObjectuiv( |
| 855 | (GLuint)id, |
| 856 | (GLenum)pname, |
| 857 | (GLuint *)params |
| 858 | ); |
| 859 | |
| 860 | exit: |
| 861 | if (params_base) { |
| 862 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 863 | _exception ? JNI_ABORT: 0); |
| 864 | } |
| 865 | if (_exception) { |
| 866 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */ |
| 871 | static void |
| 872 | android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 |
| 873 | (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) { |
| 874 | jarray _array = (jarray) 0; |
| 875 | jint _bufferOffset = (jint) 0; |
| 876 | jint _remaining; |
| 877 | GLuint *params = (GLuint *) 0; |
| 878 | |
| 879 | params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 880 | if (params == NULL) { |
| 881 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 882 | params = (GLuint *) (_paramsBase + _bufferOffset); |
| 883 | } |
| 884 | glGetQueryObjectuiv( |
| 885 | (GLuint)id, |
| 886 | (GLenum)pname, |
| 887 | (GLuint *)params |
| 888 | ); |
| 889 | if (_array) { |
| 890 | releasePointer(_env, _array, params, JNI_TRUE); |
| 891 | } |
| 892 | } |
| 893 | |
| 894 | /* GLboolean glUnmapBuffer ( GLenum target ) */ |
| 895 | static jboolean |
| 896 | android_glUnmapBuffer__I |
| 897 | (JNIEnv *_env, jobject _this, jint target) { |
| 898 | GLboolean _returnValue; |
| 899 | _returnValue = glUnmapBuffer( |
| 900 | (GLenum)target |
| 901 | ); |
| 902 | return (jboolean)_returnValue; |
| 903 | } |
| 904 | |
| 905 | /* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */ |
| 906 | static jobject |
| 907 | android_glGetBufferPointerv__II |
| 908 | (JNIEnv *_env, jobject _this, jint target, jint pname) { |
| 909 | GLint64 _mapLength; |
| 910 | GLvoid* _p; |
| 911 | glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength); |
| 912 | glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p); |
| 913 | return _env->NewDirectByteBuffer(_p, _mapLength); |
| 914 | } |
| 915 | |
| 916 | /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */ |
| 917 | static void |
| 918 | android_glDrawBuffers__I_3II |
| 919 | (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) { |
| 920 | jint _exception = 0; |
| 921 | const char * _exceptionType = NULL; |
| 922 | const char * _exceptionMessage = NULL; |
| 923 | GLenum *bufs_base = (GLenum *) 0; |
| 924 | jint _remaining; |
| 925 | GLenum *bufs = (GLenum *) 0; |
| 926 | |
| 927 | if (!bufs_ref) { |
| 928 | _exception = 1; |
| 929 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 930 | _exceptionMessage = "bufs == null"; |
| 931 | goto exit; |
| 932 | } |
| 933 | if (offset < 0) { |
| 934 | _exception = 1; |
| 935 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 936 | _exceptionMessage = "offset < 0"; |
| 937 | goto exit; |
| 938 | } |
| 939 | _remaining = _env->GetArrayLength(bufs_ref) - offset; |
| 940 | bufs_base = (GLenum *) |
| 941 | _env->GetPrimitiveArrayCritical(bufs_ref, (jboolean *)0); |
| 942 | bufs = bufs_base + offset; |
| 943 | |
| 944 | glDrawBuffers( |
| 945 | (GLsizei)n, |
| 946 | (GLenum *)bufs |
| 947 | ); |
| 948 | |
| 949 | exit: |
| 950 | if (bufs_base) { |
| 951 | _env->ReleasePrimitiveArrayCritical(bufs_ref, bufs_base, |
| 952 | JNI_ABORT); |
| 953 | } |
| 954 | if (_exception) { |
| 955 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */ |
| 960 | static void |
| 961 | android_glDrawBuffers__ILjava_nio_IntBuffer_2 |
| 962 | (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) { |
| 963 | jarray _array = (jarray) 0; |
| 964 | jint _bufferOffset = (jint) 0; |
| 965 | jint _remaining; |
| 966 | GLenum *bufs = (GLenum *) 0; |
| 967 | |
| 968 | bufs = (GLenum *)getPointer(_env, bufs_buf, &_array, &_remaining, &_bufferOffset); |
| 969 | if (bufs == NULL) { |
| 970 | char * _bufsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 971 | bufs = (GLenum *) (_bufsBase + _bufferOffset); |
| 972 | } |
| 973 | glDrawBuffers( |
| 974 | (GLsizei)n, |
| 975 | (GLenum *)bufs |
| 976 | ); |
| 977 | if (_array) { |
| 978 | releasePointer(_env, _array, bufs, JNI_FALSE); |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 983 | static void |
| 984 | android_glUniformMatrix2x3fv__IIZ_3FI |
| 985 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 986 | jint _exception = 0; |
| 987 | const char * _exceptionType = NULL; |
| 988 | const char * _exceptionMessage = NULL; |
| 989 | GLfloat *value_base = (GLfloat *) 0; |
| 990 | jint _remaining; |
| 991 | GLfloat *value = (GLfloat *) 0; |
| 992 | |
| 993 | if (!value_ref) { |
| 994 | _exception = 1; |
| 995 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 996 | _exceptionMessage = "value == null"; |
| 997 | goto exit; |
| 998 | } |
| 999 | if (offset < 0) { |
| 1000 | _exception = 1; |
| 1001 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1002 | _exceptionMessage = "offset < 0"; |
| 1003 | goto exit; |
| 1004 | } |
| 1005 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1006 | value_base = (GLfloat *) |
| 1007 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1008 | value = value_base + offset; |
| 1009 | |
| 1010 | glUniformMatrix2x3fv( |
| 1011 | (GLint)location, |
| 1012 | (GLsizei)count, |
| 1013 | (GLboolean)transpose, |
| 1014 | (GLfloat *)value |
| 1015 | ); |
| 1016 | |
| 1017 | exit: |
| 1018 | if (value_base) { |
| 1019 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1020 | JNI_ABORT); |
| 1021 | } |
| 1022 | if (_exception) { |
| 1023 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1024 | } |
| 1025 | } |
| 1026 | |
| 1027 | /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1028 | static void |
| 1029 | android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 |
| 1030 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1031 | jarray _array = (jarray) 0; |
| 1032 | jint _bufferOffset = (jint) 0; |
| 1033 | jint _remaining; |
| 1034 | GLfloat *value = (GLfloat *) 0; |
| 1035 | |
| 1036 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1037 | if (value == NULL) { |
| 1038 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1039 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1040 | } |
| 1041 | glUniformMatrix2x3fv( |
| 1042 | (GLint)location, |
| 1043 | (GLsizei)count, |
| 1044 | (GLboolean)transpose, |
| 1045 | (GLfloat *)value |
| 1046 | ); |
| 1047 | if (_array) { |
| 1048 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1049 | } |
| 1050 | } |
| 1051 | |
| 1052 | /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1053 | static void |
| 1054 | android_glUniformMatrix3x2fv__IIZ_3FI |
| 1055 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 1056 | jint _exception = 0; |
| 1057 | const char * _exceptionType = NULL; |
| 1058 | const char * _exceptionMessage = NULL; |
| 1059 | GLfloat *value_base = (GLfloat *) 0; |
| 1060 | jint _remaining; |
| 1061 | GLfloat *value = (GLfloat *) 0; |
| 1062 | |
| 1063 | if (!value_ref) { |
| 1064 | _exception = 1; |
| 1065 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1066 | _exceptionMessage = "value == null"; |
| 1067 | goto exit; |
| 1068 | } |
| 1069 | if (offset < 0) { |
| 1070 | _exception = 1; |
| 1071 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1072 | _exceptionMessage = "offset < 0"; |
| 1073 | goto exit; |
| 1074 | } |
| 1075 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1076 | value_base = (GLfloat *) |
| 1077 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1078 | value = value_base + offset; |
| 1079 | |
| 1080 | glUniformMatrix3x2fv( |
| 1081 | (GLint)location, |
| 1082 | (GLsizei)count, |
| 1083 | (GLboolean)transpose, |
| 1084 | (GLfloat *)value |
| 1085 | ); |
| 1086 | |
| 1087 | exit: |
| 1088 | if (value_base) { |
| 1089 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1090 | JNI_ABORT); |
| 1091 | } |
| 1092 | if (_exception) { |
| 1093 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1098 | static void |
| 1099 | android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 |
| 1100 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1101 | jarray _array = (jarray) 0; |
| 1102 | jint _bufferOffset = (jint) 0; |
| 1103 | jint _remaining; |
| 1104 | GLfloat *value = (GLfloat *) 0; |
| 1105 | |
| 1106 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1107 | if (value == NULL) { |
| 1108 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1109 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1110 | } |
| 1111 | glUniformMatrix3x2fv( |
| 1112 | (GLint)location, |
| 1113 | (GLsizei)count, |
| 1114 | (GLboolean)transpose, |
| 1115 | (GLfloat *)value |
| 1116 | ); |
| 1117 | if (_array) { |
| 1118 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1119 | } |
| 1120 | } |
| 1121 | |
| 1122 | /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1123 | static void |
| 1124 | android_glUniformMatrix2x4fv__IIZ_3FI |
| 1125 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 1126 | jint _exception = 0; |
| 1127 | const char * _exceptionType = NULL; |
| 1128 | const char * _exceptionMessage = NULL; |
| 1129 | GLfloat *value_base = (GLfloat *) 0; |
| 1130 | jint _remaining; |
| 1131 | GLfloat *value = (GLfloat *) 0; |
| 1132 | |
| 1133 | if (!value_ref) { |
| 1134 | _exception = 1; |
| 1135 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1136 | _exceptionMessage = "value == null"; |
| 1137 | goto exit; |
| 1138 | } |
| 1139 | if (offset < 0) { |
| 1140 | _exception = 1; |
| 1141 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1142 | _exceptionMessage = "offset < 0"; |
| 1143 | goto exit; |
| 1144 | } |
| 1145 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1146 | value_base = (GLfloat *) |
| 1147 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1148 | value = value_base + offset; |
| 1149 | |
| 1150 | glUniformMatrix2x4fv( |
| 1151 | (GLint)location, |
| 1152 | (GLsizei)count, |
| 1153 | (GLboolean)transpose, |
| 1154 | (GLfloat *)value |
| 1155 | ); |
| 1156 | |
| 1157 | exit: |
| 1158 | if (value_base) { |
| 1159 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1160 | JNI_ABORT); |
| 1161 | } |
| 1162 | if (_exception) { |
| 1163 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1164 | } |
| 1165 | } |
| 1166 | |
| 1167 | /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1168 | static void |
| 1169 | android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 |
| 1170 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1171 | jarray _array = (jarray) 0; |
| 1172 | jint _bufferOffset = (jint) 0; |
| 1173 | jint _remaining; |
| 1174 | GLfloat *value = (GLfloat *) 0; |
| 1175 | |
| 1176 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1177 | if (value == NULL) { |
| 1178 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1179 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1180 | } |
| 1181 | glUniformMatrix2x4fv( |
| 1182 | (GLint)location, |
| 1183 | (GLsizei)count, |
| 1184 | (GLboolean)transpose, |
| 1185 | (GLfloat *)value |
| 1186 | ); |
| 1187 | if (_array) { |
| 1188 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1189 | } |
| 1190 | } |
| 1191 | |
| 1192 | /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1193 | static void |
| 1194 | android_glUniformMatrix4x2fv__IIZ_3FI |
| 1195 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 1196 | jint _exception = 0; |
| 1197 | const char * _exceptionType = NULL; |
| 1198 | const char * _exceptionMessage = NULL; |
| 1199 | GLfloat *value_base = (GLfloat *) 0; |
| 1200 | jint _remaining; |
| 1201 | GLfloat *value = (GLfloat *) 0; |
| 1202 | |
| 1203 | if (!value_ref) { |
| 1204 | _exception = 1; |
| 1205 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1206 | _exceptionMessage = "value == null"; |
| 1207 | goto exit; |
| 1208 | } |
| 1209 | if (offset < 0) { |
| 1210 | _exception = 1; |
| 1211 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1212 | _exceptionMessage = "offset < 0"; |
| 1213 | goto exit; |
| 1214 | } |
| 1215 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1216 | value_base = (GLfloat *) |
| 1217 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1218 | value = value_base + offset; |
| 1219 | |
| 1220 | glUniformMatrix4x2fv( |
| 1221 | (GLint)location, |
| 1222 | (GLsizei)count, |
| 1223 | (GLboolean)transpose, |
| 1224 | (GLfloat *)value |
| 1225 | ); |
| 1226 | |
| 1227 | exit: |
| 1228 | if (value_base) { |
| 1229 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1230 | JNI_ABORT); |
| 1231 | } |
| 1232 | if (_exception) { |
| 1233 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1234 | } |
| 1235 | } |
| 1236 | |
| 1237 | /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1238 | static void |
| 1239 | android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 |
| 1240 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1241 | jarray _array = (jarray) 0; |
| 1242 | jint _bufferOffset = (jint) 0; |
| 1243 | jint _remaining; |
| 1244 | GLfloat *value = (GLfloat *) 0; |
| 1245 | |
| 1246 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1247 | if (value == NULL) { |
| 1248 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1249 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1250 | } |
| 1251 | glUniformMatrix4x2fv( |
| 1252 | (GLint)location, |
| 1253 | (GLsizei)count, |
| 1254 | (GLboolean)transpose, |
| 1255 | (GLfloat *)value |
| 1256 | ); |
| 1257 | if (_array) { |
| 1258 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1263 | static void |
| 1264 | android_glUniformMatrix3x4fv__IIZ_3FI |
| 1265 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 1266 | jint _exception = 0; |
| 1267 | const char * _exceptionType = NULL; |
| 1268 | const char * _exceptionMessage = NULL; |
| 1269 | GLfloat *value_base = (GLfloat *) 0; |
| 1270 | jint _remaining; |
| 1271 | GLfloat *value = (GLfloat *) 0; |
| 1272 | |
| 1273 | if (!value_ref) { |
| 1274 | _exception = 1; |
| 1275 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1276 | _exceptionMessage = "value == null"; |
| 1277 | goto exit; |
| 1278 | } |
| 1279 | if (offset < 0) { |
| 1280 | _exception = 1; |
| 1281 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1282 | _exceptionMessage = "offset < 0"; |
| 1283 | goto exit; |
| 1284 | } |
| 1285 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1286 | value_base = (GLfloat *) |
| 1287 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1288 | value = value_base + offset; |
| 1289 | |
| 1290 | glUniformMatrix3x4fv( |
| 1291 | (GLint)location, |
| 1292 | (GLsizei)count, |
| 1293 | (GLboolean)transpose, |
| 1294 | (GLfloat *)value |
| 1295 | ); |
| 1296 | |
| 1297 | exit: |
| 1298 | if (value_base) { |
| 1299 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1300 | JNI_ABORT); |
| 1301 | } |
| 1302 | if (_exception) { |
| 1303 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1304 | } |
| 1305 | } |
| 1306 | |
| 1307 | /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1308 | static void |
| 1309 | android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 |
| 1310 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1311 | jarray _array = (jarray) 0; |
| 1312 | jint _bufferOffset = (jint) 0; |
| 1313 | jint _remaining; |
| 1314 | GLfloat *value = (GLfloat *) 0; |
| 1315 | |
| 1316 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1317 | if (value == NULL) { |
| 1318 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1319 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1320 | } |
| 1321 | glUniformMatrix3x4fv( |
| 1322 | (GLint)location, |
| 1323 | (GLsizei)count, |
| 1324 | (GLboolean)transpose, |
| 1325 | (GLfloat *)value |
| 1326 | ); |
| 1327 | if (_array) { |
| 1328 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1329 | } |
| 1330 | } |
| 1331 | |
| 1332 | /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1333 | static void |
| 1334 | android_glUniformMatrix4x3fv__IIZ_3FI |
| 1335 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { |
| 1336 | jint _exception = 0; |
| 1337 | const char * _exceptionType = NULL; |
| 1338 | const char * _exceptionMessage = NULL; |
| 1339 | GLfloat *value_base = (GLfloat *) 0; |
| 1340 | jint _remaining; |
| 1341 | GLfloat *value = (GLfloat *) 0; |
| 1342 | |
| 1343 | if (!value_ref) { |
| 1344 | _exception = 1; |
| 1345 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1346 | _exceptionMessage = "value == null"; |
| 1347 | goto exit; |
| 1348 | } |
| 1349 | if (offset < 0) { |
| 1350 | _exception = 1; |
| 1351 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1352 | _exceptionMessage = "offset < 0"; |
| 1353 | goto exit; |
| 1354 | } |
| 1355 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 1356 | value_base = (GLfloat *) |
| 1357 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 1358 | value = value_base + offset; |
| 1359 | |
| 1360 | glUniformMatrix4x3fv( |
| 1361 | (GLint)location, |
| 1362 | (GLsizei)count, |
| 1363 | (GLboolean)transpose, |
| 1364 | (GLfloat *)value |
| 1365 | ); |
| 1366 | |
| 1367 | exit: |
| 1368 | if (value_base) { |
| 1369 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 1370 | JNI_ABORT); |
| 1371 | } |
| 1372 | if (_exception) { |
| 1373 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1374 | } |
| 1375 | } |
| 1376 | |
| 1377 | /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ |
| 1378 | static void |
| 1379 | android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 |
| 1380 | (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { |
| 1381 | jarray _array = (jarray) 0; |
| 1382 | jint _bufferOffset = (jint) 0; |
| 1383 | jint _remaining; |
| 1384 | GLfloat *value = (GLfloat *) 0; |
| 1385 | |
| 1386 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 1387 | if (value == NULL) { |
| 1388 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1389 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 1390 | } |
| 1391 | glUniformMatrix4x3fv( |
| 1392 | (GLint)location, |
| 1393 | (GLsizei)count, |
| 1394 | (GLboolean)transpose, |
| 1395 | (GLfloat *)value |
| 1396 | ); |
| 1397 | if (_array) { |
| 1398 | releasePointer(_env, _array, value, JNI_FALSE); |
| 1399 | } |
| 1400 | } |
| 1401 | |
| 1402 | /* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */ |
| 1403 | static void |
| 1404 | android_glBlitFramebuffer__IIIIIIIIII |
| 1405 | (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) { |
| 1406 | glBlitFramebuffer( |
| 1407 | (GLint)srcX0, |
| 1408 | (GLint)srcY0, |
| 1409 | (GLint)srcX1, |
| 1410 | (GLint)srcY1, |
| 1411 | (GLint)dstX0, |
| 1412 | (GLint)dstY0, |
| 1413 | (GLint)dstX1, |
| 1414 | (GLint)dstY1, |
| 1415 | (GLbitfield)mask, |
| 1416 | (GLenum)filter |
| 1417 | ); |
| 1418 | } |
| 1419 | |
| 1420 | /* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */ |
| 1421 | static void |
| 1422 | android_glRenderbufferStorageMultisample__IIIII |
| 1423 | (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) { |
| 1424 | glRenderbufferStorageMultisample( |
| 1425 | (GLenum)target, |
| 1426 | (GLsizei)samples, |
| 1427 | (GLenum)internalformat, |
| 1428 | (GLsizei)width, |
| 1429 | (GLsizei)height |
| 1430 | ); |
| 1431 | } |
| 1432 | |
| 1433 | /* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */ |
| 1434 | static void |
| 1435 | android_glFramebufferTextureLayer__IIIII |
| 1436 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) { |
| 1437 | glFramebufferTextureLayer( |
| 1438 | (GLenum)target, |
| 1439 | (GLenum)attachment, |
| 1440 | (GLuint)texture, |
| 1441 | (GLint)level, |
| 1442 | (GLint)layer |
| 1443 | ); |
| 1444 | } |
| 1445 | |
| 1446 | /* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */ |
| 1447 | static jobject |
| 1448 | android_glMapBufferRange__IIII |
| 1449 | (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) { |
| 1450 | GLvoid* _p = glMapBufferRange((GLenum)target, |
| 1451 | (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access); |
| 1452 | jobject _buf = (jobject)0; |
| 1453 | if (_p) { |
| 1454 | _buf = _env->NewDirectByteBuffer(_p, length); |
| 1455 | } |
| 1456 | return _buf; |
| 1457 | } |
| 1458 | |
| 1459 | /* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */ |
| 1460 | static void |
| 1461 | android_glFlushMappedBufferRange__III |
| 1462 | (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) { |
| 1463 | glFlushMappedBufferRange( |
| 1464 | (GLenum)target, |
| 1465 | (GLintptr)offset, |
| 1466 | (GLsizeiptr)length |
| 1467 | ); |
| 1468 | } |
| 1469 | |
| 1470 | /* void glBindVertexArray ( GLuint array ) */ |
| 1471 | static void |
| 1472 | android_glBindVertexArray__I |
| 1473 | (JNIEnv *_env, jobject _this, jint array) { |
| 1474 | glBindVertexArray( |
| 1475 | (GLuint)array |
| 1476 | ); |
| 1477 | } |
| 1478 | |
| 1479 | /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */ |
| 1480 | static void |
| 1481 | android_glDeleteVertexArrays__I_3II |
| 1482 | (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) { |
| 1483 | jint _exception = 0; |
| 1484 | const char * _exceptionType = NULL; |
| 1485 | const char * _exceptionMessage = NULL; |
| 1486 | GLuint *arrays_base = (GLuint *) 0; |
| 1487 | jint _remaining; |
| 1488 | GLuint *arrays = (GLuint *) 0; |
| 1489 | |
| 1490 | if (!arrays_ref) { |
| 1491 | _exception = 1; |
| 1492 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1493 | _exceptionMessage = "arrays == null"; |
| 1494 | goto exit; |
| 1495 | } |
| 1496 | if (offset < 0) { |
| 1497 | _exception = 1; |
| 1498 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1499 | _exceptionMessage = "offset < 0"; |
| 1500 | goto exit; |
| 1501 | } |
| 1502 | _remaining = _env->GetArrayLength(arrays_ref) - offset; |
| 1503 | arrays_base = (GLuint *) |
| 1504 | _env->GetPrimitiveArrayCritical(arrays_ref, (jboolean *)0); |
| 1505 | arrays = arrays_base + offset; |
| 1506 | |
| 1507 | glDeleteVertexArrays( |
| 1508 | (GLsizei)n, |
| 1509 | (GLuint *)arrays |
| 1510 | ); |
| 1511 | |
| 1512 | exit: |
| 1513 | if (arrays_base) { |
| 1514 | _env->ReleasePrimitiveArrayCritical(arrays_ref, arrays_base, |
| 1515 | JNI_ABORT); |
| 1516 | } |
| 1517 | if (_exception) { |
| 1518 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1519 | } |
| 1520 | } |
| 1521 | |
| 1522 | /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */ |
| 1523 | static void |
| 1524 | android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 |
| 1525 | (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) { |
| 1526 | jarray _array = (jarray) 0; |
| 1527 | jint _bufferOffset = (jint) 0; |
| 1528 | jint _remaining; |
| 1529 | GLuint *arrays = (GLuint *) 0; |
| 1530 | |
| 1531 | arrays = (GLuint *)getPointer(_env, arrays_buf, &_array, &_remaining, &_bufferOffset); |
| 1532 | if (arrays == NULL) { |
| 1533 | char * _arraysBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1534 | arrays = (GLuint *) (_arraysBase + _bufferOffset); |
| 1535 | } |
| 1536 | glDeleteVertexArrays( |
| 1537 | (GLsizei)n, |
| 1538 | (GLuint *)arrays |
| 1539 | ); |
| 1540 | if (_array) { |
| 1541 | releasePointer(_env, _array, arrays, JNI_FALSE); |
| 1542 | } |
| 1543 | } |
| 1544 | |
| 1545 | /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */ |
| 1546 | static void |
| 1547 | android_glGenVertexArrays__I_3II |
| 1548 | (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) { |
| 1549 | jint _exception = 0; |
| 1550 | const char * _exceptionType = NULL; |
| 1551 | const char * _exceptionMessage = NULL; |
| 1552 | GLuint *arrays_base = (GLuint *) 0; |
| 1553 | jint _remaining; |
| 1554 | GLuint *arrays = (GLuint *) 0; |
| 1555 | |
| 1556 | if (!arrays_ref) { |
| 1557 | _exception = 1; |
| 1558 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1559 | _exceptionMessage = "arrays == null"; |
| 1560 | goto exit; |
| 1561 | } |
| 1562 | if (offset < 0) { |
| 1563 | _exception = 1; |
| 1564 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1565 | _exceptionMessage = "offset < 0"; |
| 1566 | goto exit; |
| 1567 | } |
| 1568 | _remaining = _env->GetArrayLength(arrays_ref) - offset; |
| 1569 | arrays_base = (GLuint *) |
| 1570 | _env->GetPrimitiveArrayCritical(arrays_ref, (jboolean *)0); |
| 1571 | arrays = arrays_base + offset; |
| 1572 | |
| 1573 | glGenVertexArrays( |
| 1574 | (GLsizei)n, |
| 1575 | (GLuint *)arrays |
| 1576 | ); |
| 1577 | |
| 1578 | exit: |
| 1579 | if (arrays_base) { |
| 1580 | _env->ReleasePrimitiveArrayCritical(arrays_ref, arrays_base, |
| 1581 | _exception ? JNI_ABORT: 0); |
| 1582 | } |
| 1583 | if (_exception) { |
| 1584 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1585 | } |
| 1586 | } |
| 1587 | |
| 1588 | /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */ |
| 1589 | static void |
| 1590 | android_glGenVertexArrays__ILjava_nio_IntBuffer_2 |
| 1591 | (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) { |
| 1592 | jarray _array = (jarray) 0; |
| 1593 | jint _bufferOffset = (jint) 0; |
| 1594 | jint _remaining; |
| 1595 | GLuint *arrays = (GLuint *) 0; |
| 1596 | |
| 1597 | arrays = (GLuint *)getPointer(_env, arrays_buf, &_array, &_remaining, &_bufferOffset); |
| 1598 | if (arrays == NULL) { |
| 1599 | char * _arraysBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1600 | arrays = (GLuint *) (_arraysBase + _bufferOffset); |
| 1601 | } |
| 1602 | glGenVertexArrays( |
| 1603 | (GLsizei)n, |
| 1604 | (GLuint *)arrays |
| 1605 | ); |
| 1606 | if (_array) { |
| 1607 | releasePointer(_env, _array, arrays, JNI_TRUE); |
| 1608 | } |
| 1609 | } |
| 1610 | |
| 1611 | /* GLboolean glIsVertexArray ( GLuint array ) */ |
| 1612 | static jboolean |
| 1613 | android_glIsVertexArray__I |
| 1614 | (JNIEnv *_env, jobject _this, jint array) { |
| 1615 | GLboolean _returnValue; |
| 1616 | _returnValue = glIsVertexArray( |
| 1617 | (GLuint)array |
| 1618 | ); |
| 1619 | return (jboolean)_returnValue; |
| 1620 | } |
| 1621 | |
| 1622 | /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */ |
| 1623 | static void |
| 1624 | android_glGetIntegeri_v__II_3II |
| 1625 | (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) { |
| 1626 | jint _exception = 0; |
| 1627 | const char * _exceptionType = NULL; |
| 1628 | const char * _exceptionMessage = NULL; |
| 1629 | GLint *data_base = (GLint *) 0; |
| 1630 | jint _remaining; |
| 1631 | GLint *data = (GLint *) 0; |
| 1632 | |
| 1633 | if (!data_ref) { |
| 1634 | _exception = 1; |
| 1635 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1636 | _exceptionMessage = "data == null"; |
| 1637 | goto exit; |
| 1638 | } |
| 1639 | if (offset < 0) { |
| 1640 | _exception = 1; |
| 1641 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1642 | _exceptionMessage = "offset < 0"; |
| 1643 | goto exit; |
| 1644 | } |
| 1645 | _remaining = _env->GetArrayLength(data_ref) - offset; |
| 1646 | data_base = (GLint *) |
| 1647 | _env->GetPrimitiveArrayCritical(data_ref, (jboolean *)0); |
| 1648 | data = data_base + offset; |
| 1649 | |
| 1650 | glGetIntegeri_v( |
| 1651 | (GLenum)target, |
| 1652 | (GLuint)index, |
| 1653 | (GLint *)data |
| 1654 | ); |
| 1655 | |
| 1656 | exit: |
| 1657 | if (data_base) { |
| 1658 | _env->ReleasePrimitiveArrayCritical(data_ref, data_base, |
| 1659 | _exception ? JNI_ABORT: 0); |
| 1660 | } |
| 1661 | if (_exception) { |
| 1662 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */ |
| 1667 | static void |
| 1668 | android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 |
| 1669 | (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) { |
| 1670 | jarray _array = (jarray) 0; |
| 1671 | jint _bufferOffset = (jint) 0; |
| 1672 | jint _remaining; |
| 1673 | GLint *data = (GLint *) 0; |
| 1674 | |
| 1675 | data = (GLint *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 1676 | if (data == NULL) { |
| 1677 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 1678 | data = (GLint *) (_dataBase + _bufferOffset); |
| 1679 | } |
| 1680 | glGetIntegeri_v( |
| 1681 | (GLenum)target, |
| 1682 | (GLuint)index, |
| 1683 | (GLint *)data |
| 1684 | ); |
| 1685 | if (_array) { |
| 1686 | releasePointer(_env, _array, data, JNI_TRUE); |
| 1687 | } |
| 1688 | } |
| 1689 | |
| 1690 | /* void glBeginTransformFeedback ( GLenum primitiveMode ) */ |
| 1691 | static void |
| 1692 | android_glBeginTransformFeedback__I |
| 1693 | (JNIEnv *_env, jobject _this, jint primitiveMode) { |
| 1694 | glBeginTransformFeedback( |
| 1695 | (GLenum)primitiveMode |
| 1696 | ); |
| 1697 | } |
| 1698 | |
| 1699 | /* void glEndTransformFeedback ( void ) */ |
| 1700 | static void |
| 1701 | android_glEndTransformFeedback__ |
| 1702 | (JNIEnv *_env, jobject _this) { |
| 1703 | glEndTransformFeedback(); |
| 1704 | } |
| 1705 | |
| 1706 | /* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */ |
| 1707 | static void |
| 1708 | android_glBindBufferRange__IIIII |
| 1709 | (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) { |
| 1710 | glBindBufferRange( |
| 1711 | (GLenum)target, |
| 1712 | (GLuint)index, |
| 1713 | (GLuint)buffer, |
| 1714 | (GLintptr)offset, |
| 1715 | (GLsizeiptr)size |
| 1716 | ); |
| 1717 | } |
| 1718 | |
| 1719 | /* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */ |
| 1720 | static void |
| 1721 | android_glBindBufferBase__III |
| 1722 | (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) { |
| 1723 | glBindBufferBase( |
| 1724 | (GLenum)target, |
| 1725 | (GLuint)index, |
| 1726 | (GLuint)buffer |
| 1727 | ); |
| 1728 | } |
| 1729 | |
| 1730 | /* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */ |
| 1731 | static |
| 1732 | void |
| 1733 | android_glTransformFeedbackVaryings |
| 1734 | (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) { |
| 1735 | jint _exception = 0; |
| 1736 | const char* _exceptionType = NULL; |
| 1737 | const char* _exceptionMessage = NULL; |
| 1738 | jint _count = 0, _i; |
| 1739 | const char** _varyings = NULL; |
| 1740 | const char* _varying = NULL; |
| 1741 | |
| 1742 | if (!varyings_ref) { |
| 1743 | _exception = 1; |
| 1744 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1745 | _exceptionMessage = "varyings == null"; |
| 1746 | goto exit; |
| 1747 | } |
| 1748 | |
| 1749 | _count = _env->GetArrayLength(varyings_ref); |
| 1750 | _varyings = (const char**)calloc(_count, sizeof(const char*)); |
| 1751 | for (_i = 0; _i < _count; _i++) { |
| 1752 | jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i); |
| 1753 | if (!_varying) { |
| 1754 | _exception = 1; |
| 1755 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1756 | _exceptionMessage = "null varyings element"; |
| 1757 | goto exit; |
| 1758 | } |
| 1759 | _varyings[_i] = _env->GetStringUTFChars(_varying, 0); |
| 1760 | } |
| 1761 | |
| 1762 | glTransformFeedbackVaryings(program, _count, _varyings, bufferMode); |
| 1763 | |
| 1764 | exit: |
| 1765 | for (_i = _count - 1; _i >= 0; _i--) { |
| 1766 | if (_varyings[_i]) { |
| 1767 | jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i); |
| 1768 | if (_varying) { |
| 1769 | _env->ReleaseStringUTFChars(_varying, _varyings[_i]); |
| 1770 | } |
| 1771 | } |
| 1772 | } |
| 1773 | free(_varyings); |
| 1774 | if (_exception) { |
| 1775 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1776 | } |
| 1777 | } |
| 1778 | |
| 1779 | /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ |
| 1780 | static void |
| 1781 | android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI |
| 1782 | (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) { |
| 1783 | jint _exception = 0; |
| 1784 | const char * _exceptionType; |
| 1785 | const char * _exceptionMessage; |
| 1786 | GLsizei *length_base = (GLsizei *) 0; |
| 1787 | jint _lengthRemaining; |
| 1788 | GLsizei *length = (GLsizei *) 0; |
| 1789 | GLint *size_base = (GLint *) 0; |
| 1790 | jint _sizeRemaining; |
| 1791 | GLint *size = (GLint *) 0; |
| 1792 | GLenum *type_base = (GLenum *) 0; |
| 1793 | jint _typeRemaining; |
| 1794 | GLenum *type = (GLenum *) 0; |
| 1795 | char *name_base = (char *) 0; |
| 1796 | jint _nameRemaining; |
| 1797 | char *name = (char *) 0; |
| 1798 | |
| 1799 | if (!length_ref) { |
| 1800 | _exception = 1; |
| 1801 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1802 | _exceptionMessage = "length == null"; |
| 1803 | goto exit; |
| 1804 | } |
| 1805 | if (lengthOffset < 0) { |
| 1806 | _exception = 1; |
| 1807 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1808 | _exceptionMessage = "lengthOffset < 0"; |
| 1809 | goto exit; |
| 1810 | } |
| 1811 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 1812 | length_base = (GLsizei *) |
| 1813 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 1814 | length = length_base + lengthOffset; |
| 1815 | |
| 1816 | if (!size_ref) { |
| 1817 | _exception = 1; |
| 1818 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1819 | _exceptionMessage = "size == null"; |
| 1820 | goto exit; |
| 1821 | } |
| 1822 | if (sizeOffset < 0) { |
| 1823 | _exception = 1; |
| 1824 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1825 | _exceptionMessage = "sizeOffset < 0"; |
| 1826 | goto exit; |
| 1827 | } |
| 1828 | _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; |
| 1829 | size_base = (GLint *) |
| 1830 | _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); |
| 1831 | size = size_base + sizeOffset; |
| 1832 | |
| 1833 | if (!type_ref) { |
| 1834 | _exception = 1; |
| 1835 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1836 | _exceptionMessage = "type == null"; |
| 1837 | goto exit; |
| 1838 | } |
| 1839 | if (typeOffset < 0) { |
| 1840 | _exception = 1; |
| 1841 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1842 | _exceptionMessage = "typeOffset < 0"; |
| 1843 | goto exit; |
| 1844 | } |
| 1845 | _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; |
| 1846 | type_base = (GLenum *) |
| 1847 | _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); |
| 1848 | type = type_base + typeOffset; |
| 1849 | |
| 1850 | if (!name_ref) { |
| 1851 | _exception = 1; |
| 1852 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1853 | _exceptionMessage = "name == null"; |
| 1854 | goto exit; |
| 1855 | } |
| 1856 | if (nameOffset < 0) { |
| 1857 | _exception = 1; |
| 1858 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1859 | _exceptionMessage = "nameOffset < 0"; |
| 1860 | goto exit; |
| 1861 | } |
| 1862 | _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; |
| 1863 | name_base = (char *) |
| 1864 | _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0); |
| 1865 | name = name_base + nameOffset; |
| 1866 | |
| 1867 | glGetTransformFeedbackVarying( |
| 1868 | (GLuint)program, |
| 1869 | (GLuint)index, |
| 1870 | (GLsizei)bufsize, |
| 1871 | (GLsizei *)length, |
| 1872 | (GLint *)size, |
| 1873 | (GLenum *)type, |
| 1874 | (char *)name |
| 1875 | ); |
| 1876 | |
| 1877 | exit: |
| 1878 | if (name_base) { |
| 1879 | _env->ReleasePrimitiveArrayCritical(name_ref, name_base, |
| 1880 | _exception ? JNI_ABORT: 0); |
| 1881 | } |
| 1882 | if (type_base) { |
| 1883 | _env->ReleasePrimitiveArrayCritical(type_ref, type_base, |
| 1884 | _exception ? JNI_ABORT: 0); |
| 1885 | } |
| 1886 | if (size_base) { |
| 1887 | _env->ReleasePrimitiveArrayCritical(size_ref, size_base, |
| 1888 | _exception ? JNI_ABORT: 0); |
| 1889 | } |
| 1890 | if (length_base) { |
| 1891 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 1892 | _exception ? JNI_ABORT: 0); |
| 1893 | } |
| 1894 | if (_exception) { |
| 1895 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1896 | } |
| 1897 | } |
| 1898 | |
| 1899 | /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ |
| 1900 | static void |
| 1901 | android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B |
| 1902 | (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { |
| 1903 | jarray _lengthArray = (jarray) 0; |
| 1904 | jint _lengthBufferOffset = (jint) 0; |
| 1905 | jarray _sizeArray = (jarray) 0; |
| 1906 | jint _sizeBufferOffset = (jint) 0; |
| 1907 | jarray _typeArray = (jarray) 0; |
| 1908 | jint _typeBufferOffset = (jint) 0; |
| 1909 | jint _lengthRemaining; |
| 1910 | GLsizei *length = (GLsizei *) 0; |
| 1911 | jint _sizeRemaining; |
| 1912 | GLint *size = (GLint *) 0; |
| 1913 | jint _typeRemaining; |
| 1914 | GLenum *type = (GLenum *) 0; |
| 1915 | |
| 1916 | length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); |
| 1917 | size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset); |
| 1918 | type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset); |
| 1919 | if (length == NULL) { |
| 1920 | char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0); |
| 1921 | length = (GLsizei *) (_lengthBase + _lengthBufferOffset); |
| 1922 | } |
| 1923 | if (size == NULL) { |
| 1924 | char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0); |
| 1925 | size = (GLint *) (_sizeBase + _sizeBufferOffset); |
| 1926 | } |
| 1927 | if (type == NULL) { |
| 1928 | char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0); |
| 1929 | type = (GLenum *) (_typeBase + _typeBufferOffset); |
| 1930 | } |
| 1931 | glGetTransformFeedbackVarying( |
| 1932 | (GLuint)program, |
| 1933 | (GLuint)index, |
| 1934 | (GLsizei)bufsize, |
| 1935 | (GLsizei *)length, |
| 1936 | (GLint *)size, |
| 1937 | (GLenum *)type, |
Dan Albert | 10caf03 | 2015-02-23 10:41:10 -0800 | [diff] [blame^] | 1938 | // The cast below is incorrect. The driver will end up writing to the |
| 1939 | // address specified by name, which will always crash the process since |
| 1940 | // it is guaranteed to be in low memory. The additional static_cast |
| 1941 | // suppresses the warning for now. http://b/19478262 |
| 1942 | (char *)static_cast<uintptr_t>(name) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 1943 | ); |
| 1944 | if (_typeArray) { |
| 1945 | releasePointer(_env, _typeArray, type, JNI_TRUE); |
| 1946 | } |
| 1947 | if (_sizeArray) { |
| 1948 | releasePointer(_env, _sizeArray, size, JNI_TRUE); |
| 1949 | } |
| 1950 | if (_lengthArray) { |
| 1951 | releasePointer(_env, _lengthArray, length, JNI_TRUE); |
| 1952 | } |
| 1953 | } |
| 1954 | |
| 1955 | /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ |
| 1956 | static jstring |
| 1957 | android_glGetTransformFeedbackVarying1 |
| 1958 | (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { |
| 1959 | jint _exception = 0; |
| 1960 | const char * _exceptionType; |
| 1961 | const char * _exceptionMessage; |
| 1962 | GLint *size_base = (GLint *) 0; |
| 1963 | jint _sizeRemaining; |
| 1964 | GLint *size = (GLint *) 0; |
| 1965 | GLenum *type_base = (GLenum *) 0; |
| 1966 | jint _typeRemaining; |
| 1967 | GLenum *type = (GLenum *) 0; |
| 1968 | |
| 1969 | jstring result = 0; |
| 1970 | |
| 1971 | GLint len = 0; |
| 1972 | glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); |
| 1973 | if (!len) { |
| 1974 | return _env->NewStringUTF(""); |
| 1975 | } |
| 1976 | char* buf = (char*) malloc(len); |
| 1977 | |
| 1978 | if (buf == NULL) { |
| 1979 | jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); |
| 1980 | return NULL; |
| 1981 | } |
| 1982 | if (!size_ref) { |
| 1983 | _exception = 1; |
| 1984 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1985 | _exceptionMessage = "size == null"; |
| 1986 | goto exit; |
| 1987 | } |
| 1988 | if (sizeOffset < 0) { |
| 1989 | _exception = 1; |
| 1990 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1991 | _exceptionMessage = "sizeOffset < 0"; |
| 1992 | goto exit; |
| 1993 | } |
| 1994 | _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; |
| 1995 | size_base = (GLint *) |
| 1996 | _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); |
| 1997 | size = size_base + sizeOffset; |
| 1998 | |
| 1999 | if (!type_ref) { |
| 2000 | _exception = 1; |
| 2001 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2002 | _exceptionMessage = "type == null"; |
| 2003 | goto exit; |
| 2004 | } |
| 2005 | if (typeOffset < 0) { |
| 2006 | _exception = 1; |
| 2007 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2008 | _exceptionMessage = "typeOffset < 0"; |
| 2009 | goto exit; |
| 2010 | } |
| 2011 | _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; |
| 2012 | type_base = (GLenum *) |
| 2013 | _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); |
| 2014 | type = type_base + typeOffset; |
| 2015 | |
| 2016 | glGetTransformFeedbackVarying( |
| 2017 | (GLuint)program, |
| 2018 | (GLuint)index, |
| 2019 | (GLsizei)len, |
| 2020 | NULL, |
| 2021 | (GLint *)size, |
| 2022 | (GLenum *)type, |
| 2023 | (char *)buf |
| 2024 | ); |
| 2025 | exit: |
| 2026 | if (type_base) { |
| 2027 | _env->ReleasePrimitiveArrayCritical(type_ref, type_base, |
| 2028 | _exception ? JNI_ABORT: 0); |
| 2029 | } |
| 2030 | if (size_base) { |
| 2031 | _env->ReleasePrimitiveArrayCritical(size_ref, size_base, |
| 2032 | _exception ? JNI_ABORT: 0); |
| 2033 | } |
| 2034 | if (_exception != 1) { |
| 2035 | result = _env->NewStringUTF(buf); |
| 2036 | } |
| 2037 | if (buf) { |
| 2038 | free(buf); |
| 2039 | } |
| 2040 | if (_exception) { |
| 2041 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2042 | } |
| 2043 | if (result == 0) { |
| 2044 | result = _env->NewStringUTF(""); |
| 2045 | } |
| 2046 | |
| 2047 | return result; |
| 2048 | } |
| 2049 | |
| 2050 | /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ |
| 2051 | static jstring |
| 2052 | android_glGetTransformFeedbackVarying2 |
| 2053 | (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { |
| 2054 | jarray _sizeArray = (jarray) 0; |
| 2055 | jint _sizeBufferOffset = (jint) 0; |
| 2056 | jarray _typeArray = (jarray) 0; |
| 2057 | jint _typeBufferOffset = (jint) 0; |
| 2058 | jint _lengthRemaining; |
| 2059 | GLsizei *length = (GLsizei *) 0; |
| 2060 | jint _sizeRemaining; |
| 2061 | GLint *size = (GLint *) 0; |
| 2062 | jint _typeRemaining; |
| 2063 | GLenum *type = (GLenum *) 0; |
| 2064 | |
| 2065 | jstring result = 0; |
| 2066 | |
| 2067 | GLint len = 0; |
| 2068 | glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); |
| 2069 | if (!len) { |
| 2070 | return _env->NewStringUTF(""); |
| 2071 | } |
| 2072 | char* buf = (char*) malloc(len); |
| 2073 | |
| 2074 | if (buf == NULL) { |
| 2075 | jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); |
| 2076 | return NULL; |
| 2077 | } |
| 2078 | |
| 2079 | size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset); |
| 2080 | type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset); |
| 2081 | if (size == NULL) { |
| 2082 | char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0); |
| 2083 | size = (GLint *) (_sizeBase + _sizeBufferOffset); |
| 2084 | } |
| 2085 | if (type == NULL) { |
| 2086 | char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0); |
| 2087 | type = (GLenum *) (_typeBase + _typeBufferOffset); |
| 2088 | } |
| 2089 | glGetTransformFeedbackVarying( |
| 2090 | (GLuint)program, |
| 2091 | (GLuint)index, |
| 2092 | (GLsizei)len, |
| 2093 | NULL, |
| 2094 | (GLint *)size, |
| 2095 | (GLenum *)type, |
| 2096 | (char *)buf |
| 2097 | ); |
| 2098 | |
| 2099 | if (_typeArray) { |
| 2100 | releasePointer(_env, _typeArray, type, JNI_TRUE); |
| 2101 | } |
| 2102 | if (_sizeArray) { |
| 2103 | releasePointer(_env, _sizeArray, size, JNI_TRUE); |
| 2104 | } |
| 2105 | result = _env->NewStringUTF(buf); |
| 2106 | if (buf) { |
| 2107 | free(buf); |
| 2108 | } |
| 2109 | return result; |
| 2110 | } |
| 2111 | /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 2112 | static void |
| 2113 | android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I |
| 2114 | (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 2115 | jarray _array = (jarray) 0; |
| 2116 | jint _bufferOffset = (jint) 0; |
| 2117 | jint _remaining; |
| 2118 | GLvoid *pointer = (GLvoid *) 0; |
| 2119 | |
| 2120 | if (pointer_buf) { |
| 2121 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 2122 | if ( ! pointer ) { |
| 2123 | return; |
| 2124 | } |
| 2125 | } |
| 2126 | glVertexAttribIPointerBounds( |
| 2127 | (GLuint)index, |
| 2128 | (GLint)size, |
| 2129 | (GLenum)type, |
| 2130 | (GLsizei)stride, |
| 2131 | (GLvoid *)pointer, |
| 2132 | (GLsizei)remaining |
| 2133 | ); |
| 2134 | } |
| 2135 | |
| 2136 | /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */ |
| 2137 | static void |
| 2138 | android_glVertexAttribIPointer__IIIII |
| 2139 | (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) { |
| 2140 | glVertexAttribIPointer( |
| 2141 | (GLuint)index, |
| 2142 | (GLint)size, |
| 2143 | (GLenum)type, |
| 2144 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 2145 | reinterpret_cast<GLvoid *>(offset) |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 2146 | ); |
| 2147 | } |
| 2148 | |
| 2149 | /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */ |
| 2150 | static void |
| 2151 | android_glGetVertexAttribIiv__II_3II |
| 2152 | (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) { |
| 2153 | jint _exception = 0; |
| 2154 | const char * _exceptionType = NULL; |
| 2155 | const char * _exceptionMessage = NULL; |
| 2156 | GLint *params_base = (GLint *) 0; |
| 2157 | jint _remaining; |
| 2158 | GLint *params = (GLint *) 0; |
| 2159 | |
| 2160 | if (!params_ref) { |
| 2161 | _exception = 1; |
| 2162 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2163 | _exceptionMessage = "params == null"; |
| 2164 | goto exit; |
| 2165 | } |
| 2166 | if (offset < 0) { |
| 2167 | _exception = 1; |
| 2168 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2169 | _exceptionMessage = "offset < 0"; |
| 2170 | goto exit; |
| 2171 | } |
| 2172 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2173 | params_base = (GLint *) |
| 2174 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2175 | params = params_base + offset; |
| 2176 | |
| 2177 | glGetVertexAttribIiv( |
| 2178 | (GLuint)index, |
| 2179 | (GLenum)pname, |
| 2180 | (GLint *)params |
| 2181 | ); |
| 2182 | |
| 2183 | exit: |
| 2184 | if (params_base) { |
| 2185 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2186 | _exception ? JNI_ABORT: 0); |
| 2187 | } |
| 2188 | if (_exception) { |
| 2189 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2190 | } |
| 2191 | } |
| 2192 | |
| 2193 | /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */ |
| 2194 | static void |
| 2195 | android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 |
| 2196 | (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { |
| 2197 | jarray _array = (jarray) 0; |
| 2198 | jint _bufferOffset = (jint) 0; |
| 2199 | jint _remaining; |
| 2200 | GLint *params = (GLint *) 0; |
| 2201 | |
| 2202 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 2203 | if (params == NULL) { |
| 2204 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2205 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 2206 | } |
| 2207 | glGetVertexAttribIiv( |
| 2208 | (GLuint)index, |
| 2209 | (GLenum)pname, |
| 2210 | (GLint *)params |
| 2211 | ); |
| 2212 | if (_array) { |
| 2213 | releasePointer(_env, _array, params, JNI_TRUE); |
| 2214 | } |
| 2215 | } |
| 2216 | |
| 2217 | /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */ |
| 2218 | static void |
| 2219 | android_glGetVertexAttribIuiv__II_3II |
| 2220 | (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) { |
| 2221 | jint _exception = 0; |
| 2222 | const char * _exceptionType = NULL; |
| 2223 | const char * _exceptionMessage = NULL; |
| 2224 | GLuint *params_base = (GLuint *) 0; |
| 2225 | jint _remaining; |
| 2226 | GLuint *params = (GLuint *) 0; |
| 2227 | |
| 2228 | if (!params_ref) { |
| 2229 | _exception = 1; |
| 2230 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2231 | _exceptionMessage = "params == null"; |
| 2232 | goto exit; |
| 2233 | } |
| 2234 | if (offset < 0) { |
| 2235 | _exception = 1; |
| 2236 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2237 | _exceptionMessage = "offset < 0"; |
| 2238 | goto exit; |
| 2239 | } |
| 2240 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2241 | params_base = (GLuint *) |
| 2242 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2243 | params = params_base + offset; |
| 2244 | |
| 2245 | glGetVertexAttribIuiv( |
| 2246 | (GLuint)index, |
| 2247 | (GLenum)pname, |
| 2248 | (GLuint *)params |
| 2249 | ); |
| 2250 | |
| 2251 | exit: |
| 2252 | if (params_base) { |
| 2253 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2254 | _exception ? JNI_ABORT: 0); |
| 2255 | } |
| 2256 | if (_exception) { |
| 2257 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2258 | } |
| 2259 | } |
| 2260 | |
| 2261 | /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */ |
| 2262 | static void |
| 2263 | android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 |
| 2264 | (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { |
| 2265 | jarray _array = (jarray) 0; |
| 2266 | jint _bufferOffset = (jint) 0; |
| 2267 | jint _remaining; |
| 2268 | GLuint *params = (GLuint *) 0; |
| 2269 | |
| 2270 | params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 2271 | if (params == NULL) { |
| 2272 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2273 | params = (GLuint *) (_paramsBase + _bufferOffset); |
| 2274 | } |
| 2275 | glGetVertexAttribIuiv( |
| 2276 | (GLuint)index, |
| 2277 | (GLenum)pname, |
| 2278 | (GLuint *)params |
| 2279 | ); |
| 2280 | if (_array) { |
| 2281 | releasePointer(_env, _array, params, JNI_TRUE); |
| 2282 | } |
| 2283 | } |
| 2284 | |
| 2285 | /* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */ |
| 2286 | static void |
| 2287 | android_glVertexAttribI4i__IIIII |
| 2288 | (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) { |
| 2289 | glVertexAttribI4i( |
| 2290 | (GLuint)index, |
| 2291 | (GLint)x, |
| 2292 | (GLint)y, |
| 2293 | (GLint)z, |
| 2294 | (GLint)w |
| 2295 | ); |
| 2296 | } |
| 2297 | |
| 2298 | /* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */ |
| 2299 | static void |
| 2300 | android_glVertexAttribI4ui__IIIII |
| 2301 | (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) { |
| 2302 | glVertexAttribI4ui( |
| 2303 | (GLuint)index, |
| 2304 | (GLuint)x, |
| 2305 | (GLuint)y, |
| 2306 | (GLuint)z, |
| 2307 | (GLuint)w |
| 2308 | ); |
| 2309 | } |
| 2310 | |
| 2311 | /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */ |
| 2312 | static void |
| 2313 | android_glVertexAttribI4iv__I_3II |
| 2314 | (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) { |
| 2315 | jint _exception = 0; |
| 2316 | const char * _exceptionType = NULL; |
| 2317 | const char * _exceptionMessage = NULL; |
| 2318 | GLint *v_base = (GLint *) 0; |
| 2319 | jint _remaining; |
| 2320 | GLint *v = (GLint *) 0; |
| 2321 | |
| 2322 | if (!v_ref) { |
| 2323 | _exception = 1; |
| 2324 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2325 | _exceptionMessage = "v == null"; |
| 2326 | goto exit; |
| 2327 | } |
| 2328 | if (offset < 0) { |
| 2329 | _exception = 1; |
| 2330 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2331 | _exceptionMessage = "offset < 0"; |
| 2332 | goto exit; |
| 2333 | } |
| 2334 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 2335 | v_base = (GLint *) |
| 2336 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 2337 | v = v_base + offset; |
| 2338 | |
| 2339 | glVertexAttribI4iv( |
| 2340 | (GLuint)index, |
| 2341 | (GLint *)v |
| 2342 | ); |
| 2343 | |
| 2344 | exit: |
| 2345 | if (v_base) { |
| 2346 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 2347 | JNI_ABORT); |
| 2348 | } |
| 2349 | if (_exception) { |
| 2350 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2351 | } |
| 2352 | } |
| 2353 | |
| 2354 | /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */ |
| 2355 | static void |
| 2356 | android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 |
| 2357 | (JNIEnv *_env, jobject _this, jint index, jobject v_buf) { |
| 2358 | jarray _array = (jarray) 0; |
| 2359 | jint _bufferOffset = (jint) 0; |
| 2360 | jint _remaining; |
| 2361 | GLint *v = (GLint *) 0; |
| 2362 | |
| 2363 | v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset); |
| 2364 | if (v == NULL) { |
| 2365 | char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2366 | v = (GLint *) (_vBase + _bufferOffset); |
| 2367 | } |
| 2368 | glVertexAttribI4iv( |
| 2369 | (GLuint)index, |
| 2370 | (GLint *)v |
| 2371 | ); |
| 2372 | if (_array) { |
| 2373 | releasePointer(_env, _array, v, JNI_FALSE); |
| 2374 | } |
| 2375 | } |
| 2376 | |
| 2377 | /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */ |
| 2378 | static void |
| 2379 | android_glVertexAttribI4uiv__I_3II |
| 2380 | (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) { |
| 2381 | jint _exception = 0; |
| 2382 | const char * _exceptionType = NULL; |
| 2383 | const char * _exceptionMessage = NULL; |
| 2384 | GLuint *v_base = (GLuint *) 0; |
| 2385 | jint _remaining; |
| 2386 | GLuint *v = (GLuint *) 0; |
| 2387 | |
| 2388 | if (!v_ref) { |
| 2389 | _exception = 1; |
| 2390 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2391 | _exceptionMessage = "v == null"; |
| 2392 | goto exit; |
| 2393 | } |
| 2394 | if (offset < 0) { |
| 2395 | _exception = 1; |
| 2396 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2397 | _exceptionMessage = "offset < 0"; |
| 2398 | goto exit; |
| 2399 | } |
| 2400 | _remaining = _env->GetArrayLength(v_ref) - offset; |
| 2401 | v_base = (GLuint *) |
| 2402 | _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0); |
| 2403 | v = v_base + offset; |
| 2404 | |
| 2405 | glVertexAttribI4uiv( |
| 2406 | (GLuint)index, |
| 2407 | (GLuint *)v |
| 2408 | ); |
| 2409 | |
| 2410 | exit: |
| 2411 | if (v_base) { |
| 2412 | _env->ReleasePrimitiveArrayCritical(v_ref, v_base, |
| 2413 | JNI_ABORT); |
| 2414 | } |
| 2415 | if (_exception) { |
| 2416 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2417 | } |
| 2418 | } |
| 2419 | |
| 2420 | /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */ |
| 2421 | static void |
| 2422 | android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 |
| 2423 | (JNIEnv *_env, jobject _this, jint index, jobject v_buf) { |
| 2424 | jarray _array = (jarray) 0; |
| 2425 | jint _bufferOffset = (jint) 0; |
| 2426 | jint _remaining; |
| 2427 | GLuint *v = (GLuint *) 0; |
| 2428 | |
| 2429 | v = (GLuint *)getPointer(_env, v_buf, &_array, &_remaining, &_bufferOffset); |
| 2430 | if (v == NULL) { |
| 2431 | char * _vBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2432 | v = (GLuint *) (_vBase + _bufferOffset); |
| 2433 | } |
| 2434 | glVertexAttribI4uiv( |
| 2435 | (GLuint)index, |
| 2436 | (GLuint *)v |
| 2437 | ); |
| 2438 | if (_array) { |
| 2439 | releasePointer(_env, _array, v, JNI_FALSE); |
| 2440 | } |
| 2441 | } |
| 2442 | |
| 2443 | /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */ |
| 2444 | static void |
| 2445 | android_glGetUniformuiv__II_3II |
| 2446 | (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) { |
| 2447 | jint _exception = 0; |
| 2448 | const char * _exceptionType = NULL; |
| 2449 | const char * _exceptionMessage = NULL; |
| 2450 | GLuint *params_base = (GLuint *) 0; |
| 2451 | jint _remaining; |
| 2452 | GLuint *params = (GLuint *) 0; |
| 2453 | |
| 2454 | if (!params_ref) { |
| 2455 | _exception = 1; |
| 2456 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2457 | _exceptionMessage = "params == null"; |
| 2458 | goto exit; |
| 2459 | } |
| 2460 | if (offset < 0) { |
| 2461 | _exception = 1; |
| 2462 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2463 | _exceptionMessage = "offset < 0"; |
| 2464 | goto exit; |
| 2465 | } |
| 2466 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2467 | params_base = (GLuint *) |
| 2468 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 2469 | params = params_base + offset; |
| 2470 | |
| 2471 | glGetUniformuiv( |
| 2472 | (GLuint)program, |
| 2473 | (GLint)location, |
| 2474 | (GLuint *)params |
| 2475 | ); |
| 2476 | |
| 2477 | exit: |
| 2478 | if (params_base) { |
| 2479 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 2480 | _exception ? JNI_ABORT: 0); |
| 2481 | } |
| 2482 | if (_exception) { |
| 2483 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2484 | } |
| 2485 | } |
| 2486 | |
| 2487 | /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */ |
| 2488 | static void |
| 2489 | android_glGetUniformuiv__IILjava_nio_IntBuffer_2 |
| 2490 | (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { |
| 2491 | jarray _array = (jarray) 0; |
| 2492 | jint _bufferOffset = (jint) 0; |
| 2493 | jint _remaining; |
| 2494 | GLuint *params = (GLuint *) 0; |
| 2495 | |
| 2496 | params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 2497 | if (params == NULL) { |
| 2498 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2499 | params = (GLuint *) (_paramsBase + _bufferOffset); |
| 2500 | } |
| 2501 | glGetUniformuiv( |
| 2502 | (GLuint)program, |
| 2503 | (GLint)location, |
| 2504 | (GLuint *)params |
| 2505 | ); |
| 2506 | if (_array) { |
| 2507 | releasePointer(_env, _array, params, JNI_TRUE); |
| 2508 | } |
| 2509 | } |
| 2510 | |
| 2511 | /* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */ |
| 2512 | static jint |
| 2513 | android_glGetFragDataLocation__ILjava_lang_String_2 |
| 2514 | (JNIEnv *_env, jobject _this, jint program, jstring name) { |
| 2515 | jint _exception = 0; |
| 2516 | const char * _exceptionType = NULL; |
| 2517 | const char * _exceptionMessage = NULL; |
| 2518 | GLint _returnValue = 0; |
| 2519 | const char* _nativename = 0; |
| 2520 | |
| 2521 | if (!name) { |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 2522 | _exception = 1; |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 2523 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2524 | _exceptionMessage = "name == null"; |
| 2525 | goto exit; |
| 2526 | } |
| 2527 | _nativename = _env->GetStringUTFChars(name, 0); |
| 2528 | |
| 2529 | _returnValue = glGetFragDataLocation( |
| 2530 | (GLuint)program, |
| 2531 | (GLchar *)_nativename |
| 2532 | ); |
| 2533 | |
| 2534 | exit: |
| 2535 | if (_nativename) { |
| 2536 | _env->ReleaseStringUTFChars(name, _nativename); |
| 2537 | } |
| 2538 | |
| 2539 | if (_exception) { |
| 2540 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2541 | } |
| 2542 | return (jint)_returnValue; |
| 2543 | } |
| 2544 | |
| 2545 | /* void glUniform1ui ( GLint location, GLuint v0 ) */ |
| 2546 | static void |
| 2547 | android_glUniform1ui__II |
| 2548 | (JNIEnv *_env, jobject _this, jint location, jint v0) { |
| 2549 | glUniform1ui( |
| 2550 | (GLint)location, |
| 2551 | (GLuint)v0 |
| 2552 | ); |
| 2553 | } |
| 2554 | |
| 2555 | /* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */ |
| 2556 | static void |
| 2557 | android_glUniform2ui__III |
| 2558 | (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) { |
| 2559 | glUniform2ui( |
| 2560 | (GLint)location, |
| 2561 | (GLuint)v0, |
| 2562 | (GLuint)v1 |
| 2563 | ); |
| 2564 | } |
| 2565 | |
| 2566 | /* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */ |
| 2567 | static void |
| 2568 | android_glUniform3ui__IIII |
| 2569 | (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) { |
| 2570 | glUniform3ui( |
| 2571 | (GLint)location, |
| 2572 | (GLuint)v0, |
| 2573 | (GLuint)v1, |
| 2574 | (GLuint)v2 |
| 2575 | ); |
| 2576 | } |
| 2577 | |
| 2578 | /* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */ |
| 2579 | static void |
| 2580 | android_glUniform4ui__IIIII |
| 2581 | (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) { |
| 2582 | glUniform4ui( |
| 2583 | (GLint)location, |
| 2584 | (GLuint)v0, |
| 2585 | (GLuint)v1, |
| 2586 | (GLuint)v2, |
| 2587 | (GLuint)v3 |
| 2588 | ); |
| 2589 | } |
| 2590 | |
| 2591 | /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2592 | static void |
| 2593 | android_glUniform1uiv__II_3II |
| 2594 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) { |
| 2595 | jint _exception = 0; |
| 2596 | const char * _exceptionType = NULL; |
| 2597 | const char * _exceptionMessage = NULL; |
| 2598 | GLuint *value_base = (GLuint *) 0; |
| 2599 | jint _remaining; |
| 2600 | GLuint *value = (GLuint *) 0; |
| 2601 | |
| 2602 | if (!value_ref) { |
| 2603 | _exception = 1; |
| 2604 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2605 | _exceptionMessage = "value == null"; |
| 2606 | goto exit; |
| 2607 | } |
| 2608 | if (offset < 0) { |
| 2609 | _exception = 1; |
| 2610 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2611 | _exceptionMessage = "offset < 0"; |
| 2612 | goto exit; |
| 2613 | } |
| 2614 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2615 | value_base = (GLuint *) |
| 2616 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2617 | value = value_base + offset; |
| 2618 | |
| 2619 | glUniform1uiv( |
| 2620 | (GLint)location, |
| 2621 | (GLsizei)count, |
| 2622 | (GLuint *)value |
| 2623 | ); |
| 2624 | |
| 2625 | exit: |
| 2626 | if (value_base) { |
| 2627 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2628 | JNI_ABORT); |
| 2629 | } |
| 2630 | if (_exception) { |
| 2631 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2632 | } |
| 2633 | } |
| 2634 | |
| 2635 | /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2636 | static void |
| 2637 | android_glUniform1uiv__IILjava_nio_IntBuffer_2 |
| 2638 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) { |
| 2639 | jarray _array = (jarray) 0; |
| 2640 | jint _bufferOffset = (jint) 0; |
| 2641 | jint _remaining; |
| 2642 | GLuint *value = (GLuint *) 0; |
| 2643 | |
| 2644 | value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2645 | if (value == NULL) { |
| 2646 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2647 | value = (GLuint *) (_valueBase + _bufferOffset); |
| 2648 | } |
| 2649 | glUniform1uiv( |
| 2650 | (GLint)location, |
| 2651 | (GLsizei)count, |
| 2652 | (GLuint *)value |
| 2653 | ); |
| 2654 | if (_array) { |
| 2655 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2656 | } |
| 2657 | } |
| 2658 | |
| 2659 | /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2660 | static void |
| 2661 | android_glUniform2uiv__II_3II |
| 2662 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) { |
| 2663 | jint _exception = 0; |
| 2664 | const char * _exceptionType = NULL; |
| 2665 | const char * _exceptionMessage = NULL; |
| 2666 | GLuint *value_base = (GLuint *) 0; |
| 2667 | jint _remaining; |
| 2668 | GLuint *value = (GLuint *) 0; |
| 2669 | |
| 2670 | if (!value_ref) { |
| 2671 | _exception = 1; |
| 2672 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2673 | _exceptionMessage = "value == null"; |
| 2674 | goto exit; |
| 2675 | } |
| 2676 | if (offset < 0) { |
| 2677 | _exception = 1; |
| 2678 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2679 | _exceptionMessage = "offset < 0"; |
| 2680 | goto exit; |
| 2681 | } |
| 2682 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2683 | value_base = (GLuint *) |
| 2684 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2685 | value = value_base + offset; |
| 2686 | |
| 2687 | glUniform2uiv( |
| 2688 | (GLint)location, |
| 2689 | (GLsizei)count, |
| 2690 | (GLuint *)value |
| 2691 | ); |
| 2692 | |
| 2693 | exit: |
| 2694 | if (value_base) { |
| 2695 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2696 | JNI_ABORT); |
| 2697 | } |
| 2698 | if (_exception) { |
| 2699 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2700 | } |
| 2701 | } |
| 2702 | |
| 2703 | /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2704 | static void |
| 2705 | android_glUniform2uiv__IILjava_nio_IntBuffer_2 |
| 2706 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) { |
| 2707 | jarray _array = (jarray) 0; |
| 2708 | jint _bufferOffset = (jint) 0; |
| 2709 | jint _remaining; |
| 2710 | GLuint *value = (GLuint *) 0; |
| 2711 | |
| 2712 | value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2713 | if (value == NULL) { |
| 2714 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2715 | value = (GLuint *) (_valueBase + _bufferOffset); |
| 2716 | } |
| 2717 | glUniform2uiv( |
| 2718 | (GLint)location, |
| 2719 | (GLsizei)count, |
| 2720 | (GLuint *)value |
| 2721 | ); |
| 2722 | if (_array) { |
| 2723 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2724 | } |
| 2725 | } |
| 2726 | |
| 2727 | /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2728 | static void |
| 2729 | android_glUniform3uiv__II_3II |
| 2730 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) { |
| 2731 | jint _exception = 0; |
| 2732 | const char * _exceptionType = NULL; |
| 2733 | const char * _exceptionMessage = NULL; |
| 2734 | GLuint *value_base = (GLuint *) 0; |
| 2735 | jint _remaining; |
| 2736 | GLuint *value = (GLuint *) 0; |
| 2737 | |
| 2738 | if (!value_ref) { |
| 2739 | _exception = 1; |
| 2740 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2741 | _exceptionMessage = "value == null"; |
| 2742 | goto exit; |
| 2743 | } |
| 2744 | if (offset < 0) { |
| 2745 | _exception = 1; |
| 2746 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2747 | _exceptionMessage = "offset < 0"; |
| 2748 | goto exit; |
| 2749 | } |
| 2750 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2751 | value_base = (GLuint *) |
| 2752 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2753 | value = value_base + offset; |
| 2754 | |
| 2755 | glUniform3uiv( |
| 2756 | (GLint)location, |
| 2757 | (GLsizei)count, |
| 2758 | (GLuint *)value |
| 2759 | ); |
| 2760 | |
| 2761 | exit: |
| 2762 | if (value_base) { |
| 2763 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2764 | JNI_ABORT); |
| 2765 | } |
| 2766 | if (_exception) { |
| 2767 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2768 | } |
| 2769 | } |
| 2770 | |
| 2771 | /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2772 | static void |
| 2773 | android_glUniform3uiv__IILjava_nio_IntBuffer_2 |
| 2774 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) { |
| 2775 | jarray _array = (jarray) 0; |
| 2776 | jint _bufferOffset = (jint) 0; |
| 2777 | jint _remaining; |
| 2778 | GLuint *value = (GLuint *) 0; |
| 2779 | |
| 2780 | value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2781 | if (value == NULL) { |
| 2782 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2783 | value = (GLuint *) (_valueBase + _bufferOffset); |
| 2784 | } |
| 2785 | glUniform3uiv( |
| 2786 | (GLint)location, |
| 2787 | (GLsizei)count, |
| 2788 | (GLuint *)value |
| 2789 | ); |
| 2790 | if (_array) { |
| 2791 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2792 | } |
| 2793 | } |
| 2794 | |
| 2795 | /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2796 | static void |
| 2797 | android_glUniform4uiv__II_3II |
| 2798 | (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) { |
| 2799 | jint _exception = 0; |
| 2800 | const char * _exceptionType = NULL; |
| 2801 | const char * _exceptionMessage = NULL; |
| 2802 | GLuint *value_base = (GLuint *) 0; |
| 2803 | jint _remaining; |
| 2804 | GLuint *value = (GLuint *) 0; |
| 2805 | |
| 2806 | if (!value_ref) { |
| 2807 | _exception = 1; |
| 2808 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2809 | _exceptionMessage = "value == null"; |
| 2810 | goto exit; |
| 2811 | } |
| 2812 | if (offset < 0) { |
| 2813 | _exception = 1; |
| 2814 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2815 | _exceptionMessage = "offset < 0"; |
| 2816 | goto exit; |
| 2817 | } |
| 2818 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2819 | value_base = (GLuint *) |
| 2820 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2821 | value = value_base + offset; |
| 2822 | |
| 2823 | glUniform4uiv( |
| 2824 | (GLint)location, |
| 2825 | (GLsizei)count, |
| 2826 | (GLuint *)value |
| 2827 | ); |
| 2828 | |
| 2829 | exit: |
| 2830 | if (value_base) { |
| 2831 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2832 | JNI_ABORT); |
| 2833 | } |
| 2834 | if (_exception) { |
| 2835 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2836 | } |
| 2837 | } |
| 2838 | |
| 2839 | /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */ |
| 2840 | static void |
| 2841 | android_glUniform4uiv__IILjava_nio_IntBuffer_2 |
| 2842 | (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) { |
| 2843 | jarray _array = (jarray) 0; |
| 2844 | jint _bufferOffset = (jint) 0; |
| 2845 | jint _remaining; |
| 2846 | GLuint *value = (GLuint *) 0; |
| 2847 | |
| 2848 | value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2849 | if (value == NULL) { |
| 2850 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2851 | value = (GLuint *) (_valueBase + _bufferOffset); |
| 2852 | } |
| 2853 | glUniform4uiv( |
| 2854 | (GLint)location, |
| 2855 | (GLsizei)count, |
| 2856 | (GLuint *)value |
| 2857 | ); |
| 2858 | if (_array) { |
| 2859 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2860 | } |
| 2861 | } |
| 2862 | |
| 2863 | /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */ |
| 2864 | static void |
| 2865 | android_glClearBufferiv__II_3II |
| 2866 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) { |
| 2867 | jint _exception = 0; |
| 2868 | const char * _exceptionType = NULL; |
| 2869 | const char * _exceptionMessage = NULL; |
| 2870 | GLint *value_base = (GLint *) 0; |
| 2871 | jint _remaining; |
| 2872 | GLint *value = (GLint *) 0; |
| 2873 | |
| 2874 | if (!value_ref) { |
| 2875 | _exception = 1; |
| 2876 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2877 | _exceptionMessage = "value == null"; |
| 2878 | goto exit; |
| 2879 | } |
| 2880 | if (offset < 0) { |
| 2881 | _exception = 1; |
| 2882 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2883 | _exceptionMessage = "offset < 0"; |
| 2884 | goto exit; |
| 2885 | } |
| 2886 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2887 | value_base = (GLint *) |
| 2888 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2889 | value = value_base + offset; |
| 2890 | |
| 2891 | glClearBufferiv( |
| 2892 | (GLenum)buffer, |
| 2893 | (GLint)drawbuffer, |
| 2894 | (GLint *)value |
| 2895 | ); |
| 2896 | |
| 2897 | exit: |
| 2898 | if (value_base) { |
| 2899 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2900 | JNI_ABORT); |
| 2901 | } |
| 2902 | if (_exception) { |
| 2903 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2904 | } |
| 2905 | } |
| 2906 | |
| 2907 | /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */ |
| 2908 | static void |
| 2909 | android_glClearBufferiv__IILjava_nio_IntBuffer_2 |
| 2910 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) { |
| 2911 | jarray _array = (jarray) 0; |
| 2912 | jint _bufferOffset = (jint) 0; |
| 2913 | jint _remaining; |
| 2914 | GLint *value = (GLint *) 0; |
| 2915 | |
| 2916 | value = (GLint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2917 | if (value == NULL) { |
| 2918 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2919 | value = (GLint *) (_valueBase + _bufferOffset); |
| 2920 | } |
| 2921 | glClearBufferiv( |
| 2922 | (GLenum)buffer, |
| 2923 | (GLint)drawbuffer, |
| 2924 | (GLint *)value |
| 2925 | ); |
| 2926 | if (_array) { |
| 2927 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2928 | } |
| 2929 | } |
| 2930 | |
| 2931 | /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */ |
| 2932 | static void |
| 2933 | android_glClearBufferuiv__II_3II |
| 2934 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) { |
| 2935 | jint _exception = 0; |
| 2936 | const char * _exceptionType = NULL; |
| 2937 | const char * _exceptionMessage = NULL; |
| 2938 | GLuint *value_base = (GLuint *) 0; |
| 2939 | jint _remaining; |
| 2940 | GLuint *value = (GLuint *) 0; |
| 2941 | |
| 2942 | if (!value_ref) { |
| 2943 | _exception = 1; |
| 2944 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2945 | _exceptionMessage = "value == null"; |
| 2946 | goto exit; |
| 2947 | } |
| 2948 | if (offset < 0) { |
| 2949 | _exception = 1; |
| 2950 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2951 | _exceptionMessage = "offset < 0"; |
| 2952 | goto exit; |
| 2953 | } |
| 2954 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 2955 | value_base = (GLuint *) |
| 2956 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 2957 | value = value_base + offset; |
| 2958 | |
| 2959 | glClearBufferuiv( |
| 2960 | (GLenum)buffer, |
| 2961 | (GLint)drawbuffer, |
| 2962 | (GLuint *)value |
| 2963 | ); |
| 2964 | |
| 2965 | exit: |
| 2966 | if (value_base) { |
| 2967 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 2968 | JNI_ABORT); |
| 2969 | } |
| 2970 | if (_exception) { |
| 2971 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2972 | } |
| 2973 | } |
| 2974 | |
| 2975 | /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */ |
| 2976 | static void |
| 2977 | android_glClearBufferuiv__IILjava_nio_IntBuffer_2 |
| 2978 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) { |
| 2979 | jarray _array = (jarray) 0; |
| 2980 | jint _bufferOffset = (jint) 0; |
| 2981 | jint _remaining; |
| 2982 | GLuint *value = (GLuint *) 0; |
| 2983 | |
| 2984 | value = (GLuint *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 2985 | if (value == NULL) { |
| 2986 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 2987 | value = (GLuint *) (_valueBase + _bufferOffset); |
| 2988 | } |
| 2989 | glClearBufferuiv( |
| 2990 | (GLenum)buffer, |
| 2991 | (GLint)drawbuffer, |
| 2992 | (GLuint *)value |
| 2993 | ); |
| 2994 | if (_array) { |
| 2995 | releasePointer(_env, _array, value, JNI_FALSE); |
| 2996 | } |
| 2997 | } |
| 2998 | |
| 2999 | /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */ |
| 3000 | static void |
| 3001 | android_glClearBufferfv__II_3FI |
| 3002 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) { |
| 3003 | jint _exception = 0; |
| 3004 | const char * _exceptionType = NULL; |
| 3005 | const char * _exceptionMessage = NULL; |
| 3006 | GLfloat *value_base = (GLfloat *) 0; |
| 3007 | jint _remaining; |
| 3008 | GLfloat *value = (GLfloat *) 0; |
| 3009 | |
| 3010 | if (!value_ref) { |
| 3011 | _exception = 1; |
| 3012 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3013 | _exceptionMessage = "value == null"; |
| 3014 | goto exit; |
| 3015 | } |
| 3016 | if (offset < 0) { |
| 3017 | _exception = 1; |
| 3018 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3019 | _exceptionMessage = "offset < 0"; |
| 3020 | goto exit; |
| 3021 | } |
| 3022 | _remaining = _env->GetArrayLength(value_ref) - offset; |
| 3023 | value_base = (GLfloat *) |
| 3024 | _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0); |
| 3025 | value = value_base + offset; |
| 3026 | |
| 3027 | glClearBufferfv( |
| 3028 | (GLenum)buffer, |
| 3029 | (GLint)drawbuffer, |
| 3030 | (GLfloat *)value |
| 3031 | ); |
| 3032 | |
| 3033 | exit: |
| 3034 | if (value_base) { |
| 3035 | _env->ReleasePrimitiveArrayCritical(value_ref, value_base, |
| 3036 | JNI_ABORT); |
| 3037 | } |
| 3038 | if (_exception) { |
| 3039 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3040 | } |
| 3041 | } |
| 3042 | |
| 3043 | /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */ |
| 3044 | static void |
| 3045 | android_glClearBufferfv__IILjava_nio_FloatBuffer_2 |
| 3046 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) { |
| 3047 | jarray _array = (jarray) 0; |
| 3048 | jint _bufferOffset = (jint) 0; |
| 3049 | jint _remaining; |
| 3050 | GLfloat *value = (GLfloat *) 0; |
| 3051 | |
| 3052 | value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining, &_bufferOffset); |
| 3053 | if (value == NULL) { |
| 3054 | char * _valueBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3055 | value = (GLfloat *) (_valueBase + _bufferOffset); |
| 3056 | } |
| 3057 | glClearBufferfv( |
| 3058 | (GLenum)buffer, |
| 3059 | (GLint)drawbuffer, |
| 3060 | (GLfloat *)value |
| 3061 | ); |
| 3062 | if (_array) { |
| 3063 | releasePointer(_env, _array, value, JNI_FALSE); |
| 3064 | } |
| 3065 | } |
| 3066 | |
| 3067 | /* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */ |
| 3068 | static void |
| 3069 | android_glClearBufferfi__IIFI |
| 3070 | (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) { |
| 3071 | glClearBufferfi( |
| 3072 | (GLenum)buffer, |
| 3073 | (GLint)drawbuffer, |
| 3074 | (GLfloat)depth, |
| 3075 | (GLint)stencil |
| 3076 | ); |
| 3077 | } |
| 3078 | |
| 3079 | /* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */ |
| 3080 | static jstring |
| 3081 | android_glGetStringi__II |
| 3082 | (JNIEnv *_env, jobject _this, jint name, jint index) { |
| 3083 | const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index); |
| 3084 | return _env->NewStringUTF((const char*)_chars); |
| 3085 | } |
| 3086 | |
| 3087 | /* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */ |
| 3088 | static void |
| 3089 | android_glCopyBufferSubData__IIIII |
| 3090 | (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) { |
| 3091 | glCopyBufferSubData( |
| 3092 | (GLenum)readTarget, |
| 3093 | (GLenum)writeTarget, |
| 3094 | (GLintptr)readOffset, |
| 3095 | (GLintptr)writeOffset, |
| 3096 | (GLsizeiptr)size |
| 3097 | ); |
| 3098 | } |
| 3099 | |
| 3100 | /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */ |
| 3101 | static |
| 3102 | void |
| 3103 | android_glGetUniformIndices_array |
| 3104 | (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) { |
| 3105 | jint _exception = 0; |
| 3106 | const char* _exceptionType = NULL; |
| 3107 | const char* _exceptionMessage = NULL; |
| 3108 | jint _count = 0; |
| 3109 | jint _i; |
| 3110 | const char** _names = NULL; |
| 3111 | GLuint* _indices_base = NULL; |
| 3112 | GLuint* _indices = NULL; |
| 3113 | |
| 3114 | if (!uniformNames_ref) { |
| 3115 | _exception = 1; |
| 3116 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3117 | _exceptionMessage = "uniformNames == null"; |
| 3118 | goto exit; |
| 3119 | } |
| 3120 | _count = _env->GetArrayLength(uniformNames_ref); |
| 3121 | _names = (const char**)calloc(_count, sizeof(const char*)); |
| 3122 | for (_i = 0; _i < _count; _i++) { |
| 3123 | jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); |
| 3124 | if (!_name) { |
| 3125 | _exception = 1; |
| 3126 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3127 | _exceptionMessage = "null uniformNames element"; |
| 3128 | goto exit; |
| 3129 | } |
| 3130 | _names[_i] = _env->GetStringUTFChars(_name, 0); |
| 3131 | } |
| 3132 | |
| 3133 | if (!uniformIndices_ref) { |
| 3134 | _exception = 1; |
| 3135 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3136 | _exceptionMessage = "uniformIndices == null"; |
| 3137 | goto exit; |
| 3138 | } |
| 3139 | if (uniformIndicesOffset < 0) { |
| 3140 | _exception = 1; |
| 3141 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3142 | _exceptionMessage = "uniformIndicesOffset < 0"; |
| 3143 | goto exit; |
| 3144 | } |
| 3145 | if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) { |
| 3146 | _exception = 1; |
| 3147 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3148 | _exceptionMessage = "not enough space in uniformIndices"; |
| 3149 | goto exit; |
| 3150 | } |
| 3151 | _indices_base = (GLuint*)_env->GetPrimitiveArrayCritical( |
| 3152 | uniformIndices_ref, 0); |
| 3153 | _indices = _indices_base + uniformIndicesOffset; |
| 3154 | |
| 3155 | glGetUniformIndices(program, _count, _names, _indices); |
| 3156 | |
| 3157 | exit: |
| 3158 | if (_indices_base) { |
| 3159 | _env->ReleasePrimitiveArrayCritical(uniformIndices_ref, _indices_base, |
| 3160 | _exception ? JNI_ABORT : 0); |
| 3161 | } |
| 3162 | for (_i = _count - 1; _i >= 0; _i--) { |
| 3163 | if (_names[_i]) { |
| 3164 | jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); |
| 3165 | if (_name) { |
| 3166 | _env->ReleaseStringUTFChars(_name, _names[_i]); |
| 3167 | } |
| 3168 | } |
| 3169 | } |
| 3170 | free(_names); |
| 3171 | if (_exception) { |
| 3172 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3173 | } |
| 3174 | } |
| 3175 | |
| 3176 | /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */ |
| 3177 | static |
| 3178 | void |
| 3179 | android_glGetUniformIndices_buffer |
| 3180 | (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) { |
| 3181 | jint _exception = 0; |
| 3182 | const char* _exceptionType = NULL; |
| 3183 | const char* _exceptionMessage = NULL; |
| 3184 | jint _count = 0; |
| 3185 | jint _i; |
| 3186 | const char** _names = NULL; |
| 3187 | jarray _uniformIndicesArray = (jarray)0; |
| 3188 | jint _uniformIndicesRemaining; |
| 3189 | jint _uniformIndicesOffset = 0; |
| 3190 | GLuint* _indices = NULL; |
| 3191 | char* _indicesBase = NULL; |
| 3192 | |
| 3193 | if (!uniformNames_ref) { |
| 3194 | _exception = 1; |
| 3195 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3196 | _exceptionMessage = "uniformNames == null"; |
| 3197 | goto exit; |
| 3198 | } |
| 3199 | if (!uniformIndices_buf) { |
| 3200 | _exception = 1; |
| 3201 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3202 | _exceptionMessage = "uniformIndices == null"; |
| 3203 | goto exit; |
| 3204 | } |
| 3205 | |
| 3206 | _count = _env->GetArrayLength(uniformNames_ref); |
| 3207 | _names = (const char**)calloc(_count, sizeof(const char*)); |
| 3208 | for (_i = 0; _i < _count; _i++) { |
| 3209 | jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); |
| 3210 | if (!_name) { |
| 3211 | _exception = 1; |
| 3212 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3213 | _exceptionMessage = "null uniformNames element"; |
| 3214 | goto exit; |
| 3215 | } |
| 3216 | _names[_i] = _env->GetStringUTFChars(_name, 0); |
| 3217 | } |
| 3218 | |
| 3219 | _indices = (GLuint*)getPointer(_env, uniformIndices_buf, |
| 3220 | &_uniformIndicesArray, &_uniformIndicesRemaining, |
| 3221 | &_uniformIndicesOffset); |
| 3222 | if (!_indices) { |
| 3223 | _indicesBase = (char*)_env->GetPrimitiveArrayCritical( |
| 3224 | _uniformIndicesArray, 0); |
| 3225 | _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset); |
| 3226 | } |
| 3227 | if (_uniformIndicesRemaining < _count) { |
| 3228 | _exception = 1; |
| 3229 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3230 | _exceptionMessage = "not enough space in uniformIndices"; |
| 3231 | goto exit; |
| 3232 | } |
| 3233 | |
| 3234 | glGetUniformIndices(program, _count, _names, _indices); |
| 3235 | |
| 3236 | exit: |
| 3237 | if (_uniformIndicesArray) { |
| 3238 | releasePointer(_env, _uniformIndicesArray, _indicesBase, JNI_TRUE); |
| 3239 | } |
| 3240 | for (_i = _count - 1; _i >= 0; _i--) { |
| 3241 | if (_names[_i]) { |
| 3242 | jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); |
| 3243 | if (_name) { |
| 3244 | _env->ReleaseStringUTFChars(_name, _names[_i]); |
| 3245 | } |
| 3246 | } |
| 3247 | } |
| 3248 | free(_names); |
| 3249 | if (_exception) { |
| 3250 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3251 | } |
| 3252 | } |
| 3253 | |
| 3254 | /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */ |
| 3255 | static void |
| 3256 | android_glGetActiveUniformsiv__II_3III_3II |
| 3257 | (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) { |
| 3258 | jint _exception = 0; |
| 3259 | const char * _exceptionType = NULL; |
| 3260 | const char * _exceptionMessage = NULL; |
| 3261 | GLuint *uniformIndices_base = (GLuint *) 0; |
| 3262 | jint _uniformIndicesRemaining; |
| 3263 | GLuint *uniformIndices = (GLuint *) 0; |
| 3264 | GLint *params_base = (GLint *) 0; |
| 3265 | jint _paramsRemaining; |
| 3266 | GLint *params = (GLint *) 0; |
| 3267 | |
| 3268 | if (!uniformIndices_ref) { |
| 3269 | _exception = 1; |
| 3270 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3271 | _exceptionMessage = "uniformIndices == null"; |
| 3272 | goto exit; |
| 3273 | } |
| 3274 | if (uniformIndicesOffset < 0) { |
| 3275 | _exception = 1; |
| 3276 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3277 | _exceptionMessage = "uniformIndicesOffset < 0"; |
| 3278 | goto exit; |
| 3279 | } |
| 3280 | _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset; |
| 3281 | uniformIndices_base = (GLuint *) |
| 3282 | _env->GetPrimitiveArrayCritical(uniformIndices_ref, (jboolean *)0); |
| 3283 | uniformIndices = uniformIndices_base + uniformIndicesOffset; |
| 3284 | |
| 3285 | if (!params_ref) { |
| 3286 | _exception = 1; |
| 3287 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3288 | _exceptionMessage = "params == null"; |
| 3289 | goto exit; |
| 3290 | } |
| 3291 | if (paramsOffset < 0) { |
| 3292 | _exception = 1; |
| 3293 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3294 | _exceptionMessage = "paramsOffset < 0"; |
| 3295 | goto exit; |
| 3296 | } |
| 3297 | _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset; |
| 3298 | params_base = (GLint *) |
| 3299 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3300 | params = params_base + paramsOffset; |
| 3301 | |
| 3302 | glGetActiveUniformsiv( |
| 3303 | (GLuint)program, |
| 3304 | (GLsizei)uniformCount, |
| 3305 | (GLuint *)uniformIndices, |
| 3306 | (GLenum)pname, |
| 3307 | (GLint *)params |
| 3308 | ); |
| 3309 | |
| 3310 | exit: |
| 3311 | if (params_base) { |
| 3312 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3313 | _exception ? JNI_ABORT: 0); |
| 3314 | } |
| 3315 | if (uniformIndices_base) { |
| 3316 | _env->ReleasePrimitiveArrayCritical(uniformIndices_ref, uniformIndices_base, |
| 3317 | JNI_ABORT); |
| 3318 | } |
| 3319 | if (_exception) { |
| 3320 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3321 | } |
| 3322 | } |
| 3323 | |
| 3324 | /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */ |
| 3325 | static void |
| 3326 | android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 |
| 3327 | (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) { |
| 3328 | jarray _uniformIndicesArray = (jarray) 0; |
| 3329 | jint _uniformIndicesBufferOffset = (jint) 0; |
| 3330 | jarray _paramsArray = (jarray) 0; |
| 3331 | jint _paramsBufferOffset = (jint) 0; |
| 3332 | jint _uniformIndicesRemaining; |
| 3333 | GLuint *uniformIndices = (GLuint *) 0; |
| 3334 | jint _paramsRemaining; |
| 3335 | GLint *params = (GLint *) 0; |
| 3336 | |
| 3337 | uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, &_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset); |
| 3338 | params = (GLint *)getPointer(_env, params_buf, &_paramsArray, &_paramsRemaining, &_paramsBufferOffset); |
| 3339 | if (uniformIndices == NULL) { |
| 3340 | char * _uniformIndicesBase = (char *)_env->GetPrimitiveArrayCritical(_uniformIndicesArray, (jboolean *) 0); |
| 3341 | uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset); |
| 3342 | } |
| 3343 | if (params == NULL) { |
| 3344 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_paramsArray, (jboolean *) 0); |
| 3345 | params = (GLint *) (_paramsBase + _paramsBufferOffset); |
| 3346 | } |
| 3347 | glGetActiveUniformsiv( |
| 3348 | (GLuint)program, |
| 3349 | (GLsizei)uniformCount, |
| 3350 | (GLuint *)uniformIndices, |
| 3351 | (GLenum)pname, |
| 3352 | (GLint *)params |
| 3353 | ); |
| 3354 | if (_paramsArray) { |
| 3355 | releasePointer(_env, _paramsArray, params, JNI_TRUE); |
| 3356 | } |
| 3357 | if (_uniformIndicesArray) { |
| 3358 | releasePointer(_env, _uniformIndicesArray, uniformIndices, JNI_FALSE); |
| 3359 | } |
| 3360 | } |
| 3361 | |
| 3362 | /* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */ |
| 3363 | static jint |
| 3364 | android_glGetUniformBlockIndex__ILjava_lang_String_2 |
| 3365 | (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) { |
| 3366 | jint _exception = 0; |
| 3367 | const char * _exceptionType = NULL; |
| 3368 | const char * _exceptionMessage = NULL; |
| 3369 | GLuint _returnValue = 0; |
| 3370 | const char* _nativeuniformBlockName = 0; |
| 3371 | |
| 3372 | if (!uniformBlockName) { |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 3373 | _exception = 1; |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 3374 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3375 | _exceptionMessage = "uniformBlockName == null"; |
| 3376 | goto exit; |
| 3377 | } |
| 3378 | _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0); |
| 3379 | |
| 3380 | _returnValue = glGetUniformBlockIndex( |
| 3381 | (GLuint)program, |
| 3382 | (GLchar *)_nativeuniformBlockName |
| 3383 | ); |
| 3384 | |
| 3385 | exit: |
| 3386 | if (_nativeuniformBlockName) { |
| 3387 | _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName); |
| 3388 | } |
| 3389 | |
| 3390 | if (_exception) { |
| 3391 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3392 | } |
| 3393 | return (jint)_returnValue; |
| 3394 | } |
| 3395 | |
| 3396 | /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */ |
| 3397 | static void |
| 3398 | android_glGetActiveUniformBlockiv__III_3II |
| 3399 | (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) { |
| 3400 | jint _exception = 0; |
| 3401 | const char * _exceptionType = NULL; |
| 3402 | const char * _exceptionMessage = NULL; |
| 3403 | GLint *params_base = (GLint *) 0; |
| 3404 | jint _remaining; |
| 3405 | GLint *params = (GLint *) 0; |
| 3406 | |
| 3407 | if (!params_ref) { |
| 3408 | _exception = 1; |
| 3409 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3410 | _exceptionMessage = "params == null"; |
| 3411 | goto exit; |
| 3412 | } |
| 3413 | if (offset < 0) { |
| 3414 | _exception = 1; |
| 3415 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3416 | _exceptionMessage = "offset < 0"; |
| 3417 | goto exit; |
| 3418 | } |
| 3419 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3420 | params_base = (GLint *) |
| 3421 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3422 | params = params_base + offset; |
| 3423 | |
| 3424 | glGetActiveUniformBlockiv( |
| 3425 | (GLuint)program, |
| 3426 | (GLuint)uniformBlockIndex, |
| 3427 | (GLenum)pname, |
| 3428 | (GLint *)params |
| 3429 | ); |
| 3430 | |
| 3431 | exit: |
| 3432 | if (params_base) { |
| 3433 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3434 | _exception ? JNI_ABORT: 0); |
| 3435 | } |
| 3436 | if (_exception) { |
| 3437 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3438 | } |
| 3439 | } |
| 3440 | |
| 3441 | /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */ |
| 3442 | static void |
| 3443 | android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 |
| 3444 | (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) { |
| 3445 | jarray _array = (jarray) 0; |
| 3446 | jint _bufferOffset = (jint) 0; |
| 3447 | jint _remaining; |
| 3448 | GLint *params = (GLint *) 0; |
| 3449 | |
| 3450 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 3451 | if (params == NULL) { |
| 3452 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3453 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 3454 | } |
| 3455 | glGetActiveUniformBlockiv( |
| 3456 | (GLuint)program, |
| 3457 | (GLuint)uniformBlockIndex, |
| 3458 | (GLenum)pname, |
| 3459 | (GLint *)params |
| 3460 | ); |
| 3461 | if (_array) { |
| 3462 | releasePointer(_env, _array, params, JNI_TRUE); |
| 3463 | } |
| 3464 | } |
| 3465 | |
| 3466 | /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ |
| 3467 | static void |
| 3468 | android_glGetActiveUniformBlockName_III_3II_3BI |
| 3469 | (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) { |
| 3470 | jint _exception = 0; |
| 3471 | const char* _exceptionType; |
| 3472 | const char* _exceptionMessage; |
| 3473 | GLsizei* _length_base = (GLsizei*)0; |
| 3474 | jint _lengthRemaining; |
| 3475 | GLsizei* _length = (GLsizei*)0; |
| 3476 | GLchar* _name_base = (GLchar*)0; |
| 3477 | jint _nameRemaining; |
| 3478 | GLchar* _name = (GLchar*)0; |
| 3479 | |
| 3480 | if (!length_ref) { |
| 3481 | _exception = 1; |
| 3482 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3483 | _exceptionMessage = "length == null"; |
| 3484 | goto exit; |
| 3485 | } |
| 3486 | if (lengthOffset < 0) { |
| 3487 | _exception = 1; |
| 3488 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3489 | _exceptionMessage = "lengthOffset < 0"; |
| 3490 | goto exit; |
| 3491 | } |
| 3492 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 3493 | _length_base = (GLsizei*)_env->GetPrimitiveArrayCritical( |
| 3494 | length_ref, (jboolean*)0); |
| 3495 | _length = _length_base + lengthOffset; |
| 3496 | |
| 3497 | if (!name_ref) { |
| 3498 | _exception = 1; |
| 3499 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3500 | _exceptionMessage = "uniformBlockName == null"; |
| 3501 | goto exit; |
| 3502 | } |
| 3503 | if (nameOffset < 0) { |
| 3504 | _exception = 1; |
| 3505 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3506 | _exceptionMessage = "uniformBlockNameOffset < 0"; |
| 3507 | goto exit; |
| 3508 | } |
| 3509 | _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; |
| 3510 | _name_base = (GLchar*)_env->GetPrimitiveArrayCritical( |
| 3511 | name_ref, (jboolean*)0); |
| 3512 | _name = _name_base + nameOffset; |
| 3513 | |
| 3514 | glGetActiveUniformBlockName( |
| 3515 | (GLuint)program, |
| 3516 | (GLuint)uniformBlockIndex, |
| 3517 | (GLsizei)bufSize, |
| 3518 | (GLsizei*)_length, |
| 3519 | (GLchar*)_name |
| 3520 | ); |
| 3521 | |
| 3522 | exit: |
| 3523 | if (_name_base) { |
| 3524 | _env->ReleasePrimitiveArrayCritical(name_ref, _name_base, |
| 3525 | _exception ? JNI_ABORT: 0); |
| 3526 | } |
| 3527 | if (_length_base) { |
| 3528 | _env->ReleasePrimitiveArrayCritical(length_ref, _length_base, |
| 3529 | _exception ? JNI_ABORT: 0); |
| 3530 | } |
| 3531 | if (_exception) { |
| 3532 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3533 | } |
| 3534 | } |
| 3535 | |
| 3536 | /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ |
| 3537 | static void |
| 3538 | android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 |
| 3539 | (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) { |
| 3540 | jint _exception = 0; |
| 3541 | const char* _exceptionType; |
| 3542 | const char* _exceptionMessage; |
| 3543 | jarray _lengthArray = (jarray)0; |
| 3544 | jint _lengthBufferOffset = (jint)0; |
| 3545 | GLsizei* _length = (GLsizei*)0; |
| 3546 | jint _lengthRemaining; |
| 3547 | jarray _nameArray = (jarray)0; |
| 3548 | jint _nameBufferOffset = (jint)0; |
| 3549 | GLchar* _name = (GLchar*)0; |
| 3550 | jint _nameRemaining; |
| 3551 | |
| 3552 | _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); |
| 3553 | if (_length == NULL) { |
| 3554 | GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0); |
| 3555 | _length = (GLsizei*)(_lengthBase + _lengthBufferOffset); |
| 3556 | } |
| 3557 | |
| 3558 | _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset); |
| 3559 | if (_name == NULL) { |
| 3560 | GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0); |
| 3561 | _name = (GLchar*)(_nameBase + _nameBufferOffset); |
| 3562 | } |
| 3563 | |
| 3564 | glGetActiveUniformBlockName( |
| 3565 | (GLuint)program, |
| 3566 | (GLuint)uniformBlockIndex, |
| 3567 | (GLsizei)_nameRemaining, |
| 3568 | _length, _name |
| 3569 | ); |
| 3570 | if (_nameArray) { |
| 3571 | releasePointer(_env, _nameArray, _name, JNI_TRUE); |
| 3572 | } |
| 3573 | if (_lengthArray) { |
| 3574 | releasePointer(_env, _lengthArray, _length, JNI_TRUE); |
| 3575 | } |
| 3576 | } |
| 3577 | |
| 3578 | /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ |
| 3579 | static jstring |
| 3580 | android_glGetActiveUniformBlockName_II |
| 3581 | (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) { |
| 3582 | GLint len = 0; |
| 3583 | glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex, |
| 3584 | GL_UNIFORM_BLOCK_NAME_LENGTH, &len); |
| 3585 | GLchar* name = (GLchar*)malloc(len); |
| 3586 | glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex, |
| 3587 | len, NULL, name); |
| 3588 | jstring result = _env->NewStringUTF(name); |
| 3589 | free(name); |
| 3590 | return result; |
| 3591 | } |
| 3592 | |
| 3593 | /* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */ |
| 3594 | static void |
| 3595 | android_glUniformBlockBinding__III |
| 3596 | (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) { |
| 3597 | glUniformBlockBinding( |
| 3598 | (GLuint)program, |
| 3599 | (GLuint)uniformBlockIndex, |
| 3600 | (GLuint)uniformBlockBinding |
| 3601 | ); |
| 3602 | } |
| 3603 | |
| 3604 | /* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */ |
| 3605 | static void |
| 3606 | android_glDrawArraysInstanced__IIII |
| 3607 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) { |
| 3608 | glDrawArraysInstanced( |
| 3609 | (GLenum)mode, |
| 3610 | (GLint)first, |
| 3611 | (GLsizei)count, |
| 3612 | (GLsizei)instanceCount |
| 3613 | ); |
| 3614 | } |
| 3615 | |
| 3616 | /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */ |
| 3617 | static void |
| 3618 | android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I |
| 3619 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) { |
| 3620 | jarray _array = (jarray) 0; |
| 3621 | jint _bufferOffset = (jint) 0; |
| 3622 | jint _remaining; |
| 3623 | GLvoid *indices = (GLvoid *) 0; |
| 3624 | |
| 3625 | indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset); |
| 3626 | if (indices == NULL) { |
| 3627 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3628 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 3629 | } |
| 3630 | glDrawElementsInstanced( |
| 3631 | (GLenum)mode, |
| 3632 | (GLsizei)count, |
| 3633 | (GLenum)type, |
| 3634 | (GLvoid *)indices, |
| 3635 | (GLsizei)instanceCount |
| 3636 | ); |
| 3637 | if (_array) { |
| 3638 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 3639 | } |
| 3640 | } |
| 3641 | |
| 3642 | /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */ |
| 3643 | static void |
| 3644 | android_glDrawElementsInstanced__IIIII |
| 3645 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) { |
| 3646 | glDrawElementsInstanced( |
| 3647 | (GLenum)mode, |
| 3648 | (GLsizei)count, |
| 3649 | (GLenum)type, |
Dan Albert | 10caf03 | 2015-02-23 10:41:10 -0800 | [diff] [blame^] | 3650 | (GLvoid *)static_cast<uintptr_t>(indicesOffset), |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 3651 | (GLsizei)instanceCount |
| 3652 | ); |
| 3653 | } |
| 3654 | |
| 3655 | /* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */ |
| 3656 | static jlong |
| 3657 | android_glFenceSync__II |
| 3658 | (JNIEnv *_env, jobject _this, jint condition, jint flags) { |
| 3659 | GLsync _returnValue; |
| 3660 | _returnValue = glFenceSync( |
| 3661 | (GLenum)condition, |
| 3662 | (GLbitfield)flags |
| 3663 | ); |
| 3664 | return (jlong)_returnValue; |
| 3665 | } |
| 3666 | |
| 3667 | /* GLboolean glIsSync ( GLsync sync ) */ |
| 3668 | static jboolean |
| 3669 | android_glIsSync__J |
| 3670 | (JNIEnv *_env, jobject _this, jlong sync) { |
| 3671 | GLboolean _returnValue; |
| 3672 | _returnValue = glIsSync( |
| 3673 | (GLsync)sync |
| 3674 | ); |
| 3675 | return (jboolean)_returnValue; |
| 3676 | } |
| 3677 | |
| 3678 | /* void glDeleteSync ( GLsync sync ) */ |
| 3679 | static void |
| 3680 | android_glDeleteSync__J |
| 3681 | (JNIEnv *_env, jobject _this, jlong sync) { |
| 3682 | glDeleteSync( |
| 3683 | (GLsync)sync |
| 3684 | ); |
| 3685 | } |
| 3686 | |
| 3687 | /* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */ |
| 3688 | static jint |
| 3689 | android_glClientWaitSync__JIJ |
| 3690 | (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) { |
| 3691 | GLenum _returnValue; |
| 3692 | _returnValue = glClientWaitSync( |
| 3693 | (GLsync)sync, |
| 3694 | (GLbitfield)flags, |
| 3695 | (GLuint64)timeout |
| 3696 | ); |
| 3697 | return (jint)_returnValue; |
| 3698 | } |
| 3699 | |
| 3700 | /* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */ |
| 3701 | static void |
| 3702 | android_glWaitSync__JIJ |
| 3703 | (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) { |
| 3704 | glWaitSync( |
| 3705 | (GLsync)sync, |
| 3706 | (GLbitfield)flags, |
| 3707 | (GLuint64)timeout |
| 3708 | ); |
| 3709 | } |
| 3710 | |
| 3711 | /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */ |
| 3712 | static void |
| 3713 | android_glGetInteger64v__I_3JI |
| 3714 | (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) { |
| 3715 | jint _exception = 0; |
| 3716 | const char * _exceptionType = NULL; |
| 3717 | const char * _exceptionMessage = NULL; |
| 3718 | GLint64 *params_base = (GLint64 *) 0; |
| 3719 | jint _remaining; |
| 3720 | GLint64 *params = (GLint64 *) 0; |
| 3721 | |
| 3722 | if (!params_ref) { |
| 3723 | _exception = 1; |
| 3724 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3725 | _exceptionMessage = "params == null"; |
| 3726 | goto exit; |
| 3727 | } |
| 3728 | if (offset < 0) { |
| 3729 | _exception = 1; |
| 3730 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3731 | _exceptionMessage = "offset < 0"; |
| 3732 | goto exit; |
| 3733 | } |
| 3734 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3735 | params_base = (GLint64 *) |
| 3736 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3737 | params = params_base + offset; |
| 3738 | |
| 3739 | glGetInteger64v( |
| 3740 | (GLenum)pname, |
| 3741 | (GLint64 *)params |
| 3742 | ); |
| 3743 | |
| 3744 | exit: |
| 3745 | if (params_base) { |
| 3746 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3747 | _exception ? JNI_ABORT: 0); |
| 3748 | } |
| 3749 | if (_exception) { |
| 3750 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3751 | } |
| 3752 | } |
| 3753 | |
| 3754 | /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */ |
| 3755 | static void |
| 3756 | android_glGetInteger64v__ILjava_nio_LongBuffer_2 |
| 3757 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 3758 | jarray _array = (jarray) 0; |
| 3759 | jint _bufferOffset = (jint) 0; |
| 3760 | jint _remaining; |
| 3761 | GLint64 *params = (GLint64 *) 0; |
| 3762 | |
| 3763 | params = (GLint64 *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 3764 | if (params == NULL) { |
| 3765 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3766 | params = (GLint64 *) (_paramsBase + _bufferOffset); |
| 3767 | } |
| 3768 | glGetInteger64v( |
| 3769 | (GLenum)pname, |
| 3770 | (GLint64 *)params |
| 3771 | ); |
| 3772 | if (_array) { |
| 3773 | releasePointer(_env, _array, params, JNI_TRUE); |
| 3774 | } |
| 3775 | } |
| 3776 | |
| 3777 | /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */ |
| 3778 | static void |
| 3779 | android_glGetSynciv__JII_3II_3II |
| 3780 | (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) { |
| 3781 | jint _exception = 0; |
| 3782 | const char * _exceptionType = NULL; |
| 3783 | const char * _exceptionMessage = NULL; |
| 3784 | GLsizei *length_base = (GLsizei *) 0; |
| 3785 | jint _lengthRemaining; |
| 3786 | GLsizei *length = (GLsizei *) 0; |
| 3787 | GLint *values_base = (GLint *) 0; |
| 3788 | jint _valuesRemaining; |
| 3789 | GLint *values = (GLint *) 0; |
| 3790 | |
| 3791 | if (!length_ref) { |
| 3792 | _exception = 1; |
| 3793 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3794 | _exceptionMessage = "length == null"; |
| 3795 | goto exit; |
| 3796 | } |
| 3797 | if (lengthOffset < 0) { |
| 3798 | _exception = 1; |
| 3799 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3800 | _exceptionMessage = "lengthOffset < 0"; |
| 3801 | goto exit; |
| 3802 | } |
| 3803 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 3804 | length_base = (GLsizei *) |
| 3805 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 3806 | length = length_base + lengthOffset; |
| 3807 | |
| 3808 | if (!values_ref) { |
| 3809 | _exception = 1; |
| 3810 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3811 | _exceptionMessage = "values == null"; |
| 3812 | goto exit; |
| 3813 | } |
| 3814 | if (valuesOffset < 0) { |
| 3815 | _exception = 1; |
| 3816 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3817 | _exceptionMessage = "valuesOffset < 0"; |
| 3818 | goto exit; |
| 3819 | } |
| 3820 | _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset; |
| 3821 | values_base = (GLint *) |
| 3822 | _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0); |
| 3823 | values = values_base + valuesOffset; |
| 3824 | |
| 3825 | glGetSynciv( |
| 3826 | (GLsync)sync, |
| 3827 | (GLenum)pname, |
| 3828 | (GLsizei)bufSize, |
| 3829 | (GLsizei *)length, |
| 3830 | (GLint *)values |
| 3831 | ); |
| 3832 | |
| 3833 | exit: |
| 3834 | if (values_base) { |
| 3835 | _env->ReleasePrimitiveArrayCritical(values_ref, values_base, |
| 3836 | _exception ? JNI_ABORT: 0); |
| 3837 | } |
| 3838 | if (length_base) { |
| 3839 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 3840 | _exception ? JNI_ABORT: 0); |
| 3841 | } |
| 3842 | if (_exception) { |
| 3843 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3844 | } |
| 3845 | } |
| 3846 | |
| 3847 | /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */ |
| 3848 | static void |
| 3849 | android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 3850 | (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) { |
| 3851 | jarray _lengthArray = (jarray) 0; |
| 3852 | jint _lengthBufferOffset = (jint) 0; |
| 3853 | jarray _valuesArray = (jarray) 0; |
| 3854 | jint _valuesBufferOffset = (jint) 0; |
| 3855 | jint _lengthRemaining; |
| 3856 | GLsizei *length = (GLsizei *) 0; |
| 3857 | jint _valuesRemaining; |
| 3858 | GLint *values = (GLint *) 0; |
| 3859 | |
| 3860 | length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); |
| 3861 | values = (GLint *)getPointer(_env, values_buf, &_valuesArray, &_valuesRemaining, &_valuesBufferOffset); |
| 3862 | if (length == NULL) { |
| 3863 | char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0); |
| 3864 | length = (GLsizei *) (_lengthBase + _lengthBufferOffset); |
| 3865 | } |
| 3866 | if (values == NULL) { |
| 3867 | char * _valuesBase = (char *)_env->GetPrimitiveArrayCritical(_valuesArray, (jboolean *) 0); |
| 3868 | values = (GLint *) (_valuesBase + _valuesBufferOffset); |
| 3869 | } |
| 3870 | glGetSynciv( |
| 3871 | (GLsync)sync, |
| 3872 | (GLenum)pname, |
| 3873 | (GLsizei)bufSize, |
| 3874 | (GLsizei *)length, |
| 3875 | (GLint *)values |
| 3876 | ); |
| 3877 | if (_valuesArray) { |
| 3878 | releasePointer(_env, _valuesArray, values, JNI_TRUE); |
| 3879 | } |
| 3880 | if (_lengthArray) { |
| 3881 | releasePointer(_env, _lengthArray, length, JNI_TRUE); |
| 3882 | } |
| 3883 | } |
| 3884 | |
| 3885 | /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */ |
| 3886 | static void |
| 3887 | android_glGetInteger64i_v__II_3JI |
| 3888 | (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) { |
| 3889 | jint _exception = 0; |
| 3890 | const char * _exceptionType = NULL; |
| 3891 | const char * _exceptionMessage = NULL; |
| 3892 | GLint64 *data_base = (GLint64 *) 0; |
| 3893 | jint _remaining; |
| 3894 | GLint64 *data = (GLint64 *) 0; |
| 3895 | |
| 3896 | if (!data_ref) { |
| 3897 | _exception = 1; |
| 3898 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3899 | _exceptionMessage = "data == null"; |
| 3900 | goto exit; |
| 3901 | } |
| 3902 | if (offset < 0) { |
| 3903 | _exception = 1; |
| 3904 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3905 | _exceptionMessage = "offset < 0"; |
| 3906 | goto exit; |
| 3907 | } |
| 3908 | _remaining = _env->GetArrayLength(data_ref) - offset; |
| 3909 | data_base = (GLint64 *) |
| 3910 | _env->GetPrimitiveArrayCritical(data_ref, (jboolean *)0); |
| 3911 | data = data_base + offset; |
| 3912 | |
| 3913 | glGetInteger64i_v( |
| 3914 | (GLenum)target, |
| 3915 | (GLuint)index, |
| 3916 | (GLint64 *)data |
| 3917 | ); |
| 3918 | |
| 3919 | exit: |
| 3920 | if (data_base) { |
| 3921 | _env->ReleasePrimitiveArrayCritical(data_ref, data_base, |
| 3922 | _exception ? JNI_ABORT: 0); |
| 3923 | } |
| 3924 | if (_exception) { |
| 3925 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3926 | } |
| 3927 | } |
| 3928 | |
| 3929 | /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */ |
| 3930 | static void |
| 3931 | android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 |
| 3932 | (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) { |
| 3933 | jarray _array = (jarray) 0; |
| 3934 | jint _bufferOffset = (jint) 0; |
| 3935 | jint _remaining; |
| 3936 | GLint64 *data = (GLint64 *) 0; |
| 3937 | |
| 3938 | data = (GLint64 *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset); |
| 3939 | if (data == NULL) { |
| 3940 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3941 | data = (GLint64 *) (_dataBase + _bufferOffset); |
| 3942 | } |
| 3943 | glGetInteger64i_v( |
| 3944 | (GLenum)target, |
| 3945 | (GLuint)index, |
| 3946 | (GLint64 *)data |
| 3947 | ); |
| 3948 | if (_array) { |
| 3949 | releasePointer(_env, _array, data, JNI_TRUE); |
| 3950 | } |
| 3951 | } |
| 3952 | |
| 3953 | /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */ |
| 3954 | static void |
| 3955 | android_glGetBufferParameteri64v__II_3JI |
| 3956 | (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) { |
| 3957 | jint _exception = 0; |
| 3958 | const char * _exceptionType = NULL; |
| 3959 | const char * _exceptionMessage = NULL; |
| 3960 | GLint64 *params_base = (GLint64 *) 0; |
| 3961 | jint _remaining; |
| 3962 | GLint64 *params = (GLint64 *) 0; |
| 3963 | |
| 3964 | if (!params_ref) { |
| 3965 | _exception = 1; |
| 3966 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3967 | _exceptionMessage = "params == null"; |
| 3968 | goto exit; |
| 3969 | } |
| 3970 | if (offset < 0) { |
| 3971 | _exception = 1; |
| 3972 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3973 | _exceptionMessage = "offset < 0"; |
| 3974 | goto exit; |
| 3975 | } |
| 3976 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3977 | params_base = (GLint64 *) |
| 3978 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 3979 | params = params_base + offset; |
| 3980 | |
| 3981 | glGetBufferParameteri64v( |
| 3982 | (GLenum)target, |
| 3983 | (GLenum)pname, |
| 3984 | (GLint64 *)params |
| 3985 | ); |
| 3986 | |
| 3987 | exit: |
| 3988 | if (params_base) { |
| 3989 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 3990 | _exception ? JNI_ABORT: 0); |
| 3991 | } |
| 3992 | if (_exception) { |
| 3993 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3994 | } |
| 3995 | } |
| 3996 | |
| 3997 | /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */ |
| 3998 | static void |
| 3999 | android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 |
| 4000 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 4001 | jarray _array = (jarray) 0; |
| 4002 | jint _bufferOffset = (jint) 0; |
| 4003 | jint _remaining; |
| 4004 | GLint64 *params = (GLint64 *) 0; |
| 4005 | |
| 4006 | params = (GLint64 *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4007 | if (params == NULL) { |
| 4008 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4009 | params = (GLint64 *) (_paramsBase + _bufferOffset); |
| 4010 | } |
| 4011 | glGetBufferParameteri64v( |
| 4012 | (GLenum)target, |
| 4013 | (GLenum)pname, |
| 4014 | (GLint64 *)params |
| 4015 | ); |
| 4016 | if (_array) { |
| 4017 | releasePointer(_env, _array, params, JNI_TRUE); |
| 4018 | } |
| 4019 | } |
| 4020 | |
| 4021 | /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */ |
| 4022 | static void |
| 4023 | android_glGenSamplers__I_3II |
| 4024 | (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) { |
| 4025 | jint _exception = 0; |
| 4026 | const char * _exceptionType = NULL; |
| 4027 | const char * _exceptionMessage = NULL; |
| 4028 | GLuint *samplers_base = (GLuint *) 0; |
| 4029 | jint _remaining; |
| 4030 | GLuint *samplers = (GLuint *) 0; |
| 4031 | |
| 4032 | if (!samplers_ref) { |
| 4033 | _exception = 1; |
| 4034 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4035 | _exceptionMessage = "samplers == null"; |
| 4036 | goto exit; |
| 4037 | } |
| 4038 | if (offset < 0) { |
| 4039 | _exception = 1; |
| 4040 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4041 | _exceptionMessage = "offset < 0"; |
| 4042 | goto exit; |
| 4043 | } |
| 4044 | _remaining = _env->GetArrayLength(samplers_ref) - offset; |
| 4045 | samplers_base = (GLuint *) |
| 4046 | _env->GetPrimitiveArrayCritical(samplers_ref, (jboolean *)0); |
| 4047 | samplers = samplers_base + offset; |
| 4048 | |
| 4049 | glGenSamplers( |
| 4050 | (GLsizei)count, |
| 4051 | (GLuint *)samplers |
| 4052 | ); |
| 4053 | |
| 4054 | exit: |
| 4055 | if (samplers_base) { |
| 4056 | _env->ReleasePrimitiveArrayCritical(samplers_ref, samplers_base, |
| 4057 | _exception ? JNI_ABORT: 0); |
| 4058 | } |
| 4059 | if (_exception) { |
| 4060 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4061 | } |
| 4062 | } |
| 4063 | |
| 4064 | /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */ |
| 4065 | static void |
| 4066 | android_glGenSamplers__ILjava_nio_IntBuffer_2 |
| 4067 | (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) { |
| 4068 | jarray _array = (jarray) 0; |
| 4069 | jint _bufferOffset = (jint) 0; |
| 4070 | jint _remaining; |
| 4071 | GLuint *samplers = (GLuint *) 0; |
| 4072 | |
| 4073 | samplers = (GLuint *)getPointer(_env, samplers_buf, &_array, &_remaining, &_bufferOffset); |
| 4074 | if (samplers == NULL) { |
| 4075 | char * _samplersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4076 | samplers = (GLuint *) (_samplersBase + _bufferOffset); |
| 4077 | } |
| 4078 | glGenSamplers( |
| 4079 | (GLsizei)count, |
| 4080 | (GLuint *)samplers |
| 4081 | ); |
| 4082 | if (_array) { |
| 4083 | releasePointer(_env, _array, samplers, JNI_TRUE); |
| 4084 | } |
| 4085 | } |
| 4086 | |
| 4087 | /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */ |
| 4088 | static void |
| 4089 | android_glDeleteSamplers__I_3II |
| 4090 | (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) { |
| 4091 | jint _exception = 0; |
| 4092 | const char * _exceptionType = NULL; |
| 4093 | const char * _exceptionMessage = NULL; |
| 4094 | GLuint *samplers_base = (GLuint *) 0; |
| 4095 | jint _remaining; |
| 4096 | GLuint *samplers = (GLuint *) 0; |
| 4097 | |
| 4098 | if (!samplers_ref) { |
| 4099 | _exception = 1; |
| 4100 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4101 | _exceptionMessage = "samplers == null"; |
| 4102 | goto exit; |
| 4103 | } |
| 4104 | if (offset < 0) { |
| 4105 | _exception = 1; |
| 4106 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4107 | _exceptionMessage = "offset < 0"; |
| 4108 | goto exit; |
| 4109 | } |
| 4110 | _remaining = _env->GetArrayLength(samplers_ref) - offset; |
| 4111 | samplers_base = (GLuint *) |
| 4112 | _env->GetPrimitiveArrayCritical(samplers_ref, (jboolean *)0); |
| 4113 | samplers = samplers_base + offset; |
| 4114 | |
| 4115 | glDeleteSamplers( |
| 4116 | (GLsizei)count, |
| 4117 | (GLuint *)samplers |
| 4118 | ); |
| 4119 | |
| 4120 | exit: |
| 4121 | if (samplers_base) { |
| 4122 | _env->ReleasePrimitiveArrayCritical(samplers_ref, samplers_base, |
| 4123 | JNI_ABORT); |
| 4124 | } |
| 4125 | if (_exception) { |
| 4126 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4127 | } |
| 4128 | } |
| 4129 | |
| 4130 | /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */ |
| 4131 | static void |
| 4132 | android_glDeleteSamplers__ILjava_nio_IntBuffer_2 |
| 4133 | (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) { |
| 4134 | jarray _array = (jarray) 0; |
| 4135 | jint _bufferOffset = (jint) 0; |
| 4136 | jint _remaining; |
| 4137 | GLuint *samplers = (GLuint *) 0; |
| 4138 | |
| 4139 | samplers = (GLuint *)getPointer(_env, samplers_buf, &_array, &_remaining, &_bufferOffset); |
| 4140 | if (samplers == NULL) { |
| 4141 | char * _samplersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4142 | samplers = (GLuint *) (_samplersBase + _bufferOffset); |
| 4143 | } |
| 4144 | glDeleteSamplers( |
| 4145 | (GLsizei)count, |
| 4146 | (GLuint *)samplers |
| 4147 | ); |
| 4148 | if (_array) { |
| 4149 | releasePointer(_env, _array, samplers, JNI_FALSE); |
| 4150 | } |
| 4151 | } |
| 4152 | |
| 4153 | /* GLboolean glIsSampler ( GLuint sampler ) */ |
| 4154 | static jboolean |
| 4155 | android_glIsSampler__I |
| 4156 | (JNIEnv *_env, jobject _this, jint sampler) { |
| 4157 | GLboolean _returnValue; |
| 4158 | _returnValue = glIsSampler( |
| 4159 | (GLuint)sampler |
| 4160 | ); |
| 4161 | return (jboolean)_returnValue; |
| 4162 | } |
| 4163 | |
| 4164 | /* void glBindSampler ( GLuint unit, GLuint sampler ) */ |
| 4165 | static void |
| 4166 | android_glBindSampler__II |
| 4167 | (JNIEnv *_env, jobject _this, jint unit, jint sampler) { |
| 4168 | glBindSampler( |
| 4169 | (GLuint)unit, |
| 4170 | (GLuint)sampler |
| 4171 | ); |
| 4172 | } |
| 4173 | |
| 4174 | /* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */ |
| 4175 | static void |
| 4176 | android_glSamplerParameteri__III |
| 4177 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) { |
| 4178 | glSamplerParameteri( |
| 4179 | (GLuint)sampler, |
| 4180 | (GLenum)pname, |
| 4181 | (GLint)param |
| 4182 | ); |
| 4183 | } |
| 4184 | |
| 4185 | /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */ |
| 4186 | static void |
| 4187 | android_glSamplerParameteriv__II_3II |
| 4188 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) { |
| 4189 | jint _exception = 0; |
| 4190 | const char * _exceptionType = NULL; |
| 4191 | const char * _exceptionMessage = NULL; |
| 4192 | GLint *param_base = (GLint *) 0; |
| 4193 | jint _remaining; |
| 4194 | GLint *param = (GLint *) 0; |
| 4195 | |
| 4196 | if (!param_ref) { |
| 4197 | _exception = 1; |
| 4198 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4199 | _exceptionMessage = "param == null"; |
| 4200 | goto exit; |
| 4201 | } |
| 4202 | if (offset < 0) { |
| 4203 | _exception = 1; |
| 4204 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4205 | _exceptionMessage = "offset < 0"; |
| 4206 | goto exit; |
| 4207 | } |
| 4208 | _remaining = _env->GetArrayLength(param_ref) - offset; |
| 4209 | param_base = (GLint *) |
| 4210 | _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0); |
| 4211 | param = param_base + offset; |
| 4212 | |
| 4213 | glSamplerParameteriv( |
| 4214 | (GLuint)sampler, |
| 4215 | (GLenum)pname, |
| 4216 | (GLint *)param |
| 4217 | ); |
| 4218 | |
| 4219 | exit: |
| 4220 | if (param_base) { |
| 4221 | _env->ReleasePrimitiveArrayCritical(param_ref, param_base, |
| 4222 | JNI_ABORT); |
| 4223 | } |
| 4224 | if (_exception) { |
| 4225 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4226 | } |
| 4227 | } |
| 4228 | |
| 4229 | /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */ |
| 4230 | static void |
| 4231 | android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 |
| 4232 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) { |
| 4233 | jarray _array = (jarray) 0; |
| 4234 | jint _bufferOffset = (jint) 0; |
| 4235 | jint _remaining; |
| 4236 | GLint *param = (GLint *) 0; |
| 4237 | |
| 4238 | param = (GLint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset); |
| 4239 | if (param == NULL) { |
| 4240 | char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4241 | param = (GLint *) (_paramBase + _bufferOffset); |
| 4242 | } |
| 4243 | glSamplerParameteriv( |
| 4244 | (GLuint)sampler, |
| 4245 | (GLenum)pname, |
| 4246 | (GLint *)param |
| 4247 | ); |
| 4248 | if (_array) { |
| 4249 | releasePointer(_env, _array, param, JNI_FALSE); |
| 4250 | } |
| 4251 | } |
| 4252 | |
| 4253 | /* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */ |
| 4254 | static void |
| 4255 | android_glSamplerParameterf__IIF |
| 4256 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) { |
| 4257 | glSamplerParameterf( |
| 4258 | (GLuint)sampler, |
| 4259 | (GLenum)pname, |
| 4260 | (GLfloat)param |
| 4261 | ); |
| 4262 | } |
| 4263 | |
| 4264 | /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */ |
| 4265 | static void |
| 4266 | android_glSamplerParameterfv__II_3FI |
| 4267 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) { |
| 4268 | jint _exception = 0; |
| 4269 | const char * _exceptionType = NULL; |
| 4270 | const char * _exceptionMessage = NULL; |
| 4271 | GLfloat *param_base = (GLfloat *) 0; |
| 4272 | jint _remaining; |
| 4273 | GLfloat *param = (GLfloat *) 0; |
| 4274 | |
| 4275 | if (!param_ref) { |
| 4276 | _exception = 1; |
| 4277 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4278 | _exceptionMessage = "param == null"; |
| 4279 | goto exit; |
| 4280 | } |
| 4281 | if (offset < 0) { |
| 4282 | _exception = 1; |
| 4283 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4284 | _exceptionMessage = "offset < 0"; |
| 4285 | goto exit; |
| 4286 | } |
| 4287 | _remaining = _env->GetArrayLength(param_ref) - offset; |
| 4288 | param_base = (GLfloat *) |
| 4289 | _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0); |
| 4290 | param = param_base + offset; |
| 4291 | |
| 4292 | glSamplerParameterfv( |
| 4293 | (GLuint)sampler, |
| 4294 | (GLenum)pname, |
| 4295 | (GLfloat *)param |
| 4296 | ); |
| 4297 | |
| 4298 | exit: |
| 4299 | if (param_base) { |
| 4300 | _env->ReleasePrimitiveArrayCritical(param_ref, param_base, |
| 4301 | JNI_ABORT); |
| 4302 | } |
| 4303 | if (_exception) { |
| 4304 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4305 | } |
| 4306 | } |
| 4307 | |
| 4308 | /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */ |
| 4309 | static void |
| 4310 | android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 |
| 4311 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) { |
| 4312 | jarray _array = (jarray) 0; |
| 4313 | jint _bufferOffset = (jint) 0; |
| 4314 | jint _remaining; |
| 4315 | GLfloat *param = (GLfloat *) 0; |
| 4316 | |
| 4317 | param = (GLfloat *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset); |
| 4318 | if (param == NULL) { |
| 4319 | char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4320 | param = (GLfloat *) (_paramBase + _bufferOffset); |
| 4321 | } |
| 4322 | glSamplerParameterfv( |
| 4323 | (GLuint)sampler, |
| 4324 | (GLenum)pname, |
| 4325 | (GLfloat *)param |
| 4326 | ); |
| 4327 | if (_array) { |
| 4328 | releasePointer(_env, _array, param, JNI_FALSE); |
| 4329 | } |
| 4330 | } |
| 4331 | |
| 4332 | /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */ |
| 4333 | static void |
| 4334 | android_glGetSamplerParameteriv__II_3II |
| 4335 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) { |
| 4336 | jint _exception = 0; |
| 4337 | const char * _exceptionType = NULL; |
| 4338 | const char * _exceptionMessage = NULL; |
| 4339 | GLint *params_base = (GLint *) 0; |
| 4340 | jint _remaining; |
| 4341 | GLint *params = (GLint *) 0; |
| 4342 | |
| 4343 | if (!params_ref) { |
| 4344 | _exception = 1; |
| 4345 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4346 | _exceptionMessage = "params == null"; |
| 4347 | goto exit; |
| 4348 | } |
| 4349 | if (offset < 0) { |
| 4350 | _exception = 1; |
| 4351 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4352 | _exceptionMessage = "offset < 0"; |
| 4353 | goto exit; |
| 4354 | } |
| 4355 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4356 | params_base = (GLint *) |
| 4357 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4358 | params = params_base + offset; |
| 4359 | |
| 4360 | glGetSamplerParameteriv( |
| 4361 | (GLuint)sampler, |
| 4362 | (GLenum)pname, |
| 4363 | (GLint *)params |
| 4364 | ); |
| 4365 | |
| 4366 | exit: |
| 4367 | if (params_base) { |
| 4368 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4369 | _exception ? JNI_ABORT: 0); |
| 4370 | } |
| 4371 | if (_exception) { |
| 4372 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4373 | } |
| 4374 | } |
| 4375 | |
| 4376 | /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */ |
| 4377 | static void |
| 4378 | android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 |
| 4379 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) { |
| 4380 | jarray _array = (jarray) 0; |
| 4381 | jint _bufferOffset = (jint) 0; |
| 4382 | jint _remaining; |
| 4383 | GLint *params = (GLint *) 0; |
| 4384 | |
| 4385 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4386 | if (params == NULL) { |
| 4387 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4388 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 4389 | } |
| 4390 | glGetSamplerParameteriv( |
| 4391 | (GLuint)sampler, |
| 4392 | (GLenum)pname, |
| 4393 | (GLint *)params |
| 4394 | ); |
| 4395 | if (_array) { |
| 4396 | releasePointer(_env, _array, params, JNI_TRUE); |
| 4397 | } |
| 4398 | } |
| 4399 | |
| 4400 | /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */ |
| 4401 | static void |
| 4402 | android_glGetSamplerParameterfv__II_3FI |
| 4403 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) { |
| 4404 | jint _exception = 0; |
| 4405 | const char * _exceptionType = NULL; |
| 4406 | const char * _exceptionMessage = NULL; |
| 4407 | GLfloat *params_base = (GLfloat *) 0; |
| 4408 | jint _remaining; |
| 4409 | GLfloat *params = (GLfloat *) 0; |
| 4410 | |
| 4411 | if (!params_ref) { |
| 4412 | _exception = 1; |
| 4413 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4414 | _exceptionMessage = "params == null"; |
| 4415 | goto exit; |
| 4416 | } |
| 4417 | if (offset < 0) { |
| 4418 | _exception = 1; |
| 4419 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4420 | _exceptionMessage = "offset < 0"; |
| 4421 | goto exit; |
| 4422 | } |
| 4423 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4424 | params_base = (GLfloat *) |
| 4425 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 4426 | params = params_base + offset; |
| 4427 | |
| 4428 | glGetSamplerParameterfv( |
| 4429 | (GLuint)sampler, |
| 4430 | (GLenum)pname, |
| 4431 | (GLfloat *)params |
| 4432 | ); |
| 4433 | |
| 4434 | exit: |
| 4435 | if (params_base) { |
| 4436 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 4437 | _exception ? JNI_ABORT: 0); |
| 4438 | } |
| 4439 | if (_exception) { |
| 4440 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4441 | } |
| 4442 | } |
| 4443 | |
| 4444 | /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */ |
| 4445 | static void |
| 4446 | android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 |
| 4447 | (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) { |
| 4448 | jarray _array = (jarray) 0; |
| 4449 | jint _bufferOffset = (jint) 0; |
| 4450 | jint _remaining; |
| 4451 | GLfloat *params = (GLfloat *) 0; |
| 4452 | |
| 4453 | params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 4454 | if (params == NULL) { |
| 4455 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4456 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 4457 | } |
| 4458 | glGetSamplerParameterfv( |
| 4459 | (GLuint)sampler, |
| 4460 | (GLenum)pname, |
| 4461 | (GLfloat *)params |
| 4462 | ); |
| 4463 | if (_array) { |
| 4464 | releasePointer(_env, _array, params, JNI_TRUE); |
| 4465 | } |
| 4466 | } |
| 4467 | |
| 4468 | /* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */ |
| 4469 | static void |
| 4470 | android_glVertexAttribDivisor__II |
| 4471 | (JNIEnv *_env, jobject _this, jint index, jint divisor) { |
| 4472 | glVertexAttribDivisor( |
| 4473 | (GLuint)index, |
| 4474 | (GLuint)divisor |
| 4475 | ); |
| 4476 | } |
| 4477 | |
| 4478 | /* void glBindTransformFeedback ( GLenum target, GLuint id ) */ |
| 4479 | static void |
| 4480 | android_glBindTransformFeedback__II |
| 4481 | (JNIEnv *_env, jobject _this, jint target, jint id) { |
| 4482 | glBindTransformFeedback( |
| 4483 | (GLenum)target, |
| 4484 | (GLuint)id |
| 4485 | ); |
| 4486 | } |
| 4487 | |
| 4488 | /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */ |
| 4489 | static void |
| 4490 | android_glDeleteTransformFeedbacks__I_3II |
| 4491 | (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) { |
| 4492 | jint _exception = 0; |
| 4493 | const char * _exceptionType = NULL; |
| 4494 | const char * _exceptionMessage = NULL; |
| 4495 | GLuint *ids_base = (GLuint *) 0; |
| 4496 | jint _remaining; |
| 4497 | GLuint *ids = (GLuint *) 0; |
| 4498 | |
| 4499 | if (!ids_ref) { |
| 4500 | _exception = 1; |
| 4501 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4502 | _exceptionMessage = "ids == null"; |
| 4503 | goto exit; |
| 4504 | } |
| 4505 | if (offset < 0) { |
| 4506 | _exception = 1; |
| 4507 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4508 | _exceptionMessage = "offset < 0"; |
| 4509 | goto exit; |
| 4510 | } |
| 4511 | _remaining = _env->GetArrayLength(ids_ref) - offset; |
| 4512 | ids_base = (GLuint *) |
| 4513 | _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0); |
| 4514 | ids = ids_base + offset; |
| 4515 | |
| 4516 | glDeleteTransformFeedbacks( |
| 4517 | (GLsizei)n, |
| 4518 | (GLuint *)ids |
| 4519 | ); |
| 4520 | |
| 4521 | exit: |
| 4522 | if (ids_base) { |
| 4523 | _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base, |
| 4524 | JNI_ABORT); |
| 4525 | } |
| 4526 | if (_exception) { |
| 4527 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4528 | } |
| 4529 | } |
| 4530 | |
| 4531 | /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */ |
| 4532 | static void |
| 4533 | android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 |
| 4534 | (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) { |
| 4535 | jarray _array = (jarray) 0; |
| 4536 | jint _bufferOffset = (jint) 0; |
| 4537 | jint _remaining; |
| 4538 | GLuint *ids = (GLuint *) 0; |
| 4539 | |
| 4540 | ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset); |
| 4541 | if (ids == NULL) { |
| 4542 | char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4543 | ids = (GLuint *) (_idsBase + _bufferOffset); |
| 4544 | } |
| 4545 | glDeleteTransformFeedbacks( |
| 4546 | (GLsizei)n, |
| 4547 | (GLuint *)ids |
| 4548 | ); |
| 4549 | if (_array) { |
| 4550 | releasePointer(_env, _array, ids, JNI_FALSE); |
| 4551 | } |
| 4552 | } |
| 4553 | |
| 4554 | /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */ |
| 4555 | static void |
| 4556 | android_glGenTransformFeedbacks__I_3II |
| 4557 | (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) { |
| 4558 | jint _exception = 0; |
| 4559 | const char * _exceptionType = NULL; |
| 4560 | const char * _exceptionMessage = NULL; |
| 4561 | GLuint *ids_base = (GLuint *) 0; |
| 4562 | jint _remaining; |
| 4563 | GLuint *ids = (GLuint *) 0; |
| 4564 | |
| 4565 | if (!ids_ref) { |
| 4566 | _exception = 1; |
| 4567 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4568 | _exceptionMessage = "ids == null"; |
| 4569 | goto exit; |
| 4570 | } |
| 4571 | if (offset < 0) { |
| 4572 | _exception = 1; |
| 4573 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4574 | _exceptionMessage = "offset < 0"; |
| 4575 | goto exit; |
| 4576 | } |
| 4577 | _remaining = _env->GetArrayLength(ids_ref) - offset; |
| 4578 | ids_base = (GLuint *) |
| 4579 | _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0); |
| 4580 | ids = ids_base + offset; |
| 4581 | |
| 4582 | glGenTransformFeedbacks( |
| 4583 | (GLsizei)n, |
| 4584 | (GLuint *)ids |
| 4585 | ); |
| 4586 | |
| 4587 | exit: |
| 4588 | if (ids_base) { |
| 4589 | _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base, |
| 4590 | _exception ? JNI_ABORT: 0); |
| 4591 | } |
| 4592 | if (_exception) { |
| 4593 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4594 | } |
| 4595 | } |
| 4596 | |
| 4597 | /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */ |
| 4598 | static void |
| 4599 | android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 |
| 4600 | (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) { |
| 4601 | jarray _array = (jarray) 0; |
| 4602 | jint _bufferOffset = (jint) 0; |
| 4603 | jint _remaining; |
| 4604 | GLuint *ids = (GLuint *) 0; |
| 4605 | |
| 4606 | ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset); |
| 4607 | if (ids == NULL) { |
| 4608 | char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4609 | ids = (GLuint *) (_idsBase + _bufferOffset); |
| 4610 | } |
| 4611 | glGenTransformFeedbacks( |
| 4612 | (GLsizei)n, |
| 4613 | (GLuint *)ids |
| 4614 | ); |
| 4615 | if (_array) { |
| 4616 | releasePointer(_env, _array, ids, JNI_TRUE); |
| 4617 | } |
| 4618 | } |
| 4619 | |
| 4620 | /* GLboolean glIsTransformFeedback ( GLuint id ) */ |
| 4621 | static jboolean |
| 4622 | android_glIsTransformFeedback__I |
| 4623 | (JNIEnv *_env, jobject _this, jint id) { |
| 4624 | GLboolean _returnValue; |
| 4625 | _returnValue = glIsTransformFeedback( |
| 4626 | (GLuint)id |
| 4627 | ); |
| 4628 | return (jboolean)_returnValue; |
| 4629 | } |
| 4630 | |
| 4631 | /* void glPauseTransformFeedback ( void ) */ |
| 4632 | static void |
| 4633 | android_glPauseTransformFeedback__ |
| 4634 | (JNIEnv *_env, jobject _this) { |
| 4635 | glPauseTransformFeedback(); |
| 4636 | } |
| 4637 | |
| 4638 | /* void glResumeTransformFeedback ( void ) */ |
| 4639 | static void |
| 4640 | android_glResumeTransformFeedback__ |
| 4641 | (JNIEnv *_env, jobject _this) { |
| 4642 | glResumeTransformFeedback(); |
| 4643 | } |
| 4644 | |
| 4645 | /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */ |
| 4646 | static void |
| 4647 | android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 |
| 4648 | (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) { |
| 4649 | jint _exception = 0; |
| 4650 | const char * _exceptionType = NULL; |
| 4651 | const char * _exceptionMessage = NULL; |
| 4652 | jarray _array = (jarray) 0; |
| 4653 | jint _bufferOffset = (jint) 0; |
| 4654 | GLsizei *length_base = (GLsizei *) 0; |
| 4655 | jint _lengthRemaining; |
| 4656 | GLsizei *length = (GLsizei *) 0; |
| 4657 | GLenum *binaryFormat_base = (GLenum *) 0; |
| 4658 | jint _binaryFormatRemaining; |
| 4659 | GLenum *binaryFormat = (GLenum *) 0; |
| 4660 | jint _binaryRemaining; |
| 4661 | GLvoid *binary = (GLvoid *) 0; |
| 4662 | |
| 4663 | if (!length_ref) { |
| 4664 | _exception = 1; |
| 4665 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4666 | _exceptionMessage = "length == null"; |
| 4667 | goto exit; |
| 4668 | } |
| 4669 | if (lengthOffset < 0) { |
| 4670 | _exception = 1; |
| 4671 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4672 | _exceptionMessage = "lengthOffset < 0"; |
| 4673 | goto exit; |
| 4674 | } |
| 4675 | _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; |
| 4676 | length_base = (GLsizei *) |
| 4677 | _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); |
| 4678 | length = length_base + lengthOffset; |
| 4679 | |
| 4680 | if (!binaryFormat_ref) { |
| 4681 | _exception = 1; |
| 4682 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4683 | _exceptionMessage = "binaryFormat == null"; |
| 4684 | goto exit; |
| 4685 | } |
| 4686 | if (binaryFormatOffset < 0) { |
| 4687 | _exception = 1; |
| 4688 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4689 | _exceptionMessage = "binaryFormatOffset < 0"; |
| 4690 | goto exit; |
| 4691 | } |
| 4692 | _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset; |
| 4693 | binaryFormat_base = (GLenum *) |
| 4694 | _env->GetPrimitiveArrayCritical(binaryFormat_ref, (jboolean *)0); |
| 4695 | binaryFormat = binaryFormat_base + binaryFormatOffset; |
| 4696 | |
| 4697 | binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining, &_bufferOffset); |
| 4698 | if (binary == NULL) { |
| 4699 | char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4700 | binary = (GLvoid *) (_binaryBase + _bufferOffset); |
| 4701 | } |
| 4702 | glGetProgramBinary( |
| 4703 | (GLuint)program, |
| 4704 | (GLsizei)bufSize, |
| 4705 | (GLsizei *)length, |
| 4706 | (GLenum *)binaryFormat, |
| 4707 | (GLvoid *)binary |
| 4708 | ); |
| 4709 | |
| 4710 | exit: |
| 4711 | if (_array) { |
| 4712 | releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE); |
| 4713 | } |
| 4714 | if (binaryFormat_base) { |
| 4715 | _env->ReleasePrimitiveArrayCritical(binaryFormat_ref, binaryFormat_base, |
| 4716 | _exception ? JNI_ABORT: 0); |
| 4717 | } |
| 4718 | if (length_base) { |
| 4719 | _env->ReleasePrimitiveArrayCritical(length_ref, length_base, |
| 4720 | _exception ? JNI_ABORT: 0); |
| 4721 | } |
| 4722 | if (_exception) { |
| 4723 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4724 | } |
| 4725 | } |
| 4726 | |
| 4727 | /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */ |
| 4728 | static void |
| 4729 | android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 |
| 4730 | (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) { |
| 4731 | jarray _lengthArray = (jarray) 0; |
| 4732 | jint _lengthBufferOffset = (jint) 0; |
| 4733 | jarray _binaryFormatArray = (jarray) 0; |
| 4734 | jint _binaryFormatBufferOffset = (jint) 0; |
| 4735 | jarray _binaryArray = (jarray) 0; |
| 4736 | jint _binaryBufferOffset = (jint) 0; |
| 4737 | jint _lengthRemaining; |
| 4738 | GLsizei *length = (GLsizei *) 0; |
| 4739 | jint _binaryFormatRemaining; |
| 4740 | GLenum *binaryFormat = (GLenum *) 0; |
| 4741 | jint _binaryRemaining; |
| 4742 | GLvoid *binary = (GLvoid *) 0; |
| 4743 | |
| 4744 | length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); |
| 4745 | binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, &_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset); |
| 4746 | binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining, &_binaryBufferOffset); |
| 4747 | if (length == NULL) { |
| 4748 | char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0); |
| 4749 | length = (GLsizei *) (_lengthBase + _lengthBufferOffset); |
| 4750 | } |
| 4751 | if (binaryFormat == NULL) { |
| 4752 | char * _binaryFormatBase = (char *)_env->GetPrimitiveArrayCritical(_binaryFormatArray, (jboolean *) 0); |
| 4753 | binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset); |
| 4754 | } |
| 4755 | if (binary == NULL) { |
| 4756 | char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0); |
| 4757 | binary = (GLvoid *) (_binaryBase + _binaryBufferOffset); |
| 4758 | } |
| 4759 | glGetProgramBinary( |
| 4760 | (GLuint)program, |
| 4761 | (GLsizei)bufSize, |
| 4762 | (GLsizei *)length, |
| 4763 | (GLenum *)binaryFormat, |
| 4764 | (GLvoid *)binary |
| 4765 | ); |
| 4766 | if (_binaryArray) { |
| 4767 | releasePointer(_env, _binaryArray, binary, JNI_TRUE); |
| 4768 | } |
| 4769 | if (_binaryFormatArray) { |
| 4770 | releasePointer(_env, _binaryFormatArray, binaryFormat, JNI_TRUE); |
| 4771 | } |
| 4772 | if (_lengthArray) { |
| 4773 | releasePointer(_env, _lengthArray, length, JNI_TRUE); |
| 4774 | } |
| 4775 | } |
| 4776 | |
| 4777 | /* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */ |
| 4778 | static void |
| 4779 | android_glProgramBinary__IILjava_nio_Buffer_2I |
| 4780 | (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) { |
| 4781 | jarray _array = (jarray) 0; |
| 4782 | jint _bufferOffset = (jint) 0; |
| 4783 | jint _remaining; |
| 4784 | GLvoid *binary = (GLvoid *) 0; |
| 4785 | |
| 4786 | binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_remaining, &_bufferOffset); |
| 4787 | if (binary == NULL) { |
| 4788 | char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4789 | binary = (GLvoid *) (_binaryBase + _bufferOffset); |
| 4790 | } |
| 4791 | glProgramBinary( |
| 4792 | (GLuint)program, |
| 4793 | (GLenum)binaryFormat, |
| 4794 | (GLvoid *)binary, |
| 4795 | (GLsizei)length |
| 4796 | ); |
| 4797 | if (_array) { |
| 4798 | releasePointer(_env, _array, binary, JNI_FALSE); |
| 4799 | } |
| 4800 | } |
| 4801 | |
| 4802 | /* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */ |
| 4803 | static void |
| 4804 | android_glProgramParameteri__III |
| 4805 | (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) { |
| 4806 | glProgramParameteri( |
| 4807 | (GLuint)program, |
| 4808 | (GLenum)pname, |
| 4809 | (GLint)value |
| 4810 | ); |
| 4811 | } |
| 4812 | |
| 4813 | /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */ |
| 4814 | static void |
| 4815 | android_glInvalidateFramebuffer__II_3II |
| 4816 | (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) { |
| 4817 | jint _exception = 0; |
| 4818 | const char * _exceptionType = NULL; |
| 4819 | const char * _exceptionMessage = NULL; |
| 4820 | GLenum *attachments_base = (GLenum *) 0; |
| 4821 | jint _remaining; |
| 4822 | GLenum *attachments = (GLenum *) 0; |
| 4823 | |
| 4824 | if (!attachments_ref) { |
| 4825 | _exception = 1; |
| 4826 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4827 | _exceptionMessage = "attachments == null"; |
| 4828 | goto exit; |
| 4829 | } |
| 4830 | if (offset < 0) { |
| 4831 | _exception = 1; |
| 4832 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4833 | _exceptionMessage = "offset < 0"; |
| 4834 | goto exit; |
| 4835 | } |
| 4836 | _remaining = _env->GetArrayLength(attachments_ref) - offset; |
| 4837 | attachments_base = (GLenum *) |
| 4838 | _env->GetPrimitiveArrayCritical(attachments_ref, (jboolean *)0); |
| 4839 | attachments = attachments_base + offset; |
| 4840 | |
| 4841 | glInvalidateFramebuffer( |
| 4842 | (GLenum)target, |
| 4843 | (GLsizei)numAttachments, |
| 4844 | (GLenum *)attachments |
| 4845 | ); |
| 4846 | |
| 4847 | exit: |
| 4848 | if (attachments_base) { |
| 4849 | _env->ReleasePrimitiveArrayCritical(attachments_ref, attachments_base, |
| 4850 | JNI_ABORT); |
| 4851 | } |
| 4852 | if (_exception) { |
| 4853 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4854 | } |
| 4855 | } |
| 4856 | |
| 4857 | /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */ |
| 4858 | static void |
| 4859 | android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 |
| 4860 | (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) { |
| 4861 | jarray _array = (jarray) 0; |
| 4862 | jint _bufferOffset = (jint) 0; |
| 4863 | jint _remaining; |
| 4864 | GLenum *attachments = (GLenum *) 0; |
| 4865 | |
| 4866 | attachments = (GLenum *)getPointer(_env, attachments_buf, &_array, &_remaining, &_bufferOffset); |
| 4867 | if (attachments == NULL) { |
| 4868 | char * _attachmentsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4869 | attachments = (GLenum *) (_attachmentsBase + _bufferOffset); |
| 4870 | } |
| 4871 | glInvalidateFramebuffer( |
| 4872 | (GLenum)target, |
| 4873 | (GLsizei)numAttachments, |
| 4874 | (GLenum *)attachments |
| 4875 | ); |
| 4876 | if (_array) { |
| 4877 | releasePointer(_env, _array, attachments, JNI_FALSE); |
| 4878 | } |
| 4879 | } |
| 4880 | |
| 4881 | /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 4882 | static void |
| 4883 | android_glInvalidateSubFramebuffer__II_3IIIIII |
| 4884 | (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) { |
| 4885 | jint _exception = 0; |
| 4886 | const char * _exceptionType = NULL; |
| 4887 | const char * _exceptionMessage = NULL; |
| 4888 | GLenum *attachments_base = (GLenum *) 0; |
| 4889 | jint _remaining; |
| 4890 | GLenum *attachments = (GLenum *) 0; |
| 4891 | |
| 4892 | if (!attachments_ref) { |
| 4893 | _exception = 1; |
| 4894 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4895 | _exceptionMessage = "attachments == null"; |
| 4896 | goto exit; |
| 4897 | } |
| 4898 | if (offset < 0) { |
| 4899 | _exception = 1; |
| 4900 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4901 | _exceptionMessage = "offset < 0"; |
| 4902 | goto exit; |
| 4903 | } |
| 4904 | _remaining = _env->GetArrayLength(attachments_ref) - offset; |
| 4905 | attachments_base = (GLenum *) |
| 4906 | _env->GetPrimitiveArrayCritical(attachments_ref, (jboolean *)0); |
| 4907 | attachments = attachments_base + offset; |
| 4908 | |
| 4909 | glInvalidateSubFramebuffer( |
| 4910 | (GLenum)target, |
| 4911 | (GLsizei)numAttachments, |
| 4912 | (GLenum *)attachments, |
| 4913 | (GLint)x, |
| 4914 | (GLint)y, |
| 4915 | (GLsizei)width, |
| 4916 | (GLsizei)height |
| 4917 | ); |
| 4918 | |
| 4919 | exit: |
| 4920 | if (attachments_base) { |
| 4921 | _env->ReleasePrimitiveArrayCritical(attachments_ref, attachments_base, |
| 4922 | JNI_ABORT); |
| 4923 | } |
| 4924 | if (_exception) { |
| 4925 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4926 | } |
| 4927 | } |
| 4928 | |
| 4929 | /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 4930 | static void |
| 4931 | android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII |
| 4932 | (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf, jint x, jint y, jint width, jint height) { |
| 4933 | jarray _array = (jarray) 0; |
| 4934 | jint _bufferOffset = (jint) 0; |
| 4935 | jint _remaining; |
| 4936 | GLenum *attachments = (GLenum *) 0; |
| 4937 | |
| 4938 | attachments = (GLenum *)getPointer(_env, attachments_buf, &_array, &_remaining, &_bufferOffset); |
| 4939 | if (attachments == NULL) { |
| 4940 | char * _attachmentsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4941 | attachments = (GLenum *) (_attachmentsBase + _bufferOffset); |
| 4942 | } |
| 4943 | glInvalidateSubFramebuffer( |
| 4944 | (GLenum)target, |
| 4945 | (GLsizei)numAttachments, |
| 4946 | (GLenum *)attachments, |
| 4947 | (GLint)x, |
| 4948 | (GLint)y, |
| 4949 | (GLsizei)width, |
| 4950 | (GLsizei)height |
| 4951 | ); |
| 4952 | if (_array) { |
| 4953 | releasePointer(_env, _array, attachments, JNI_FALSE); |
| 4954 | } |
| 4955 | } |
| 4956 | |
| 4957 | /* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */ |
| 4958 | static void |
| 4959 | android_glTexStorage2D__IIIII |
| 4960 | (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) { |
| 4961 | glTexStorage2D( |
| 4962 | (GLenum)target, |
| 4963 | (GLsizei)levels, |
| 4964 | (GLenum)internalformat, |
| 4965 | (GLsizei)width, |
| 4966 | (GLsizei)height |
| 4967 | ); |
| 4968 | } |
| 4969 | |
| 4970 | /* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */ |
| 4971 | static void |
| 4972 | android_glTexStorage3D__IIIIII |
| 4973 | (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) { |
| 4974 | glTexStorage3D( |
| 4975 | (GLenum)target, |
| 4976 | (GLsizei)levels, |
| 4977 | (GLenum)internalformat, |
| 4978 | (GLsizei)width, |
| 4979 | (GLsizei)height, |
| 4980 | (GLsizei)depth |
| 4981 | ); |
| 4982 | } |
| 4983 | |
| 4984 | /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */ |
| 4985 | static void |
| 4986 | android_glGetInternalformativ__IIII_3II |
| 4987 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) { |
| 4988 | jint _exception = 0; |
| 4989 | const char * _exceptionType = NULL; |
| 4990 | const char * _exceptionMessage = NULL; |
| 4991 | GLint *params_base = (GLint *) 0; |
| 4992 | jint _remaining; |
| 4993 | GLint *params = (GLint *) 0; |
| 4994 | |
| 4995 | if (!params_ref) { |
| 4996 | _exception = 1; |
| 4997 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4998 | _exceptionMessage = "params == null"; |
| 4999 | goto exit; |
| 5000 | } |
| 5001 | if (offset < 0) { |
| 5002 | _exception = 1; |
| 5003 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5004 | _exceptionMessage = "offset < 0"; |
| 5005 | goto exit; |
| 5006 | } |
| 5007 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5008 | params_base = (GLint *) |
| 5009 | _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); |
| 5010 | params = params_base + offset; |
| 5011 | |
| 5012 | glGetInternalformativ( |
| 5013 | (GLenum)target, |
| 5014 | (GLenum)internalformat, |
| 5015 | (GLenum)pname, |
| 5016 | (GLsizei)bufSize, |
| 5017 | (GLint *)params |
| 5018 | ); |
| 5019 | |
| 5020 | exit: |
| 5021 | if (params_base) { |
| 5022 | _env->ReleasePrimitiveArrayCritical(params_ref, params_base, |
| 5023 | _exception ? JNI_ABORT: 0); |
| 5024 | } |
| 5025 | if (_exception) { |
| 5026 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5027 | } |
| 5028 | } |
| 5029 | |
| 5030 | /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */ |
| 5031 | static void |
| 5032 | android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 |
| 5033 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) { |
| 5034 | jarray _array = (jarray) 0; |
| 5035 | jint _bufferOffset = (jint) 0; |
| 5036 | jint _remaining; |
| 5037 | GLint *params = (GLint *) 0; |
| 5038 | |
| 5039 | params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); |
| 5040 | if (params == NULL) { |
| 5041 | char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 5042 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5043 | } |
| 5044 | glGetInternalformativ( |
| 5045 | (GLenum)target, |
| 5046 | (GLenum)internalformat, |
| 5047 | (GLenum)pname, |
| 5048 | (GLsizei)bufSize, |
| 5049 | (GLint *)params |
| 5050 | ); |
| 5051 | if (_array) { |
| 5052 | releasePointer(_env, _array, params, JNI_TRUE); |
| 5053 | } |
| 5054 | } |
| 5055 | |
| 5056 | static const char *classPathName = "android/opengl/GLES30"; |
| 5057 | |
| 5058 | static JNINativeMethod methods[] = { |
| 5059 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 5060 | {"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I }, |
| 5061 | {"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 }, |
| 5062 | {"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII }, |
| 5063 | {"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 }, |
| 5064 | {"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII }, |
| 5065 | {"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 }, |
| 5066 | {"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII }, |
| 5067 | {"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII }, |
| 5068 | {"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 }, |
| 5069 | {"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII }, |
| 5070 | {"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 }, |
| 5071 | {"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII }, |
| 5072 | {"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II }, |
| 5073 | {"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 }, |
| 5074 | {"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II }, |
| 5075 | {"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 }, |
| 5076 | {"glIsQuery", "(I)Z", (void *) android_glIsQuery__I }, |
| 5077 | {"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II }, |
| 5078 | {"glEndQuery", "(I)V", (void *) android_glEndQuery__I }, |
| 5079 | {"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II }, |
| 5080 | {"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 }, |
| 5081 | {"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II }, |
| 5082 | {"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 }, |
| 5083 | {"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I }, |
| 5084 | {"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II }, |
| 5085 | {"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II }, |
| 5086 | {"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 }, |
| 5087 | {"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI }, |
| 5088 | {"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5089 | {"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI }, |
| 5090 | {"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5091 | {"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI }, |
| 5092 | {"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5093 | {"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI }, |
| 5094 | {"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5095 | {"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI }, |
| 5096 | {"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5097 | {"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI }, |
| 5098 | {"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 }, |
| 5099 | {"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII }, |
| 5100 | {"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII }, |
| 5101 | {"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII }, |
| 5102 | {"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII }, |
| 5103 | {"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III }, |
| 5104 | {"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I }, |
| 5105 | {"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II }, |
| 5106 | {"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 }, |
| 5107 | {"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II }, |
| 5108 | {"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 }, |
| 5109 | {"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I }, |
| 5110 | {"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II }, |
| 5111 | {"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 }, |
| 5112 | {"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I }, |
| 5113 | {"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ }, |
| 5114 | {"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII }, |
| 5115 | {"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III }, |
| 5116 | {"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings }, |
| 5117 | {"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI }, |
| 5118 | {"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, |
| 5119 | {"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 }, |
| 5120 | {"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 }, |
| 5121 | {"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I }, |
| 5122 | {"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII }, |
| 5123 | {"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II }, |
| 5124 | {"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 }, |
| 5125 | {"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II }, |
| 5126 | {"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 }, |
| 5127 | {"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII }, |
| 5128 | {"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII }, |
| 5129 | {"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II }, |
| 5130 | {"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 }, |
| 5131 | {"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II }, |
| 5132 | {"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 }, |
| 5133 | {"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II }, |
| 5134 | {"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 }, |
| 5135 | {"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 }, |
| 5136 | {"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II }, |
| 5137 | {"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III }, |
| 5138 | {"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII }, |
| 5139 | {"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII }, |
| 5140 | {"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II }, |
| 5141 | {"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 }, |
| 5142 | {"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II }, |
| 5143 | {"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 }, |
| 5144 | {"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II }, |
| 5145 | {"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 }, |
| 5146 | {"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II }, |
| 5147 | {"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 }, |
| 5148 | {"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II }, |
| 5149 | {"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 }, |
| 5150 | {"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II }, |
| 5151 | {"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 }, |
| 5152 | {"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI }, |
| 5153 | {"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 }, |
| 5154 | {"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI }, |
| 5155 | {"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II }, |
| 5156 | {"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII }, |
| 5157 | {"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array }, |
Jesse Hall | d877efe | 2013-04-29 15:59:35 -0700 | [diff] [blame] | 5158 | {"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer }, |
Jesse Hall | d830e74 | 2013-03-29 11:02:35 -0700 | [diff] [blame] | 5159 | {"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II }, |
| 5160 | {"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 }, |
| 5161 | {"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 }, |
| 5162 | {"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II }, |
| 5163 | {"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 }, |
| 5164 | {"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI }, |
| 5165 | {"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 }, |
| 5166 | {"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II }, |
| 5167 | {"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III }, |
| 5168 | {"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII }, |
| 5169 | {"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I }, |
| 5170 | {"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII }, |
| 5171 | {"glFenceSync", "(II)J", (void *) android_glFenceSync__II }, |
| 5172 | {"glIsSync", "(J)Z", (void *) android_glIsSync__J }, |
| 5173 | {"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J }, |
| 5174 | {"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ }, |
| 5175 | {"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ }, |
| 5176 | {"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI }, |
| 5177 | {"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 }, |
| 5178 | {"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II }, |
| 5179 | {"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 5180 | {"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI }, |
| 5181 | {"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 }, |
| 5182 | {"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI }, |
| 5183 | {"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 }, |
| 5184 | {"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II }, |
| 5185 | {"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 }, |
| 5186 | {"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II }, |
| 5187 | {"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 }, |
| 5188 | {"glIsSampler", "(I)Z", (void *) android_glIsSampler__I }, |
| 5189 | {"glBindSampler", "(II)V", (void *) android_glBindSampler__II }, |
| 5190 | {"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III }, |
| 5191 | {"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II }, |
| 5192 | {"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 }, |
| 5193 | {"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF }, |
| 5194 | {"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI }, |
| 5195 | {"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 5196 | {"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II }, |
| 5197 | {"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 }, |
| 5198 | {"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI }, |
| 5199 | {"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 5200 | {"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II }, |
| 5201 | {"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II }, |
| 5202 | {"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II }, |
| 5203 | {"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 }, |
| 5204 | {"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II }, |
| 5205 | {"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 }, |
| 5206 | {"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I }, |
| 5207 | {"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ }, |
| 5208 | {"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ }, |
| 5209 | {"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 }, |
| 5210 | {"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 }, |
| 5211 | {"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I }, |
| 5212 | {"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III }, |
| 5213 | {"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II }, |
| 5214 | {"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 }, |
| 5215 | {"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII }, |
| 5216 | {"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII }, |
| 5217 | {"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII }, |
| 5218 | {"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII }, |
| 5219 | {"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II }, |
| 5220 | {"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 }, |
| 5221 | }; |
| 5222 | |
| 5223 | int register_android_opengl_jni_GLES30(JNIEnv *_env) |
| 5224 | { |
| 5225 | int err; |
| 5226 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 5227 | return err; |
| 5228 | } |