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