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