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