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