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