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