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