Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2009, The Android Open Source Project |
| 4 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 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 |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 8 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 10 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 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 |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | // This source file is automatically generated |
| 19 | |
Andreas Gampe | bfe6333 | 2014-11-12 14:12:45 -0800 | [diff] [blame] | 20 | #pragma GCC diagnostic ignored "-Wunused-variable" |
| 21 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable" |
| 22 | #pragma GCC diagnostic ignored "-Wunused-function" |
| 23 | |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 24 | #include <GLES/gl.h> |
| 25 | #include <GLES/glext.h> |
| 26 | |
Jesse Hall | 9626f82 | 2014-05-19 20:57:49 -0700 | [diff] [blame] | 27 | #include <jni.h> |
Steven Moreland | 2279b25 | 2017-07-19 09:50:45 -0700 | [diff] [blame] | 28 | #include <nativehelper/JNIHelp.h> |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 29 | #include <android_runtime/AndroidRuntime.h> |
| 30 | #include <utils/misc.h> |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 31 | #include <assert.h> |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 32 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 33 | static int initialized = 0; |
| 34 | |
| 35 | static jclass nioAccessClass; |
| 36 | static jclass bufferClass; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 37 | static jmethodID getBasePointerID; |
| 38 | static jmethodID getBaseArrayID; |
| 39 | static jmethodID getBaseArrayOffsetID; |
| 40 | static jfieldID positionID; |
| 41 | static jfieldID limitID; |
| 42 | static jfieldID elementSizeShiftID; |
| 43 | |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 44 | |
| 45 | /* special calls implemented in Android's GLES wrapper used to more |
| 46 | * efficiently bound-check passed arrays */ |
| 47 | extern "C" { |
| 48 | #ifdef GL_VERSION_ES_CM_1_1 |
| 49 | GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, |
| 50 | const GLvoid *ptr, GLsizei count); |
| 51 | GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, |
| 52 | const GLvoid *pointer, GLsizei count); |
| 53 | GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, |
| 54 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 55 | GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, |
| 56 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 57 | GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, |
| 58 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 59 | GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, |
| 60 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 61 | GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, |
| 62 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 63 | #endif |
| 64 | #ifdef GL_ES_VERSION_2_0 |
| 65 | static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, |
| 66 | GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) { |
| 67 | glVertexAttribPointer(indx, size, type, normalized, stride, pointer); |
| 68 | } |
| 69 | #endif |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 70 | #ifdef GL_ES_VERSION_3_0 |
| 71 | static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type, |
| 72 | GLsizei stride, const GLvoid *pointer, GLsizei count) { |
| 73 | glVertexAttribIPointer(indx, size, type, stride, pointer); |
| 74 | } |
| 75 | #endif |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 76 | } |
| 77 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 78 | /* Cache method IDs each time the class is loaded. */ |
| 79 | |
| 80 | static void |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 81 | nativeClassInit(JNIEnv *_env, jclass glImplClass) |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 82 | { |
| 83 | jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); |
| 84 | nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); |
| 85 | |
| 86 | jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); |
| 87 | bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); |
| 88 | |
| 89 | getBasePointerID = _env->GetStaticMethodID(nioAccessClass, |
| 90 | "getBasePointer", "(Ljava/nio/Buffer;)J"); |
| 91 | getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, |
| 92 | "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); |
| 93 | getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, |
| 94 | "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); |
| 95 | |
| 96 | positionID = _env->GetFieldID(bufferClass, "position", "I"); |
| 97 | limitID = _env->GetFieldID(bufferClass, "limit", "I"); |
| 98 | elementSizeShiftID = |
| 99 | _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); |
| 100 | } |
| 101 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 102 | static void * |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 103 | getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 104 | { |
| 105 | jint position; |
| 106 | jint limit; |
| 107 | jint elementSizeShift; |
| 108 | jlong pointer; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 109 | |
| 110 | position = _env->GetIntField(buffer, positionID); |
| 111 | limit = _env->GetIntField(buffer, limitID); |
| 112 | elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 113 | *remaining = (limit - position) << elementSizeShift; |
| 114 | pointer = _env->CallStaticLongMethod(nioAccessClass, |
| 115 | getBasePointerID, buffer); |
| 116 | if (pointer != 0L) { |
| 117 | *array = NULL; |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 118 | return reinterpret_cast<void*>(pointer); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 119 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 120 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 121 | *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, |
| 122 | getBaseArrayID, buffer); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 123 | *offset = _env->CallStaticIntMethod(nioAccessClass, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 124 | getBaseArrayOffsetID, buffer); |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 125 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 126 | return NULL; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 127 | } |
| 128 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 129 | class ByteArrayGetter { |
| 130 | public: |
| 131 | static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { |
| 132 | return _env->GetByteArrayElements(array, is_copy); |
| 133 | } |
| 134 | }; |
| 135 | class BooleanArrayGetter { |
| 136 | public: |
| 137 | static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { |
| 138 | return _env->GetBooleanArrayElements(array, is_copy); |
| 139 | } |
| 140 | }; |
| 141 | class CharArrayGetter { |
| 142 | public: |
| 143 | static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { |
| 144 | return _env->GetCharArrayElements(array, is_copy); |
| 145 | } |
| 146 | }; |
| 147 | class ShortArrayGetter { |
| 148 | public: |
| 149 | static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { |
| 150 | return _env->GetShortArrayElements(array, is_copy); |
| 151 | } |
| 152 | }; |
| 153 | class IntArrayGetter { |
| 154 | public: |
| 155 | static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) { |
| 156 | return _env->GetIntArrayElements(array, is_copy); |
| 157 | } |
| 158 | }; |
| 159 | class LongArrayGetter { |
| 160 | public: |
| 161 | static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) { |
| 162 | return _env->GetLongArrayElements(array, is_copy); |
| 163 | } |
| 164 | }; |
| 165 | class FloatArrayGetter { |
| 166 | public: |
| 167 | static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) { |
| 168 | return _env->GetFloatArrayElements(array, is_copy); |
| 169 | } |
| 170 | }; |
| 171 | class DoubleArrayGetter { |
| 172 | public: |
| 173 | static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) { |
| 174 | return _env->GetDoubleArrayElements(array, is_copy); |
| 175 | } |
| 176 | }; |
| 177 | |
| 178 | template<typename JTYPEARRAY, typename ARRAYGETTER> |
| 179 | static void* |
| 180 | getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) { |
| 181 | return ARRAYGETTER::Get(_env, array, is_copy); |
| 182 | } |
| 183 | |
| 184 | class ByteArrayReleaser { |
| 185 | public: |
| 186 | static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) { |
| 187 | _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 188 | } |
| 189 | }; |
| 190 | class BooleanArrayReleaser { |
| 191 | public: |
| 192 | static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) { |
| 193 | _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 194 | } |
| 195 | }; |
| 196 | class CharArrayReleaser { |
| 197 | public: |
| 198 | static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) { |
| 199 | _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 200 | } |
| 201 | }; |
| 202 | class ShortArrayReleaser { |
| 203 | public: |
| 204 | static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) { |
| 205 | _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 206 | } |
| 207 | }; |
| 208 | class IntArrayReleaser { |
| 209 | public: |
| 210 | static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) { |
| 211 | _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 212 | } |
| 213 | }; |
| 214 | class LongArrayReleaser { |
| 215 | public: |
| 216 | static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) { |
| 217 | _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 218 | } |
| 219 | }; |
| 220 | class FloatArrayReleaser { |
| 221 | public: |
| 222 | static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) { |
| 223 | _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 224 | } |
| 225 | }; |
| 226 | class DoubleArrayReleaser { |
| 227 | public: |
| 228 | static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) { |
| 229 | _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT); |
| 230 | } |
| 231 | }; |
| 232 | |
| 233 | template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER> |
| 234 | static void |
| 235 | releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) { |
| 236 | ARRAYRELEASER::Release(_env, array, data, commit); |
| 237 | } |
| 238 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 239 | static void |
| 240 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 241 | { |
| 242 | _env->ReleasePrimitiveArrayCritical(array, data, |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 243 | commit ? 0 : JNI_ABORT); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 244 | } |
| 245 | |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 246 | static void * |
| 247 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
| 248 | char* buf = (char*) _env->GetDirectBufferAddress(buffer); |
| 249 | if (buf) { |
| 250 | jint position = _env->GetIntField(buffer, positionID); |
| 251 | jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 252 | buf += position << elementSizeShift; |
| 253 | } else { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 254 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 255 | "Must use a native order direct Buffer"); |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 256 | } |
| 257 | return (void*) buf; |
| 258 | } |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 259 | |
| 260 | // -------------------------------------------------------------------------- |
| 261 | |
| 262 | /* |
| 263 | * returns the number of values glGet returns for a given pname. |
| 264 | * |
| 265 | * The code below is written such that pnames requiring only one values |
| 266 | * are the default (and are not explicitely tested for). This makes the |
| 267 | * checking code much shorter/readable/efficient. |
| 268 | * |
| 269 | * This means that unknown pnames (e.g.: extensions) will default to 1. If |
| 270 | * that unknown pname needs more than 1 value, then the validation check |
| 271 | * is incomplete and the app may crash if it passed the wrong number params. |
| 272 | */ |
| 273 | static int getNeededCount(GLint pname) { |
| 274 | int needed = 1; |
Romain Guy | dc43a6c | 2017-02-17 19:54:25 -0800 | [diff] [blame] | 275 | #ifdef GL_ES_VERSION_3_0 |
| 276 | // GLES 3.x pnames |
| 277 | switch (pname) { |
| 278 | case GL_MAX_VIEWPORT_DIMS: |
| 279 | needed = 2; |
| 280 | break; |
| 281 | |
| 282 | case GL_PROGRAM_BINARY_FORMATS: |
| 283 | glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed); |
| 284 | break; |
| 285 | } |
| 286 | #endif |
| 287 | |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 288 | #ifdef GL_ES_VERSION_2_0 |
| 289 | // GLES 2.x pnames |
| 290 | switch (pname) { |
| 291 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 292 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 293 | needed = 2; |
| 294 | break; |
| 295 | |
| 296 | case GL_BLEND_COLOR: |
| 297 | case GL_COLOR_CLEAR_VALUE: |
| 298 | case GL_COLOR_WRITEMASK: |
| 299 | case GL_SCISSOR_BOX: |
| 300 | case GL_VIEWPORT: |
| 301 | needed = 4; |
| 302 | break; |
| 303 | |
| 304 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 305 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); |
| 306 | break; |
| 307 | |
| 308 | case GL_SHADER_BINARY_FORMATS: |
| 309 | glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); |
| 310 | break; |
| 311 | } |
| 312 | #endif |
| 313 | |
| 314 | #ifdef GL_VERSION_ES_CM_1_1 |
| 315 | // GLES 1.x pnames |
| 316 | switch (pname) { |
| 317 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 318 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 319 | case GL_DEPTH_RANGE: |
| 320 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 321 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 322 | needed = 2; |
| 323 | break; |
| 324 | |
| 325 | case GL_CURRENT_NORMAL: |
| 326 | case GL_POINT_DISTANCE_ATTENUATION: |
| 327 | needed = 3; |
| 328 | break; |
| 329 | |
| 330 | case GL_COLOR_CLEAR_VALUE: |
| 331 | case GL_COLOR_WRITEMASK: |
| 332 | case GL_CURRENT_COLOR: |
| 333 | case GL_CURRENT_TEXTURE_COORDS: |
| 334 | case GL_FOG_COLOR: |
| 335 | case GL_LIGHT_MODEL_AMBIENT: |
| 336 | case GL_SCISSOR_BOX: |
| 337 | case GL_VIEWPORT: |
| 338 | needed = 4; |
| 339 | break; |
| 340 | |
| 341 | case GL_MODELVIEW_MATRIX: |
| 342 | case GL_PROJECTION_MATRIX: |
| 343 | case GL_TEXTURE_MATRIX: |
| 344 | needed = 16; |
| 345 | break; |
| 346 | |
| 347 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 348 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); |
| 349 | break; |
| 350 | } |
| 351 | #endif |
| 352 | return needed; |
| 353 | } |
| 354 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 355 | template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, |
| 356 | typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)> |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 357 | static void |
| 358 | get |
| 359 | (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { |
| 360 | jint _exception = 0; |
| 361 | const char * _exceptionType; |
| 362 | const char * _exceptionMessage; |
| 363 | CTYPE *params_base = (CTYPE *) 0; |
| 364 | jint _remaining; |
| 365 | CTYPE *params = (CTYPE *) 0; |
| 366 | int _needed = 0; |
| 367 | |
| 368 | if (!params_ref) { |
| 369 | _exception = 1; |
| 370 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 371 | _exceptionMessage = "params == null"; |
| 372 | goto exit; |
| 373 | } |
| 374 | if (offset < 0) { |
| 375 | _exception = 1; |
| 376 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 377 | _exceptionMessage = "offset < 0"; |
| 378 | goto exit; |
| 379 | } |
| 380 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 381 | _needed = getNeededCount(pname); |
| 382 | // if we didn't find this pname, we just assume the user passed |
| 383 | // an array of the right size -- this might happen with extensions |
| 384 | // or if we forget an enum here. |
| 385 | if (_remaining < _needed) { |
| 386 | _exception = 1; |
| 387 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 388 | _exceptionMessage = "length - offset < needed"; |
| 389 | goto exit; |
| 390 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 391 | params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( |
| 392 | _env, params_ref, (jboolean *)0); |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 393 | params = params_base + offset; |
| 394 | |
| 395 | GET( |
| 396 | (GLenum)pname, |
| 397 | (CTYPE *)params |
| 398 | ); |
| 399 | |
| 400 | exit: |
| 401 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 402 | releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( |
| 403 | _env, params_ref, params_base, !_exception); |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 404 | } |
| 405 | if (_exception) { |
| 406 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 411 | template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, |
| 412 | typename ARRAYRELEASER, void GET(GLenum, CTYPE*)> |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 413 | static void |
| 414 | getarray |
| 415 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 416 | jint _exception = 0; |
| 417 | const char * _exceptionType; |
| 418 | const char * _exceptionMessage; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 419 | JTYPEARRAY _array = (JTYPEARRAY) 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 420 | jint _bufferOffset = (jint) 0; |
| 421 | jint _remaining; |
| 422 | CTYPE *params = (CTYPE *) 0; |
| 423 | int _needed = 0; |
| 424 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 425 | params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 426 | _remaining /= sizeof(CTYPE); // convert from bytes to item count |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 427 | _needed = getNeededCount(pname); |
| 428 | // if we didn't find this pname, we just assume the user passed |
| 429 | // an array of the right size -- this might happen with extensions |
| 430 | // or if we forget an enum here. |
| 431 | if (_needed>0 && _remaining < _needed) { |
| 432 | _exception = 1; |
| 433 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 434 | _exceptionMessage = "remaining() < needed"; |
| 435 | goto exit; |
| 436 | } |
| 437 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 438 | char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( |
| 439 | _env, _array, (jboolean *) 0); |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 440 | params = (CTYPE *) (_paramsBase + _bufferOffset); |
| 441 | } |
| 442 | GET( |
| 443 | (GLenum)pname, |
| 444 | (CTYPE *)params |
| 445 | ); |
| 446 | |
| 447 | exit: |
| 448 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 449 | releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( |
| 450 | _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE); |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 451 | } |
| 452 | if (_exception) { |
| 453 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 454 | } |
| 455 | } |
| 456 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 457 | // -------------------------------------------------------------------------- |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 458 | /* void glBlendEquationSeparateOES ( GLenum modeRGB, GLenum modeAlpha ) */ |
| 459 | static void |
| 460 | android_glBlendEquationSeparateOES__II |
| 461 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 462 | glBlendEquationSeparateOES( |
| 463 | (GLenum)modeRGB, |
| 464 | (GLenum)modeAlpha |
| 465 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | /* void glBlendFuncSeparateOES ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */ |
| 469 | static void |
| 470 | android_glBlendFuncSeparateOES__IIII |
| 471 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 472 | glBlendFuncSeparateOES( |
| 473 | (GLenum)srcRGB, |
| 474 | (GLenum)dstRGB, |
| 475 | (GLenum)srcAlpha, |
| 476 | (GLenum)dstAlpha |
| 477 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 478 | } |
| 479 | |
| 480 | /* void glBlendEquationOES ( GLenum mode ) */ |
| 481 | static void |
| 482 | android_glBlendEquationOES__I |
| 483 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 484 | glBlendEquationOES( |
| 485 | (GLenum)mode |
| 486 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | /* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */ |
| 490 | static void |
| 491 | android_glDrawTexsOES__SSSSS |
| 492 | (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) { |
| 493 | glDrawTexsOES( |
| 494 | (GLshort)x, |
| 495 | (GLshort)y, |
| 496 | (GLshort)z, |
| 497 | (GLshort)width, |
| 498 | (GLshort)height |
| 499 | ); |
| 500 | } |
| 501 | |
| 502 | /* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */ |
| 503 | static void |
| 504 | android_glDrawTexiOES__IIIII |
| 505 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 506 | glDrawTexiOES( |
| 507 | (GLint)x, |
| 508 | (GLint)y, |
| 509 | (GLint)z, |
| 510 | (GLint)width, |
| 511 | (GLint)height |
| 512 | ); |
| 513 | } |
| 514 | |
| 515 | /* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */ |
| 516 | static void |
| 517 | android_glDrawTexxOES__IIIII |
| 518 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 519 | glDrawTexxOES( |
| 520 | (GLfixed)x, |
| 521 | (GLfixed)y, |
| 522 | (GLfixed)z, |
| 523 | (GLfixed)width, |
| 524 | (GLfixed)height |
| 525 | ); |
| 526 | } |
| 527 | |
| 528 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 529 | static void |
| 530 | android_glDrawTexsvOES___3SI |
| 531 | (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 532 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 533 | const char * _exceptionType = NULL; |
| 534 | const char * _exceptionMessage = NULL; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 535 | GLshort *coords_base = (GLshort *) 0; |
| 536 | jint _remaining; |
| 537 | GLshort *coords = (GLshort *) 0; |
| 538 | |
| 539 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 540 | _exception = 1; |
| 541 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 542 | _exceptionMessage = "coords == null"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 543 | goto exit; |
| 544 | } |
| 545 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 546 | _exception = 1; |
| 547 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 548 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 549 | goto exit; |
| 550 | } |
| 551 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 552 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 553 | _exception = 1; |
| 554 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 555 | _exceptionMessage = "length - offset < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 556 | goto exit; |
| 557 | } |
| 558 | coords_base = (GLshort *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 559 | _env->GetShortArrayElements(coords_ref, (jboolean *)0); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 560 | coords = coords_base + offset; |
| 561 | |
| 562 | glDrawTexsvOES( |
| 563 | (GLshort *)coords |
| 564 | ); |
| 565 | |
| 566 | exit: |
| 567 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 568 | _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 569 | JNI_ABORT); |
| 570 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 571 | if (_exception) { |
| 572 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 573 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 574 | } |
| 575 | |
| 576 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 577 | static void |
| 578 | android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 |
| 579 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 580 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 581 | const char * _exceptionType = NULL; |
| 582 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 583 | jshortArray _array = (jshortArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 584 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 585 | jint _remaining; |
| 586 | GLshort *coords = (GLshort *) 0; |
| 587 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 588 | if (!coords_buf) { |
| 589 | _exception = 1; |
| 590 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 591 | _exceptionMessage = "coords == null"; |
| 592 | goto exit; |
| 593 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 594 | coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 595 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 596 | _exception = 1; |
| 597 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 598 | _exceptionMessage = "remaining() < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 599 | goto exit; |
| 600 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 601 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 602 | char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 603 | coords = (GLshort *) (_coordsBase + _bufferOffset); |
| 604 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 605 | glDrawTexsvOES( |
| 606 | (GLshort *)coords |
| 607 | ); |
| 608 | |
| 609 | exit: |
| 610 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 611 | _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 612 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 613 | if (_exception) { |
| 614 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 615 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 616 | } |
| 617 | |
| 618 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 619 | static void |
| 620 | android_glDrawTexivOES___3II |
| 621 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 622 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 623 | const char * _exceptionType = NULL; |
| 624 | const char * _exceptionMessage = NULL; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 625 | GLint *coords_base = (GLint *) 0; |
| 626 | jint _remaining; |
| 627 | GLint *coords = (GLint *) 0; |
| 628 | |
| 629 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 630 | _exception = 1; |
| 631 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 632 | _exceptionMessage = "coords == null"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 633 | goto exit; |
| 634 | } |
| 635 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 636 | _exception = 1; |
| 637 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 638 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 639 | goto exit; |
| 640 | } |
| 641 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 642 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 643 | _exception = 1; |
| 644 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 645 | _exceptionMessage = "length - offset < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 646 | goto exit; |
| 647 | } |
| 648 | coords_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 649 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 650 | coords = coords_base + offset; |
| 651 | |
| 652 | glDrawTexivOES( |
| 653 | (GLint *)coords |
| 654 | ); |
| 655 | |
| 656 | exit: |
| 657 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 658 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 659 | JNI_ABORT); |
| 660 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 661 | if (_exception) { |
| 662 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 663 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 664 | } |
| 665 | |
| 666 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 667 | static void |
| 668 | android_glDrawTexivOES__Ljava_nio_IntBuffer_2 |
| 669 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 670 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 671 | const char * _exceptionType = NULL; |
| 672 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 673 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 674 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 675 | jint _remaining; |
| 676 | GLint *coords = (GLint *) 0; |
| 677 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 678 | if (!coords_buf) { |
| 679 | _exception = 1; |
| 680 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 681 | _exceptionMessage = "coords == null"; |
| 682 | goto exit; |
| 683 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 684 | coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 685 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 686 | _exception = 1; |
| 687 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 688 | _exceptionMessage = "remaining() < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 689 | goto exit; |
| 690 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 691 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 692 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 693 | coords = (GLint *) (_coordsBase + _bufferOffset); |
| 694 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 695 | glDrawTexivOES( |
| 696 | (GLint *)coords |
| 697 | ); |
| 698 | |
| 699 | exit: |
| 700 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 701 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 702 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 703 | if (_exception) { |
| 704 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 705 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 706 | } |
| 707 | |
| 708 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 709 | static void |
| 710 | android_glDrawTexxvOES___3II |
| 711 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 712 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 713 | const char * _exceptionType = NULL; |
| 714 | const char * _exceptionMessage = NULL; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 715 | GLfixed *coords_base = (GLfixed *) 0; |
| 716 | jint _remaining; |
| 717 | GLfixed *coords = (GLfixed *) 0; |
| 718 | |
| 719 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 720 | _exception = 1; |
| 721 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 722 | _exceptionMessage = "coords == null"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 723 | goto exit; |
| 724 | } |
| 725 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 726 | _exception = 1; |
| 727 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 728 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 729 | goto exit; |
| 730 | } |
| 731 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 732 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 733 | _exception = 1; |
| 734 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 735 | _exceptionMessage = "length - offset < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 736 | goto exit; |
| 737 | } |
| 738 | coords_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 739 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 740 | coords = coords_base + offset; |
| 741 | |
| 742 | glDrawTexxvOES( |
| 743 | (GLfixed *)coords |
| 744 | ); |
| 745 | |
| 746 | exit: |
| 747 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 748 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 749 | JNI_ABORT); |
| 750 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 751 | if (_exception) { |
| 752 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 753 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 754 | } |
| 755 | |
| 756 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 757 | static void |
| 758 | android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 |
| 759 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 760 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 761 | const char * _exceptionType = NULL; |
| 762 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 763 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 764 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 765 | jint _remaining; |
| 766 | GLfixed *coords = (GLfixed *) 0; |
| 767 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 768 | if (!coords_buf) { |
| 769 | _exception = 1; |
| 770 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 771 | _exceptionMessage = "coords == null"; |
| 772 | goto exit; |
| 773 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 774 | coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 775 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 776 | _exception = 1; |
| 777 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 778 | _exceptionMessage = "remaining() < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 779 | goto exit; |
| 780 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 781 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 782 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 783 | coords = (GLfixed *) (_coordsBase + _bufferOffset); |
| 784 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 785 | glDrawTexxvOES( |
| 786 | (GLfixed *)coords |
| 787 | ); |
| 788 | |
| 789 | exit: |
| 790 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 791 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 792 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 793 | if (_exception) { |
| 794 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 795 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 796 | } |
| 797 | |
| 798 | /* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */ |
| 799 | static void |
| 800 | android_glDrawTexfOES__FFFFF |
| 801 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) { |
| 802 | glDrawTexfOES( |
| 803 | (GLfloat)x, |
| 804 | (GLfloat)y, |
| 805 | (GLfloat)z, |
| 806 | (GLfloat)width, |
| 807 | (GLfloat)height |
| 808 | ); |
| 809 | } |
| 810 | |
| 811 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 812 | static void |
| 813 | android_glDrawTexfvOES___3FI |
| 814 | (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 815 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 816 | const char * _exceptionType = NULL; |
| 817 | const char * _exceptionMessage = NULL; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 818 | GLfloat *coords_base = (GLfloat *) 0; |
| 819 | jint _remaining; |
| 820 | GLfloat *coords = (GLfloat *) 0; |
| 821 | |
| 822 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 823 | _exception = 1; |
| 824 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 825 | _exceptionMessage = "coords == null"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 826 | goto exit; |
| 827 | } |
| 828 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 829 | _exception = 1; |
| 830 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 831 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 832 | goto exit; |
| 833 | } |
| 834 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 835 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 836 | _exception = 1; |
| 837 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 838 | _exceptionMessage = "length - offset < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 839 | goto exit; |
| 840 | } |
| 841 | coords_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 842 | _env->GetFloatArrayElements(coords_ref, (jboolean *)0); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 843 | coords = coords_base + offset; |
| 844 | |
| 845 | glDrawTexfvOES( |
| 846 | (GLfloat *)coords |
| 847 | ); |
| 848 | |
| 849 | exit: |
| 850 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 851 | _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 852 | JNI_ABORT); |
| 853 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 854 | if (_exception) { |
| 855 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 856 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 857 | } |
| 858 | |
| 859 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 860 | static void |
| 861 | android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 |
| 862 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 863 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 864 | const char * _exceptionType = NULL; |
| 865 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 866 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 867 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 868 | jint _remaining; |
| 869 | GLfloat *coords = (GLfloat *) 0; |
| 870 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 871 | if (!coords_buf) { |
| 872 | _exception = 1; |
| 873 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 874 | _exceptionMessage = "coords == null"; |
| 875 | goto exit; |
| 876 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 877 | coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 878 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 879 | _exception = 1; |
| 880 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 881 | _exceptionMessage = "remaining() < 5 < needed"; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 882 | goto exit; |
| 883 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 884 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 885 | char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 886 | coords = (GLfloat *) (_coordsBase + _bufferOffset); |
| 887 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 888 | glDrawTexfvOES( |
| 889 | (GLfloat *)coords |
| 890 | ); |
| 891 | |
| 892 | exit: |
| 893 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 894 | _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 895 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 896 | if (_exception) { |
| 897 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 898 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 899 | } |
| 900 | |
| 901 | /* void glEGLImageTargetTexture2DOES ( GLenum target, GLeglImageOES image ) */ |
| 902 | static void |
| 903 | android_glEGLImageTargetTexture2DOES__ILjava_nio_Buffer_2 |
| 904 | (JNIEnv *_env, jobject _this, jint target, jobject image_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 905 | jint _exception = 0; |
| 906 | const char * _exceptionType = NULL; |
| 907 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 908 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 909 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 910 | jint _remaining; |
| 911 | GLeglImageOES image = (GLeglImageOES) 0; |
| 912 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 913 | if (!image_buf) { |
| 914 | _exception = 1; |
| 915 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 916 | _exceptionMessage = "image == null"; |
| 917 | goto exit; |
| 918 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 919 | image = (GLeglImageOES)getPointer(_env, image_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 920 | if (image == NULL) { |
| 921 | char * _imageBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 922 | image = (GLeglImageOES) (_imageBase + _bufferOffset); |
| 923 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 924 | glEGLImageTargetTexture2DOES( |
| 925 | (GLenum)target, |
| 926 | (GLeglImageOES)image |
| 927 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 928 | |
| 929 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 930 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 931 | releasePointer(_env, _array, image, _exception ? JNI_FALSE : JNI_TRUE); |
| 932 | } |
| 933 | if (_exception) { |
| 934 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 935 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 936 | } |
| 937 | |
| 938 | /* void glEGLImageTargetRenderbufferStorageOES ( GLenum target, GLeglImageOES image ) */ |
| 939 | static void |
| 940 | android_glEGLImageTargetRenderbufferStorageOES__ILjava_nio_Buffer_2 |
| 941 | (JNIEnv *_env, jobject _this, jint target, jobject image_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 942 | jint _exception = 0; |
| 943 | const char * _exceptionType = NULL; |
| 944 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 945 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 946 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 947 | jint _remaining; |
| 948 | GLeglImageOES image = (GLeglImageOES) 0; |
| 949 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 950 | if (!image_buf) { |
| 951 | _exception = 1; |
| 952 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 953 | _exceptionMessage = "image == null"; |
| 954 | goto exit; |
| 955 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 956 | image = (GLeglImageOES)getPointer(_env, image_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 957 | if (image == NULL) { |
| 958 | char * _imageBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 959 | image = (GLeglImageOES) (_imageBase + _bufferOffset); |
| 960 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 961 | glEGLImageTargetRenderbufferStorageOES( |
| 962 | (GLenum)target, |
| 963 | (GLeglImageOES)image |
| 964 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 965 | |
| 966 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 967 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 968 | releasePointer(_env, _array, image, _exception ? JNI_FALSE : JNI_TRUE); |
| 969 | } |
| 970 | if (_exception) { |
| 971 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 972 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 973 | } |
| 974 | |
| 975 | /* void glAlphaFuncxOES ( GLenum func, GLclampx ref ) */ |
| 976 | static void |
| 977 | android_glAlphaFuncxOES__II |
| 978 | (JNIEnv *_env, jobject _this, jint func, jint ref) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 979 | glAlphaFuncxOES( |
| 980 | (GLenum)func, |
| 981 | (GLclampx)ref |
| 982 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 983 | } |
| 984 | |
| 985 | /* void glClearColorxOES ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */ |
| 986 | static void |
| 987 | android_glClearColorxOES__IIII |
| 988 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 989 | glClearColorxOES( |
| 990 | (GLclampx)red, |
| 991 | (GLclampx)green, |
| 992 | (GLclampx)blue, |
| 993 | (GLclampx)alpha |
| 994 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 995 | } |
| 996 | |
| 997 | /* void glClearDepthxOES ( GLclampx depth ) */ |
| 998 | static void |
| 999 | android_glClearDepthxOES__I |
| 1000 | (JNIEnv *_env, jobject _this, jint depth) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1001 | glClearDepthxOES( |
| 1002 | (GLclampx)depth |
| 1003 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1004 | } |
| 1005 | |
| 1006 | /* void glClipPlanexOES ( GLenum plane, const GLfixed *equation ) */ |
| 1007 | static void |
| 1008 | android_glClipPlanexOES__I_3II |
| 1009 | (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1010 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1011 | const char * _exceptionType = NULL; |
| 1012 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1013 | GLfixed *equation_base = (GLfixed *) 0; |
| 1014 | jint _remaining; |
| 1015 | GLfixed *equation = (GLfixed *) 0; |
| 1016 | |
| 1017 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1018 | _exception = 1; |
| 1019 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1020 | _exceptionMessage = "equation == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1021 | goto exit; |
| 1022 | } |
| 1023 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1024 | _exception = 1; |
| 1025 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1026 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1027 | goto exit; |
| 1028 | } |
| 1029 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 1030 | equation_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1031 | _env->GetIntArrayElements(equation_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1032 | equation = equation_base + offset; |
| 1033 | |
| 1034 | glClipPlanexOES( |
| 1035 | (GLenum)plane, |
| 1036 | (GLfixed *)equation |
| 1037 | ); |
| 1038 | |
| 1039 | exit: |
| 1040 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1041 | _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1042 | JNI_ABORT); |
| 1043 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1044 | if (_exception) { |
| 1045 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1046 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1047 | } |
| 1048 | |
| 1049 | /* void glClipPlanexOES ( GLenum plane, const GLfixed *equation ) */ |
| 1050 | static void |
| 1051 | android_glClipPlanexOES__ILjava_nio_IntBuffer_2 |
| 1052 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1053 | jint _exception = 0; |
| 1054 | const char * _exceptionType = NULL; |
| 1055 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1056 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1057 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1058 | jint _remaining; |
| 1059 | GLfixed *equation = (GLfixed *) 0; |
| 1060 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1061 | if (!equation_buf) { |
| 1062 | _exception = 1; |
| 1063 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1064 | _exceptionMessage = "equation == null"; |
| 1065 | goto exit; |
| 1066 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1067 | equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1068 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1069 | char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1070 | equation = (GLfixed *) (_equationBase + _bufferOffset); |
| 1071 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1072 | glClipPlanexOES( |
| 1073 | (GLenum)plane, |
| 1074 | (GLfixed *)equation |
| 1075 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1076 | |
| 1077 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1078 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1079 | _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1080 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1081 | if (_exception) { |
| 1082 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1083 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1084 | } |
| 1085 | |
| 1086 | /* void glColor4xOES ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */ |
| 1087 | static void |
| 1088 | android_glColor4xOES__IIII |
| 1089 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1090 | glColor4xOES( |
| 1091 | (GLfixed)red, |
| 1092 | (GLfixed)green, |
| 1093 | (GLfixed)blue, |
| 1094 | (GLfixed)alpha |
| 1095 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1096 | } |
| 1097 | |
| 1098 | /* void glDepthRangexOES ( GLclampx zNear, GLclampx zFar ) */ |
| 1099 | static void |
| 1100 | android_glDepthRangexOES__II |
| 1101 | (JNIEnv *_env, jobject _this, jint zNear, jint zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1102 | glDepthRangexOES( |
| 1103 | (GLclampx)zNear, |
| 1104 | (GLclampx)zFar |
| 1105 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1106 | } |
| 1107 | |
| 1108 | /* void glFogxOES ( GLenum pname, GLfixed param ) */ |
| 1109 | static void |
| 1110 | android_glFogxOES__II |
| 1111 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1112 | glFogxOES( |
| 1113 | (GLenum)pname, |
| 1114 | (GLfixed)param |
| 1115 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1116 | } |
| 1117 | |
| 1118 | /* void glFogxvOES ( GLenum pname, const GLfixed *params ) */ |
| 1119 | static void |
| 1120 | android_glFogxvOES__I_3II |
| 1121 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1122 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1123 | const char * _exceptionType = NULL; |
| 1124 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1125 | GLfixed *params_base = (GLfixed *) 0; |
| 1126 | jint _remaining; |
| 1127 | GLfixed *params = (GLfixed *) 0; |
| 1128 | |
| 1129 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1130 | _exception = 1; |
| 1131 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1132 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1133 | goto exit; |
| 1134 | } |
| 1135 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1136 | _exception = 1; |
| 1137 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1138 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1139 | goto exit; |
| 1140 | } |
| 1141 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1142 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1143 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1144 | params = params_base + offset; |
| 1145 | |
| 1146 | glFogxvOES( |
| 1147 | (GLenum)pname, |
| 1148 | (GLfixed *)params |
| 1149 | ); |
| 1150 | |
| 1151 | exit: |
| 1152 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1153 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1154 | JNI_ABORT); |
| 1155 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1156 | if (_exception) { |
| 1157 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1158 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1159 | } |
| 1160 | |
| 1161 | /* void glFogxvOES ( GLenum pname, const GLfixed *params ) */ |
| 1162 | static void |
| 1163 | android_glFogxvOES__ILjava_nio_IntBuffer_2 |
| 1164 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1165 | jint _exception = 0; |
| 1166 | const char * _exceptionType = NULL; |
| 1167 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1168 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1169 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1170 | jint _remaining; |
| 1171 | GLfixed *params = (GLfixed *) 0; |
| 1172 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1173 | if (!params_buf) { |
| 1174 | _exception = 1; |
| 1175 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1176 | _exceptionMessage = "params == null"; |
| 1177 | goto exit; |
| 1178 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1179 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1180 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1181 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1182 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1183 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1184 | glFogxvOES( |
| 1185 | (GLenum)pname, |
| 1186 | (GLfixed *)params |
| 1187 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1188 | |
| 1189 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1190 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1191 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1192 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1193 | if (_exception) { |
| 1194 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1195 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1196 | } |
| 1197 | |
| 1198 | /* void glFrustumxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 1199 | static void |
| 1200 | android_glFrustumxOES__IIIIII |
| 1201 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1202 | glFrustumxOES( |
| 1203 | (GLfixed)left, |
| 1204 | (GLfixed)right, |
| 1205 | (GLfixed)bottom, |
| 1206 | (GLfixed)top, |
| 1207 | (GLfixed)zNear, |
| 1208 | (GLfixed)zFar |
| 1209 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | /* void glGetClipPlanexOES ( GLenum pname, GLfixed *eqn ) */ |
| 1213 | static void |
| 1214 | android_glGetClipPlanexOES__I_3II |
| 1215 | (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1216 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1217 | const char * _exceptionType = NULL; |
| 1218 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1219 | GLfixed *eqn_base = (GLfixed *) 0; |
| 1220 | jint _remaining; |
| 1221 | GLfixed *eqn = (GLfixed *) 0; |
| 1222 | |
| 1223 | if (!eqn_ref) { |
| 1224 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1225 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1226 | _exceptionMessage = "eqn == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1227 | goto exit; |
| 1228 | } |
| 1229 | if (offset < 0) { |
| 1230 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1231 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1232 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1233 | goto exit; |
| 1234 | } |
| 1235 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 1236 | if (_remaining < 4) { |
| 1237 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1238 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1239 | _exceptionMessage = "length - offset < 4 < needed"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1240 | goto exit; |
| 1241 | } |
| 1242 | eqn_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1243 | _env->GetIntArrayElements(eqn_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1244 | eqn = eqn_base + offset; |
| 1245 | |
| 1246 | glGetClipPlanexOES( |
| 1247 | (GLenum)pname, |
| 1248 | (GLfixed *)eqn |
| 1249 | ); |
| 1250 | |
| 1251 | exit: |
| 1252 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1253 | _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1254 | _exception ? JNI_ABORT: 0); |
| 1255 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1256 | if (_exception) { |
| 1257 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1258 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1259 | } |
| 1260 | |
| 1261 | /* void glGetClipPlanexOES ( GLenum pname, GLfixed *eqn ) */ |
| 1262 | static void |
| 1263 | android_glGetClipPlanexOES__ILjava_nio_IntBuffer_2 |
| 1264 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1265 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1266 | const char * _exceptionType = NULL; |
| 1267 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1268 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1269 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1270 | jint _remaining; |
| 1271 | GLfixed *eqn = (GLfixed *) 0; |
| 1272 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1273 | if (!eqn_buf) { |
| 1274 | _exception = 1; |
| 1275 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1276 | _exceptionMessage = "eqn == null"; |
| 1277 | goto exit; |
| 1278 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1279 | eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1280 | if (_remaining < 4) { |
| 1281 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1282 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1283 | _exceptionMessage = "remaining() < 4 < needed"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1284 | goto exit; |
| 1285 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1286 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1287 | char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1288 | eqn = (GLfixed *) (_eqnBase + _bufferOffset); |
| 1289 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1290 | glGetClipPlanexOES( |
| 1291 | (GLenum)pname, |
| 1292 | (GLfixed *)eqn |
| 1293 | ); |
| 1294 | |
| 1295 | exit: |
| 1296 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1297 | _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1298 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1299 | if (_exception) { |
| 1300 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1301 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1302 | } |
| 1303 | |
| 1304 | /* void glGetFixedvOES ( GLenum pname, GLfixed *params ) */ |
| 1305 | static void |
| 1306 | android_glGetFixedvOES__I_3II |
| 1307 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1308 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1309 | const char * _exceptionType = NULL; |
| 1310 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1311 | GLfixed *params_base = (GLfixed *) 0; |
| 1312 | jint _remaining; |
| 1313 | GLfixed *params = (GLfixed *) 0; |
| 1314 | |
| 1315 | if (!params_ref) { |
| 1316 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1317 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1318 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1319 | goto exit; |
| 1320 | } |
| 1321 | if (offset < 0) { |
| 1322 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1323 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1324 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1325 | goto exit; |
| 1326 | } |
| 1327 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1328 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1329 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1330 | params = params_base + offset; |
| 1331 | |
| 1332 | glGetFixedvOES( |
| 1333 | (GLenum)pname, |
| 1334 | (GLfixed *)params |
| 1335 | ); |
| 1336 | |
| 1337 | exit: |
| 1338 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1339 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1340 | _exception ? JNI_ABORT: 0); |
| 1341 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1342 | if (_exception) { |
| 1343 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1344 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1345 | } |
| 1346 | |
| 1347 | /* void glGetFixedvOES ( GLenum pname, GLfixed *params ) */ |
| 1348 | static void |
| 1349 | android_glGetFixedvOES__ILjava_nio_IntBuffer_2 |
| 1350 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1351 | jint _exception = 0; |
| 1352 | const char * _exceptionType = NULL; |
| 1353 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1354 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1355 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1356 | jint _remaining; |
| 1357 | GLfixed *params = (GLfixed *) 0; |
| 1358 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1359 | if (!params_buf) { |
| 1360 | _exception = 1; |
| 1361 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1362 | _exceptionMessage = "params == null"; |
| 1363 | goto exit; |
| 1364 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1365 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1366 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1367 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1368 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1369 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1370 | glGetFixedvOES( |
| 1371 | (GLenum)pname, |
| 1372 | (GLfixed *)params |
| 1373 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1374 | |
| 1375 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1376 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1377 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 1378 | } |
| 1379 | if (_exception) { |
| 1380 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1381 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1382 | } |
| 1383 | |
| 1384 | /* void glGetLightxvOES ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 1385 | static void |
| 1386 | android_glGetLightxvOES__II_3II |
| 1387 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1388 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1389 | const char * _exceptionType = NULL; |
| 1390 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1391 | GLfixed *params_base = (GLfixed *) 0; |
| 1392 | jint _remaining; |
| 1393 | GLfixed *params = (GLfixed *) 0; |
| 1394 | |
| 1395 | if (!params_ref) { |
| 1396 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1397 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1398 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1399 | goto exit; |
| 1400 | } |
| 1401 | if (offset < 0) { |
| 1402 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1403 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1404 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1405 | goto exit; |
| 1406 | } |
| 1407 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1408 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1409 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1410 | params = params_base + offset; |
| 1411 | |
| 1412 | glGetLightxvOES( |
| 1413 | (GLenum)light, |
| 1414 | (GLenum)pname, |
| 1415 | (GLfixed *)params |
| 1416 | ); |
| 1417 | |
| 1418 | exit: |
| 1419 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1420 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1421 | _exception ? JNI_ABORT: 0); |
| 1422 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1423 | if (_exception) { |
| 1424 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1425 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1426 | } |
| 1427 | |
| 1428 | /* void glGetLightxvOES ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 1429 | static void |
| 1430 | android_glGetLightxvOES__IILjava_nio_IntBuffer_2 |
| 1431 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1432 | jint _exception = 0; |
| 1433 | const char * _exceptionType = NULL; |
| 1434 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1435 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1436 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1437 | jint _remaining; |
| 1438 | GLfixed *params = (GLfixed *) 0; |
| 1439 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1440 | if (!params_buf) { |
| 1441 | _exception = 1; |
| 1442 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1443 | _exceptionMessage = "params == null"; |
| 1444 | goto exit; |
| 1445 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1446 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1447 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1448 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1449 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1450 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1451 | glGetLightxvOES( |
| 1452 | (GLenum)light, |
| 1453 | (GLenum)pname, |
| 1454 | (GLfixed *)params |
| 1455 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1456 | |
| 1457 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1458 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1459 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 1460 | } |
| 1461 | if (_exception) { |
| 1462 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1463 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1464 | } |
| 1465 | |
| 1466 | /* void glGetMaterialxvOES ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 1467 | static void |
| 1468 | android_glGetMaterialxvOES__II_3II |
| 1469 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1470 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1471 | const char * _exceptionType = NULL; |
| 1472 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1473 | GLfixed *params_base = (GLfixed *) 0; |
| 1474 | jint _remaining; |
| 1475 | GLfixed *params = (GLfixed *) 0; |
| 1476 | |
| 1477 | if (!params_ref) { |
| 1478 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1479 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1480 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1481 | goto exit; |
| 1482 | } |
| 1483 | if (offset < 0) { |
| 1484 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1485 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1486 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1487 | goto exit; |
| 1488 | } |
| 1489 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1490 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1491 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1492 | params = params_base + offset; |
| 1493 | |
| 1494 | glGetMaterialxvOES( |
| 1495 | (GLenum)face, |
| 1496 | (GLenum)pname, |
| 1497 | (GLfixed *)params |
| 1498 | ); |
| 1499 | |
| 1500 | exit: |
| 1501 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1502 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1503 | _exception ? JNI_ABORT: 0); |
| 1504 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1505 | if (_exception) { |
| 1506 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1507 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1508 | } |
| 1509 | |
| 1510 | /* void glGetMaterialxvOES ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 1511 | static void |
| 1512 | android_glGetMaterialxvOES__IILjava_nio_IntBuffer_2 |
| 1513 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1514 | jint _exception = 0; |
| 1515 | const char * _exceptionType = NULL; |
| 1516 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1517 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1518 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1519 | jint _remaining; |
| 1520 | GLfixed *params = (GLfixed *) 0; |
| 1521 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1522 | if (!params_buf) { |
| 1523 | _exception = 1; |
| 1524 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1525 | _exceptionMessage = "params == null"; |
| 1526 | goto exit; |
| 1527 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1528 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1529 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1530 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1531 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1532 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1533 | glGetMaterialxvOES( |
| 1534 | (GLenum)face, |
| 1535 | (GLenum)pname, |
| 1536 | (GLfixed *)params |
| 1537 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1538 | |
| 1539 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1540 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1541 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 1542 | } |
| 1543 | if (_exception) { |
| 1544 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1545 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1546 | } |
| 1547 | |
| 1548 | /* void glGetTexEnvxvOES ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 1549 | static void |
| 1550 | android_glGetTexEnvxvOES__II_3II |
| 1551 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1552 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1553 | const char * _exceptionType = NULL; |
| 1554 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1555 | GLfixed *params_base = (GLfixed *) 0; |
| 1556 | jint _remaining; |
| 1557 | GLfixed *params = (GLfixed *) 0; |
| 1558 | |
| 1559 | if (!params_ref) { |
| 1560 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1561 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1562 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1563 | goto exit; |
| 1564 | } |
| 1565 | if (offset < 0) { |
| 1566 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1567 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1568 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1569 | goto exit; |
| 1570 | } |
| 1571 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1572 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1573 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1574 | params = params_base + offset; |
| 1575 | |
| 1576 | glGetTexEnvxvOES( |
| 1577 | (GLenum)env, |
| 1578 | (GLenum)pname, |
| 1579 | (GLfixed *)params |
| 1580 | ); |
| 1581 | |
| 1582 | exit: |
| 1583 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1584 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1585 | _exception ? JNI_ABORT: 0); |
| 1586 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1587 | if (_exception) { |
| 1588 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1589 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1590 | } |
| 1591 | |
| 1592 | /* void glGetTexEnvxvOES ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 1593 | static void |
| 1594 | android_glGetTexEnvxvOES__IILjava_nio_IntBuffer_2 |
| 1595 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1596 | jint _exception = 0; |
| 1597 | const char * _exceptionType = NULL; |
| 1598 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1599 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1600 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1601 | jint _remaining; |
| 1602 | GLfixed *params = (GLfixed *) 0; |
| 1603 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1604 | if (!params_buf) { |
| 1605 | _exception = 1; |
| 1606 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1607 | _exceptionMessage = "params == null"; |
| 1608 | goto exit; |
| 1609 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1610 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1611 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1612 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1613 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1614 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1615 | glGetTexEnvxvOES( |
| 1616 | (GLenum)env, |
| 1617 | (GLenum)pname, |
| 1618 | (GLfixed *)params |
| 1619 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1620 | |
| 1621 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1622 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1623 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 1624 | } |
| 1625 | if (_exception) { |
| 1626 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1627 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1628 | } |
| 1629 | |
| 1630 | /* void glGetTexParameterxvOES ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 1631 | static void |
| 1632 | android_glGetTexParameterxvOES__II_3II |
| 1633 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1634 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1635 | const char * _exceptionType = NULL; |
| 1636 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1637 | GLfixed *params_base = (GLfixed *) 0; |
| 1638 | jint _remaining; |
| 1639 | GLfixed *params = (GLfixed *) 0; |
| 1640 | |
| 1641 | if (!params_ref) { |
| 1642 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1643 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1644 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1645 | goto exit; |
| 1646 | } |
| 1647 | if (offset < 0) { |
| 1648 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1649 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1650 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1651 | goto exit; |
| 1652 | } |
| 1653 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1654 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1655 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1656 | params = params_base + offset; |
| 1657 | |
| 1658 | glGetTexParameterxvOES( |
| 1659 | (GLenum)target, |
| 1660 | (GLenum)pname, |
| 1661 | (GLfixed *)params |
| 1662 | ); |
| 1663 | |
| 1664 | exit: |
| 1665 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1666 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1667 | _exception ? JNI_ABORT: 0); |
| 1668 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1669 | if (_exception) { |
| 1670 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1671 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1672 | } |
| 1673 | |
| 1674 | /* void glGetTexParameterxvOES ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 1675 | static void |
| 1676 | android_glGetTexParameterxvOES__IILjava_nio_IntBuffer_2 |
| 1677 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1678 | jint _exception = 0; |
| 1679 | const char * _exceptionType = NULL; |
| 1680 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1681 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1682 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1683 | jint _remaining; |
| 1684 | GLfixed *params = (GLfixed *) 0; |
| 1685 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1686 | if (!params_buf) { |
| 1687 | _exception = 1; |
| 1688 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1689 | _exceptionMessage = "params == null"; |
| 1690 | goto exit; |
| 1691 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1692 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1693 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1694 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1695 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1696 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1697 | glGetTexParameterxvOES( |
| 1698 | (GLenum)target, |
| 1699 | (GLenum)pname, |
| 1700 | (GLfixed *)params |
| 1701 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1702 | |
| 1703 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1704 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1705 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 1706 | } |
| 1707 | if (_exception) { |
| 1708 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1709 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1710 | } |
| 1711 | |
| 1712 | /* void glLightModelxOES ( GLenum pname, GLfixed param ) */ |
| 1713 | static void |
| 1714 | android_glLightModelxOES__II |
| 1715 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1716 | glLightModelxOES( |
| 1717 | (GLenum)pname, |
| 1718 | (GLfixed)param |
| 1719 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1720 | } |
| 1721 | |
| 1722 | /* void glLightModelxvOES ( GLenum pname, const GLfixed *params ) */ |
| 1723 | static void |
| 1724 | android_glLightModelxvOES__I_3II |
| 1725 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1726 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1727 | const char * _exceptionType = NULL; |
| 1728 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1729 | GLfixed *params_base = (GLfixed *) 0; |
| 1730 | jint _remaining; |
| 1731 | GLfixed *params = (GLfixed *) 0; |
| 1732 | |
| 1733 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1734 | _exception = 1; |
| 1735 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1736 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1737 | goto exit; |
| 1738 | } |
| 1739 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1740 | _exception = 1; |
| 1741 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1742 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1743 | goto exit; |
| 1744 | } |
| 1745 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1746 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1747 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1748 | params = params_base + offset; |
| 1749 | |
| 1750 | glLightModelxvOES( |
| 1751 | (GLenum)pname, |
| 1752 | (GLfixed *)params |
| 1753 | ); |
| 1754 | |
| 1755 | exit: |
| 1756 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1757 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1758 | JNI_ABORT); |
| 1759 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1760 | if (_exception) { |
| 1761 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1762 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1763 | } |
| 1764 | |
| 1765 | /* void glLightModelxvOES ( GLenum pname, const GLfixed *params ) */ |
| 1766 | static void |
| 1767 | android_glLightModelxvOES__ILjava_nio_IntBuffer_2 |
| 1768 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1769 | jint _exception = 0; |
| 1770 | const char * _exceptionType = NULL; |
| 1771 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1772 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1773 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1774 | jint _remaining; |
| 1775 | GLfixed *params = (GLfixed *) 0; |
| 1776 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1777 | if (!params_buf) { |
| 1778 | _exception = 1; |
| 1779 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1780 | _exceptionMessage = "params == null"; |
| 1781 | goto exit; |
| 1782 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1783 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1784 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1785 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1786 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1787 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1788 | glLightModelxvOES( |
| 1789 | (GLenum)pname, |
| 1790 | (GLfixed *)params |
| 1791 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1792 | |
| 1793 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1794 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1795 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1796 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1797 | if (_exception) { |
| 1798 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1799 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1800 | } |
| 1801 | |
| 1802 | /* void glLightxOES ( GLenum light, GLenum pname, GLfixed param ) */ |
| 1803 | static void |
| 1804 | android_glLightxOES__III |
| 1805 | (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1806 | glLightxOES( |
| 1807 | (GLenum)light, |
| 1808 | (GLenum)pname, |
| 1809 | (GLfixed)param |
| 1810 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1811 | } |
| 1812 | |
| 1813 | /* void glLightxvOES ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 1814 | static void |
| 1815 | android_glLightxvOES__II_3II |
| 1816 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1817 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1818 | const char * _exceptionType = NULL; |
| 1819 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1820 | GLfixed *params_base = (GLfixed *) 0; |
| 1821 | jint _remaining; |
| 1822 | GLfixed *params = (GLfixed *) 0; |
| 1823 | |
| 1824 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1825 | _exception = 1; |
| 1826 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1827 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1828 | goto exit; |
| 1829 | } |
| 1830 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1831 | _exception = 1; |
| 1832 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1833 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1834 | goto exit; |
| 1835 | } |
| 1836 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1837 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1838 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1839 | params = params_base + offset; |
| 1840 | |
| 1841 | glLightxvOES( |
| 1842 | (GLenum)light, |
| 1843 | (GLenum)pname, |
| 1844 | (GLfixed *)params |
| 1845 | ); |
| 1846 | |
| 1847 | exit: |
| 1848 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1849 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1850 | JNI_ABORT); |
| 1851 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1852 | if (_exception) { |
| 1853 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1854 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1855 | } |
| 1856 | |
| 1857 | /* void glLightxvOES ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 1858 | static void |
| 1859 | android_glLightxvOES__IILjava_nio_IntBuffer_2 |
| 1860 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1861 | jint _exception = 0; |
| 1862 | const char * _exceptionType = NULL; |
| 1863 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1864 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1865 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1866 | jint _remaining; |
| 1867 | GLfixed *params = (GLfixed *) 0; |
| 1868 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1869 | if (!params_buf) { |
| 1870 | _exception = 1; |
| 1871 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1872 | _exceptionMessage = "params == null"; |
| 1873 | goto exit; |
| 1874 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1875 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1876 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1877 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1878 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1879 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1880 | glLightxvOES( |
| 1881 | (GLenum)light, |
| 1882 | (GLenum)pname, |
| 1883 | (GLfixed *)params |
| 1884 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1885 | |
| 1886 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1887 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1888 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1889 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1890 | if (_exception) { |
| 1891 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1892 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1893 | } |
| 1894 | |
| 1895 | /* void glLineWidthxOES ( GLfixed width ) */ |
| 1896 | static void |
| 1897 | android_glLineWidthxOES__I |
| 1898 | (JNIEnv *_env, jobject _this, jint width) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1899 | glLineWidthxOES( |
| 1900 | (GLfixed)width |
| 1901 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1902 | } |
| 1903 | |
| 1904 | /* void glLoadMatrixxOES ( const GLfixed *m ) */ |
| 1905 | static void |
| 1906 | android_glLoadMatrixxOES___3II |
| 1907 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1908 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1909 | const char * _exceptionType = NULL; |
| 1910 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1911 | GLfixed *m_base = (GLfixed *) 0; |
| 1912 | jint _remaining; |
| 1913 | GLfixed *m = (GLfixed *) 0; |
| 1914 | |
| 1915 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1916 | _exception = 1; |
| 1917 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1918 | _exceptionMessage = "m == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1919 | goto exit; |
| 1920 | } |
| 1921 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1922 | _exception = 1; |
| 1923 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1924 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1925 | goto exit; |
| 1926 | } |
| 1927 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 1928 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1929 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1930 | m = m_base + offset; |
| 1931 | |
| 1932 | glLoadMatrixxOES( |
| 1933 | (GLfixed *)m |
| 1934 | ); |
| 1935 | |
| 1936 | exit: |
| 1937 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1938 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1939 | JNI_ABORT); |
| 1940 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1941 | if (_exception) { |
| 1942 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1943 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1944 | } |
| 1945 | |
| 1946 | /* void glLoadMatrixxOES ( const GLfixed *m ) */ |
| 1947 | static void |
| 1948 | android_glLoadMatrixxOES__Ljava_nio_IntBuffer_2 |
| 1949 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1950 | jint _exception = 0; |
| 1951 | const char * _exceptionType = NULL; |
| 1952 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1953 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1954 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1955 | jint _remaining; |
| 1956 | GLfixed *m = (GLfixed *) 0; |
| 1957 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1958 | if (!m_buf) { |
| 1959 | _exception = 1; |
| 1960 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1961 | _exceptionMessage = "m == null"; |
| 1962 | goto exit; |
| 1963 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1964 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1965 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1966 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1967 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 1968 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1969 | glLoadMatrixxOES( |
| 1970 | (GLfixed *)m |
| 1971 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1972 | |
| 1973 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1974 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1975 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1976 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1977 | if (_exception) { |
| 1978 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1979 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1980 | } |
| 1981 | |
| 1982 | /* void glMaterialxOES ( GLenum face, GLenum pname, GLfixed param ) */ |
| 1983 | static void |
| 1984 | android_glMaterialxOES__III |
| 1985 | (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 1986 | glMaterialxOES( |
| 1987 | (GLenum)face, |
| 1988 | (GLenum)pname, |
| 1989 | (GLfixed)param |
| 1990 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 1991 | } |
| 1992 | |
| 1993 | /* void glMaterialxvOES ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 1994 | static void |
| 1995 | android_glMaterialxvOES__II_3II |
| 1996 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1997 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1998 | const char * _exceptionType = NULL; |
| 1999 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2000 | GLfixed *params_base = (GLfixed *) 0; |
| 2001 | jint _remaining; |
| 2002 | GLfixed *params = (GLfixed *) 0; |
| 2003 | |
| 2004 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2005 | _exception = 1; |
| 2006 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2007 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2008 | goto exit; |
| 2009 | } |
| 2010 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2011 | _exception = 1; |
| 2012 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2013 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2014 | goto exit; |
| 2015 | } |
| 2016 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2017 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2018 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2019 | params = params_base + offset; |
| 2020 | |
| 2021 | glMaterialxvOES( |
| 2022 | (GLenum)face, |
| 2023 | (GLenum)pname, |
| 2024 | (GLfixed *)params |
| 2025 | ); |
| 2026 | |
| 2027 | exit: |
| 2028 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2029 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2030 | JNI_ABORT); |
| 2031 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2032 | if (_exception) { |
| 2033 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2034 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2035 | } |
| 2036 | |
| 2037 | /* void glMaterialxvOES ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2038 | static void |
| 2039 | android_glMaterialxvOES__IILjava_nio_IntBuffer_2 |
| 2040 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2041 | jint _exception = 0; |
| 2042 | const char * _exceptionType = NULL; |
| 2043 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2044 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2045 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2046 | jint _remaining; |
| 2047 | GLfixed *params = (GLfixed *) 0; |
| 2048 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2049 | if (!params_buf) { |
| 2050 | _exception = 1; |
| 2051 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2052 | _exceptionMessage = "params == null"; |
| 2053 | goto exit; |
| 2054 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2055 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2056 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2057 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2058 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2059 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2060 | glMaterialxvOES( |
| 2061 | (GLenum)face, |
| 2062 | (GLenum)pname, |
| 2063 | (GLfixed *)params |
| 2064 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2065 | |
| 2066 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2067 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2068 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2069 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2070 | if (_exception) { |
| 2071 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2072 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2073 | } |
| 2074 | |
| 2075 | /* void glMultMatrixxOES ( const GLfixed *m ) */ |
| 2076 | static void |
| 2077 | android_glMultMatrixxOES___3II |
| 2078 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2079 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2080 | const char * _exceptionType = NULL; |
| 2081 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2082 | GLfixed *m_base = (GLfixed *) 0; |
| 2083 | jint _remaining; |
| 2084 | GLfixed *m = (GLfixed *) 0; |
| 2085 | |
| 2086 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2087 | _exception = 1; |
| 2088 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2089 | _exceptionMessage = "m == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2090 | goto exit; |
| 2091 | } |
| 2092 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2093 | _exception = 1; |
| 2094 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2095 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2096 | goto exit; |
| 2097 | } |
| 2098 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2099 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2100 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2101 | m = m_base + offset; |
| 2102 | |
| 2103 | glMultMatrixxOES( |
| 2104 | (GLfixed *)m |
| 2105 | ); |
| 2106 | |
| 2107 | exit: |
| 2108 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2109 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2110 | JNI_ABORT); |
| 2111 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2112 | if (_exception) { |
| 2113 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2114 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2115 | } |
| 2116 | |
| 2117 | /* void glMultMatrixxOES ( const GLfixed *m ) */ |
| 2118 | static void |
| 2119 | android_glMultMatrixxOES__Ljava_nio_IntBuffer_2 |
| 2120 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2121 | jint _exception = 0; |
| 2122 | const char * _exceptionType = NULL; |
| 2123 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2124 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2125 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2126 | jint _remaining; |
| 2127 | GLfixed *m = (GLfixed *) 0; |
| 2128 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2129 | if (!m_buf) { |
| 2130 | _exception = 1; |
| 2131 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2132 | _exceptionMessage = "m == null"; |
| 2133 | goto exit; |
| 2134 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2135 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2136 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2137 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2138 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 2139 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2140 | glMultMatrixxOES( |
| 2141 | (GLfixed *)m |
| 2142 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2143 | |
| 2144 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2145 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2146 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2147 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2148 | if (_exception) { |
| 2149 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2150 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2151 | } |
| 2152 | |
| 2153 | /* void glMultiTexCoord4xOES ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */ |
| 2154 | static void |
| 2155 | android_glMultiTexCoord4xOES__IIIII |
| 2156 | (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2157 | glMultiTexCoord4xOES( |
| 2158 | (GLenum)target, |
| 2159 | (GLfixed)s, |
| 2160 | (GLfixed)t, |
| 2161 | (GLfixed)r, |
| 2162 | (GLfixed)q |
| 2163 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2164 | } |
| 2165 | |
| 2166 | /* void glNormal3xOES ( GLfixed nx, GLfixed ny, GLfixed nz ) */ |
| 2167 | static void |
| 2168 | android_glNormal3xOES__III |
| 2169 | (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2170 | glNormal3xOES( |
| 2171 | (GLfixed)nx, |
| 2172 | (GLfixed)ny, |
| 2173 | (GLfixed)nz |
| 2174 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2175 | } |
| 2176 | |
| 2177 | /* void glOrthoxOES ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 2178 | static void |
| 2179 | android_glOrthoxOES__IIIIII |
| 2180 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2181 | glOrthoxOES( |
| 2182 | (GLfixed)left, |
| 2183 | (GLfixed)right, |
| 2184 | (GLfixed)bottom, |
| 2185 | (GLfixed)top, |
| 2186 | (GLfixed)zNear, |
| 2187 | (GLfixed)zFar |
| 2188 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2189 | } |
| 2190 | |
| 2191 | /* void glPointParameterxOES ( GLenum pname, GLfixed param ) */ |
| 2192 | static void |
| 2193 | android_glPointParameterxOES__II |
| 2194 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2195 | glPointParameterxOES( |
| 2196 | (GLenum)pname, |
| 2197 | (GLfixed)param |
| 2198 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2199 | } |
| 2200 | |
| 2201 | /* void glPointParameterxvOES ( GLenum pname, const GLfixed *params ) */ |
| 2202 | static void |
| 2203 | android_glPointParameterxvOES__I_3II |
| 2204 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2205 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2206 | const char * _exceptionType = NULL; |
| 2207 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2208 | GLfixed *params_base = (GLfixed *) 0; |
| 2209 | jint _remaining; |
| 2210 | GLfixed *params = (GLfixed *) 0; |
| 2211 | |
| 2212 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2213 | _exception = 1; |
| 2214 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2215 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2216 | goto exit; |
| 2217 | } |
| 2218 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2219 | _exception = 1; |
| 2220 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2221 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2222 | goto exit; |
| 2223 | } |
| 2224 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2225 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2226 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2227 | params = params_base + offset; |
| 2228 | |
| 2229 | glPointParameterxvOES( |
| 2230 | (GLenum)pname, |
| 2231 | (GLfixed *)params |
| 2232 | ); |
| 2233 | |
| 2234 | exit: |
| 2235 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2236 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2237 | JNI_ABORT); |
| 2238 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2239 | if (_exception) { |
| 2240 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2241 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2242 | } |
| 2243 | |
| 2244 | /* void glPointParameterxvOES ( GLenum pname, const GLfixed *params ) */ |
| 2245 | static void |
| 2246 | android_glPointParameterxvOES__ILjava_nio_IntBuffer_2 |
| 2247 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2248 | jint _exception = 0; |
| 2249 | const char * _exceptionType = NULL; |
| 2250 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2251 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2252 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2253 | jint _remaining; |
| 2254 | GLfixed *params = (GLfixed *) 0; |
| 2255 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2256 | if (!params_buf) { |
| 2257 | _exception = 1; |
| 2258 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2259 | _exceptionMessage = "params == null"; |
| 2260 | goto exit; |
| 2261 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2262 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2263 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2264 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2265 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2266 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2267 | glPointParameterxvOES( |
| 2268 | (GLenum)pname, |
| 2269 | (GLfixed *)params |
| 2270 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2271 | |
| 2272 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2273 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2274 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2275 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2276 | if (_exception) { |
| 2277 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2278 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2279 | } |
| 2280 | |
| 2281 | /* void glPointSizexOES ( GLfixed size ) */ |
| 2282 | static void |
| 2283 | android_glPointSizexOES__I |
| 2284 | (JNIEnv *_env, jobject _this, jint size) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2285 | glPointSizexOES( |
| 2286 | (GLfixed)size |
| 2287 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2288 | } |
| 2289 | |
| 2290 | /* void glPolygonOffsetxOES ( GLfixed factor, GLfixed units ) */ |
| 2291 | static void |
| 2292 | android_glPolygonOffsetxOES__II |
| 2293 | (JNIEnv *_env, jobject _this, jint factor, jint units) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2294 | glPolygonOffsetxOES( |
| 2295 | (GLfixed)factor, |
| 2296 | (GLfixed)units |
| 2297 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2298 | } |
| 2299 | |
| 2300 | /* void glRotatexOES ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */ |
| 2301 | static void |
| 2302 | android_glRotatexOES__IIII |
| 2303 | (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2304 | glRotatexOES( |
| 2305 | (GLfixed)angle, |
| 2306 | (GLfixed)x, |
| 2307 | (GLfixed)y, |
| 2308 | (GLfixed)z |
| 2309 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2310 | } |
| 2311 | |
| 2312 | /* void glSampleCoveragexOES ( GLclampx value, GLboolean invert ) */ |
| 2313 | static void |
| 2314 | android_glSampleCoveragexOES__IZ |
| 2315 | (JNIEnv *_env, jobject _this, jint value, jboolean invert) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2316 | glSampleCoveragexOES( |
| 2317 | (GLclampx)value, |
| 2318 | (GLboolean)invert |
| 2319 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2320 | } |
| 2321 | |
| 2322 | /* void glScalexOES ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 2323 | static void |
| 2324 | android_glScalexOES__III |
| 2325 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2326 | glScalexOES( |
| 2327 | (GLfixed)x, |
| 2328 | (GLfixed)y, |
| 2329 | (GLfixed)z |
| 2330 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2331 | } |
| 2332 | |
| 2333 | /* void glTexEnvxOES ( GLenum target, GLenum pname, GLfixed param ) */ |
| 2334 | static void |
| 2335 | android_glTexEnvxOES__III |
| 2336 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2337 | glTexEnvxOES( |
| 2338 | (GLenum)target, |
| 2339 | (GLenum)pname, |
| 2340 | (GLfixed)param |
| 2341 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2342 | } |
| 2343 | |
| 2344 | /* void glTexEnvxvOES ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 2345 | static void |
| 2346 | android_glTexEnvxvOES__II_3II |
| 2347 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2348 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2349 | const char * _exceptionType = NULL; |
| 2350 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2351 | GLfixed *params_base = (GLfixed *) 0; |
| 2352 | jint _remaining; |
| 2353 | GLfixed *params = (GLfixed *) 0; |
| 2354 | |
| 2355 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2356 | _exception = 1; |
| 2357 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2358 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2359 | goto exit; |
| 2360 | } |
| 2361 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2362 | _exception = 1; |
| 2363 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2364 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2365 | goto exit; |
| 2366 | } |
| 2367 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2368 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2369 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2370 | params = params_base + offset; |
| 2371 | |
| 2372 | glTexEnvxvOES( |
| 2373 | (GLenum)target, |
| 2374 | (GLenum)pname, |
| 2375 | (GLfixed *)params |
| 2376 | ); |
| 2377 | |
| 2378 | exit: |
| 2379 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2380 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2381 | JNI_ABORT); |
| 2382 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2383 | if (_exception) { |
| 2384 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2385 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2386 | } |
| 2387 | |
| 2388 | /* void glTexEnvxvOES ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 2389 | static void |
| 2390 | android_glTexEnvxvOES__IILjava_nio_IntBuffer_2 |
| 2391 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2392 | jint _exception = 0; |
| 2393 | const char * _exceptionType = NULL; |
| 2394 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2395 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2396 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2397 | jint _remaining; |
| 2398 | GLfixed *params = (GLfixed *) 0; |
| 2399 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2400 | if (!params_buf) { |
| 2401 | _exception = 1; |
| 2402 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2403 | _exceptionMessage = "params == null"; |
| 2404 | goto exit; |
| 2405 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2406 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2407 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2408 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2409 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2410 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2411 | glTexEnvxvOES( |
| 2412 | (GLenum)target, |
| 2413 | (GLenum)pname, |
| 2414 | (GLfixed *)params |
| 2415 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2416 | |
| 2417 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2418 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2419 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2420 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2421 | if (_exception) { |
| 2422 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2423 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2424 | } |
| 2425 | |
| 2426 | /* void glTexParameterxOES ( GLenum target, GLenum pname, GLfixed param ) */ |
| 2427 | static void |
| 2428 | android_glTexParameterxOES__III |
| 2429 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2430 | glTexParameterxOES( |
| 2431 | (GLenum)target, |
| 2432 | (GLenum)pname, |
| 2433 | (GLfixed)param |
| 2434 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2435 | } |
| 2436 | |
| 2437 | /* void glTexParameterxvOES ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 2438 | static void |
| 2439 | android_glTexParameterxvOES__II_3II |
| 2440 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2441 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2442 | const char * _exceptionType = NULL; |
| 2443 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2444 | GLfixed *params_base = (GLfixed *) 0; |
| 2445 | jint _remaining; |
| 2446 | GLfixed *params = (GLfixed *) 0; |
| 2447 | |
| 2448 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2449 | _exception = 1; |
| 2450 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2451 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2452 | goto exit; |
| 2453 | } |
| 2454 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2455 | _exception = 1; |
| 2456 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2457 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2458 | goto exit; |
| 2459 | } |
| 2460 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2461 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2462 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2463 | params = params_base + offset; |
| 2464 | |
| 2465 | glTexParameterxvOES( |
| 2466 | (GLenum)target, |
| 2467 | (GLenum)pname, |
| 2468 | (GLfixed *)params |
| 2469 | ); |
| 2470 | |
| 2471 | exit: |
| 2472 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2473 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2474 | JNI_ABORT); |
| 2475 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2476 | if (_exception) { |
| 2477 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2478 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2479 | } |
| 2480 | |
| 2481 | /* void glTexParameterxvOES ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 2482 | static void |
| 2483 | android_glTexParameterxvOES__IILjava_nio_IntBuffer_2 |
| 2484 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2485 | jint _exception = 0; |
| 2486 | const char * _exceptionType = NULL; |
| 2487 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2488 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2489 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2490 | jint _remaining; |
| 2491 | GLfixed *params = (GLfixed *) 0; |
| 2492 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2493 | if (!params_buf) { |
| 2494 | _exception = 1; |
| 2495 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2496 | _exceptionMessage = "params == null"; |
| 2497 | goto exit; |
| 2498 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2499 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2500 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2501 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2502 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2503 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2504 | glTexParameterxvOES( |
| 2505 | (GLenum)target, |
| 2506 | (GLenum)pname, |
| 2507 | (GLfixed *)params |
| 2508 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2509 | |
| 2510 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2511 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2512 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2513 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2514 | if (_exception) { |
| 2515 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2516 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2517 | } |
| 2518 | |
| 2519 | /* void glTranslatexOES ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 2520 | static void |
| 2521 | android_glTranslatexOES__III |
| 2522 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 2523 | glTranslatexOES( |
| 2524 | (GLfixed)x, |
| 2525 | (GLfixed)y, |
| 2526 | (GLfixed)z |
| 2527 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2528 | } |
| 2529 | |
| 2530 | /* GLboolean glIsRenderbufferOES ( GLuint renderbuffer ) */ |
| 2531 | static jboolean |
| 2532 | android_glIsRenderbufferOES__I |
| 2533 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2534 | GLboolean _returnValue; |
| 2535 | _returnValue = glIsRenderbufferOES( |
| 2536 | (GLuint)renderbuffer |
| 2537 | ); |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 2538 | return (jboolean)_returnValue; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2539 | } |
| 2540 | |
| 2541 | /* void glBindRenderbufferOES ( GLenum target, GLuint renderbuffer ) */ |
| 2542 | static void |
| 2543 | android_glBindRenderbufferOES__II |
| 2544 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2545 | glBindRenderbufferOES( |
| 2546 | (GLenum)target, |
| 2547 | (GLuint)renderbuffer |
| 2548 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2549 | } |
| 2550 | |
| 2551 | /* void glDeleteRenderbuffersOES ( GLsizei n, const GLuint *renderbuffers ) */ |
| 2552 | static void |
| 2553 | android_glDeleteRenderbuffersOES__I_3II |
| 2554 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2555 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2556 | const char * _exceptionType = NULL; |
| 2557 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2558 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 2559 | jint _remaining; |
| 2560 | GLuint *renderbuffers = (GLuint *) 0; |
| 2561 | |
| 2562 | if (!renderbuffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2563 | _exception = 1; |
| 2564 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2565 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2566 | goto exit; |
| 2567 | } |
| 2568 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2569 | _exception = 1; |
| 2570 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2571 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2572 | goto exit; |
| 2573 | } |
| 2574 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 2575 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2576 | _exception = 1; |
| 2577 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2578 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2579 | goto exit; |
| 2580 | } |
| 2581 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2582 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2583 | renderbuffers = renderbuffers_base + offset; |
| 2584 | |
| 2585 | glDeleteRenderbuffersOES( |
| 2586 | (GLsizei)n, |
| 2587 | (GLuint *)renderbuffers |
| 2588 | ); |
| 2589 | |
| 2590 | exit: |
| 2591 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2592 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2593 | JNI_ABORT); |
| 2594 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2595 | if (_exception) { |
| 2596 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2597 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2598 | } |
| 2599 | |
| 2600 | /* void glDeleteRenderbuffersOES ( GLsizei n, const GLuint *renderbuffers ) */ |
| 2601 | static void |
| 2602 | android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 2603 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2604 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2605 | const char * _exceptionType = NULL; |
| 2606 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2607 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2608 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2609 | jint _remaining; |
| 2610 | GLuint *renderbuffers = (GLuint *) 0; |
| 2611 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2612 | if (!renderbuffers_buf) { |
| 2613 | _exception = 1; |
| 2614 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2615 | _exceptionMessage = "renderbuffers == null"; |
| 2616 | goto exit; |
| 2617 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2618 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2619 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2620 | _exception = 1; |
| 2621 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2622 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2623 | goto exit; |
| 2624 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2625 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2626 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2627 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 2628 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2629 | glDeleteRenderbuffersOES( |
| 2630 | (GLsizei)n, |
| 2631 | (GLuint *)renderbuffers |
| 2632 | ); |
| 2633 | |
| 2634 | exit: |
| 2635 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2636 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, JNI_ABORT); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2637 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2638 | if (_exception) { |
| 2639 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2640 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2641 | } |
| 2642 | |
| 2643 | /* void glGenRenderbuffersOES ( GLsizei n, GLuint *renderbuffers ) */ |
| 2644 | static void |
| 2645 | android_glGenRenderbuffersOES__I_3II |
| 2646 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2647 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2648 | const char * _exceptionType = NULL; |
| 2649 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2650 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 2651 | jint _remaining; |
| 2652 | GLuint *renderbuffers = (GLuint *) 0; |
| 2653 | |
| 2654 | if (!renderbuffers_ref) { |
| 2655 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2656 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2657 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2658 | goto exit; |
| 2659 | } |
| 2660 | if (offset < 0) { |
| 2661 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2662 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2663 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2664 | goto exit; |
| 2665 | } |
| 2666 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 2667 | if (_remaining < n) { |
| 2668 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2669 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2670 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2671 | goto exit; |
| 2672 | } |
| 2673 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2674 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2675 | renderbuffers = renderbuffers_base + offset; |
| 2676 | |
| 2677 | glGenRenderbuffersOES( |
| 2678 | (GLsizei)n, |
| 2679 | (GLuint *)renderbuffers |
| 2680 | ); |
| 2681 | |
| 2682 | exit: |
| 2683 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2684 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2685 | _exception ? JNI_ABORT: 0); |
| 2686 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2687 | if (_exception) { |
| 2688 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2689 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2690 | } |
| 2691 | |
| 2692 | /* void glGenRenderbuffersOES ( GLsizei n, GLuint *renderbuffers ) */ |
| 2693 | static void |
| 2694 | android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 2695 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2696 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2697 | const char * _exceptionType = NULL; |
| 2698 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2699 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2700 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2701 | jint _remaining; |
| 2702 | GLuint *renderbuffers = (GLuint *) 0; |
| 2703 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2704 | if (!renderbuffers_buf) { |
| 2705 | _exception = 1; |
| 2706 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2707 | _exceptionMessage = "renderbuffers == null"; |
| 2708 | goto exit; |
| 2709 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2710 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2711 | if (_remaining < n) { |
| 2712 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2713 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2714 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2715 | goto exit; |
| 2716 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2717 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2718 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2719 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 2720 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2721 | glGenRenderbuffersOES( |
| 2722 | (GLsizei)n, |
| 2723 | (GLuint *)renderbuffers |
| 2724 | ); |
| 2725 | |
| 2726 | exit: |
| 2727 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2728 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2729 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2730 | if (_exception) { |
| 2731 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2732 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2733 | } |
| 2734 | |
| 2735 | /* void glRenderbufferStorageOES ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) */ |
| 2736 | static void |
| 2737 | android_glRenderbufferStorageOES__IIII |
| 2738 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2739 | glRenderbufferStorageOES( |
| 2740 | (GLenum)target, |
| 2741 | (GLenum)internalformat, |
| 2742 | (GLsizei)width, |
| 2743 | (GLsizei)height |
| 2744 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2745 | } |
| 2746 | |
| 2747 | /* void glGetRenderbufferParameterivOES ( GLenum target, GLenum pname, GLint *params ) */ |
| 2748 | static void |
| 2749 | android_glGetRenderbufferParameterivOES__II_3II |
| 2750 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2751 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2752 | const char * _exceptionType = NULL; |
| 2753 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2754 | GLint *params_base = (GLint *) 0; |
| 2755 | jint _remaining; |
| 2756 | GLint *params = (GLint *) 0; |
| 2757 | |
| 2758 | if (!params_ref) { |
| 2759 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2760 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2761 | _exceptionMessage = "params == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2762 | goto exit; |
| 2763 | } |
| 2764 | if (offset < 0) { |
| 2765 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2766 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2767 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2768 | goto exit; |
| 2769 | } |
| 2770 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2771 | if (_remaining < 1) { |
| 2772 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2773 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2774 | _exceptionMessage = "length - offset < 1 < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2775 | goto exit; |
| 2776 | } |
| 2777 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2778 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2779 | params = params_base + offset; |
| 2780 | |
| 2781 | glGetRenderbufferParameterivOES( |
| 2782 | (GLenum)target, |
| 2783 | (GLenum)pname, |
| 2784 | (GLint *)params |
| 2785 | ); |
| 2786 | |
| 2787 | exit: |
| 2788 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2789 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2790 | _exception ? JNI_ABORT: 0); |
| 2791 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2792 | if (_exception) { |
| 2793 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2794 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2795 | } |
| 2796 | |
| 2797 | /* void glGetRenderbufferParameterivOES ( GLenum target, GLenum pname, GLint *params ) */ |
| 2798 | static void |
| 2799 | android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 |
| 2800 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2801 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2802 | const char * _exceptionType = NULL; |
| 2803 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2804 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2805 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2806 | jint _remaining; |
| 2807 | GLint *params = (GLint *) 0; |
| 2808 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2809 | if (!params_buf) { |
| 2810 | _exception = 1; |
| 2811 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2812 | _exceptionMessage = "params == null"; |
| 2813 | goto exit; |
| 2814 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2815 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2816 | if (_remaining < 1) { |
| 2817 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2818 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2819 | _exceptionMessage = "remaining() < 1 < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2820 | goto exit; |
| 2821 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2822 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2823 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2824 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 2825 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2826 | glGetRenderbufferParameterivOES( |
| 2827 | (GLenum)target, |
| 2828 | (GLenum)pname, |
| 2829 | (GLint *)params |
| 2830 | ); |
| 2831 | |
| 2832 | exit: |
| 2833 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2834 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2835 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2836 | if (_exception) { |
| 2837 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2838 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2839 | } |
| 2840 | |
| 2841 | /* GLboolean glIsFramebufferOES ( GLuint framebuffer ) */ |
| 2842 | static jboolean |
| 2843 | android_glIsFramebufferOES__I |
| 2844 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2845 | GLboolean _returnValue; |
| 2846 | _returnValue = glIsFramebufferOES( |
| 2847 | (GLuint)framebuffer |
| 2848 | ); |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 2849 | return (jboolean)_returnValue; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2850 | } |
| 2851 | |
| 2852 | /* void glBindFramebufferOES ( GLenum target, GLuint framebuffer ) */ |
| 2853 | static void |
| 2854 | android_glBindFramebufferOES__II |
| 2855 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2856 | glBindFramebufferOES( |
| 2857 | (GLenum)target, |
| 2858 | (GLuint)framebuffer |
| 2859 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2860 | } |
| 2861 | |
| 2862 | /* void glDeleteFramebuffersOES ( GLsizei n, const GLuint *framebuffers ) */ |
| 2863 | static void |
| 2864 | android_glDeleteFramebuffersOES__I_3II |
| 2865 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2866 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2867 | const char * _exceptionType = NULL; |
| 2868 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2869 | GLuint *framebuffers_base = (GLuint *) 0; |
| 2870 | jint _remaining; |
| 2871 | GLuint *framebuffers = (GLuint *) 0; |
| 2872 | |
| 2873 | if (!framebuffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2874 | _exception = 1; |
| 2875 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2876 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2877 | goto exit; |
| 2878 | } |
| 2879 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2880 | _exception = 1; |
| 2881 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2882 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2883 | goto exit; |
| 2884 | } |
| 2885 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 2886 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2887 | _exception = 1; |
| 2888 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2889 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2890 | goto exit; |
| 2891 | } |
| 2892 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2893 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2894 | framebuffers = framebuffers_base + offset; |
| 2895 | |
| 2896 | glDeleteFramebuffersOES( |
| 2897 | (GLsizei)n, |
| 2898 | (GLuint *)framebuffers |
| 2899 | ); |
| 2900 | |
| 2901 | exit: |
| 2902 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2903 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2904 | JNI_ABORT); |
| 2905 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2906 | if (_exception) { |
| 2907 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2908 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2909 | } |
| 2910 | |
| 2911 | /* void glDeleteFramebuffersOES ( GLsizei n, const GLuint *framebuffers ) */ |
| 2912 | static void |
| 2913 | android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 2914 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2915 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2916 | const char * _exceptionType = NULL; |
| 2917 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2918 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2919 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2920 | jint _remaining; |
| 2921 | GLuint *framebuffers = (GLuint *) 0; |
| 2922 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2923 | if (!framebuffers_buf) { |
| 2924 | _exception = 1; |
| 2925 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2926 | _exceptionMessage = "framebuffers == null"; |
| 2927 | goto exit; |
| 2928 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2929 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2930 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2931 | _exception = 1; |
| 2932 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2933 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2934 | goto exit; |
| 2935 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2936 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2937 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2938 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 2939 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2940 | glDeleteFramebuffersOES( |
| 2941 | (GLsizei)n, |
| 2942 | (GLuint *)framebuffers |
| 2943 | ); |
| 2944 | |
| 2945 | exit: |
| 2946 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2947 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, JNI_ABORT); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2948 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2949 | if (_exception) { |
| 2950 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2951 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 2952 | } |
| 2953 | |
| 2954 | /* void glGenFramebuffersOES ( GLsizei n, GLuint *framebuffers ) */ |
| 2955 | static void |
| 2956 | android_glGenFramebuffersOES__I_3II |
| 2957 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2958 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2959 | const char * _exceptionType = NULL; |
| 2960 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2961 | GLuint *framebuffers_base = (GLuint *) 0; |
| 2962 | jint _remaining; |
| 2963 | GLuint *framebuffers = (GLuint *) 0; |
| 2964 | |
| 2965 | if (!framebuffers_ref) { |
| 2966 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2967 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2968 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2969 | goto exit; |
| 2970 | } |
| 2971 | if (offset < 0) { |
| 2972 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2973 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2974 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2975 | goto exit; |
| 2976 | } |
| 2977 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 2978 | if (_remaining < n) { |
| 2979 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2980 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2981 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2982 | goto exit; |
| 2983 | } |
| 2984 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2985 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2986 | framebuffers = framebuffers_base + offset; |
| 2987 | |
| 2988 | glGenFramebuffersOES( |
| 2989 | (GLsizei)n, |
| 2990 | (GLuint *)framebuffers |
| 2991 | ); |
| 2992 | |
| 2993 | exit: |
| 2994 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2995 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 2996 | _exception ? JNI_ABORT: 0); |
| 2997 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2998 | if (_exception) { |
| 2999 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3000 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3001 | } |
| 3002 | |
| 3003 | /* void glGenFramebuffersOES ( GLsizei n, GLuint *framebuffers ) */ |
| 3004 | static void |
| 3005 | android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 3006 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3007 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3008 | const char * _exceptionType = NULL; |
| 3009 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3010 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3011 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3012 | jint _remaining; |
| 3013 | GLuint *framebuffers = (GLuint *) 0; |
| 3014 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3015 | if (!framebuffers_buf) { |
| 3016 | _exception = 1; |
| 3017 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3018 | _exceptionMessage = "framebuffers == null"; |
| 3019 | goto exit; |
| 3020 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3021 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3022 | if (_remaining < n) { |
| 3023 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3024 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3025 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3026 | goto exit; |
| 3027 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3028 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3029 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3030 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 3031 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3032 | glGenFramebuffersOES( |
| 3033 | (GLsizei)n, |
| 3034 | (GLuint *)framebuffers |
| 3035 | ); |
| 3036 | |
| 3037 | exit: |
| 3038 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3039 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3040 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3041 | if (_exception) { |
| 3042 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3043 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3044 | } |
| 3045 | |
| 3046 | /* GLenum glCheckFramebufferStatusOES ( GLenum target ) */ |
| 3047 | static jint |
| 3048 | android_glCheckFramebufferStatusOES__I |
| 3049 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3050 | GLenum _returnValue; |
| 3051 | _returnValue = glCheckFramebufferStatusOES( |
| 3052 | (GLenum)target |
| 3053 | ); |
Andy McFadden | cee5198 | 2013-04-25 16:08:31 -0700 | [diff] [blame] | 3054 | return (jint)_returnValue; |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3055 | } |
| 3056 | |
| 3057 | /* void glFramebufferRenderbufferOES ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) */ |
| 3058 | static void |
| 3059 | android_glFramebufferRenderbufferOES__IIII |
| 3060 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3061 | glFramebufferRenderbufferOES( |
| 3062 | (GLenum)target, |
| 3063 | (GLenum)attachment, |
| 3064 | (GLenum)renderbuffertarget, |
| 3065 | (GLuint)renderbuffer |
| 3066 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3067 | } |
| 3068 | |
| 3069 | /* void glFramebufferTexture2DOES ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) */ |
| 3070 | static void |
| 3071 | android_glFramebufferTexture2DOES__IIIII |
| 3072 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3073 | glFramebufferTexture2DOES( |
| 3074 | (GLenum)target, |
| 3075 | (GLenum)attachment, |
| 3076 | (GLenum)textarget, |
| 3077 | (GLuint)texture, |
| 3078 | (GLint)level |
| 3079 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3080 | } |
| 3081 | |
| 3082 | /* void glGetFramebufferAttachmentParameterivOES ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ |
| 3083 | static void |
| 3084 | android_glGetFramebufferAttachmentParameterivOES__III_3II |
| 3085 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3086 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3087 | const char * _exceptionType = NULL; |
| 3088 | const char * _exceptionMessage = NULL; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3089 | GLint *params_base = (GLint *) 0; |
| 3090 | jint _remaining; |
| 3091 | GLint *params = (GLint *) 0; |
| 3092 | |
| 3093 | if (!params_ref) { |
| 3094 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3095 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3096 | _exceptionMessage = "params == null"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3097 | goto exit; |
| 3098 | } |
| 3099 | if (offset < 0) { |
| 3100 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3101 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3102 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3103 | goto exit; |
| 3104 | } |
| 3105 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3106 | if (_remaining < 1) { |
| 3107 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3108 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3109 | _exceptionMessage = "length - offset < 1 < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3110 | goto exit; |
| 3111 | } |
| 3112 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3113 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3114 | params = params_base + offset; |
| 3115 | |
| 3116 | glGetFramebufferAttachmentParameterivOES( |
| 3117 | (GLenum)target, |
| 3118 | (GLenum)attachment, |
| 3119 | (GLenum)pname, |
| 3120 | (GLint *)params |
| 3121 | ); |
| 3122 | |
| 3123 | exit: |
| 3124 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3125 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3126 | _exception ? JNI_ABORT: 0); |
| 3127 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3128 | if (_exception) { |
| 3129 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3130 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3131 | } |
| 3132 | |
| 3133 | /* void glGetFramebufferAttachmentParameterivOES ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ |
| 3134 | static void |
| 3135 | android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 |
| 3136 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3137 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3138 | const char * _exceptionType = NULL; |
| 3139 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3140 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3141 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3142 | jint _remaining; |
| 3143 | GLint *params = (GLint *) 0; |
| 3144 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3145 | if (!params_buf) { |
| 3146 | _exception = 1; |
| 3147 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3148 | _exceptionMessage = "params == null"; |
| 3149 | goto exit; |
| 3150 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3151 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3152 | if (_remaining < 1) { |
| 3153 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3154 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3155 | _exceptionMessage = "remaining() < 1 < needed"; |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3156 | goto exit; |
| 3157 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3158 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3159 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3160 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 3161 | } |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3162 | glGetFramebufferAttachmentParameterivOES( |
| 3163 | (GLenum)target, |
| 3164 | (GLenum)attachment, |
| 3165 | (GLenum)pname, |
| 3166 | (GLint *)params |
| 3167 | ); |
| 3168 | |
| 3169 | exit: |
| 3170 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3171 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3172 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3173 | if (_exception) { |
| 3174 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3175 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3176 | } |
| 3177 | |
| 3178 | /* void glGenerateMipmapOES ( GLenum target ) */ |
| 3179 | static void |
| 3180 | android_glGenerateMipmapOES__I |
| 3181 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 7310867 | 2011-03-28 14:49:12 -0700 | [diff] [blame] | 3182 | glGenerateMipmapOES( |
| 3183 | (GLenum)target |
| 3184 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3185 | } |
| 3186 | |
| 3187 | /* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */ |
| 3188 | static void |
| 3189 | android_glCurrentPaletteMatrixOES__I |
| 3190 | (JNIEnv *_env, jobject _this, jint matrixpaletteindex) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3191 | glCurrentPaletteMatrixOES( |
| 3192 | (GLuint)matrixpaletteindex |
| 3193 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3194 | } |
| 3195 | |
| 3196 | /* void glLoadPaletteFromModelViewMatrixOES ( void ) */ |
| 3197 | static void |
| 3198 | android_glLoadPaletteFromModelViewMatrixOES__ |
| 3199 | (JNIEnv *_env, jobject _this) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3200 | glLoadPaletteFromModelViewMatrixOES(); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3201 | } |
| 3202 | |
| 3203 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3204 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3205 | android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I |
| 3206 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3207 | jint _exception = 0; |
| 3208 | const char * _exceptionType = NULL; |
| 3209 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3210 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3211 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3212 | jint _remaining; |
| 3213 | GLvoid *pointer = (GLvoid *) 0; |
| 3214 | |
| 3215 | if (pointer_buf) { |
| 3216 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 3217 | if ( ! pointer ) { |
| 3218 | return; |
| 3219 | } |
| 3220 | } |
| 3221 | glMatrixIndexPointerOESBounds( |
| 3222 | (GLint)size, |
| 3223 | (GLenum)type, |
| 3224 | (GLsizei)stride, |
| 3225 | (GLvoid *)pointer, |
| 3226 | (GLsizei)remaining |
| 3227 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3228 | if (_exception) { |
| 3229 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3230 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3231 | } |
| 3232 | |
| 3233 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3234 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3235 | android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I |
| 3236 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3237 | jint _exception = 0; |
| 3238 | const char * _exceptionType = NULL; |
| 3239 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3240 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3241 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 3242 | jint _remaining; |
| 3243 | GLvoid *pointer = (GLvoid *) 0; |
| 3244 | |
| 3245 | if (pointer_buf) { |
| 3246 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 3247 | if ( ! pointer ) { |
| 3248 | return; |
| 3249 | } |
| 3250 | } |
| 3251 | glWeightPointerOESBounds( |
| 3252 | (GLint)size, |
| 3253 | (GLenum)type, |
| 3254 | (GLsizei)stride, |
| 3255 | (GLvoid *)pointer, |
| 3256 | (GLsizei)remaining |
| 3257 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3258 | if (_exception) { |
| 3259 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3260 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3261 | } |
| 3262 | |
| 3263 | /* void glDepthRangefOES ( GLclampf zNear, GLclampf zFar ) */ |
| 3264 | static void |
| 3265 | android_glDepthRangefOES__FF |
| 3266 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3267 | glDepthRangefOES( |
| 3268 | (GLclampf)zNear, |
| 3269 | (GLclampf)zFar |
| 3270 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3271 | } |
| 3272 | |
| 3273 | /* void glFrustumfOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3274 | static void |
| 3275 | android_glFrustumfOES__FFFFFF |
| 3276 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3277 | glFrustumfOES( |
| 3278 | (GLfloat)left, |
| 3279 | (GLfloat)right, |
| 3280 | (GLfloat)bottom, |
| 3281 | (GLfloat)top, |
| 3282 | (GLfloat)zNear, |
| 3283 | (GLfloat)zFar |
| 3284 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3285 | } |
| 3286 | |
| 3287 | /* void glOrthofOES ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3288 | static void |
| 3289 | android_glOrthofOES__FFFFFF |
| 3290 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3291 | glOrthofOES( |
| 3292 | (GLfloat)left, |
| 3293 | (GLfloat)right, |
| 3294 | (GLfloat)bottom, |
| 3295 | (GLfloat)top, |
| 3296 | (GLfloat)zNear, |
| 3297 | (GLfloat)zFar |
| 3298 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3299 | } |
| 3300 | |
| 3301 | /* void glClipPlanefOES ( GLenum plane, const GLfloat *equation ) */ |
| 3302 | static void |
| 3303 | android_glClipPlanefOES__I_3FI |
| 3304 | (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3305 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3306 | const char * _exceptionType = NULL; |
| 3307 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3308 | GLfloat *equation_base = (GLfloat *) 0; |
| 3309 | jint _remaining; |
| 3310 | GLfloat *equation = (GLfloat *) 0; |
| 3311 | |
| 3312 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3313 | _exception = 1; |
| 3314 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3315 | _exceptionMessage = "equation == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3316 | goto exit; |
| 3317 | } |
| 3318 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3319 | _exception = 1; |
| 3320 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3321 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3322 | goto exit; |
| 3323 | } |
| 3324 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 3325 | equation_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3326 | _env->GetFloatArrayElements(equation_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3327 | equation = equation_base + offset; |
| 3328 | |
| 3329 | glClipPlanefOES( |
| 3330 | (GLenum)plane, |
| 3331 | (GLfloat *)equation |
| 3332 | ); |
| 3333 | |
| 3334 | exit: |
| 3335 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3336 | _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3337 | JNI_ABORT); |
| 3338 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3339 | if (_exception) { |
| 3340 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3341 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3342 | } |
| 3343 | |
| 3344 | /* void glClipPlanefOES ( GLenum plane, const GLfloat *equation ) */ |
| 3345 | static void |
| 3346 | android_glClipPlanefOES__ILjava_nio_FloatBuffer_2 |
| 3347 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3348 | jint _exception = 0; |
| 3349 | const char * _exceptionType = NULL; |
| 3350 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3351 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3352 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3353 | jint _remaining; |
| 3354 | GLfloat *equation = (GLfloat *) 0; |
| 3355 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3356 | if (!equation_buf) { |
| 3357 | _exception = 1; |
| 3358 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3359 | _exceptionMessage = "equation == null"; |
| 3360 | goto exit; |
| 3361 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3362 | equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3363 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3364 | char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3365 | equation = (GLfloat *) (_equationBase + _bufferOffset); |
| 3366 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3367 | glClipPlanefOES( |
| 3368 | (GLenum)plane, |
| 3369 | (GLfloat *)equation |
| 3370 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3371 | |
| 3372 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3373 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3374 | _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3375 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3376 | if (_exception) { |
| 3377 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3378 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3379 | } |
| 3380 | |
| 3381 | /* void glGetClipPlanefOES ( GLenum pname, GLfloat *eqn ) */ |
| 3382 | static void |
| 3383 | android_glGetClipPlanefOES__I_3FI |
| 3384 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3385 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3386 | const char * _exceptionType = NULL; |
| 3387 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3388 | GLfloat *eqn_base = (GLfloat *) 0; |
| 3389 | jint _remaining; |
| 3390 | GLfloat *eqn = (GLfloat *) 0; |
| 3391 | |
| 3392 | if (!eqn_ref) { |
| 3393 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3394 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3395 | _exceptionMessage = "eqn == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3396 | goto exit; |
| 3397 | } |
| 3398 | if (offset < 0) { |
| 3399 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3400 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3401 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3402 | goto exit; |
| 3403 | } |
| 3404 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 3405 | if (_remaining < 4) { |
| 3406 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3407 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3408 | _exceptionMessage = "length - offset < 4 < needed"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3409 | goto exit; |
| 3410 | } |
| 3411 | eqn_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3412 | _env->GetFloatArrayElements(eqn_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3413 | eqn = eqn_base + offset; |
| 3414 | |
| 3415 | glGetClipPlanefOES( |
| 3416 | (GLenum)pname, |
| 3417 | (GLfloat *)eqn |
| 3418 | ); |
| 3419 | |
| 3420 | exit: |
| 3421 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3422 | _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3423 | _exception ? JNI_ABORT: 0); |
| 3424 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3425 | if (_exception) { |
| 3426 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3427 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3428 | } |
| 3429 | |
| 3430 | /* void glGetClipPlanefOES ( GLenum pname, GLfloat *eqn ) */ |
| 3431 | static void |
| 3432 | android_glGetClipPlanefOES__ILjava_nio_FloatBuffer_2 |
| 3433 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3434 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3435 | const char * _exceptionType = NULL; |
| 3436 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3437 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3438 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3439 | jint _remaining; |
| 3440 | GLfloat *eqn = (GLfloat *) 0; |
| 3441 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3442 | if (!eqn_buf) { |
| 3443 | _exception = 1; |
| 3444 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3445 | _exceptionMessage = "eqn == null"; |
| 3446 | goto exit; |
| 3447 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3448 | eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3449 | if (_remaining < 4) { |
| 3450 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3451 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3452 | _exceptionMessage = "remaining() < 4 < needed"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3453 | goto exit; |
| 3454 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3455 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3456 | char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3457 | eqn = (GLfloat *) (_eqnBase + _bufferOffset); |
| 3458 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3459 | glGetClipPlanefOES( |
| 3460 | (GLenum)pname, |
| 3461 | (GLfloat *)eqn |
| 3462 | ); |
| 3463 | |
| 3464 | exit: |
| 3465 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3466 | _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3467 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3468 | if (_exception) { |
| 3469 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3470 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3471 | } |
| 3472 | |
| 3473 | /* void glClearDepthfOES ( GLclampf depth ) */ |
| 3474 | static void |
| 3475 | android_glClearDepthfOES__F |
| 3476 | (JNIEnv *_env, jobject _this, jfloat depth) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3477 | glClearDepthfOES( |
| 3478 | (GLclampf)depth |
| 3479 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3480 | } |
| 3481 | |
| 3482 | /* void glTexGenfOES ( GLenum coord, GLenum pname, GLfloat param ) */ |
| 3483 | static void |
| 3484 | android_glTexGenfOES__IIF |
| 3485 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3486 | glTexGenfOES( |
| 3487 | (GLenum)coord, |
| 3488 | (GLenum)pname, |
| 3489 | (GLfloat)param |
| 3490 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3491 | } |
| 3492 | |
| 3493 | /* void glTexGenfvOES ( GLenum coord, GLenum pname, const GLfloat *params ) */ |
| 3494 | static void |
| 3495 | android_glTexGenfvOES__II_3FI |
| 3496 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3497 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3498 | const char * _exceptionType = NULL; |
| 3499 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3500 | GLfloat *params_base = (GLfloat *) 0; |
| 3501 | jint _remaining; |
| 3502 | GLfloat *params = (GLfloat *) 0; |
| 3503 | |
| 3504 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3505 | _exception = 1; |
| 3506 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3507 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3508 | goto exit; |
| 3509 | } |
| 3510 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3511 | _exception = 1; |
| 3512 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3513 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3514 | goto exit; |
| 3515 | } |
| 3516 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3517 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3518 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3519 | params = params_base + offset; |
| 3520 | |
| 3521 | glTexGenfvOES( |
| 3522 | (GLenum)coord, |
| 3523 | (GLenum)pname, |
| 3524 | (GLfloat *)params |
| 3525 | ); |
| 3526 | |
| 3527 | exit: |
| 3528 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3529 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3530 | JNI_ABORT); |
| 3531 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3532 | if (_exception) { |
| 3533 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3534 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3535 | } |
| 3536 | |
| 3537 | /* void glTexGenfvOES ( GLenum coord, GLenum pname, const GLfloat *params ) */ |
| 3538 | static void |
| 3539 | android_glTexGenfvOES__IILjava_nio_FloatBuffer_2 |
| 3540 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3541 | jint _exception = 0; |
| 3542 | const char * _exceptionType = NULL; |
| 3543 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3544 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3545 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3546 | jint _remaining; |
| 3547 | GLfloat *params = (GLfloat *) 0; |
| 3548 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3549 | if (!params_buf) { |
| 3550 | _exception = 1; |
| 3551 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3552 | _exceptionMessage = "params == null"; |
| 3553 | goto exit; |
| 3554 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3555 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3556 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3557 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3558 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3559 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3560 | glTexGenfvOES( |
| 3561 | (GLenum)coord, |
| 3562 | (GLenum)pname, |
| 3563 | (GLfloat *)params |
| 3564 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3565 | |
| 3566 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3567 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3568 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3569 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3570 | if (_exception) { |
| 3571 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3572 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3573 | } |
| 3574 | |
| 3575 | /* void glTexGeniOES ( GLenum coord, GLenum pname, GLint param ) */ |
| 3576 | static void |
| 3577 | android_glTexGeniOES__III |
| 3578 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3579 | glTexGeniOES( |
| 3580 | (GLenum)coord, |
| 3581 | (GLenum)pname, |
| 3582 | (GLint)param |
| 3583 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3584 | } |
| 3585 | |
| 3586 | /* void glTexGenivOES ( GLenum coord, GLenum pname, const GLint *params ) */ |
| 3587 | static void |
| 3588 | android_glTexGenivOES__II_3II |
| 3589 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3590 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3591 | const char * _exceptionType = NULL; |
| 3592 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3593 | GLint *params_base = (GLint *) 0; |
| 3594 | jint _remaining; |
| 3595 | GLint *params = (GLint *) 0; |
| 3596 | |
| 3597 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3598 | _exception = 1; |
| 3599 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3600 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3601 | goto exit; |
| 3602 | } |
| 3603 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3604 | _exception = 1; |
| 3605 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3606 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3607 | goto exit; |
| 3608 | } |
| 3609 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3610 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3611 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3612 | params = params_base + offset; |
| 3613 | |
| 3614 | glTexGenivOES( |
| 3615 | (GLenum)coord, |
| 3616 | (GLenum)pname, |
| 3617 | (GLint *)params |
| 3618 | ); |
| 3619 | |
| 3620 | exit: |
| 3621 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3622 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3623 | JNI_ABORT); |
| 3624 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3625 | if (_exception) { |
| 3626 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3627 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3628 | } |
| 3629 | |
| 3630 | /* void glTexGenivOES ( GLenum coord, GLenum pname, const GLint *params ) */ |
| 3631 | static void |
| 3632 | android_glTexGenivOES__IILjava_nio_IntBuffer_2 |
| 3633 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3634 | jint _exception = 0; |
| 3635 | const char * _exceptionType = NULL; |
| 3636 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3637 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3638 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3639 | jint _remaining; |
| 3640 | GLint *params = (GLint *) 0; |
| 3641 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3642 | if (!params_buf) { |
| 3643 | _exception = 1; |
| 3644 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3645 | _exceptionMessage = "params == null"; |
| 3646 | goto exit; |
| 3647 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3648 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3649 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3650 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3651 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 3652 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3653 | glTexGenivOES( |
| 3654 | (GLenum)coord, |
| 3655 | (GLenum)pname, |
| 3656 | (GLint *)params |
| 3657 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3658 | |
| 3659 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3660 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3661 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3662 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3663 | if (_exception) { |
| 3664 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3665 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3666 | } |
| 3667 | |
| 3668 | /* void glTexGenxOES ( GLenum coord, GLenum pname, GLfixed param ) */ |
| 3669 | static void |
| 3670 | android_glTexGenxOES__III |
| 3671 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3672 | glTexGenxOES( |
| 3673 | (GLenum)coord, |
| 3674 | (GLenum)pname, |
| 3675 | (GLfixed)param |
| 3676 | ); |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3677 | } |
| 3678 | |
| 3679 | /* void glTexGenxvOES ( GLenum coord, GLenum pname, const GLfixed *params ) */ |
| 3680 | static void |
| 3681 | android_glTexGenxvOES__II_3II |
| 3682 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3683 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3684 | const char * _exceptionType = NULL; |
| 3685 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3686 | GLfixed *params_base = (GLfixed *) 0; |
| 3687 | jint _remaining; |
| 3688 | GLfixed *params = (GLfixed *) 0; |
| 3689 | |
| 3690 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3691 | _exception = 1; |
| 3692 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3693 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3694 | goto exit; |
| 3695 | } |
| 3696 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3697 | _exception = 1; |
| 3698 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3699 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3700 | goto exit; |
| 3701 | } |
| 3702 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3703 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3704 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3705 | params = params_base + offset; |
| 3706 | |
| 3707 | glTexGenxvOES( |
| 3708 | (GLenum)coord, |
| 3709 | (GLenum)pname, |
| 3710 | (GLfixed *)params |
| 3711 | ); |
| 3712 | |
| 3713 | exit: |
| 3714 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3715 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3716 | JNI_ABORT); |
| 3717 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3718 | if (_exception) { |
| 3719 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3720 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3721 | } |
| 3722 | |
| 3723 | /* void glTexGenxvOES ( GLenum coord, GLenum pname, const GLfixed *params ) */ |
| 3724 | static void |
| 3725 | android_glTexGenxvOES__IILjava_nio_IntBuffer_2 |
| 3726 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3727 | jint _exception = 0; |
| 3728 | const char * _exceptionType = NULL; |
| 3729 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3730 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3731 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3732 | jint _remaining; |
| 3733 | GLfixed *params = (GLfixed *) 0; |
| 3734 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3735 | if (!params_buf) { |
| 3736 | _exception = 1; |
| 3737 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3738 | _exceptionMessage = "params == null"; |
| 3739 | goto exit; |
| 3740 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3741 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3742 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3743 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3744 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3745 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3746 | glTexGenxvOES( |
| 3747 | (GLenum)coord, |
| 3748 | (GLenum)pname, |
| 3749 | (GLfixed *)params |
| 3750 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3751 | |
| 3752 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3753 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3754 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3755 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3756 | if (_exception) { |
| 3757 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3758 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3759 | } |
| 3760 | |
| 3761 | /* void glGetTexGenfvOES ( GLenum coord, GLenum pname, GLfloat *params ) */ |
| 3762 | static void |
| 3763 | android_glGetTexGenfvOES__II_3FI |
| 3764 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3765 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3766 | const char * _exceptionType = NULL; |
| 3767 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3768 | GLfloat *params_base = (GLfloat *) 0; |
| 3769 | jint _remaining; |
| 3770 | GLfloat *params = (GLfloat *) 0; |
| 3771 | |
| 3772 | if (!params_ref) { |
| 3773 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3774 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3775 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3776 | goto exit; |
| 3777 | } |
| 3778 | if (offset < 0) { |
| 3779 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3780 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3781 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3782 | goto exit; |
| 3783 | } |
| 3784 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3785 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3786 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3787 | params = params_base + offset; |
| 3788 | |
| 3789 | glGetTexGenfvOES( |
| 3790 | (GLenum)coord, |
| 3791 | (GLenum)pname, |
| 3792 | (GLfloat *)params |
| 3793 | ); |
| 3794 | |
| 3795 | exit: |
| 3796 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3797 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3798 | _exception ? JNI_ABORT: 0); |
| 3799 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3800 | if (_exception) { |
| 3801 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3802 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3803 | } |
| 3804 | |
| 3805 | /* void glGetTexGenfvOES ( GLenum coord, GLenum pname, GLfloat *params ) */ |
| 3806 | static void |
| 3807 | android_glGetTexGenfvOES__IILjava_nio_FloatBuffer_2 |
| 3808 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3809 | jint _exception = 0; |
| 3810 | const char * _exceptionType = NULL; |
| 3811 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3812 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3813 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3814 | jint _remaining; |
| 3815 | GLfloat *params = (GLfloat *) 0; |
| 3816 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3817 | if (!params_buf) { |
| 3818 | _exception = 1; |
| 3819 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3820 | _exceptionMessage = "params == null"; |
| 3821 | goto exit; |
| 3822 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3823 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3824 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3825 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3826 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3827 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3828 | glGetTexGenfvOES( |
| 3829 | (GLenum)coord, |
| 3830 | (GLenum)pname, |
| 3831 | (GLfloat *)params |
| 3832 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3833 | |
| 3834 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3835 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3836 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 3837 | } |
| 3838 | if (_exception) { |
| 3839 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3840 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3841 | } |
| 3842 | |
| 3843 | /* void glGetTexGenivOES ( GLenum coord, GLenum pname, GLint *params ) */ |
| 3844 | static void |
| 3845 | android_glGetTexGenivOES__II_3II |
| 3846 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3847 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3848 | const char * _exceptionType = NULL; |
| 3849 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3850 | GLint *params_base = (GLint *) 0; |
| 3851 | jint _remaining; |
| 3852 | GLint *params = (GLint *) 0; |
| 3853 | |
| 3854 | if (!params_ref) { |
| 3855 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3856 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3857 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3858 | goto exit; |
| 3859 | } |
| 3860 | if (offset < 0) { |
| 3861 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3862 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3863 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3864 | goto exit; |
| 3865 | } |
| 3866 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3867 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3868 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3869 | params = params_base + offset; |
| 3870 | |
| 3871 | glGetTexGenivOES( |
| 3872 | (GLenum)coord, |
| 3873 | (GLenum)pname, |
| 3874 | (GLint *)params |
| 3875 | ); |
| 3876 | |
| 3877 | exit: |
| 3878 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3879 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3880 | _exception ? JNI_ABORT: 0); |
| 3881 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3882 | if (_exception) { |
| 3883 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3884 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3885 | } |
| 3886 | |
| 3887 | /* void glGetTexGenivOES ( GLenum coord, GLenum pname, GLint *params ) */ |
| 3888 | static void |
| 3889 | android_glGetTexGenivOES__IILjava_nio_IntBuffer_2 |
| 3890 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3891 | jint _exception = 0; |
| 3892 | const char * _exceptionType = NULL; |
| 3893 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3894 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3895 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3896 | jint _remaining; |
| 3897 | GLint *params = (GLint *) 0; |
| 3898 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3899 | if (!params_buf) { |
| 3900 | _exception = 1; |
| 3901 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3902 | _exceptionMessage = "params == null"; |
| 3903 | goto exit; |
| 3904 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3905 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3906 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3907 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3908 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 3909 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3910 | glGetTexGenivOES( |
| 3911 | (GLenum)coord, |
| 3912 | (GLenum)pname, |
| 3913 | (GLint *)params |
| 3914 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3915 | |
| 3916 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3917 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3918 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 3919 | } |
| 3920 | if (_exception) { |
| 3921 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3922 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3923 | } |
| 3924 | |
| 3925 | /* void glGetTexGenxvOES ( GLenum coord, GLenum pname, GLfixed *params ) */ |
| 3926 | static void |
| 3927 | android_glGetTexGenxvOES__II_3II |
| 3928 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3929 | jint _exception = 0; |
Mathias Agopian | 2ad0477 | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3930 | const char * _exceptionType = NULL; |
| 3931 | const char * _exceptionMessage = NULL; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3932 | GLfixed *params_base = (GLfixed *) 0; |
| 3933 | jint _remaining; |
| 3934 | GLfixed *params = (GLfixed *) 0; |
| 3935 | |
| 3936 | if (!params_ref) { |
| 3937 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3938 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3939 | _exceptionMessage = "params == null"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3940 | goto exit; |
| 3941 | } |
| 3942 | if (offset < 0) { |
| 3943 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3944 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3945 | _exceptionMessage = "offset < 0"; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3946 | goto exit; |
| 3947 | } |
| 3948 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3949 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3950 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3951 | params = params_base + offset; |
| 3952 | |
| 3953 | glGetTexGenxvOES( |
| 3954 | (GLenum)coord, |
| 3955 | (GLenum)pname, |
| 3956 | (GLfixed *)params |
| 3957 | ); |
| 3958 | |
| 3959 | exit: |
| 3960 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3961 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3962 | _exception ? JNI_ABORT: 0); |
| 3963 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3964 | if (_exception) { |
| 3965 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3966 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 3967 | } |
| 3968 | |
| 3969 | /* void glGetTexGenxvOES ( GLenum coord, GLenum pname, GLfixed *params ) */ |
| 3970 | static void |
| 3971 | android_glGetTexGenxvOES__IILjava_nio_IntBuffer_2 |
| 3972 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3973 | jint _exception = 0; |
| 3974 | const char * _exceptionType = NULL; |
| 3975 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3976 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3977 | jint _bufferOffset = (jint) 0; |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3978 | jint _remaining; |
| 3979 | GLfixed *params = (GLfixed *) 0; |
| 3980 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3981 | if (!params_buf) { |
| 3982 | _exception = 1; |
| 3983 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3984 | _exceptionMessage = "params == null"; |
| 3985 | goto exit; |
| 3986 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3987 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3988 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3989 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3990 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3991 | } |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3992 | glGetTexGenxvOES( |
| 3993 | (GLenum)coord, |
| 3994 | (GLenum)pname, |
| 3995 | (GLfixed *)params |
| 3996 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3997 | |
| 3998 | exit: |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 3999 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4000 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 4001 | } |
| 4002 | if (_exception) { |
| 4003 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | a379585 | 2009-04-24 10:35:11 -0700 | [diff] [blame] | 4004 | } |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 4005 | } |
| 4006 | |
| 4007 | static const char *classPathName = "android/opengl/GLES11Ext"; |
| 4008 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 4009 | static const JNINativeMethod methods[] = { |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 4010 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 4011 | {"glBlendEquationSeparateOES", "(II)V", (void *) android_glBlendEquationSeparateOES__II }, |
| 4012 | {"glBlendFuncSeparateOES", "(IIII)V", (void *) android_glBlendFuncSeparateOES__IIII }, |
| 4013 | {"glBlendEquationOES", "(I)V", (void *) android_glBlendEquationOES__I }, |
| 4014 | {"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS }, |
| 4015 | {"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII }, |
| 4016 | {"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII }, |
| 4017 | {"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI }, |
| 4018 | {"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 }, |
| 4019 | {"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II }, |
| 4020 | {"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 }, |
| 4021 | {"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II }, |
| 4022 | {"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 }, |
| 4023 | {"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF }, |
| 4024 | {"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI }, |
| 4025 | {"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 }, |
| 4026 | {"glEGLImageTargetTexture2DOES", "(ILjava/nio/Buffer;)V", (void *) android_glEGLImageTargetTexture2DOES__ILjava_nio_Buffer_2 }, |
| 4027 | {"glEGLImageTargetRenderbufferStorageOES", "(ILjava/nio/Buffer;)V", (void *) android_glEGLImageTargetRenderbufferStorageOES__ILjava_nio_Buffer_2 }, |
| 4028 | {"glAlphaFuncxOES", "(II)V", (void *) android_glAlphaFuncxOES__II }, |
| 4029 | {"glClearColorxOES", "(IIII)V", (void *) android_glClearColorxOES__IIII }, |
| 4030 | {"glClearDepthxOES", "(I)V", (void *) android_glClearDepthxOES__I }, |
| 4031 | {"glClipPlanexOES", "(I[II)V", (void *) android_glClipPlanexOES__I_3II }, |
| 4032 | {"glClipPlanexOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanexOES__ILjava_nio_IntBuffer_2 }, |
| 4033 | {"glColor4xOES", "(IIII)V", (void *) android_glColor4xOES__IIII }, |
| 4034 | {"glDepthRangexOES", "(II)V", (void *) android_glDepthRangexOES__II }, |
| 4035 | {"glFogxOES", "(II)V", (void *) android_glFogxOES__II }, |
| 4036 | {"glFogxvOES", "(I[II)V", (void *) android_glFogxvOES__I_3II }, |
| 4037 | {"glFogxvOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxvOES__ILjava_nio_IntBuffer_2 }, |
| 4038 | {"glFrustumxOES", "(IIIIII)V", (void *) android_glFrustumxOES__IIIIII }, |
| 4039 | {"glGetClipPlanexOES", "(I[II)V", (void *) android_glGetClipPlanexOES__I_3II }, |
| 4040 | {"glGetClipPlanexOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanexOES__ILjava_nio_IntBuffer_2 }, |
| 4041 | {"glGetFixedvOES", "(I[II)V", (void *) android_glGetFixedvOES__I_3II }, |
| 4042 | {"glGetFixedvOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedvOES__ILjava_nio_IntBuffer_2 }, |
| 4043 | {"glGetLightxvOES", "(II[II)V", (void *) android_glGetLightxvOES__II_3II }, |
| 4044 | {"glGetLightxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxvOES__IILjava_nio_IntBuffer_2 }, |
| 4045 | {"glGetMaterialxvOES", "(II[II)V", (void *) android_glGetMaterialxvOES__II_3II }, |
| 4046 | {"glGetMaterialxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxvOES__IILjava_nio_IntBuffer_2 }, |
| 4047 | {"glGetTexEnvxvOES", "(II[II)V", (void *) android_glGetTexEnvxvOES__II_3II }, |
| 4048 | {"glGetTexEnvxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxvOES__IILjava_nio_IntBuffer_2 }, |
| 4049 | {"glGetTexParameterxvOES", "(II[II)V", (void *) android_glGetTexParameterxvOES__II_3II }, |
| 4050 | {"glGetTexParameterxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxvOES__IILjava_nio_IntBuffer_2 }, |
| 4051 | {"glLightModelxOES", "(II)V", (void *) android_glLightModelxOES__II }, |
| 4052 | {"glLightModelxvOES", "(I[II)V", (void *) android_glLightModelxvOES__I_3II }, |
| 4053 | {"glLightModelxvOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxvOES__ILjava_nio_IntBuffer_2 }, |
| 4054 | {"glLightxOES", "(III)V", (void *) android_glLightxOES__III }, |
| 4055 | {"glLightxvOES", "(II[II)V", (void *) android_glLightxvOES__II_3II }, |
| 4056 | {"glLightxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxvOES__IILjava_nio_IntBuffer_2 }, |
| 4057 | {"glLineWidthxOES", "(I)V", (void *) android_glLineWidthxOES__I }, |
| 4058 | {"glLoadMatrixxOES", "([II)V", (void *) android_glLoadMatrixxOES___3II }, |
| 4059 | {"glLoadMatrixxOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixxOES__Ljava_nio_IntBuffer_2 }, |
| 4060 | {"glMaterialxOES", "(III)V", (void *) android_glMaterialxOES__III }, |
| 4061 | {"glMaterialxvOES", "(II[II)V", (void *) android_glMaterialxvOES__II_3II }, |
| 4062 | {"glMaterialxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxvOES__IILjava_nio_IntBuffer_2 }, |
| 4063 | {"glMultMatrixxOES", "([II)V", (void *) android_glMultMatrixxOES___3II }, |
| 4064 | {"glMultMatrixxOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixxOES__Ljava_nio_IntBuffer_2 }, |
| 4065 | {"glMultiTexCoord4xOES", "(IIIII)V", (void *) android_glMultiTexCoord4xOES__IIIII }, |
| 4066 | {"glNormal3xOES", "(III)V", (void *) android_glNormal3xOES__III }, |
| 4067 | {"glOrthoxOES", "(IIIIII)V", (void *) android_glOrthoxOES__IIIIII }, |
| 4068 | {"glPointParameterxOES", "(II)V", (void *) android_glPointParameterxOES__II }, |
| 4069 | {"glPointParameterxvOES", "(I[II)V", (void *) android_glPointParameterxvOES__I_3II }, |
| 4070 | {"glPointParameterxvOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxvOES__ILjava_nio_IntBuffer_2 }, |
| 4071 | {"glPointSizexOES", "(I)V", (void *) android_glPointSizexOES__I }, |
| 4072 | {"glPolygonOffsetxOES", "(II)V", (void *) android_glPolygonOffsetxOES__II }, |
| 4073 | {"glRotatexOES", "(IIII)V", (void *) android_glRotatexOES__IIII }, |
| 4074 | {"glSampleCoveragexOES", "(IZ)V", (void *) android_glSampleCoveragexOES__IZ }, |
| 4075 | {"glScalexOES", "(III)V", (void *) android_glScalexOES__III }, |
| 4076 | {"glTexEnvxOES", "(III)V", (void *) android_glTexEnvxOES__III }, |
| 4077 | {"glTexEnvxvOES", "(II[II)V", (void *) android_glTexEnvxvOES__II_3II }, |
| 4078 | {"glTexEnvxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxvOES__IILjava_nio_IntBuffer_2 }, |
| 4079 | {"glTexParameterxOES", "(III)V", (void *) android_glTexParameterxOES__III }, |
| 4080 | {"glTexParameterxvOES", "(II[II)V", (void *) android_glTexParameterxvOES__II_3II }, |
| 4081 | {"glTexParameterxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxvOES__IILjava_nio_IntBuffer_2 }, |
| 4082 | {"glTranslatexOES", "(III)V", (void *) android_glTranslatexOES__III }, |
| 4083 | {"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I }, |
| 4084 | {"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II }, |
| 4085 | {"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II }, |
| 4086 | {"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 4087 | {"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II }, |
| 4088 | {"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 4089 | {"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII }, |
| 4090 | {"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II }, |
| 4091 | {"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 }, |
| 4092 | {"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I }, |
| 4093 | {"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II }, |
| 4094 | {"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II }, |
| 4095 | {"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 4096 | {"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II }, |
| 4097 | {"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 4098 | {"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I }, |
| 4099 | {"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII }, |
| 4100 | {"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII }, |
| 4101 | {"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II }, |
| 4102 | {"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 }, |
| 4103 | {"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I }, |
| 4104 | {"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I }, |
| 4105 | {"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 4106 | {"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I }, |
| 4107 | {"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I }, |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 4108 | {"glDepthRangefOES", "(FF)V", (void *) android_glDepthRangefOES__FF }, |
| 4109 | {"glFrustumfOES", "(FFFFFF)V", (void *) android_glFrustumfOES__FFFFFF }, |
| 4110 | {"glOrthofOES", "(FFFFFF)V", (void *) android_glOrthofOES__FFFFFF }, |
| 4111 | {"glClipPlanefOES", "(I[FI)V", (void *) android_glClipPlanefOES__I_3FI }, |
| 4112 | {"glClipPlanefOES", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanefOES__ILjava_nio_FloatBuffer_2 }, |
| 4113 | {"glGetClipPlanefOES", "(I[FI)V", (void *) android_glGetClipPlanefOES__I_3FI }, |
| 4114 | {"glGetClipPlanefOES", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanefOES__ILjava_nio_FloatBuffer_2 }, |
| 4115 | {"glClearDepthfOES", "(F)V", (void *) android_glClearDepthfOES__F }, |
| 4116 | {"glTexGenfOES", "(IIF)V", (void *) android_glTexGenfOES__IIF }, |
| 4117 | {"glTexGenfvOES", "(II[FI)V", (void *) android_glTexGenfvOES__II_3FI }, |
| 4118 | {"glTexGenfvOES", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfvOES__IILjava_nio_FloatBuffer_2 }, |
| 4119 | {"glTexGeniOES", "(III)V", (void *) android_glTexGeniOES__III }, |
| 4120 | {"glTexGenivOES", "(II[II)V", (void *) android_glTexGenivOES__II_3II }, |
| 4121 | {"glTexGenivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenivOES__IILjava_nio_IntBuffer_2 }, |
| 4122 | {"glTexGenxOES", "(III)V", (void *) android_glTexGenxOES__III }, |
| 4123 | {"glTexGenxvOES", "(II[II)V", (void *) android_glTexGenxvOES__II_3II }, |
| 4124 | {"glTexGenxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxvOES__IILjava_nio_IntBuffer_2 }, |
| 4125 | {"glGetTexGenfvOES", "(II[FI)V", (void *) android_glGetTexGenfvOES__II_3FI }, |
| 4126 | {"glGetTexGenfvOES", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfvOES__IILjava_nio_FloatBuffer_2 }, |
| 4127 | {"glGetTexGenivOES", "(II[II)V", (void *) android_glGetTexGenivOES__II_3II }, |
| 4128 | {"glGetTexGenivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenivOES__IILjava_nio_IntBuffer_2 }, |
| 4129 | {"glGetTexGenxvOES", "(II[II)V", (void *) android_glGetTexGenxvOES__II_3II }, |
| 4130 | {"glGetTexGenxvOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxvOES__IILjava_nio_IntBuffer_2 }, |
| 4131 | }; |
| 4132 | |
| 4133 | int register_android_opengl_jni_GLES11Ext(JNIEnv *_env) |
| 4134 | { |
| 4135 | int err; |
| 4136 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 4137 | return err; |
| 4138 | } |