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