The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* //device/libs/android_runtime/com_google_android_gles_jni_GLImpl.cpp |
| 2 | ** |
| 3 | ** Copyright 2006, 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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8 | ** |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [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 |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [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 | |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 24 | #include "jni.h" |
| 25 | #include "JNIHelp.h" |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | #include <android_runtime/AndroidRuntime.h> |
| 27 | #include <utils/misc.h> |
| 28 | |
| 29 | #include <assert.h> |
| 30 | #include <GLES/gl.h> |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 31 | #include <GLES/glext.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 32 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 33 | // Work around differences between the generated name and the actual name. |
| 34 | |
| 35 | #define glBlendEquation glBlendEquationOES |
| 36 | #define glBlendEquationSeparate glBlendEquationSeparateOES |
| 37 | #define glBlendFuncSeparate glBlendFuncSeparateOES |
| 38 | #define glGetTexGenfv glGetTexGenfvOES |
| 39 | #define glGetTexGeniv glGetTexGenivOES |
| 40 | #define glGetTexGenxv glGetTexGenxvOES |
| 41 | #define glTexGenf glTexGenfOES |
| 42 | #define glTexGenfv glTexGenfvOES |
| 43 | #define glTexGeni glTexGeniOES |
| 44 | #define glTexGeniv glTexGenivOES |
| 45 | #define glTexGenx glTexGenxOES |
| 46 | #define glTexGenxv glTexGenxvOES |
| 47 | |
| 48 | |
| 49 | |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 50 | /* special calls implemented in Android's GLES wrapper used to more |
| 51 | * efficiently bound-check passed arrays */ |
| 52 | extern "C" { |
| 53 | GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, |
| 54 | const GLvoid *ptr, GLsizei count); |
| 55 | GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, |
| 56 | const GLvoid *pointer, GLsizei count); |
| 57 | GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, |
| 58 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 59 | GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, |
| 60 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 61 | GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, |
| 62 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 63 | GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, |
| 64 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 65 | GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, |
| 66 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 67 | } |
| 68 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | static int initialized = 0; |
| 70 | |
| 71 | static jclass nioAccessClass; |
| 72 | static jclass bufferClass; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 73 | static jclass G11ImplClass; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | static jmethodID getBasePointerID; |
| 75 | static jmethodID getBaseArrayID; |
| 76 | static jmethodID getBaseArrayOffsetID; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 77 | static jmethodID allowIndirectBuffersID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | static jfieldID positionID; |
| 79 | static jfieldID limitID; |
| 80 | static jfieldID elementSizeShiftID; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 81 | static jfieldID haveCheckedExtensionsID; |
| 82 | static jfieldID have_OES_blend_equation_separateID; |
| 83 | static jfieldID have_OES_blend_subtractID; |
| 84 | static jfieldID have_OES_framebuffer_objectID; |
| 85 | static jfieldID have_OES_texture_cube_mapID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | |
| 87 | /* Cache method IDs each time the class is loaded. */ |
| 88 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 89 | static void |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 90 | nativeClassInit(JNIEnv *_env, jclass glImplClass) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 91 | { |
| 92 | jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); |
| 93 | nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); |
| 94 | |
| 95 | jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); |
| 96 | bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); |
| 97 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 98 | jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl"); |
| 99 | G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 100 | haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z"); |
| 101 | have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z"); |
| 102 | have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z"); |
| 103 | have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z"); |
| 104 | have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 105 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 106 | getBasePointerID = _env->GetStaticMethodID(nioAccessClass, |
| 107 | "getBasePointer", "(Ljava/nio/Buffer;)J"); |
| 108 | getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, |
| 109 | "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); |
| 110 | getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, |
| 111 | "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 112 | allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal, |
| 113 | "allowIndirectBuffers", "(Ljava/lang/String;)Z"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 114 | positionID = _env->GetFieldID(bufferClass, "position", "I"); |
| 115 | limitID = _env->GetFieldID(bufferClass, "limit", "I"); |
| 116 | elementSizeShiftID = |
| 117 | _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); |
| 118 | } |
| 119 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 120 | static void * |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 121 | getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | { |
| 123 | jint position; |
| 124 | jint limit; |
| 125 | jint elementSizeShift; |
| 126 | jlong pointer; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 127 | |
| 128 | position = _env->GetIntField(buffer, positionID); |
| 129 | limit = _env->GetIntField(buffer, limitID); |
| 130 | elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
| 131 | *remaining = (limit - position) << elementSizeShift; |
| 132 | pointer = _env->CallStaticLongMethod(nioAccessClass, |
| 133 | getBasePointerID, buffer); |
| 134 | if (pointer != 0L) { |
| 135 | *array = NULL; |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 136 | return reinterpret_cast<void *>(pointer); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 137 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 138 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 139 | *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, |
| 140 | getBaseArrayID, buffer); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 141 | if (*array == NULL) { |
| 142 | return (void*) NULL; |
| 143 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 144 | *offset = _env->CallStaticIntMethod(nioAccessClass, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 145 | getBaseArrayOffsetID, buffer); |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 146 | |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 147 | return NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 148 | } |
| 149 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | static void |
| 151 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 152 | { |
| 153 | _env->ReleasePrimitiveArrayCritical(array, data, |
| 154 | commit ? 0 : JNI_ABORT); |
| 155 | } |
| 156 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 157 | extern "C" { |
| 158 | extern char* __progname; |
| 159 | } |
| 160 | |
| 161 | static bool |
| 162 | allowIndirectBuffers(JNIEnv *_env) { |
| 163 | static jint sIndirectBufferCompatability; |
| 164 | if (sIndirectBufferCompatability == 0) { |
| 165 | jobject appName = _env->NewStringUTF(::__progname); |
| 166 | sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1; |
| 167 | } |
| 168 | return sIndirectBufferCompatability == 2; |
| 169 | } |
| 170 | |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 171 | static void * |
| 172 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 173 | if (!buffer) { |
| 174 | return NULL; |
| 175 | } |
| 176 | void* buf = _env->GetDirectBufferAddress(buffer); |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 177 | if (buf) { |
| 178 | jint position = _env->GetIntField(buffer, positionID); |
| 179 | jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 180 | buf = ((char*) buf) + (position << elementSizeShift); |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 181 | } else { |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 182 | if (allowIndirectBuffers(_env)) { |
| 183 | jarray array = 0; |
| 184 | jint remaining; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 185 | jint offset; |
| 186 | buf = getPointer(_env, buffer, &array, &remaining, &offset); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 187 | if (array) { |
| 188 | releasePointer(_env, array, buf, 0); |
| 189 | } |
synergydev | 01994c7 | 2013-10-14 12:20:16 -0700 | [diff] [blame] | 190 | buf = (char*)buf + offset; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 191 | } else { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 192 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 193 | "Must use a native order direct Buffer"); |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 194 | } |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 195 | } |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 196 | return buf; |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 197 | } |
| 198 | |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 199 | static int |
| 200 | getNumCompressedTextureFormats() { |
| 201 | int numCompressedTextureFormats = 0; |
| 202 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); |
| 203 | return numCompressedTextureFormats; |
| 204 | } |
| 205 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 206 | // Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is |
| 207 | // terminated by either 0 or space, while pExtension is terminated by 0. |
| 208 | |
| 209 | static bool |
| 210 | extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 211 | while (true) { |
| 212 | char a = *pExtensions++; |
| 213 | char b = *pExtension++; |
| 214 | bool aEnd = a == '\0' || a == ' '; |
| 215 | bool bEnd = b == '\0'; |
| 216 | if ( aEnd || bEnd) { |
| 217 | return aEnd == bEnd; |
| 218 | } |
| 219 | if ( a != b ) { |
| 220 | return false; |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | static const GLubyte* |
| 226 | nextExtension(const GLubyte* pExtensions) { |
| 227 | while (true) { |
| 228 | char a = *pExtensions++; |
| 229 | if ( a == '\0') { |
| 230 | return pExtensions-1; |
| 231 | } else if ( a == ' ') { |
| 232 | return pExtensions; |
| 233 | } |
| 234 | } |
| 235 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 236 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 237 | static bool |
| 238 | checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 239 | for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) { |
| 240 | if (extensionEqual(pExtensions, pExtension)) { |
| 241 | return true; |
| 242 | } |
| 243 | } |
| 244 | return false; |
| 245 | } |
| 246 | |
| 247 | static bool |
| 248 | supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) { |
| 249 | if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) { |
| 250 | _env->SetBooleanField(impl, haveCheckedExtensionsID, true); |
| 251 | const GLubyte* sExtensions = glGetString(GL_EXTENSIONS); |
| 252 | _env->SetBooleanField(impl, have_OES_blend_equation_separateID, |
| 253 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate")); |
| 254 | _env->SetBooleanField(impl, have_OES_blend_subtractID, |
| 255 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract")); |
| 256 | _env->SetBooleanField(impl, have_OES_framebuffer_objectID, |
| 257 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object")); |
| 258 | _env->SetBooleanField(impl, have_OES_texture_cube_mapID, |
| 259 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map")); |
| 260 | } |
| 261 | return _env->GetBooleanField(impl, fieldId); |
| 262 | } |
| 263 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 264 | // -------------------------------------------------------------------------- |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 265 | /* void glActiveTexture ( GLenum texture ) */ |
| 266 | static void |
| 267 | android_glActiveTexture__I |
| 268 | (JNIEnv *_env, jobject _this, jint texture) { |
| 269 | glActiveTexture( |
| 270 | (GLenum)texture |
| 271 | ); |
| 272 | } |
| 273 | |
| 274 | /* void glAlphaFunc ( GLenum func, GLclampf ref ) */ |
| 275 | static void |
| 276 | android_glAlphaFunc__IF |
| 277 | (JNIEnv *_env, jobject _this, jint func, jfloat ref) { |
| 278 | glAlphaFunc( |
| 279 | (GLenum)func, |
| 280 | (GLclampf)ref |
| 281 | ); |
| 282 | } |
| 283 | |
| 284 | /* void glAlphaFuncx ( GLenum func, GLclampx ref ) */ |
| 285 | static void |
| 286 | android_glAlphaFuncx__II |
| 287 | (JNIEnv *_env, jobject _this, jint func, jint ref) { |
| 288 | glAlphaFuncx( |
| 289 | (GLenum)func, |
| 290 | (GLclampx)ref |
| 291 | ); |
| 292 | } |
| 293 | |
| 294 | /* void glBindTexture ( GLenum target, GLuint texture ) */ |
| 295 | static void |
| 296 | android_glBindTexture__II |
| 297 | (JNIEnv *_env, jobject _this, jint target, jint texture) { |
| 298 | glBindTexture( |
| 299 | (GLenum)target, |
| 300 | (GLuint)texture |
| 301 | ); |
| 302 | } |
| 303 | |
| 304 | /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ |
| 305 | static void |
| 306 | android_glBlendFunc__II |
| 307 | (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { |
| 308 | glBlendFunc( |
| 309 | (GLenum)sfactor, |
| 310 | (GLenum)dfactor |
| 311 | ); |
| 312 | } |
| 313 | |
| 314 | /* void glClear ( GLbitfield mask ) */ |
| 315 | static void |
| 316 | android_glClear__I |
| 317 | (JNIEnv *_env, jobject _this, jint mask) { |
| 318 | glClear( |
| 319 | (GLbitfield)mask |
| 320 | ); |
| 321 | } |
| 322 | |
| 323 | /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ |
| 324 | static void |
| 325 | android_glClearColor__FFFF |
| 326 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 327 | glClearColor( |
| 328 | (GLclampf)red, |
| 329 | (GLclampf)green, |
| 330 | (GLclampf)blue, |
| 331 | (GLclampf)alpha |
| 332 | ); |
| 333 | } |
| 334 | |
| 335 | /* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */ |
| 336 | static void |
| 337 | android_glClearColorx__IIII |
| 338 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 339 | glClearColorx( |
| 340 | (GLclampx)red, |
| 341 | (GLclampx)green, |
| 342 | (GLclampx)blue, |
| 343 | (GLclampx)alpha |
| 344 | ); |
| 345 | } |
| 346 | |
| 347 | /* void glClearDepthf ( GLclampf depth ) */ |
| 348 | static void |
| 349 | android_glClearDepthf__F |
| 350 | (JNIEnv *_env, jobject _this, jfloat depth) { |
| 351 | glClearDepthf( |
| 352 | (GLclampf)depth |
| 353 | ); |
| 354 | } |
| 355 | |
| 356 | /* void glClearDepthx ( GLclampx depth ) */ |
| 357 | static void |
| 358 | android_glClearDepthx__I |
| 359 | (JNIEnv *_env, jobject _this, jint depth) { |
| 360 | glClearDepthx( |
| 361 | (GLclampx)depth |
| 362 | ); |
| 363 | } |
| 364 | |
| 365 | /* void glClearStencil ( GLint s ) */ |
| 366 | static void |
| 367 | android_glClearStencil__I |
| 368 | (JNIEnv *_env, jobject _this, jint s) { |
| 369 | glClearStencil( |
| 370 | (GLint)s |
| 371 | ); |
| 372 | } |
| 373 | |
| 374 | /* void glClientActiveTexture ( GLenum texture ) */ |
| 375 | static void |
| 376 | android_glClientActiveTexture__I |
| 377 | (JNIEnv *_env, jobject _this, jint texture) { |
| 378 | glClientActiveTexture( |
| 379 | (GLenum)texture |
| 380 | ); |
| 381 | } |
| 382 | |
| 383 | /* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */ |
| 384 | static void |
| 385 | android_glColor4f__FFFF |
| 386 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 387 | glColor4f( |
| 388 | (GLfloat)red, |
| 389 | (GLfloat)green, |
| 390 | (GLfloat)blue, |
| 391 | (GLfloat)alpha |
| 392 | ); |
| 393 | } |
| 394 | |
| 395 | /* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */ |
| 396 | static void |
| 397 | android_glColor4x__IIII |
| 398 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 399 | glColor4x( |
| 400 | (GLfixed)red, |
| 401 | (GLfixed)green, |
| 402 | (GLfixed)blue, |
| 403 | (GLfixed)alpha |
| 404 | ); |
| 405 | } |
| 406 | |
| 407 | /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ |
| 408 | static void |
| 409 | android_glColorMask__ZZZZ |
| 410 | (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { |
| 411 | glColorMask( |
| 412 | (GLboolean)red, |
| 413 | (GLboolean)green, |
| 414 | (GLboolean)blue, |
| 415 | (GLboolean)alpha |
| 416 | ); |
| 417 | } |
| 418 | |
| 419 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 420 | static void |
| 421 | android_glColorPointerBounds__IIILjava_nio_Buffer_2I |
| 422 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 423 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 424 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 425 | jint _remaining; |
| 426 | GLvoid *pointer = (GLvoid *) 0; |
| 427 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 428 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 429 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 430 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 431 | return; |
| 432 | } |
| 433 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 434 | glColorPointerBounds( |
| 435 | (GLint)size, |
| 436 | (GLenum)type, |
| 437 | (GLsizei)stride, |
| 438 | (GLvoid *)pointer, |
| 439 | (GLsizei)remaining |
| 440 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | } |
| 442 | |
| 443 | /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 444 | static void |
| 445 | android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 |
| 446 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { |
| 447 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 448 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 449 | jint _remaining; |
| 450 | GLvoid *data = (GLvoid *) 0; |
| 451 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 452 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 453 | if (data == NULL) { |
| 454 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 455 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 456 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 457 | glCompressedTexImage2D( |
| 458 | (GLenum)target, |
| 459 | (GLint)level, |
| 460 | (GLenum)internalformat, |
| 461 | (GLsizei)width, |
| 462 | (GLsizei)height, |
| 463 | (GLint)border, |
| 464 | (GLsizei)imageSize, |
| 465 | (GLvoid *)data |
| 466 | ); |
| 467 | if (_array) { |
| 468 | releasePointer(_env, _array, data, JNI_FALSE); |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 473 | static void |
| 474 | android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 475 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { |
| 476 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 477 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 478 | jint _remaining; |
| 479 | GLvoid *data = (GLvoid *) 0; |
| 480 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 481 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 482 | if (data == NULL) { |
| 483 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 484 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 485 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 486 | glCompressedTexSubImage2D( |
| 487 | (GLenum)target, |
| 488 | (GLint)level, |
| 489 | (GLint)xoffset, |
| 490 | (GLint)yoffset, |
| 491 | (GLsizei)width, |
| 492 | (GLsizei)height, |
| 493 | (GLenum)format, |
| 494 | (GLsizei)imageSize, |
| 495 | (GLvoid *)data |
| 496 | ); |
| 497 | if (_array) { |
| 498 | releasePointer(_env, _array, data, JNI_FALSE); |
| 499 | } |
| 500 | } |
| 501 | |
| 502 | /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ |
| 503 | static void |
| 504 | android_glCopyTexImage2D__IIIIIIII |
| 505 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { |
| 506 | glCopyTexImage2D( |
| 507 | (GLenum)target, |
| 508 | (GLint)level, |
| 509 | (GLenum)internalformat, |
| 510 | (GLint)x, |
| 511 | (GLint)y, |
| 512 | (GLsizei)width, |
| 513 | (GLsizei)height, |
| 514 | (GLint)border |
| 515 | ); |
| 516 | } |
| 517 | |
| 518 | /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 519 | static void |
| 520 | android_glCopyTexSubImage2D__IIIIIIII |
| 521 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { |
| 522 | glCopyTexSubImage2D( |
| 523 | (GLenum)target, |
| 524 | (GLint)level, |
| 525 | (GLint)xoffset, |
| 526 | (GLint)yoffset, |
| 527 | (GLint)x, |
| 528 | (GLint)y, |
| 529 | (GLsizei)width, |
| 530 | (GLsizei)height |
| 531 | ); |
| 532 | } |
| 533 | |
| 534 | /* void glCullFace ( GLenum mode ) */ |
| 535 | static void |
| 536 | android_glCullFace__I |
| 537 | (JNIEnv *_env, jobject _this, jint mode) { |
| 538 | glCullFace( |
| 539 | (GLenum)mode |
| 540 | ); |
| 541 | } |
| 542 | |
| 543 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 544 | static void |
| 545 | android_glDeleteTextures__I_3II |
| 546 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 547 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 548 | const char * _exceptionType = NULL; |
| 549 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 550 | GLuint *textures_base = (GLuint *) 0; |
| 551 | jint _remaining; |
| 552 | GLuint *textures = (GLuint *) 0; |
| 553 | |
| 554 | if (!textures_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 555 | _exception = 1; |
| 556 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 557 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 558 | goto exit; |
| 559 | } |
| 560 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 561 | _exception = 1; |
| 562 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 563 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 564 | goto exit; |
| 565 | } |
| 566 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 567 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 568 | _exception = 1; |
| 569 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 570 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 571 | goto exit; |
| 572 | } |
| 573 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 574 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 575 | textures = textures_base + offset; |
| 576 | |
| 577 | glDeleteTextures( |
| 578 | (GLsizei)n, |
| 579 | (GLuint *)textures |
| 580 | ); |
| 581 | |
| 582 | exit: |
| 583 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 584 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 585 | JNI_ABORT); |
| 586 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 587 | if (_exception) { |
| 588 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 589 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 590 | } |
| 591 | |
| 592 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 593 | static void |
| 594 | android_glDeleteTextures__ILjava_nio_IntBuffer_2 |
| 595 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 596 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 597 | const char * _exceptionType = NULL; |
| 598 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 599 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 600 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 601 | jint _remaining; |
| 602 | GLuint *textures = (GLuint *) 0; |
| 603 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 604 | textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 606 | _exception = 1; |
| 607 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 608 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | goto exit; |
| 610 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 611 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 612 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 613 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 614 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 615 | glDeleteTextures( |
| 616 | (GLsizei)n, |
| 617 | (GLuint *)textures |
| 618 | ); |
| 619 | |
| 620 | exit: |
| 621 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 622 | _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 623 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 624 | if (_exception) { |
| 625 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 626 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 627 | } |
| 628 | |
| 629 | /* void glDepthFunc ( GLenum func ) */ |
| 630 | static void |
| 631 | android_glDepthFunc__I |
| 632 | (JNIEnv *_env, jobject _this, jint func) { |
| 633 | glDepthFunc( |
| 634 | (GLenum)func |
| 635 | ); |
| 636 | } |
| 637 | |
| 638 | /* void glDepthMask ( GLboolean flag ) */ |
| 639 | static void |
| 640 | android_glDepthMask__Z |
| 641 | (JNIEnv *_env, jobject _this, jboolean flag) { |
| 642 | glDepthMask( |
| 643 | (GLboolean)flag |
| 644 | ); |
| 645 | } |
| 646 | |
| 647 | /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ |
| 648 | static void |
| 649 | android_glDepthRangef__FF |
| 650 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
| 651 | glDepthRangef( |
| 652 | (GLclampf)zNear, |
| 653 | (GLclampf)zFar |
| 654 | ); |
| 655 | } |
| 656 | |
| 657 | /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */ |
| 658 | static void |
| 659 | android_glDepthRangex__II |
| 660 | (JNIEnv *_env, jobject _this, jint zNear, jint zFar) { |
| 661 | glDepthRangex( |
| 662 | (GLclampx)zNear, |
| 663 | (GLclampx)zFar |
| 664 | ); |
| 665 | } |
| 666 | |
| 667 | /* void glDisable ( GLenum cap ) */ |
| 668 | static void |
| 669 | android_glDisable__I |
| 670 | (JNIEnv *_env, jobject _this, jint cap) { |
| 671 | glDisable( |
| 672 | (GLenum)cap |
| 673 | ); |
| 674 | } |
| 675 | |
| 676 | /* void glDisableClientState ( GLenum array ) */ |
| 677 | static void |
| 678 | android_glDisableClientState__I |
| 679 | (JNIEnv *_env, jobject _this, jint array) { |
| 680 | glDisableClientState( |
| 681 | (GLenum)array |
| 682 | ); |
| 683 | } |
| 684 | |
| 685 | /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ |
| 686 | static void |
| 687 | android_glDrawArrays__III |
| 688 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { |
| 689 | glDrawArrays( |
| 690 | (GLenum)mode, |
| 691 | (GLint)first, |
| 692 | (GLsizei)count |
| 693 | ); |
| 694 | } |
| 695 | |
| 696 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 697 | static void |
| 698 | android_glDrawElements__IIILjava_nio_Buffer_2 |
| 699 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 700 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 701 | const char * _exceptionType = NULL; |
| 702 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 703 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 704 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | jint _remaining; |
| 706 | GLvoid *indices = (GLvoid *) 0; |
| 707 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 708 | indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 709 | if (_remaining < count) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 710 | _exception = 1; |
| 711 | _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; |
| 712 | _exceptionMessage = "remaining() < count < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 713 | goto exit; |
| 714 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 715 | if (indices == NULL) { |
| 716 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 717 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 718 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 719 | glDrawElements( |
| 720 | (GLenum)mode, |
| 721 | (GLsizei)count, |
| 722 | (GLenum)type, |
| 723 | (GLvoid *)indices |
| 724 | ); |
| 725 | |
| 726 | exit: |
| 727 | if (_array) { |
| 728 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 729 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 730 | if (_exception) { |
| 731 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 732 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | /* void glEnable ( GLenum cap ) */ |
| 736 | static void |
| 737 | android_glEnable__I |
| 738 | (JNIEnv *_env, jobject _this, jint cap) { |
| 739 | glEnable( |
| 740 | (GLenum)cap |
| 741 | ); |
| 742 | } |
| 743 | |
| 744 | /* void glEnableClientState ( GLenum array ) */ |
| 745 | static void |
| 746 | android_glEnableClientState__I |
| 747 | (JNIEnv *_env, jobject _this, jint array) { |
| 748 | glEnableClientState( |
| 749 | (GLenum)array |
| 750 | ); |
| 751 | } |
| 752 | |
| 753 | /* void glFinish ( void ) */ |
| 754 | static void |
| 755 | android_glFinish__ |
| 756 | (JNIEnv *_env, jobject _this) { |
| 757 | glFinish(); |
| 758 | } |
| 759 | |
| 760 | /* void glFlush ( void ) */ |
| 761 | static void |
| 762 | android_glFlush__ |
| 763 | (JNIEnv *_env, jobject _this) { |
| 764 | glFlush(); |
| 765 | } |
| 766 | |
| 767 | /* void glFogf ( GLenum pname, GLfloat param ) */ |
| 768 | static void |
| 769 | android_glFogf__IF |
| 770 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 771 | glFogf( |
| 772 | (GLenum)pname, |
| 773 | (GLfloat)param |
| 774 | ); |
| 775 | } |
| 776 | |
| 777 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 778 | static void |
| 779 | android_glFogfv__I_3FI |
| 780 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 781 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 782 | const char * _exceptionType = NULL; |
| 783 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 784 | GLfloat *params_base = (GLfloat *) 0; |
| 785 | jint _remaining; |
| 786 | GLfloat *params = (GLfloat *) 0; |
| 787 | |
| 788 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 789 | _exception = 1; |
| 790 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 791 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 792 | goto exit; |
| 793 | } |
| 794 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 795 | _exception = 1; |
| 796 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 797 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 798 | goto exit; |
| 799 | } |
| 800 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 801 | int _needed; |
| 802 | switch (pname) { |
| 803 | #if defined(GL_FOG_MODE) |
| 804 | case GL_FOG_MODE: |
| 805 | #endif // defined(GL_FOG_MODE) |
| 806 | #if defined(GL_FOG_DENSITY) |
| 807 | case GL_FOG_DENSITY: |
| 808 | #endif // defined(GL_FOG_DENSITY) |
| 809 | #if defined(GL_FOG_START) |
| 810 | case GL_FOG_START: |
| 811 | #endif // defined(GL_FOG_START) |
| 812 | #if defined(GL_FOG_END) |
| 813 | case GL_FOG_END: |
| 814 | #endif // defined(GL_FOG_END) |
| 815 | _needed = 1; |
| 816 | break; |
| 817 | #if defined(GL_FOG_COLOR) |
| 818 | case GL_FOG_COLOR: |
| 819 | #endif // defined(GL_FOG_COLOR) |
| 820 | _needed = 4; |
| 821 | break; |
| 822 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 823 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 824 | break; |
| 825 | } |
| 826 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 827 | _exception = 1; |
| 828 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 829 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 830 | goto exit; |
| 831 | } |
| 832 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 833 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 834 | params = params_base + offset; |
| 835 | |
| 836 | glFogfv( |
| 837 | (GLenum)pname, |
| 838 | (GLfloat *)params |
| 839 | ); |
| 840 | |
| 841 | exit: |
| 842 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 843 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 844 | JNI_ABORT); |
| 845 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 846 | if (_exception) { |
| 847 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 848 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 849 | } |
| 850 | |
| 851 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 852 | static void |
| 853 | android_glFogfv__ILjava_nio_FloatBuffer_2 |
| 854 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 855 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 856 | const char * _exceptionType = NULL; |
| 857 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 858 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 859 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 860 | jint _remaining; |
| 861 | GLfloat *params = (GLfloat *) 0; |
| 862 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 863 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 864 | int _needed; |
| 865 | switch (pname) { |
| 866 | #if defined(GL_FOG_MODE) |
| 867 | case GL_FOG_MODE: |
| 868 | #endif // defined(GL_FOG_MODE) |
| 869 | #if defined(GL_FOG_DENSITY) |
| 870 | case GL_FOG_DENSITY: |
| 871 | #endif // defined(GL_FOG_DENSITY) |
| 872 | #if defined(GL_FOG_START) |
| 873 | case GL_FOG_START: |
| 874 | #endif // defined(GL_FOG_START) |
| 875 | #if defined(GL_FOG_END) |
| 876 | case GL_FOG_END: |
| 877 | #endif // defined(GL_FOG_END) |
| 878 | _needed = 1; |
| 879 | break; |
| 880 | #if defined(GL_FOG_COLOR) |
| 881 | case GL_FOG_COLOR: |
| 882 | #endif // defined(GL_FOG_COLOR) |
| 883 | _needed = 4; |
| 884 | break; |
| 885 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 886 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 887 | break; |
| 888 | } |
| 889 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 890 | _exception = 1; |
| 891 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 892 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 893 | goto exit; |
| 894 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 895 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 896 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 897 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 898 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 899 | glFogfv( |
| 900 | (GLenum)pname, |
| 901 | (GLfloat *)params |
| 902 | ); |
| 903 | |
| 904 | exit: |
| 905 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 906 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 907 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 908 | if (_exception) { |
| 909 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 910 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 911 | } |
| 912 | |
| 913 | /* void glFogx ( GLenum pname, GLfixed param ) */ |
| 914 | static void |
| 915 | android_glFogx__II |
| 916 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 917 | glFogx( |
| 918 | (GLenum)pname, |
| 919 | (GLfixed)param |
| 920 | ); |
| 921 | } |
| 922 | |
| 923 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 924 | static void |
| 925 | android_glFogxv__I_3II |
| 926 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 927 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 928 | const char * _exceptionType = NULL; |
| 929 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 930 | GLfixed *params_base = (GLfixed *) 0; |
| 931 | jint _remaining; |
| 932 | GLfixed *params = (GLfixed *) 0; |
| 933 | |
| 934 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 935 | _exception = 1; |
| 936 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 937 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 938 | goto exit; |
| 939 | } |
| 940 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 941 | _exception = 1; |
| 942 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 943 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 944 | goto exit; |
| 945 | } |
| 946 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 947 | int _needed; |
| 948 | switch (pname) { |
| 949 | #if defined(GL_FOG_MODE) |
| 950 | case GL_FOG_MODE: |
| 951 | #endif // defined(GL_FOG_MODE) |
| 952 | #if defined(GL_FOG_DENSITY) |
| 953 | case GL_FOG_DENSITY: |
| 954 | #endif // defined(GL_FOG_DENSITY) |
| 955 | #if defined(GL_FOG_START) |
| 956 | case GL_FOG_START: |
| 957 | #endif // defined(GL_FOG_START) |
| 958 | #if defined(GL_FOG_END) |
| 959 | case GL_FOG_END: |
| 960 | #endif // defined(GL_FOG_END) |
| 961 | _needed = 1; |
| 962 | break; |
| 963 | #if defined(GL_FOG_COLOR) |
| 964 | case GL_FOG_COLOR: |
| 965 | #endif // defined(GL_FOG_COLOR) |
| 966 | _needed = 4; |
| 967 | break; |
| 968 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 969 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 970 | break; |
| 971 | } |
| 972 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 973 | _exception = 1; |
| 974 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 975 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 976 | goto exit; |
| 977 | } |
| 978 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 979 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 980 | params = params_base + offset; |
| 981 | |
| 982 | glFogxv( |
| 983 | (GLenum)pname, |
| 984 | (GLfixed *)params |
| 985 | ); |
| 986 | |
| 987 | exit: |
| 988 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 989 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 990 | JNI_ABORT); |
| 991 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 992 | if (_exception) { |
| 993 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 994 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 995 | } |
| 996 | |
| 997 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 998 | static void |
| 999 | android_glFogxv__ILjava_nio_IntBuffer_2 |
| 1000 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1001 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1002 | const char * _exceptionType = NULL; |
| 1003 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1004 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1005 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1006 | jint _remaining; |
| 1007 | GLfixed *params = (GLfixed *) 0; |
| 1008 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1009 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1010 | int _needed; |
| 1011 | switch (pname) { |
| 1012 | #if defined(GL_FOG_MODE) |
| 1013 | case GL_FOG_MODE: |
| 1014 | #endif // defined(GL_FOG_MODE) |
| 1015 | #if defined(GL_FOG_DENSITY) |
| 1016 | case GL_FOG_DENSITY: |
| 1017 | #endif // defined(GL_FOG_DENSITY) |
| 1018 | #if defined(GL_FOG_START) |
| 1019 | case GL_FOG_START: |
| 1020 | #endif // defined(GL_FOG_START) |
| 1021 | #if defined(GL_FOG_END) |
| 1022 | case GL_FOG_END: |
| 1023 | #endif // defined(GL_FOG_END) |
| 1024 | _needed = 1; |
| 1025 | break; |
| 1026 | #if defined(GL_FOG_COLOR) |
| 1027 | case GL_FOG_COLOR: |
| 1028 | #endif // defined(GL_FOG_COLOR) |
| 1029 | _needed = 4; |
| 1030 | break; |
| 1031 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1032 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1033 | break; |
| 1034 | } |
| 1035 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1036 | _exception = 1; |
| 1037 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1038 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1039 | goto exit; |
| 1040 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1041 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1042 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1043 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1044 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1045 | glFogxv( |
| 1046 | (GLenum)pname, |
| 1047 | (GLfixed *)params |
| 1048 | ); |
| 1049 | |
| 1050 | exit: |
| 1051 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1052 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1053 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1054 | if (_exception) { |
| 1055 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1056 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1057 | } |
| 1058 | |
| 1059 | /* void glFrontFace ( GLenum mode ) */ |
| 1060 | static void |
| 1061 | android_glFrontFace__I |
| 1062 | (JNIEnv *_env, jobject _this, jint mode) { |
| 1063 | glFrontFace( |
| 1064 | (GLenum)mode |
| 1065 | ); |
| 1066 | } |
| 1067 | |
| 1068 | /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 1069 | static void |
| 1070 | android_glFrustumf__FFFFFF |
| 1071 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 1072 | glFrustumf( |
| 1073 | (GLfloat)left, |
| 1074 | (GLfloat)right, |
| 1075 | (GLfloat)bottom, |
| 1076 | (GLfloat)top, |
| 1077 | (GLfloat)zNear, |
| 1078 | (GLfloat)zFar |
| 1079 | ); |
| 1080 | } |
| 1081 | |
| 1082 | /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 1083 | static void |
| 1084 | android_glFrustumx__IIIIII |
| 1085 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 1086 | glFrustumx( |
| 1087 | (GLfixed)left, |
| 1088 | (GLfixed)right, |
| 1089 | (GLfixed)bottom, |
| 1090 | (GLfixed)top, |
| 1091 | (GLfixed)zNear, |
| 1092 | (GLfixed)zFar |
| 1093 | ); |
| 1094 | } |
| 1095 | |
| 1096 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1097 | static void |
| 1098 | android_glGenTextures__I_3II |
| 1099 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 1100 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1101 | const char * _exceptionType = NULL; |
| 1102 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1103 | GLuint *textures_base = (GLuint *) 0; |
| 1104 | jint _remaining; |
| 1105 | GLuint *textures = (GLuint *) 0; |
| 1106 | |
| 1107 | if (!textures_ref) { |
| 1108 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1109 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1110 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1111 | goto exit; |
| 1112 | } |
| 1113 | if (offset < 0) { |
| 1114 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1115 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1116 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1117 | goto exit; |
| 1118 | } |
| 1119 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 1120 | if (_remaining < n) { |
| 1121 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1122 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1123 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1124 | goto exit; |
| 1125 | } |
| 1126 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1127 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1128 | textures = textures_base + offset; |
| 1129 | |
| 1130 | glGenTextures( |
| 1131 | (GLsizei)n, |
| 1132 | (GLuint *)textures |
| 1133 | ); |
| 1134 | |
| 1135 | exit: |
| 1136 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1137 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1138 | _exception ? JNI_ABORT: 0); |
| 1139 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1140 | if (_exception) { |
| 1141 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1142 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1143 | } |
| 1144 | |
| 1145 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1146 | static void |
| 1147 | android_glGenTextures__ILjava_nio_IntBuffer_2 |
| 1148 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 1149 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1150 | const char * _exceptionType = NULL; |
| 1151 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1152 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1153 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1154 | jint _remaining; |
| 1155 | GLuint *textures = (GLuint *) 0; |
| 1156 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1157 | textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1158 | if (_remaining < n) { |
| 1159 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1160 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1161 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1162 | goto exit; |
| 1163 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1164 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1165 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1166 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 1167 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1168 | glGenTextures( |
| 1169 | (GLsizei)n, |
| 1170 | (GLuint *)textures |
| 1171 | ); |
| 1172 | |
| 1173 | exit: |
| 1174 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1175 | _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1176 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1177 | if (_exception) { |
| 1178 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1179 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1180 | } |
| 1181 | |
| 1182 | /* GLenum glGetError ( void ) */ |
| 1183 | static jint |
| 1184 | android_glGetError__ |
| 1185 | (JNIEnv *_env, jobject _this) { |
| 1186 | GLenum _returnValue; |
| 1187 | _returnValue = glGetError(); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 1188 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1189 | } |
| 1190 | |
| 1191 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1192 | static void |
| 1193 | android_glGetIntegerv__I_3II |
| 1194 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 1195 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1196 | const char * _exceptionType = NULL; |
| 1197 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1198 | GLint *params_base = (GLint *) 0; |
| 1199 | jint _remaining; |
| 1200 | GLint *params = (GLint *) 0; |
| 1201 | |
| 1202 | if (!params_ref) { |
| 1203 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1204 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1205 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1206 | goto exit; |
| 1207 | } |
| 1208 | if (offset < 0) { |
| 1209 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1210 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1211 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1212 | goto exit; |
| 1213 | } |
| 1214 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1215 | int _needed; |
| 1216 | switch (pname) { |
| 1217 | #if defined(GL_ALPHA_BITS) |
| 1218 | case GL_ALPHA_BITS: |
| 1219 | #endif // defined(GL_ALPHA_BITS) |
| 1220 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1221 | case GL_ALPHA_TEST_FUNC: |
| 1222 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1223 | #if defined(GL_ALPHA_TEST_REF) |
| 1224 | case GL_ALPHA_TEST_REF: |
| 1225 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1226 | #if defined(GL_BLEND_DST) |
| 1227 | case GL_BLEND_DST: |
| 1228 | #endif // defined(GL_BLEND_DST) |
| 1229 | #if defined(GL_BLUE_BITS) |
| 1230 | case GL_BLUE_BITS: |
| 1231 | #endif // defined(GL_BLUE_BITS) |
| 1232 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1233 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1234 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1235 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1236 | case GL_COLOR_ARRAY_SIZE: |
| 1237 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1238 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1239 | case GL_COLOR_ARRAY_STRIDE: |
| 1240 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1241 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1242 | case GL_COLOR_ARRAY_TYPE: |
| 1243 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1244 | #if defined(GL_CULL_FACE) |
| 1245 | case GL_CULL_FACE: |
| 1246 | #endif // defined(GL_CULL_FACE) |
| 1247 | #if defined(GL_DEPTH_BITS) |
| 1248 | case GL_DEPTH_BITS: |
| 1249 | #endif // defined(GL_DEPTH_BITS) |
| 1250 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1251 | case GL_DEPTH_CLEAR_VALUE: |
| 1252 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1253 | #if defined(GL_DEPTH_FUNC) |
| 1254 | case GL_DEPTH_FUNC: |
| 1255 | #endif // defined(GL_DEPTH_FUNC) |
| 1256 | #if defined(GL_DEPTH_WRITEMASK) |
| 1257 | case GL_DEPTH_WRITEMASK: |
| 1258 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1259 | #if defined(GL_FOG_DENSITY) |
| 1260 | case GL_FOG_DENSITY: |
| 1261 | #endif // defined(GL_FOG_DENSITY) |
| 1262 | #if defined(GL_FOG_END) |
| 1263 | case GL_FOG_END: |
| 1264 | #endif // defined(GL_FOG_END) |
| 1265 | #if defined(GL_FOG_MODE) |
| 1266 | case GL_FOG_MODE: |
| 1267 | #endif // defined(GL_FOG_MODE) |
| 1268 | #if defined(GL_FOG_START) |
| 1269 | case GL_FOG_START: |
| 1270 | #endif // defined(GL_FOG_START) |
| 1271 | #if defined(GL_FRONT_FACE) |
| 1272 | case GL_FRONT_FACE: |
| 1273 | #endif // defined(GL_FRONT_FACE) |
| 1274 | #if defined(GL_GREEN_BITS) |
| 1275 | case GL_GREEN_BITS: |
| 1276 | #endif // defined(GL_GREEN_BITS) |
| 1277 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1278 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1279 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1280 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1281 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1282 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1283 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1284 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1285 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1286 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1287 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1288 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1289 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1290 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1291 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1292 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1293 | case GL_LINE_SMOOTH_HINT: |
| 1294 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1295 | #if defined(GL_LINE_WIDTH) |
| 1296 | case GL_LINE_WIDTH: |
| 1297 | #endif // defined(GL_LINE_WIDTH) |
| 1298 | #if defined(GL_LOGIC_OP_MODE) |
| 1299 | case GL_LOGIC_OP_MODE: |
| 1300 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1301 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1302 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1303 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1304 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1305 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1306 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1307 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1308 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1309 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1310 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1311 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1312 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1313 | #if defined(GL_MATRIX_MODE) |
| 1314 | case GL_MATRIX_MODE: |
| 1315 | #endif // defined(GL_MATRIX_MODE) |
| 1316 | #if defined(GL_MAX_CLIP_PLANES) |
| 1317 | case GL_MAX_CLIP_PLANES: |
| 1318 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1319 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1320 | case GL_MAX_ELEMENTS_INDICES: |
| 1321 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1322 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1323 | case GL_MAX_ELEMENTS_VERTICES: |
| 1324 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1325 | #if defined(GL_MAX_LIGHTS) |
| 1326 | case GL_MAX_LIGHTS: |
| 1327 | #endif // defined(GL_MAX_LIGHTS) |
| 1328 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1329 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1330 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1331 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1332 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1333 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1334 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1335 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1336 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1337 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1338 | case GL_MAX_TEXTURE_SIZE: |
| 1339 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1340 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1341 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1342 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1343 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1344 | case GL_MAX_TEXTURE_UNITS: |
| 1345 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1346 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1347 | case GL_MAX_VERTEX_UNITS_OES: |
| 1348 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1349 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1350 | case GL_MODELVIEW_STACK_DEPTH: |
| 1351 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1352 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1353 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1354 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1355 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1356 | case GL_NORMAL_ARRAY_STRIDE: |
| 1357 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1358 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1359 | case GL_NORMAL_ARRAY_TYPE: |
| 1360 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1361 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1362 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1363 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1364 | #if defined(GL_PACK_ALIGNMENT) |
| 1365 | case GL_PACK_ALIGNMENT: |
| 1366 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1367 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1368 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1369 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1370 | #if defined(GL_POINT_SIZE) |
| 1371 | case GL_POINT_SIZE: |
| 1372 | #endif // defined(GL_POINT_SIZE) |
| 1373 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1374 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1375 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1376 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1377 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1378 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1379 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1380 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1381 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1382 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1383 | case GL_POINT_SMOOTH_HINT: |
| 1384 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1385 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1386 | case GL_POLYGON_OFFSET_FACTOR: |
| 1387 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1388 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1389 | case GL_POLYGON_OFFSET_UNITS: |
| 1390 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1391 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1392 | case GL_PROJECTION_STACK_DEPTH: |
| 1393 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1394 | #if defined(GL_RED_BITS) |
| 1395 | case GL_RED_BITS: |
| 1396 | #endif // defined(GL_RED_BITS) |
| 1397 | #if defined(GL_SHADE_MODEL) |
| 1398 | case GL_SHADE_MODEL: |
| 1399 | #endif // defined(GL_SHADE_MODEL) |
| 1400 | #if defined(GL_STENCIL_BITS) |
| 1401 | case GL_STENCIL_BITS: |
| 1402 | #endif // defined(GL_STENCIL_BITS) |
| 1403 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1404 | case GL_STENCIL_CLEAR_VALUE: |
| 1405 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1406 | #if defined(GL_STENCIL_FAIL) |
| 1407 | case GL_STENCIL_FAIL: |
| 1408 | #endif // defined(GL_STENCIL_FAIL) |
| 1409 | #if defined(GL_STENCIL_FUNC) |
| 1410 | case GL_STENCIL_FUNC: |
| 1411 | #endif // defined(GL_STENCIL_FUNC) |
| 1412 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1413 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1414 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1415 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1416 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1417 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1418 | #if defined(GL_STENCIL_REF) |
| 1419 | case GL_STENCIL_REF: |
| 1420 | #endif // defined(GL_STENCIL_REF) |
| 1421 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1422 | case GL_STENCIL_VALUE_MASK: |
| 1423 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1424 | #if defined(GL_STENCIL_WRITEMASK) |
| 1425 | case GL_STENCIL_WRITEMASK: |
| 1426 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1427 | #if defined(GL_SUBPIXEL_BITS) |
| 1428 | case GL_SUBPIXEL_BITS: |
| 1429 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1430 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1431 | case GL_TEXTURE_BINDING_2D: |
| 1432 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1433 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1434 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1435 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1436 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1437 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1438 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1439 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1440 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1441 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1442 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1443 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1444 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1445 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1446 | case GL_TEXTURE_STACK_DEPTH: |
| 1447 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1448 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1449 | case GL_UNPACK_ALIGNMENT: |
| 1450 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1451 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1452 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1453 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1454 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1455 | case GL_VERTEX_ARRAY_SIZE: |
| 1456 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1457 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1458 | case GL_VERTEX_ARRAY_STRIDE: |
| 1459 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1460 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1461 | case GL_VERTEX_ARRAY_TYPE: |
| 1462 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1463 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1464 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1465 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1466 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1467 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1468 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1469 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1470 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1471 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1472 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1473 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1474 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1475 | _needed = 1; |
| 1476 | break; |
| 1477 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1478 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1479 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1480 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1481 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1482 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1483 | #if defined(GL_DEPTH_RANGE) |
| 1484 | case GL_DEPTH_RANGE: |
| 1485 | #endif // defined(GL_DEPTH_RANGE) |
| 1486 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1487 | case GL_MAX_VIEWPORT_DIMS: |
| 1488 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1489 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1490 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1491 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1492 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1493 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1494 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1495 | _needed = 2; |
| 1496 | break; |
| 1497 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1498 | case GL_COLOR_CLEAR_VALUE: |
| 1499 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1500 | #if defined(GL_COLOR_WRITEMASK) |
| 1501 | case GL_COLOR_WRITEMASK: |
| 1502 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1503 | #if defined(GL_FOG_COLOR) |
| 1504 | case GL_FOG_COLOR: |
| 1505 | #endif // defined(GL_FOG_COLOR) |
| 1506 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1507 | case GL_LIGHT_MODEL_AMBIENT: |
| 1508 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1509 | #if defined(GL_SCISSOR_BOX) |
| 1510 | case GL_SCISSOR_BOX: |
| 1511 | #endif // defined(GL_SCISSOR_BOX) |
| 1512 | #if defined(GL_VIEWPORT) |
| 1513 | case GL_VIEWPORT: |
| 1514 | #endif // defined(GL_VIEWPORT) |
| 1515 | _needed = 4; |
| 1516 | break; |
| 1517 | #if defined(GL_MODELVIEW_MATRIX) |
| 1518 | case GL_MODELVIEW_MATRIX: |
| 1519 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1520 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1521 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1522 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1523 | #if defined(GL_PROJECTION_MATRIX) |
| 1524 | case GL_PROJECTION_MATRIX: |
| 1525 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1526 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1527 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1528 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1529 | #if defined(GL_TEXTURE_MATRIX) |
| 1530 | case GL_TEXTURE_MATRIX: |
| 1531 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1532 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1533 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1534 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1535 | _needed = 16; |
| 1536 | break; |
| 1537 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1538 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1539 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1540 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1541 | break; |
| 1542 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1543 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1544 | break; |
| 1545 | } |
| 1546 | if (_remaining < _needed) { |
| 1547 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1548 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1549 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1550 | goto exit; |
| 1551 | } |
| 1552 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1553 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1554 | params = params_base + offset; |
| 1555 | |
| 1556 | glGetIntegerv( |
| 1557 | (GLenum)pname, |
| 1558 | (GLint *)params |
| 1559 | ); |
| 1560 | |
| 1561 | exit: |
| 1562 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1563 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1564 | _exception ? JNI_ABORT: 0); |
| 1565 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1566 | if (_exception) { |
| 1567 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1568 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1569 | } |
| 1570 | |
| 1571 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1572 | static void |
| 1573 | android_glGetIntegerv__ILjava_nio_IntBuffer_2 |
| 1574 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1575 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1576 | const char * _exceptionType = NULL; |
| 1577 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1578 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1579 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1580 | jint _remaining; |
| 1581 | GLint *params = (GLint *) 0; |
| 1582 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1583 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1584 | int _needed; |
| 1585 | switch (pname) { |
| 1586 | #if defined(GL_ALPHA_BITS) |
| 1587 | case GL_ALPHA_BITS: |
| 1588 | #endif // defined(GL_ALPHA_BITS) |
| 1589 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1590 | case GL_ALPHA_TEST_FUNC: |
| 1591 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1592 | #if defined(GL_ALPHA_TEST_REF) |
| 1593 | case GL_ALPHA_TEST_REF: |
| 1594 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1595 | #if defined(GL_BLEND_DST) |
| 1596 | case GL_BLEND_DST: |
| 1597 | #endif // defined(GL_BLEND_DST) |
| 1598 | #if defined(GL_BLUE_BITS) |
| 1599 | case GL_BLUE_BITS: |
| 1600 | #endif // defined(GL_BLUE_BITS) |
| 1601 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1602 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1603 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1604 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1605 | case GL_COLOR_ARRAY_SIZE: |
| 1606 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1607 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1608 | case GL_COLOR_ARRAY_STRIDE: |
| 1609 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1610 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1611 | case GL_COLOR_ARRAY_TYPE: |
| 1612 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1613 | #if defined(GL_CULL_FACE) |
| 1614 | case GL_CULL_FACE: |
| 1615 | #endif // defined(GL_CULL_FACE) |
| 1616 | #if defined(GL_DEPTH_BITS) |
| 1617 | case GL_DEPTH_BITS: |
| 1618 | #endif // defined(GL_DEPTH_BITS) |
| 1619 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1620 | case GL_DEPTH_CLEAR_VALUE: |
| 1621 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1622 | #if defined(GL_DEPTH_FUNC) |
| 1623 | case GL_DEPTH_FUNC: |
| 1624 | #endif // defined(GL_DEPTH_FUNC) |
| 1625 | #if defined(GL_DEPTH_WRITEMASK) |
| 1626 | case GL_DEPTH_WRITEMASK: |
| 1627 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1628 | #if defined(GL_FOG_DENSITY) |
| 1629 | case GL_FOG_DENSITY: |
| 1630 | #endif // defined(GL_FOG_DENSITY) |
| 1631 | #if defined(GL_FOG_END) |
| 1632 | case GL_FOG_END: |
| 1633 | #endif // defined(GL_FOG_END) |
| 1634 | #if defined(GL_FOG_MODE) |
| 1635 | case GL_FOG_MODE: |
| 1636 | #endif // defined(GL_FOG_MODE) |
| 1637 | #if defined(GL_FOG_START) |
| 1638 | case GL_FOG_START: |
| 1639 | #endif // defined(GL_FOG_START) |
| 1640 | #if defined(GL_FRONT_FACE) |
| 1641 | case GL_FRONT_FACE: |
| 1642 | #endif // defined(GL_FRONT_FACE) |
| 1643 | #if defined(GL_GREEN_BITS) |
| 1644 | case GL_GREEN_BITS: |
| 1645 | #endif // defined(GL_GREEN_BITS) |
| 1646 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1647 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1648 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1649 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1650 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1651 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1652 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1653 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1654 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1655 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1656 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1657 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1658 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1659 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1660 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1661 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1662 | case GL_LINE_SMOOTH_HINT: |
| 1663 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1664 | #if defined(GL_LINE_WIDTH) |
| 1665 | case GL_LINE_WIDTH: |
| 1666 | #endif // defined(GL_LINE_WIDTH) |
| 1667 | #if defined(GL_LOGIC_OP_MODE) |
| 1668 | case GL_LOGIC_OP_MODE: |
| 1669 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1670 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1671 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1672 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1673 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1674 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1675 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1676 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1677 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1678 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1679 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1680 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1681 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1682 | #if defined(GL_MATRIX_MODE) |
| 1683 | case GL_MATRIX_MODE: |
| 1684 | #endif // defined(GL_MATRIX_MODE) |
| 1685 | #if defined(GL_MAX_CLIP_PLANES) |
| 1686 | case GL_MAX_CLIP_PLANES: |
| 1687 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1688 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1689 | case GL_MAX_ELEMENTS_INDICES: |
| 1690 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1691 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1692 | case GL_MAX_ELEMENTS_VERTICES: |
| 1693 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1694 | #if defined(GL_MAX_LIGHTS) |
| 1695 | case GL_MAX_LIGHTS: |
| 1696 | #endif // defined(GL_MAX_LIGHTS) |
| 1697 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1698 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1699 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1700 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1701 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1702 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1703 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1704 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1705 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1706 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1707 | case GL_MAX_TEXTURE_SIZE: |
| 1708 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1709 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1710 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1711 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1712 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1713 | case GL_MAX_TEXTURE_UNITS: |
| 1714 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1715 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1716 | case GL_MAX_VERTEX_UNITS_OES: |
| 1717 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1718 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1719 | case GL_MODELVIEW_STACK_DEPTH: |
| 1720 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1721 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1722 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1723 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1724 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1725 | case GL_NORMAL_ARRAY_STRIDE: |
| 1726 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1727 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1728 | case GL_NORMAL_ARRAY_TYPE: |
| 1729 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1730 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1731 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1732 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1733 | #if defined(GL_PACK_ALIGNMENT) |
| 1734 | case GL_PACK_ALIGNMENT: |
| 1735 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1736 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1737 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1738 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1739 | #if defined(GL_POINT_SIZE) |
| 1740 | case GL_POINT_SIZE: |
| 1741 | #endif // defined(GL_POINT_SIZE) |
| 1742 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1743 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1744 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1745 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1746 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1747 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1748 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1749 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1750 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1751 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1752 | case GL_POINT_SMOOTH_HINT: |
| 1753 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1754 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1755 | case GL_POLYGON_OFFSET_FACTOR: |
| 1756 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1757 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1758 | case GL_POLYGON_OFFSET_UNITS: |
| 1759 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1760 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1761 | case GL_PROJECTION_STACK_DEPTH: |
| 1762 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1763 | #if defined(GL_RED_BITS) |
| 1764 | case GL_RED_BITS: |
| 1765 | #endif // defined(GL_RED_BITS) |
| 1766 | #if defined(GL_SHADE_MODEL) |
| 1767 | case GL_SHADE_MODEL: |
| 1768 | #endif // defined(GL_SHADE_MODEL) |
| 1769 | #if defined(GL_STENCIL_BITS) |
| 1770 | case GL_STENCIL_BITS: |
| 1771 | #endif // defined(GL_STENCIL_BITS) |
| 1772 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1773 | case GL_STENCIL_CLEAR_VALUE: |
| 1774 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1775 | #if defined(GL_STENCIL_FAIL) |
| 1776 | case GL_STENCIL_FAIL: |
| 1777 | #endif // defined(GL_STENCIL_FAIL) |
| 1778 | #if defined(GL_STENCIL_FUNC) |
| 1779 | case GL_STENCIL_FUNC: |
| 1780 | #endif // defined(GL_STENCIL_FUNC) |
| 1781 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1782 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1783 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1784 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1785 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1786 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1787 | #if defined(GL_STENCIL_REF) |
| 1788 | case GL_STENCIL_REF: |
| 1789 | #endif // defined(GL_STENCIL_REF) |
| 1790 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1791 | case GL_STENCIL_VALUE_MASK: |
| 1792 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1793 | #if defined(GL_STENCIL_WRITEMASK) |
| 1794 | case GL_STENCIL_WRITEMASK: |
| 1795 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1796 | #if defined(GL_SUBPIXEL_BITS) |
| 1797 | case GL_SUBPIXEL_BITS: |
| 1798 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1799 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1800 | case GL_TEXTURE_BINDING_2D: |
| 1801 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1802 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1803 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1804 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1805 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1806 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1807 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1808 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1809 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1810 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1811 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1812 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1813 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1814 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1815 | case GL_TEXTURE_STACK_DEPTH: |
| 1816 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1817 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1818 | case GL_UNPACK_ALIGNMENT: |
| 1819 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1820 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1821 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1822 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1823 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1824 | case GL_VERTEX_ARRAY_SIZE: |
| 1825 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1826 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1827 | case GL_VERTEX_ARRAY_STRIDE: |
| 1828 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1829 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1830 | case GL_VERTEX_ARRAY_TYPE: |
| 1831 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1832 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1833 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1834 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1835 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1836 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1837 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1838 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1839 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1840 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1841 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1842 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1843 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1844 | _needed = 1; |
| 1845 | break; |
| 1846 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1847 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1848 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1849 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1850 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1851 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1852 | #if defined(GL_DEPTH_RANGE) |
| 1853 | case GL_DEPTH_RANGE: |
| 1854 | #endif // defined(GL_DEPTH_RANGE) |
| 1855 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1856 | case GL_MAX_VIEWPORT_DIMS: |
| 1857 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1858 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1859 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1860 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1861 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1862 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1863 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1864 | _needed = 2; |
| 1865 | break; |
| 1866 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1867 | case GL_COLOR_CLEAR_VALUE: |
| 1868 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1869 | #if defined(GL_COLOR_WRITEMASK) |
| 1870 | case GL_COLOR_WRITEMASK: |
| 1871 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1872 | #if defined(GL_FOG_COLOR) |
| 1873 | case GL_FOG_COLOR: |
| 1874 | #endif // defined(GL_FOG_COLOR) |
| 1875 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1876 | case GL_LIGHT_MODEL_AMBIENT: |
| 1877 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1878 | #if defined(GL_SCISSOR_BOX) |
| 1879 | case GL_SCISSOR_BOX: |
| 1880 | #endif // defined(GL_SCISSOR_BOX) |
| 1881 | #if defined(GL_VIEWPORT) |
| 1882 | case GL_VIEWPORT: |
| 1883 | #endif // defined(GL_VIEWPORT) |
| 1884 | _needed = 4; |
| 1885 | break; |
| 1886 | #if defined(GL_MODELVIEW_MATRIX) |
| 1887 | case GL_MODELVIEW_MATRIX: |
| 1888 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1889 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1890 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1891 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1892 | #if defined(GL_PROJECTION_MATRIX) |
| 1893 | case GL_PROJECTION_MATRIX: |
| 1894 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1895 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1896 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1897 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1898 | #if defined(GL_TEXTURE_MATRIX) |
| 1899 | case GL_TEXTURE_MATRIX: |
| 1900 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1901 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1902 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1903 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1904 | _needed = 16; |
| 1905 | break; |
| 1906 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1907 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1908 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1909 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1910 | break; |
| 1911 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1912 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1913 | break; |
| 1914 | } |
| 1915 | if (_remaining < _needed) { |
| 1916 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1917 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1918 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1919 | goto exit; |
| 1920 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1921 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1922 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1923 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 1924 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1925 | glGetIntegerv( |
| 1926 | (GLenum)pname, |
| 1927 | (GLint *)params |
| 1928 | ); |
| 1929 | |
| 1930 | exit: |
| 1931 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1932 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1933 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1934 | if (_exception) { |
| 1935 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1936 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1937 | } |
| 1938 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1939 | /* const GLubyte * glGetString ( GLenum name ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1940 | static jstring android_glGetString(JNIEnv *_env, jobject, jint name) { |
| 1941 | const char* chars = (const char*) glGetString((GLenum) name); |
| 1942 | return _env->NewStringUTF(chars); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1943 | } |
| 1944 | /* void glHint ( GLenum target, GLenum mode ) */ |
| 1945 | static void |
| 1946 | android_glHint__II |
| 1947 | (JNIEnv *_env, jobject _this, jint target, jint mode) { |
| 1948 | glHint( |
| 1949 | (GLenum)target, |
| 1950 | (GLenum)mode |
| 1951 | ); |
| 1952 | } |
| 1953 | |
| 1954 | /* void glLightModelf ( GLenum pname, GLfloat param ) */ |
| 1955 | static void |
| 1956 | android_glLightModelf__IF |
| 1957 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 1958 | glLightModelf( |
| 1959 | (GLenum)pname, |
| 1960 | (GLfloat)param |
| 1961 | ); |
| 1962 | } |
| 1963 | |
| 1964 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 1965 | static void |
| 1966 | android_glLightModelfv__I_3FI |
| 1967 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1968 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1969 | const char * _exceptionType = NULL; |
| 1970 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1971 | GLfloat *params_base = (GLfloat *) 0; |
| 1972 | jint _remaining; |
| 1973 | GLfloat *params = (GLfloat *) 0; |
| 1974 | |
| 1975 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1976 | _exception = 1; |
| 1977 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1978 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1979 | goto exit; |
| 1980 | } |
| 1981 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1982 | _exception = 1; |
| 1983 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1984 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1985 | goto exit; |
| 1986 | } |
| 1987 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1988 | int _needed; |
| 1989 | switch (pname) { |
| 1990 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1991 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1992 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1993 | _needed = 1; |
| 1994 | break; |
| 1995 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1996 | case GL_LIGHT_MODEL_AMBIENT: |
| 1997 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 1998 | _needed = 4; |
| 1999 | break; |
| 2000 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2001 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2002 | break; |
| 2003 | } |
| 2004 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2005 | _exception = 1; |
| 2006 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2007 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2008 | goto exit; |
| 2009 | } |
| 2010 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2011 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2012 | params = params_base + offset; |
| 2013 | |
| 2014 | glLightModelfv( |
| 2015 | (GLenum)pname, |
| 2016 | (GLfloat *)params |
| 2017 | ); |
| 2018 | |
| 2019 | exit: |
| 2020 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2021 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2022 | JNI_ABORT); |
| 2023 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2024 | if (_exception) { |
| 2025 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2026 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2027 | } |
| 2028 | |
| 2029 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 2030 | static void |
| 2031 | android_glLightModelfv__ILjava_nio_FloatBuffer_2 |
| 2032 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2033 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2034 | const char * _exceptionType = NULL; |
| 2035 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2036 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2037 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2038 | jint _remaining; |
| 2039 | GLfloat *params = (GLfloat *) 0; |
| 2040 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2041 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2042 | int _needed; |
| 2043 | switch (pname) { |
| 2044 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2045 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2046 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2047 | _needed = 1; |
| 2048 | break; |
| 2049 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2050 | case GL_LIGHT_MODEL_AMBIENT: |
| 2051 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2052 | _needed = 4; |
| 2053 | break; |
| 2054 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2055 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2056 | break; |
| 2057 | } |
| 2058 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2059 | _exception = 1; |
| 2060 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2061 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2062 | goto exit; |
| 2063 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2064 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2065 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2066 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2067 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2068 | glLightModelfv( |
| 2069 | (GLenum)pname, |
| 2070 | (GLfloat *)params |
| 2071 | ); |
| 2072 | |
| 2073 | exit: |
| 2074 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2075 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2076 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2077 | if (_exception) { |
| 2078 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2079 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2080 | } |
| 2081 | |
| 2082 | /* void glLightModelx ( GLenum pname, GLfixed param ) */ |
| 2083 | static void |
| 2084 | android_glLightModelx__II |
| 2085 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 2086 | glLightModelx( |
| 2087 | (GLenum)pname, |
| 2088 | (GLfixed)param |
| 2089 | ); |
| 2090 | } |
| 2091 | |
| 2092 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2093 | static void |
| 2094 | android_glLightModelxv__I_3II |
| 2095 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2096 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2097 | const char * _exceptionType = NULL; |
| 2098 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2099 | GLfixed *params_base = (GLfixed *) 0; |
| 2100 | jint _remaining; |
| 2101 | GLfixed *params = (GLfixed *) 0; |
| 2102 | |
| 2103 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2104 | _exception = 1; |
| 2105 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2106 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2107 | goto exit; |
| 2108 | } |
| 2109 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2110 | _exception = 1; |
| 2111 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2112 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2113 | goto exit; |
| 2114 | } |
| 2115 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2116 | int _needed; |
| 2117 | switch (pname) { |
| 2118 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2119 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2120 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2121 | _needed = 1; |
| 2122 | break; |
| 2123 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2124 | case GL_LIGHT_MODEL_AMBIENT: |
| 2125 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2126 | _needed = 4; |
| 2127 | break; |
| 2128 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2129 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2130 | break; |
| 2131 | } |
| 2132 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2133 | _exception = 1; |
| 2134 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2135 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2136 | goto exit; |
| 2137 | } |
| 2138 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2139 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2140 | params = params_base + offset; |
| 2141 | |
| 2142 | glLightModelxv( |
| 2143 | (GLenum)pname, |
| 2144 | (GLfixed *)params |
| 2145 | ); |
| 2146 | |
| 2147 | exit: |
| 2148 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2149 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2150 | JNI_ABORT); |
| 2151 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2152 | if (_exception) { |
| 2153 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2154 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2155 | } |
| 2156 | |
| 2157 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2158 | static void |
| 2159 | android_glLightModelxv__ILjava_nio_IntBuffer_2 |
| 2160 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2161 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2162 | const char * _exceptionType = NULL; |
| 2163 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2164 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2165 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2166 | jint _remaining; |
| 2167 | GLfixed *params = (GLfixed *) 0; |
| 2168 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2169 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2170 | int _needed; |
| 2171 | switch (pname) { |
| 2172 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2173 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2174 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2175 | _needed = 1; |
| 2176 | break; |
| 2177 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2178 | case GL_LIGHT_MODEL_AMBIENT: |
| 2179 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2180 | _needed = 4; |
| 2181 | break; |
| 2182 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2183 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2184 | break; |
| 2185 | } |
| 2186 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2187 | _exception = 1; |
| 2188 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2189 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2190 | goto exit; |
| 2191 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2192 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2193 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2194 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2195 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2196 | glLightModelxv( |
| 2197 | (GLenum)pname, |
| 2198 | (GLfixed *)params |
| 2199 | ); |
| 2200 | |
| 2201 | exit: |
| 2202 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2203 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2204 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2205 | if (_exception) { |
| 2206 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2207 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2208 | } |
| 2209 | |
| 2210 | /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */ |
| 2211 | static void |
| 2212 | android_glLightf__IIF |
| 2213 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) { |
| 2214 | glLightf( |
| 2215 | (GLenum)light, |
| 2216 | (GLenum)pname, |
| 2217 | (GLfloat)param |
| 2218 | ); |
| 2219 | } |
| 2220 | |
| 2221 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2222 | static void |
| 2223 | android_glLightfv__II_3FI |
| 2224 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2225 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2226 | const char * _exceptionType = NULL; |
| 2227 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2228 | GLfloat *params_base = (GLfloat *) 0; |
| 2229 | jint _remaining; |
| 2230 | GLfloat *params = (GLfloat *) 0; |
| 2231 | |
| 2232 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2233 | _exception = 1; |
| 2234 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2235 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2236 | goto exit; |
| 2237 | } |
| 2238 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2239 | _exception = 1; |
| 2240 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2241 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2242 | goto exit; |
| 2243 | } |
| 2244 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2245 | int _needed; |
| 2246 | switch (pname) { |
| 2247 | #if defined(GL_SPOT_EXPONENT) |
| 2248 | case GL_SPOT_EXPONENT: |
| 2249 | #endif // defined(GL_SPOT_EXPONENT) |
| 2250 | #if defined(GL_SPOT_CUTOFF) |
| 2251 | case GL_SPOT_CUTOFF: |
| 2252 | #endif // defined(GL_SPOT_CUTOFF) |
| 2253 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2254 | case GL_CONSTANT_ATTENUATION: |
| 2255 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2256 | #if defined(GL_LINEAR_ATTENUATION) |
| 2257 | case GL_LINEAR_ATTENUATION: |
| 2258 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2259 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2260 | case GL_QUADRATIC_ATTENUATION: |
| 2261 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2262 | _needed = 1; |
| 2263 | break; |
| 2264 | #if defined(GL_SPOT_DIRECTION) |
| 2265 | case GL_SPOT_DIRECTION: |
| 2266 | #endif // defined(GL_SPOT_DIRECTION) |
| 2267 | _needed = 3; |
| 2268 | break; |
| 2269 | #if defined(GL_AMBIENT) |
| 2270 | case GL_AMBIENT: |
| 2271 | #endif // defined(GL_AMBIENT) |
| 2272 | #if defined(GL_DIFFUSE) |
| 2273 | case GL_DIFFUSE: |
| 2274 | #endif // defined(GL_DIFFUSE) |
| 2275 | #if defined(GL_SPECULAR) |
| 2276 | case GL_SPECULAR: |
| 2277 | #endif // defined(GL_SPECULAR) |
| 2278 | #if defined(GL_EMISSION) |
| 2279 | case GL_EMISSION: |
| 2280 | #endif // defined(GL_EMISSION) |
| 2281 | _needed = 4; |
| 2282 | break; |
| 2283 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2284 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2285 | break; |
| 2286 | } |
| 2287 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2288 | _exception = 1; |
| 2289 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2290 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2291 | goto exit; |
| 2292 | } |
| 2293 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2294 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2295 | params = params_base + offset; |
| 2296 | |
| 2297 | glLightfv( |
| 2298 | (GLenum)light, |
| 2299 | (GLenum)pname, |
| 2300 | (GLfloat *)params |
| 2301 | ); |
| 2302 | |
| 2303 | exit: |
| 2304 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2305 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2306 | JNI_ABORT); |
| 2307 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2308 | if (_exception) { |
| 2309 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2310 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2311 | } |
| 2312 | |
| 2313 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2314 | static void |
| 2315 | android_glLightfv__IILjava_nio_FloatBuffer_2 |
| 2316 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2317 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2318 | const char * _exceptionType = NULL; |
| 2319 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2320 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2321 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2322 | jint _remaining; |
| 2323 | GLfloat *params = (GLfloat *) 0; |
| 2324 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2325 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2326 | int _needed; |
| 2327 | switch (pname) { |
| 2328 | #if defined(GL_SPOT_EXPONENT) |
| 2329 | case GL_SPOT_EXPONENT: |
| 2330 | #endif // defined(GL_SPOT_EXPONENT) |
| 2331 | #if defined(GL_SPOT_CUTOFF) |
| 2332 | case GL_SPOT_CUTOFF: |
| 2333 | #endif // defined(GL_SPOT_CUTOFF) |
| 2334 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2335 | case GL_CONSTANT_ATTENUATION: |
| 2336 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2337 | #if defined(GL_LINEAR_ATTENUATION) |
| 2338 | case GL_LINEAR_ATTENUATION: |
| 2339 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2340 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2341 | case GL_QUADRATIC_ATTENUATION: |
| 2342 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2343 | _needed = 1; |
| 2344 | break; |
| 2345 | #if defined(GL_SPOT_DIRECTION) |
| 2346 | case GL_SPOT_DIRECTION: |
| 2347 | #endif // defined(GL_SPOT_DIRECTION) |
| 2348 | _needed = 3; |
| 2349 | break; |
| 2350 | #if defined(GL_AMBIENT) |
| 2351 | case GL_AMBIENT: |
| 2352 | #endif // defined(GL_AMBIENT) |
| 2353 | #if defined(GL_DIFFUSE) |
| 2354 | case GL_DIFFUSE: |
| 2355 | #endif // defined(GL_DIFFUSE) |
| 2356 | #if defined(GL_SPECULAR) |
| 2357 | case GL_SPECULAR: |
| 2358 | #endif // defined(GL_SPECULAR) |
| 2359 | #if defined(GL_EMISSION) |
| 2360 | case GL_EMISSION: |
| 2361 | #endif // defined(GL_EMISSION) |
| 2362 | _needed = 4; |
| 2363 | break; |
| 2364 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2365 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2366 | break; |
| 2367 | } |
| 2368 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2369 | _exception = 1; |
| 2370 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2371 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2372 | goto exit; |
| 2373 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2374 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2375 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2376 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2377 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2378 | glLightfv( |
| 2379 | (GLenum)light, |
| 2380 | (GLenum)pname, |
| 2381 | (GLfloat *)params |
| 2382 | ); |
| 2383 | |
| 2384 | exit: |
| 2385 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2386 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2387 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2388 | if (_exception) { |
| 2389 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2390 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2391 | } |
| 2392 | |
| 2393 | /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */ |
| 2394 | static void |
| 2395 | android_glLightx__III |
| 2396 | (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) { |
| 2397 | glLightx( |
| 2398 | (GLenum)light, |
| 2399 | (GLenum)pname, |
| 2400 | (GLfixed)param |
| 2401 | ); |
| 2402 | } |
| 2403 | |
| 2404 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2405 | static void |
| 2406 | android_glLightxv__II_3II |
| 2407 | (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] | 2408 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2409 | const char * _exceptionType = NULL; |
| 2410 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2411 | GLfixed *params_base = (GLfixed *) 0; |
| 2412 | jint _remaining; |
| 2413 | GLfixed *params = (GLfixed *) 0; |
| 2414 | |
| 2415 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2416 | _exception = 1; |
| 2417 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2418 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2419 | goto exit; |
| 2420 | } |
| 2421 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2422 | _exception = 1; |
| 2423 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2424 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2425 | goto exit; |
| 2426 | } |
| 2427 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2428 | int _needed; |
| 2429 | switch (pname) { |
| 2430 | #if defined(GL_SPOT_EXPONENT) |
| 2431 | case GL_SPOT_EXPONENT: |
| 2432 | #endif // defined(GL_SPOT_EXPONENT) |
| 2433 | #if defined(GL_SPOT_CUTOFF) |
| 2434 | case GL_SPOT_CUTOFF: |
| 2435 | #endif // defined(GL_SPOT_CUTOFF) |
| 2436 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2437 | case GL_CONSTANT_ATTENUATION: |
| 2438 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2439 | #if defined(GL_LINEAR_ATTENUATION) |
| 2440 | case GL_LINEAR_ATTENUATION: |
| 2441 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2442 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2443 | case GL_QUADRATIC_ATTENUATION: |
| 2444 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2445 | _needed = 1; |
| 2446 | break; |
| 2447 | #if defined(GL_SPOT_DIRECTION) |
| 2448 | case GL_SPOT_DIRECTION: |
| 2449 | #endif // defined(GL_SPOT_DIRECTION) |
| 2450 | _needed = 3; |
| 2451 | break; |
| 2452 | #if defined(GL_AMBIENT) |
| 2453 | case GL_AMBIENT: |
| 2454 | #endif // defined(GL_AMBIENT) |
| 2455 | #if defined(GL_DIFFUSE) |
| 2456 | case GL_DIFFUSE: |
| 2457 | #endif // defined(GL_DIFFUSE) |
| 2458 | #if defined(GL_SPECULAR) |
| 2459 | case GL_SPECULAR: |
| 2460 | #endif // defined(GL_SPECULAR) |
| 2461 | #if defined(GL_EMISSION) |
| 2462 | case GL_EMISSION: |
| 2463 | #endif // defined(GL_EMISSION) |
| 2464 | _needed = 4; |
| 2465 | break; |
| 2466 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2467 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2468 | break; |
| 2469 | } |
| 2470 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2471 | _exception = 1; |
| 2472 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2473 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2474 | goto exit; |
| 2475 | } |
| 2476 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2477 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2478 | params = params_base + offset; |
| 2479 | |
| 2480 | glLightxv( |
| 2481 | (GLenum)light, |
| 2482 | (GLenum)pname, |
| 2483 | (GLfixed *)params |
| 2484 | ); |
| 2485 | |
| 2486 | exit: |
| 2487 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2488 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2489 | JNI_ABORT); |
| 2490 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2491 | if (_exception) { |
| 2492 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2493 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2494 | } |
| 2495 | |
| 2496 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2497 | static void |
| 2498 | android_glLightxv__IILjava_nio_IntBuffer_2 |
| 2499 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2500 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2501 | const char * _exceptionType = NULL; |
| 2502 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2503 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2504 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2505 | jint _remaining; |
| 2506 | GLfixed *params = (GLfixed *) 0; |
| 2507 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2508 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2509 | int _needed; |
| 2510 | switch (pname) { |
| 2511 | #if defined(GL_SPOT_EXPONENT) |
| 2512 | case GL_SPOT_EXPONENT: |
| 2513 | #endif // defined(GL_SPOT_EXPONENT) |
| 2514 | #if defined(GL_SPOT_CUTOFF) |
| 2515 | case GL_SPOT_CUTOFF: |
| 2516 | #endif // defined(GL_SPOT_CUTOFF) |
| 2517 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2518 | case GL_CONSTANT_ATTENUATION: |
| 2519 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2520 | #if defined(GL_LINEAR_ATTENUATION) |
| 2521 | case GL_LINEAR_ATTENUATION: |
| 2522 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2523 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2524 | case GL_QUADRATIC_ATTENUATION: |
| 2525 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2526 | _needed = 1; |
| 2527 | break; |
| 2528 | #if defined(GL_SPOT_DIRECTION) |
| 2529 | case GL_SPOT_DIRECTION: |
| 2530 | #endif // defined(GL_SPOT_DIRECTION) |
| 2531 | _needed = 3; |
| 2532 | break; |
| 2533 | #if defined(GL_AMBIENT) |
| 2534 | case GL_AMBIENT: |
| 2535 | #endif // defined(GL_AMBIENT) |
| 2536 | #if defined(GL_DIFFUSE) |
| 2537 | case GL_DIFFUSE: |
| 2538 | #endif // defined(GL_DIFFUSE) |
| 2539 | #if defined(GL_SPECULAR) |
| 2540 | case GL_SPECULAR: |
| 2541 | #endif // defined(GL_SPECULAR) |
| 2542 | #if defined(GL_EMISSION) |
| 2543 | case GL_EMISSION: |
| 2544 | #endif // defined(GL_EMISSION) |
| 2545 | _needed = 4; |
| 2546 | break; |
| 2547 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2548 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2549 | break; |
| 2550 | } |
| 2551 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2552 | _exception = 1; |
| 2553 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2554 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2555 | goto exit; |
| 2556 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2557 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2558 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2559 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2560 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2561 | glLightxv( |
| 2562 | (GLenum)light, |
| 2563 | (GLenum)pname, |
| 2564 | (GLfixed *)params |
| 2565 | ); |
| 2566 | |
| 2567 | exit: |
| 2568 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2569 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2570 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2571 | if (_exception) { |
| 2572 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2573 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2574 | } |
| 2575 | |
| 2576 | /* void glLineWidth ( GLfloat width ) */ |
| 2577 | static void |
| 2578 | android_glLineWidth__F |
| 2579 | (JNIEnv *_env, jobject _this, jfloat width) { |
| 2580 | glLineWidth( |
| 2581 | (GLfloat)width |
| 2582 | ); |
| 2583 | } |
| 2584 | |
| 2585 | /* void glLineWidthx ( GLfixed width ) */ |
| 2586 | static void |
| 2587 | android_glLineWidthx__I |
| 2588 | (JNIEnv *_env, jobject _this, jint width) { |
| 2589 | glLineWidthx( |
| 2590 | (GLfixed)width |
| 2591 | ); |
| 2592 | } |
| 2593 | |
| 2594 | /* void glLoadIdentity ( void ) */ |
| 2595 | static void |
| 2596 | android_glLoadIdentity__ |
| 2597 | (JNIEnv *_env, jobject _this) { |
| 2598 | glLoadIdentity(); |
| 2599 | } |
| 2600 | |
| 2601 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2602 | static void |
| 2603 | android_glLoadMatrixf___3FI |
| 2604 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2605 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2606 | const char * _exceptionType = NULL; |
| 2607 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2608 | GLfloat *m_base = (GLfloat *) 0; |
| 2609 | jint _remaining; |
| 2610 | GLfloat *m = (GLfloat *) 0; |
| 2611 | |
| 2612 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2613 | _exception = 1; |
| 2614 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2615 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2616 | goto exit; |
| 2617 | } |
| 2618 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2619 | _exception = 1; |
| 2620 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2621 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2622 | goto exit; |
| 2623 | } |
| 2624 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2625 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2626 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2627 | m = m_base + offset; |
| 2628 | |
| 2629 | glLoadMatrixf( |
| 2630 | (GLfloat *)m |
| 2631 | ); |
| 2632 | |
| 2633 | exit: |
| 2634 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2635 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2636 | JNI_ABORT); |
| 2637 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2638 | if (_exception) { |
| 2639 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2640 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2641 | } |
| 2642 | |
| 2643 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2644 | static void |
| 2645 | android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 |
| 2646 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2647 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2648 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2649 | jint _remaining; |
| 2650 | GLfloat *m = (GLfloat *) 0; |
| 2651 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2652 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2653 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2654 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2655 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 2656 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2657 | glLoadMatrixf( |
| 2658 | (GLfloat *)m |
| 2659 | ); |
| 2660 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2661 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2662 | } |
| 2663 | } |
| 2664 | |
| 2665 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2666 | static void |
| 2667 | android_glLoadMatrixx___3II |
| 2668 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2669 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2670 | const char * _exceptionType = NULL; |
| 2671 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2672 | GLfixed *m_base = (GLfixed *) 0; |
| 2673 | jint _remaining; |
| 2674 | GLfixed *m = (GLfixed *) 0; |
| 2675 | |
| 2676 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2677 | _exception = 1; |
| 2678 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2679 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2680 | goto exit; |
| 2681 | } |
| 2682 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2683 | _exception = 1; |
| 2684 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2685 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2686 | goto exit; |
| 2687 | } |
| 2688 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2689 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2690 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2691 | m = m_base + offset; |
| 2692 | |
| 2693 | glLoadMatrixx( |
| 2694 | (GLfixed *)m |
| 2695 | ); |
| 2696 | |
| 2697 | exit: |
| 2698 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2699 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2700 | JNI_ABORT); |
| 2701 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2702 | if (_exception) { |
| 2703 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2704 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2705 | } |
| 2706 | |
| 2707 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2708 | static void |
| 2709 | android_glLoadMatrixx__Ljava_nio_IntBuffer_2 |
| 2710 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2711 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2712 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2713 | jint _remaining; |
| 2714 | GLfixed *m = (GLfixed *) 0; |
| 2715 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2716 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2717 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2718 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2719 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 2720 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2721 | glLoadMatrixx( |
| 2722 | (GLfixed *)m |
| 2723 | ); |
| 2724 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2725 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2726 | } |
| 2727 | } |
| 2728 | |
| 2729 | /* void glLogicOp ( GLenum opcode ) */ |
| 2730 | static void |
| 2731 | android_glLogicOp__I |
| 2732 | (JNIEnv *_env, jobject _this, jint opcode) { |
| 2733 | glLogicOp( |
| 2734 | (GLenum)opcode |
| 2735 | ); |
| 2736 | } |
| 2737 | |
| 2738 | /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */ |
| 2739 | static void |
| 2740 | android_glMaterialf__IIF |
| 2741 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) { |
| 2742 | glMaterialf( |
| 2743 | (GLenum)face, |
| 2744 | (GLenum)pname, |
| 2745 | (GLfloat)param |
| 2746 | ); |
| 2747 | } |
| 2748 | |
| 2749 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2750 | static void |
| 2751 | android_glMaterialfv__II_3FI |
| 2752 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2753 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2754 | const char * _exceptionType = NULL; |
| 2755 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2756 | GLfloat *params_base = (GLfloat *) 0; |
| 2757 | jint _remaining; |
| 2758 | GLfloat *params = (GLfloat *) 0; |
| 2759 | |
| 2760 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2761 | _exception = 1; |
| 2762 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2763 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2764 | goto exit; |
| 2765 | } |
| 2766 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2767 | _exception = 1; |
| 2768 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2769 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2770 | goto exit; |
| 2771 | } |
| 2772 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2773 | int _needed; |
| 2774 | switch (pname) { |
| 2775 | #if defined(GL_SHININESS) |
| 2776 | case GL_SHININESS: |
| 2777 | #endif // defined(GL_SHININESS) |
| 2778 | _needed = 1; |
| 2779 | break; |
| 2780 | #if defined(GL_AMBIENT) |
| 2781 | case GL_AMBIENT: |
| 2782 | #endif // defined(GL_AMBIENT) |
| 2783 | #if defined(GL_DIFFUSE) |
| 2784 | case GL_DIFFUSE: |
| 2785 | #endif // defined(GL_DIFFUSE) |
| 2786 | #if defined(GL_SPECULAR) |
| 2787 | case GL_SPECULAR: |
| 2788 | #endif // defined(GL_SPECULAR) |
| 2789 | #if defined(GL_EMISSION) |
| 2790 | case GL_EMISSION: |
| 2791 | #endif // defined(GL_EMISSION) |
| 2792 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2793 | case GL_AMBIENT_AND_DIFFUSE: |
| 2794 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2795 | _needed = 4; |
| 2796 | break; |
| 2797 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2798 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2799 | break; |
| 2800 | } |
| 2801 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2802 | _exception = 1; |
| 2803 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2804 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2805 | goto exit; |
| 2806 | } |
| 2807 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2808 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2809 | params = params_base + offset; |
| 2810 | |
| 2811 | glMaterialfv( |
| 2812 | (GLenum)face, |
| 2813 | (GLenum)pname, |
| 2814 | (GLfloat *)params |
| 2815 | ); |
| 2816 | |
| 2817 | exit: |
| 2818 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2819 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2820 | JNI_ABORT); |
| 2821 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2822 | if (_exception) { |
| 2823 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2824 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2825 | } |
| 2826 | |
| 2827 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2828 | static void |
| 2829 | android_glMaterialfv__IILjava_nio_FloatBuffer_2 |
| 2830 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2831 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2832 | const char * _exceptionType = NULL; |
| 2833 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2834 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2835 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2836 | jint _remaining; |
| 2837 | GLfloat *params = (GLfloat *) 0; |
| 2838 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2839 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2840 | int _needed; |
| 2841 | switch (pname) { |
| 2842 | #if defined(GL_SHININESS) |
| 2843 | case GL_SHININESS: |
| 2844 | #endif // defined(GL_SHININESS) |
| 2845 | _needed = 1; |
| 2846 | break; |
| 2847 | #if defined(GL_AMBIENT) |
| 2848 | case GL_AMBIENT: |
| 2849 | #endif // defined(GL_AMBIENT) |
| 2850 | #if defined(GL_DIFFUSE) |
| 2851 | case GL_DIFFUSE: |
| 2852 | #endif // defined(GL_DIFFUSE) |
| 2853 | #if defined(GL_SPECULAR) |
| 2854 | case GL_SPECULAR: |
| 2855 | #endif // defined(GL_SPECULAR) |
| 2856 | #if defined(GL_EMISSION) |
| 2857 | case GL_EMISSION: |
| 2858 | #endif // defined(GL_EMISSION) |
| 2859 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2860 | case GL_AMBIENT_AND_DIFFUSE: |
| 2861 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2862 | _needed = 4; |
| 2863 | break; |
| 2864 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2865 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2866 | break; |
| 2867 | } |
| 2868 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2869 | _exception = 1; |
| 2870 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2871 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2872 | goto exit; |
| 2873 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2874 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2875 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2876 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2877 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2878 | glMaterialfv( |
| 2879 | (GLenum)face, |
| 2880 | (GLenum)pname, |
| 2881 | (GLfloat *)params |
| 2882 | ); |
| 2883 | |
| 2884 | exit: |
| 2885 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2886 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2887 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2888 | if (_exception) { |
| 2889 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2890 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2891 | } |
| 2892 | |
| 2893 | /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */ |
| 2894 | static void |
| 2895 | android_glMaterialx__III |
| 2896 | (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) { |
| 2897 | glMaterialx( |
| 2898 | (GLenum)face, |
| 2899 | (GLenum)pname, |
| 2900 | (GLfixed)param |
| 2901 | ); |
| 2902 | } |
| 2903 | |
| 2904 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2905 | static void |
| 2906 | android_glMaterialxv__II_3II |
| 2907 | (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] | 2908 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2909 | const char * _exceptionType = NULL; |
| 2910 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2911 | GLfixed *params_base = (GLfixed *) 0; |
| 2912 | jint _remaining; |
| 2913 | GLfixed *params = (GLfixed *) 0; |
| 2914 | |
| 2915 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2916 | _exception = 1; |
| 2917 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2918 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2919 | goto exit; |
| 2920 | } |
| 2921 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2922 | _exception = 1; |
| 2923 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2924 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2925 | goto exit; |
| 2926 | } |
| 2927 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2928 | int _needed; |
| 2929 | switch (pname) { |
| 2930 | #if defined(GL_SHININESS) |
| 2931 | case GL_SHININESS: |
| 2932 | #endif // defined(GL_SHININESS) |
| 2933 | _needed = 1; |
| 2934 | break; |
| 2935 | #if defined(GL_AMBIENT) |
| 2936 | case GL_AMBIENT: |
| 2937 | #endif // defined(GL_AMBIENT) |
| 2938 | #if defined(GL_DIFFUSE) |
| 2939 | case GL_DIFFUSE: |
| 2940 | #endif // defined(GL_DIFFUSE) |
| 2941 | #if defined(GL_SPECULAR) |
| 2942 | case GL_SPECULAR: |
| 2943 | #endif // defined(GL_SPECULAR) |
| 2944 | #if defined(GL_EMISSION) |
| 2945 | case GL_EMISSION: |
| 2946 | #endif // defined(GL_EMISSION) |
| 2947 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2948 | case GL_AMBIENT_AND_DIFFUSE: |
| 2949 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2950 | _needed = 4; |
| 2951 | break; |
| 2952 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2953 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2954 | break; |
| 2955 | } |
| 2956 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2957 | _exception = 1; |
| 2958 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2959 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2960 | goto exit; |
| 2961 | } |
| 2962 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2963 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2964 | params = params_base + offset; |
| 2965 | |
| 2966 | glMaterialxv( |
| 2967 | (GLenum)face, |
| 2968 | (GLenum)pname, |
| 2969 | (GLfixed *)params |
| 2970 | ); |
| 2971 | |
| 2972 | exit: |
| 2973 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2974 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2975 | JNI_ABORT); |
| 2976 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2977 | if (_exception) { |
| 2978 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2979 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2980 | } |
| 2981 | |
| 2982 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2983 | static void |
| 2984 | android_glMaterialxv__IILjava_nio_IntBuffer_2 |
| 2985 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2986 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2987 | const char * _exceptionType = NULL; |
| 2988 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2989 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2990 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2991 | jint _remaining; |
| 2992 | GLfixed *params = (GLfixed *) 0; |
| 2993 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2994 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2995 | int _needed; |
| 2996 | switch (pname) { |
| 2997 | #if defined(GL_SHININESS) |
| 2998 | case GL_SHININESS: |
| 2999 | #endif // defined(GL_SHININESS) |
| 3000 | _needed = 1; |
| 3001 | break; |
| 3002 | #if defined(GL_AMBIENT) |
| 3003 | case GL_AMBIENT: |
| 3004 | #endif // defined(GL_AMBIENT) |
| 3005 | #if defined(GL_DIFFUSE) |
| 3006 | case GL_DIFFUSE: |
| 3007 | #endif // defined(GL_DIFFUSE) |
| 3008 | #if defined(GL_SPECULAR) |
| 3009 | case GL_SPECULAR: |
| 3010 | #endif // defined(GL_SPECULAR) |
| 3011 | #if defined(GL_EMISSION) |
| 3012 | case GL_EMISSION: |
| 3013 | #endif // defined(GL_EMISSION) |
| 3014 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3015 | case GL_AMBIENT_AND_DIFFUSE: |
| 3016 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3017 | _needed = 4; |
| 3018 | break; |
| 3019 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3020 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3021 | break; |
| 3022 | } |
| 3023 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3024 | _exception = 1; |
| 3025 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3026 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3027 | goto exit; |
| 3028 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3029 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3030 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3031 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3032 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3033 | glMaterialxv( |
| 3034 | (GLenum)face, |
| 3035 | (GLenum)pname, |
| 3036 | (GLfixed *)params |
| 3037 | ); |
| 3038 | |
| 3039 | exit: |
| 3040 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3041 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3042 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3043 | if (_exception) { |
| 3044 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3045 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3046 | } |
| 3047 | |
| 3048 | /* void glMatrixMode ( GLenum mode ) */ |
| 3049 | static void |
| 3050 | android_glMatrixMode__I |
| 3051 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3052 | glMatrixMode( |
| 3053 | (GLenum)mode |
| 3054 | ); |
| 3055 | } |
| 3056 | |
| 3057 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3058 | static void |
| 3059 | android_glMultMatrixf___3FI |
| 3060 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3061 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3062 | const char * _exceptionType = NULL; |
| 3063 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3064 | GLfloat *m_base = (GLfloat *) 0; |
| 3065 | jint _remaining; |
| 3066 | GLfloat *m = (GLfloat *) 0; |
| 3067 | |
| 3068 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3069 | _exception = 1; |
| 3070 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3071 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3072 | goto exit; |
| 3073 | } |
| 3074 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3075 | _exception = 1; |
| 3076 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3077 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3078 | goto exit; |
| 3079 | } |
| 3080 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3081 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3082 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3083 | m = m_base + offset; |
| 3084 | |
| 3085 | glMultMatrixf( |
| 3086 | (GLfloat *)m |
| 3087 | ); |
| 3088 | |
| 3089 | exit: |
| 3090 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3091 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3092 | JNI_ABORT); |
| 3093 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3094 | if (_exception) { |
| 3095 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3096 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3097 | } |
| 3098 | |
| 3099 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3100 | static void |
| 3101 | android_glMultMatrixf__Ljava_nio_FloatBuffer_2 |
| 3102 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3103 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3104 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3105 | jint _remaining; |
| 3106 | GLfloat *m = (GLfloat *) 0; |
| 3107 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3108 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3109 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3110 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3111 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 3112 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3113 | glMultMatrixf( |
| 3114 | (GLfloat *)m |
| 3115 | ); |
| 3116 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3117 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3118 | } |
| 3119 | } |
| 3120 | |
| 3121 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3122 | static void |
| 3123 | android_glMultMatrixx___3II |
| 3124 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3125 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3126 | const char * _exceptionType = NULL; |
| 3127 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3128 | GLfixed *m_base = (GLfixed *) 0; |
| 3129 | jint _remaining; |
| 3130 | GLfixed *m = (GLfixed *) 0; |
| 3131 | |
| 3132 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3133 | _exception = 1; |
| 3134 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3135 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3136 | goto exit; |
| 3137 | } |
| 3138 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3139 | _exception = 1; |
| 3140 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3141 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3142 | goto exit; |
| 3143 | } |
| 3144 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3145 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3146 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3147 | m = m_base + offset; |
| 3148 | |
| 3149 | glMultMatrixx( |
| 3150 | (GLfixed *)m |
| 3151 | ); |
| 3152 | |
| 3153 | exit: |
| 3154 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3155 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3156 | JNI_ABORT); |
| 3157 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3158 | if (_exception) { |
| 3159 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3160 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3161 | } |
| 3162 | |
| 3163 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3164 | static void |
| 3165 | android_glMultMatrixx__Ljava_nio_IntBuffer_2 |
| 3166 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3167 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3168 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3169 | jint _remaining; |
| 3170 | GLfixed *m = (GLfixed *) 0; |
| 3171 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3172 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3173 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3174 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3175 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 3176 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3177 | glMultMatrixx( |
| 3178 | (GLfixed *)m |
| 3179 | ); |
| 3180 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3181 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3182 | } |
| 3183 | } |
| 3184 | |
| 3185 | /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */ |
| 3186 | static void |
| 3187 | android_glMultiTexCoord4f__IFFFF |
| 3188 | (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) { |
| 3189 | glMultiTexCoord4f( |
| 3190 | (GLenum)target, |
| 3191 | (GLfloat)s, |
| 3192 | (GLfloat)t, |
| 3193 | (GLfloat)r, |
| 3194 | (GLfloat)q |
| 3195 | ); |
| 3196 | } |
| 3197 | |
| 3198 | /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */ |
| 3199 | static void |
| 3200 | android_glMultiTexCoord4x__IIIII |
| 3201 | (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) { |
| 3202 | glMultiTexCoord4x( |
| 3203 | (GLenum)target, |
| 3204 | (GLfixed)s, |
| 3205 | (GLfixed)t, |
| 3206 | (GLfixed)r, |
| 3207 | (GLfixed)q |
| 3208 | ); |
| 3209 | } |
| 3210 | |
| 3211 | /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */ |
| 3212 | static void |
| 3213 | android_glNormal3f__FFF |
| 3214 | (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) { |
| 3215 | glNormal3f( |
| 3216 | (GLfloat)nx, |
| 3217 | (GLfloat)ny, |
| 3218 | (GLfloat)nz |
| 3219 | ); |
| 3220 | } |
| 3221 | |
| 3222 | /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */ |
| 3223 | static void |
| 3224 | android_glNormal3x__III |
| 3225 | (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) { |
| 3226 | glNormal3x( |
| 3227 | (GLfixed)nx, |
| 3228 | (GLfixed)ny, |
| 3229 | (GLfixed)nz |
| 3230 | ); |
| 3231 | } |
| 3232 | |
| 3233 | /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3234 | static void |
| 3235 | android_glNormalPointerBounds__IILjava_nio_Buffer_2I |
| 3236 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3237 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3238 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3239 | jint _remaining; |
| 3240 | GLvoid *pointer = (GLvoid *) 0; |
| 3241 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3242 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3243 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3244 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3245 | return; |
| 3246 | } |
| 3247 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3248 | glNormalPointerBounds( |
| 3249 | (GLenum)type, |
| 3250 | (GLsizei)stride, |
| 3251 | (GLvoid *)pointer, |
| 3252 | (GLsizei)remaining |
| 3253 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3254 | } |
| 3255 | |
| 3256 | /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3257 | static void |
| 3258 | android_glOrthof__FFFFFF |
| 3259 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 3260 | glOrthof( |
| 3261 | (GLfloat)left, |
| 3262 | (GLfloat)right, |
| 3263 | (GLfloat)bottom, |
| 3264 | (GLfloat)top, |
| 3265 | (GLfloat)zNear, |
| 3266 | (GLfloat)zFar |
| 3267 | ); |
| 3268 | } |
| 3269 | |
| 3270 | /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 3271 | static void |
| 3272 | android_glOrthox__IIIIII |
| 3273 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 3274 | glOrthox( |
| 3275 | (GLfixed)left, |
| 3276 | (GLfixed)right, |
| 3277 | (GLfixed)bottom, |
| 3278 | (GLfixed)top, |
| 3279 | (GLfixed)zNear, |
| 3280 | (GLfixed)zFar |
| 3281 | ); |
| 3282 | } |
| 3283 | |
| 3284 | /* void glPixelStorei ( GLenum pname, GLint param ) */ |
| 3285 | static void |
| 3286 | android_glPixelStorei__II |
| 3287 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 3288 | glPixelStorei( |
| 3289 | (GLenum)pname, |
| 3290 | (GLint)param |
| 3291 | ); |
| 3292 | } |
| 3293 | |
| 3294 | /* void glPointSize ( GLfloat size ) */ |
| 3295 | static void |
| 3296 | android_glPointSize__F |
| 3297 | (JNIEnv *_env, jobject _this, jfloat size) { |
| 3298 | glPointSize( |
| 3299 | (GLfloat)size |
| 3300 | ); |
| 3301 | } |
| 3302 | |
| 3303 | /* void glPointSizex ( GLfixed size ) */ |
| 3304 | static void |
| 3305 | android_glPointSizex__I |
| 3306 | (JNIEnv *_env, jobject _this, jint size) { |
| 3307 | glPointSizex( |
| 3308 | (GLfixed)size |
| 3309 | ); |
| 3310 | } |
| 3311 | |
| 3312 | /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ |
| 3313 | static void |
| 3314 | android_glPolygonOffset__FF |
| 3315 | (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { |
| 3316 | glPolygonOffset( |
| 3317 | (GLfloat)factor, |
| 3318 | (GLfloat)units |
| 3319 | ); |
| 3320 | } |
| 3321 | |
| 3322 | /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */ |
| 3323 | static void |
| 3324 | android_glPolygonOffsetx__II |
| 3325 | (JNIEnv *_env, jobject _this, jint factor, jint units) { |
| 3326 | glPolygonOffsetx( |
| 3327 | (GLfixed)factor, |
| 3328 | (GLfixed)units |
| 3329 | ); |
| 3330 | } |
| 3331 | |
| 3332 | /* void glPopMatrix ( void ) */ |
| 3333 | static void |
| 3334 | android_glPopMatrix__ |
| 3335 | (JNIEnv *_env, jobject _this) { |
| 3336 | glPopMatrix(); |
| 3337 | } |
| 3338 | |
| 3339 | /* void glPushMatrix ( void ) */ |
| 3340 | static void |
| 3341 | android_glPushMatrix__ |
| 3342 | (JNIEnv *_env, jobject _this) { |
| 3343 | glPushMatrix(); |
| 3344 | } |
| 3345 | |
| 3346 | /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ |
| 3347 | static void |
| 3348 | android_glReadPixels__IIIIIILjava_nio_Buffer_2 |
| 3349 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3350 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3351 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3352 | jint _remaining; |
| 3353 | GLvoid *pixels = (GLvoid *) 0; |
| 3354 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3355 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3356 | if (pixels == NULL) { |
| 3357 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3358 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 3359 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3360 | glReadPixels( |
| 3361 | (GLint)x, |
| 3362 | (GLint)y, |
| 3363 | (GLsizei)width, |
| 3364 | (GLsizei)height, |
| 3365 | (GLenum)format, |
| 3366 | (GLenum)type, |
| 3367 | (GLvoid *)pixels |
| 3368 | ); |
| 3369 | if (_array) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3370 | releasePointer(_env, _array, pixels, JNI_TRUE); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3371 | } |
| 3372 | } |
| 3373 | |
| 3374 | /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */ |
| 3375 | static void |
| 3376 | android_glRotatef__FFFF |
| 3377 | (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) { |
| 3378 | glRotatef( |
| 3379 | (GLfloat)angle, |
| 3380 | (GLfloat)x, |
| 3381 | (GLfloat)y, |
| 3382 | (GLfloat)z |
| 3383 | ); |
| 3384 | } |
| 3385 | |
| 3386 | /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */ |
| 3387 | static void |
| 3388 | android_glRotatex__IIII |
| 3389 | (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) { |
| 3390 | glRotatex( |
| 3391 | (GLfixed)angle, |
| 3392 | (GLfixed)x, |
| 3393 | (GLfixed)y, |
| 3394 | (GLfixed)z |
| 3395 | ); |
| 3396 | } |
| 3397 | |
| 3398 | /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ |
| 3399 | static void |
| 3400 | android_glSampleCoverage__FZ |
| 3401 | (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { |
| 3402 | glSampleCoverage( |
| 3403 | (GLclampf)value, |
| 3404 | (GLboolean)invert |
| 3405 | ); |
| 3406 | } |
| 3407 | |
| 3408 | /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */ |
| 3409 | static void |
| 3410 | android_glSampleCoveragex__IZ |
| 3411 | (JNIEnv *_env, jobject _this, jint value, jboolean invert) { |
| 3412 | glSampleCoveragex( |
| 3413 | (GLclampx)value, |
| 3414 | (GLboolean)invert |
| 3415 | ); |
| 3416 | } |
| 3417 | |
| 3418 | /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3419 | static void |
| 3420 | android_glScalef__FFF |
| 3421 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3422 | glScalef( |
| 3423 | (GLfloat)x, |
| 3424 | (GLfloat)y, |
| 3425 | (GLfloat)z |
| 3426 | ); |
| 3427 | } |
| 3428 | |
| 3429 | /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3430 | static void |
| 3431 | android_glScalex__III |
| 3432 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3433 | glScalex( |
| 3434 | (GLfixed)x, |
| 3435 | (GLfixed)y, |
| 3436 | (GLfixed)z |
| 3437 | ); |
| 3438 | } |
| 3439 | |
| 3440 | /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3441 | static void |
| 3442 | android_glScissor__IIII |
| 3443 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3444 | glScissor( |
| 3445 | (GLint)x, |
| 3446 | (GLint)y, |
| 3447 | (GLsizei)width, |
| 3448 | (GLsizei)height |
| 3449 | ); |
| 3450 | } |
| 3451 | |
| 3452 | /* void glShadeModel ( GLenum mode ) */ |
| 3453 | static void |
| 3454 | android_glShadeModel__I |
| 3455 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3456 | glShadeModel( |
| 3457 | (GLenum)mode |
| 3458 | ); |
| 3459 | } |
| 3460 | |
| 3461 | /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ |
| 3462 | static void |
| 3463 | android_glStencilFunc__III |
| 3464 | (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { |
| 3465 | glStencilFunc( |
| 3466 | (GLenum)func, |
| 3467 | (GLint)ref, |
| 3468 | (GLuint)mask |
| 3469 | ); |
| 3470 | } |
| 3471 | |
| 3472 | /* void glStencilMask ( GLuint mask ) */ |
| 3473 | static void |
| 3474 | android_glStencilMask__I |
| 3475 | (JNIEnv *_env, jobject _this, jint mask) { |
| 3476 | glStencilMask( |
| 3477 | (GLuint)mask |
| 3478 | ); |
| 3479 | } |
| 3480 | |
| 3481 | /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3482 | static void |
| 3483 | android_glStencilOp__III |
| 3484 | (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { |
| 3485 | glStencilOp( |
| 3486 | (GLenum)fail, |
| 3487 | (GLenum)zfail, |
| 3488 | (GLenum)zpass |
| 3489 | ); |
| 3490 | } |
| 3491 | |
| 3492 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3493 | static void |
| 3494 | android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I |
| 3495 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3496 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3497 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3498 | jint _remaining; |
| 3499 | GLvoid *pointer = (GLvoid *) 0; |
| 3500 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3501 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3502 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3503 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3504 | return; |
| 3505 | } |
| 3506 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3507 | glTexCoordPointerBounds( |
| 3508 | (GLint)size, |
| 3509 | (GLenum)type, |
| 3510 | (GLsizei)stride, |
| 3511 | (GLvoid *)pointer, |
| 3512 | (GLsizei)remaining |
| 3513 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3514 | } |
| 3515 | |
| 3516 | /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3517 | static void |
| 3518 | android_glTexEnvf__IIF |
| 3519 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3520 | glTexEnvf( |
| 3521 | (GLenum)target, |
| 3522 | (GLenum)pname, |
| 3523 | (GLfloat)param |
| 3524 | ); |
| 3525 | } |
| 3526 | |
| 3527 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3528 | static void |
| 3529 | android_glTexEnvfv__II_3FI |
| 3530 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3531 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3532 | const char * _exceptionType = NULL; |
| 3533 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3534 | GLfloat *params_base = (GLfloat *) 0; |
| 3535 | jint _remaining; |
| 3536 | GLfloat *params = (GLfloat *) 0; |
| 3537 | |
| 3538 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3539 | _exception = 1; |
| 3540 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3541 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3542 | goto exit; |
| 3543 | } |
| 3544 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3545 | _exception = 1; |
| 3546 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3547 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3548 | goto exit; |
| 3549 | } |
| 3550 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3551 | int _needed; |
| 3552 | switch (pname) { |
| 3553 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3554 | case GL_TEXTURE_ENV_MODE: |
| 3555 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3556 | #if defined(GL_COMBINE_RGB) |
| 3557 | case GL_COMBINE_RGB: |
| 3558 | #endif // defined(GL_COMBINE_RGB) |
| 3559 | #if defined(GL_COMBINE_ALPHA) |
| 3560 | case GL_COMBINE_ALPHA: |
| 3561 | #endif // defined(GL_COMBINE_ALPHA) |
| 3562 | _needed = 1; |
| 3563 | break; |
| 3564 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3565 | case GL_TEXTURE_ENV_COLOR: |
| 3566 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3567 | _needed = 4; |
| 3568 | break; |
| 3569 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3570 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3571 | break; |
| 3572 | } |
| 3573 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3574 | _exception = 1; |
| 3575 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3576 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3577 | goto exit; |
| 3578 | } |
| 3579 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3580 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3581 | params = params_base + offset; |
| 3582 | |
| 3583 | glTexEnvfv( |
| 3584 | (GLenum)target, |
| 3585 | (GLenum)pname, |
| 3586 | (GLfloat *)params |
| 3587 | ); |
| 3588 | |
| 3589 | exit: |
| 3590 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3591 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3592 | JNI_ABORT); |
| 3593 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3594 | if (_exception) { |
| 3595 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3596 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3597 | } |
| 3598 | |
| 3599 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3600 | static void |
| 3601 | android_glTexEnvfv__IILjava_nio_FloatBuffer_2 |
| 3602 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3603 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3604 | const char * _exceptionType = NULL; |
| 3605 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3606 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3607 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3608 | jint _remaining; |
| 3609 | GLfloat *params = (GLfloat *) 0; |
| 3610 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3611 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3612 | int _needed; |
| 3613 | switch (pname) { |
| 3614 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3615 | case GL_TEXTURE_ENV_MODE: |
| 3616 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3617 | #if defined(GL_COMBINE_RGB) |
| 3618 | case GL_COMBINE_RGB: |
| 3619 | #endif // defined(GL_COMBINE_RGB) |
| 3620 | #if defined(GL_COMBINE_ALPHA) |
| 3621 | case GL_COMBINE_ALPHA: |
| 3622 | #endif // defined(GL_COMBINE_ALPHA) |
| 3623 | _needed = 1; |
| 3624 | break; |
| 3625 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3626 | case GL_TEXTURE_ENV_COLOR: |
| 3627 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3628 | _needed = 4; |
| 3629 | break; |
| 3630 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3631 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3632 | break; |
| 3633 | } |
| 3634 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3635 | _exception = 1; |
| 3636 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3637 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3638 | goto exit; |
| 3639 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3640 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3641 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3642 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3643 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3644 | glTexEnvfv( |
| 3645 | (GLenum)target, |
| 3646 | (GLenum)pname, |
| 3647 | (GLfloat *)params |
| 3648 | ); |
| 3649 | |
| 3650 | exit: |
| 3651 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3652 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3653 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3654 | if (_exception) { |
| 3655 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3656 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3657 | } |
| 3658 | |
| 3659 | /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3660 | static void |
| 3661 | android_glTexEnvx__III |
| 3662 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3663 | glTexEnvx( |
| 3664 | (GLenum)target, |
| 3665 | (GLenum)pname, |
| 3666 | (GLfixed)param |
| 3667 | ); |
| 3668 | } |
| 3669 | |
| 3670 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3671 | static void |
| 3672 | android_glTexEnvxv__II_3II |
| 3673 | (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] | 3674 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3675 | const char * _exceptionType = NULL; |
| 3676 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3677 | GLfixed *params_base = (GLfixed *) 0; |
| 3678 | jint _remaining; |
| 3679 | GLfixed *params = (GLfixed *) 0; |
| 3680 | |
| 3681 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3682 | _exception = 1; |
| 3683 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3684 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3685 | goto exit; |
| 3686 | } |
| 3687 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3688 | _exception = 1; |
| 3689 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3690 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3691 | goto exit; |
| 3692 | } |
| 3693 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3694 | int _needed; |
| 3695 | switch (pname) { |
| 3696 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3697 | case GL_TEXTURE_ENV_MODE: |
| 3698 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3699 | #if defined(GL_COMBINE_RGB) |
| 3700 | case GL_COMBINE_RGB: |
| 3701 | #endif // defined(GL_COMBINE_RGB) |
| 3702 | #if defined(GL_COMBINE_ALPHA) |
| 3703 | case GL_COMBINE_ALPHA: |
| 3704 | #endif // defined(GL_COMBINE_ALPHA) |
| 3705 | _needed = 1; |
| 3706 | break; |
| 3707 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3708 | case GL_TEXTURE_ENV_COLOR: |
| 3709 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3710 | _needed = 4; |
| 3711 | break; |
| 3712 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3713 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3714 | break; |
| 3715 | } |
| 3716 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3717 | _exception = 1; |
| 3718 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3719 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3720 | goto exit; |
| 3721 | } |
| 3722 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3723 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3724 | params = params_base + offset; |
| 3725 | |
| 3726 | glTexEnvxv( |
| 3727 | (GLenum)target, |
| 3728 | (GLenum)pname, |
| 3729 | (GLfixed *)params |
| 3730 | ); |
| 3731 | |
| 3732 | exit: |
| 3733 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3734 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3735 | JNI_ABORT); |
| 3736 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3737 | if (_exception) { |
| 3738 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3739 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3740 | } |
| 3741 | |
| 3742 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3743 | static void |
| 3744 | android_glTexEnvxv__IILjava_nio_IntBuffer_2 |
| 3745 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3746 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3747 | const char * _exceptionType = NULL; |
| 3748 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3749 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3750 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3751 | jint _remaining; |
| 3752 | GLfixed *params = (GLfixed *) 0; |
| 3753 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3754 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3755 | int _needed; |
| 3756 | switch (pname) { |
| 3757 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3758 | case GL_TEXTURE_ENV_MODE: |
| 3759 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3760 | #if defined(GL_COMBINE_RGB) |
| 3761 | case GL_COMBINE_RGB: |
| 3762 | #endif // defined(GL_COMBINE_RGB) |
| 3763 | #if defined(GL_COMBINE_ALPHA) |
| 3764 | case GL_COMBINE_ALPHA: |
| 3765 | #endif // defined(GL_COMBINE_ALPHA) |
| 3766 | _needed = 1; |
| 3767 | break; |
| 3768 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3769 | case GL_TEXTURE_ENV_COLOR: |
| 3770 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3771 | _needed = 4; |
| 3772 | break; |
| 3773 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3774 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3775 | break; |
| 3776 | } |
| 3777 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3778 | _exception = 1; |
| 3779 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3780 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3781 | goto exit; |
| 3782 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3783 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3784 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3785 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3786 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3787 | glTexEnvxv( |
| 3788 | (GLenum)target, |
| 3789 | (GLenum)pname, |
| 3790 | (GLfixed *)params |
| 3791 | ); |
| 3792 | |
| 3793 | exit: |
| 3794 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3795 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3796 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3797 | if (_exception) { |
| 3798 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3799 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3800 | } |
| 3801 | |
| 3802 | /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3803 | static void |
| 3804 | android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3805 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { |
| 3806 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3807 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3808 | jint _remaining; |
| 3809 | GLvoid *pixels = (GLvoid *) 0; |
| 3810 | |
| 3811 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3812 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3813 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 3814 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3815 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3816 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3817 | } |
| 3818 | glTexImage2D( |
| 3819 | (GLenum)target, |
| 3820 | (GLint)level, |
| 3821 | (GLint)internalformat, |
| 3822 | (GLsizei)width, |
| 3823 | (GLsizei)height, |
| 3824 | (GLint)border, |
| 3825 | (GLenum)format, |
| 3826 | (GLenum)type, |
| 3827 | (GLvoid *)pixels |
| 3828 | ); |
| 3829 | if (_array) { |
| 3830 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3831 | } |
| 3832 | } |
| 3833 | |
| 3834 | /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3835 | static void |
| 3836 | android_glTexParameterf__IIF |
| 3837 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3838 | glTexParameterf( |
| 3839 | (GLenum)target, |
| 3840 | (GLenum)pname, |
| 3841 | (GLfloat)param |
| 3842 | ); |
| 3843 | } |
| 3844 | |
| 3845 | /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3846 | static void |
| 3847 | android_glTexParameterx__III |
| 3848 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3849 | glTexParameterx( |
| 3850 | (GLenum)target, |
| 3851 | (GLenum)pname, |
| 3852 | (GLfixed)param |
| 3853 | ); |
| 3854 | } |
| 3855 | |
| 3856 | /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3857 | static void |
| 3858 | android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3859 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
| 3860 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3861 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3862 | jint _remaining; |
| 3863 | GLvoid *pixels = (GLvoid *) 0; |
| 3864 | |
| 3865 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3866 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3867 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 3868 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3869 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3870 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3871 | } |
| 3872 | glTexSubImage2D( |
| 3873 | (GLenum)target, |
| 3874 | (GLint)level, |
| 3875 | (GLint)xoffset, |
| 3876 | (GLint)yoffset, |
| 3877 | (GLsizei)width, |
| 3878 | (GLsizei)height, |
| 3879 | (GLenum)format, |
| 3880 | (GLenum)type, |
| 3881 | (GLvoid *)pixels |
| 3882 | ); |
| 3883 | if (_array) { |
| 3884 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3885 | } |
| 3886 | } |
| 3887 | |
| 3888 | /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3889 | static void |
| 3890 | android_glTranslatef__FFF |
| 3891 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3892 | glTranslatef( |
| 3893 | (GLfloat)x, |
| 3894 | (GLfloat)y, |
| 3895 | (GLfloat)z |
| 3896 | ); |
| 3897 | } |
| 3898 | |
| 3899 | /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3900 | static void |
| 3901 | android_glTranslatex__III |
| 3902 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3903 | glTranslatex( |
| 3904 | (GLfixed)x, |
| 3905 | (GLfixed)y, |
| 3906 | (GLfixed)z |
| 3907 | ); |
| 3908 | } |
| 3909 | |
| 3910 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3911 | static void |
| 3912 | android_glVertexPointerBounds__IIILjava_nio_Buffer_2I |
| 3913 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 3914 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3915 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3916 | jint _remaining; |
| 3917 | GLvoid *pointer = (GLvoid *) 0; |
| 3918 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3919 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3920 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3921 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3922 | return; |
| 3923 | } |
| 3924 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3925 | glVertexPointerBounds( |
| 3926 | (GLint)size, |
| 3927 | (GLenum)type, |
| 3928 | (GLsizei)stride, |
| 3929 | (GLvoid *)pointer, |
| 3930 | (GLsizei)remaining |
| 3931 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3932 | } |
| 3933 | |
| 3934 | /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3935 | static void |
| 3936 | android_glViewport__IIII |
| 3937 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3938 | glViewport( |
| 3939 | (GLint)x, |
| 3940 | (GLint)y, |
| 3941 | (GLsizei)width, |
| 3942 | (GLsizei)height |
| 3943 | ); |
| 3944 | } |
| 3945 | |
| 3946 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 3947 | static jint |
| 3948 | android_glQueryMatrixxOES___3II_3II |
| 3949 | (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) { |
| 3950 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3951 | const char * _exceptionType = NULL; |
| 3952 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3953 | GLbitfield _returnValue = -1; |
| 3954 | GLfixed *mantissa_base = (GLfixed *) 0; |
| 3955 | jint _mantissaRemaining; |
| 3956 | GLfixed *mantissa = (GLfixed *) 0; |
| 3957 | GLint *exponent_base = (GLint *) 0; |
| 3958 | jint _exponentRemaining; |
| 3959 | GLint *exponent = (GLint *) 0; |
| 3960 | |
| 3961 | if (!mantissa_ref) { |
| 3962 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3963 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3964 | _exceptionMessage = "mantissa == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3965 | goto exit; |
| 3966 | } |
| 3967 | if (mantissaOffset < 0) { |
| 3968 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3969 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3970 | _exceptionMessage = "mantissaOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3971 | goto exit; |
| 3972 | } |
| 3973 | _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; |
| 3974 | if (_mantissaRemaining < 16) { |
| 3975 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3976 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3977 | _exceptionMessage = "length - mantissaOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3978 | goto exit; |
| 3979 | } |
| 3980 | mantissa_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3981 | _env->GetIntArrayElements(mantissa_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3982 | mantissa = mantissa_base + mantissaOffset; |
| 3983 | |
| 3984 | if (!exponent_ref) { |
| 3985 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3986 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3987 | _exceptionMessage = "exponent == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3988 | goto exit; |
| 3989 | } |
| 3990 | if (exponentOffset < 0) { |
| 3991 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3992 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3993 | _exceptionMessage = "exponentOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3994 | goto exit; |
| 3995 | } |
| 3996 | _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; |
| 3997 | if (_exponentRemaining < 16) { |
| 3998 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3999 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4000 | _exceptionMessage = "length - exponentOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4001 | goto exit; |
| 4002 | } |
| 4003 | exponent_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4004 | _env->GetIntArrayElements(exponent_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4005 | exponent = exponent_base + exponentOffset; |
| 4006 | |
| 4007 | _returnValue = glQueryMatrixxOES( |
| 4008 | (GLfixed *)mantissa, |
| 4009 | (GLint *)exponent |
| 4010 | ); |
| 4011 | |
| 4012 | exit: |
| 4013 | if (exponent_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4014 | _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4015 | _exception ? JNI_ABORT: 0); |
| 4016 | } |
| 4017 | if (mantissa_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4018 | _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4019 | _exception ? JNI_ABORT: 0); |
| 4020 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4021 | if (_exception) { |
| 4022 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4023 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4024 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4025 | } |
| 4026 | |
| 4027 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4028 | static jint |
| 4029 | android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 4030 | (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) { |
| 4031 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4032 | const char * _exceptionType = NULL; |
| 4033 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4034 | jintArray _mantissaArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4035 | jint _mantissaBufferOffset = (jint) 0; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4036 | jintArray _exponentArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4037 | jint _exponentBufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4038 | GLbitfield _returnValue = -1; |
| 4039 | jint _mantissaRemaining; |
| 4040 | GLfixed *mantissa = (GLfixed *) 0; |
| 4041 | jint _exponentRemaining; |
| 4042 | GLint *exponent = (GLint *) 0; |
| 4043 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4044 | mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4045 | if (_mantissaRemaining < 16) { |
| 4046 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4047 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4048 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4049 | goto exit; |
| 4050 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4051 | exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4052 | if (_exponentRemaining < 16) { |
| 4053 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4054 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4055 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4056 | goto exit; |
| 4057 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4058 | if (mantissa == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4059 | char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4060 | mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset); |
| 4061 | } |
| 4062 | if (exponent == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4063 | char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4064 | exponent = (GLint *) (_exponentBase + _exponentBufferOffset); |
| 4065 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4066 | _returnValue = glQueryMatrixxOES( |
| 4067 | (GLfixed *)mantissa, |
| 4068 | (GLint *)exponent |
| 4069 | ); |
| 4070 | |
| 4071 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4072 | if (_exponentArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4073 | _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4074 | } |
| 4075 | if (_mantissaArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4076 | _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4077 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4078 | if (_exception) { |
| 4079 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4080 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4081 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4082 | } |
| 4083 | |
| 4084 | /* void glBindBuffer ( GLenum target, GLuint buffer ) */ |
| 4085 | static void |
| 4086 | android_glBindBuffer__II |
| 4087 | (JNIEnv *_env, jobject _this, jint target, jint buffer) { |
| 4088 | glBindBuffer( |
| 4089 | (GLenum)target, |
| 4090 | (GLuint)buffer |
| 4091 | ); |
| 4092 | } |
| 4093 | |
| 4094 | /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ |
| 4095 | static void |
| 4096 | android_glBufferData__IILjava_nio_Buffer_2I |
| 4097 | (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4098 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4099 | const char * _exceptionType = NULL; |
| 4100 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4101 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4102 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4103 | jint _remaining; |
| 4104 | GLvoid *data = (GLvoid *) 0; |
| 4105 | |
| 4106 | if (data_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4107 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4108 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4109 | _exception = 1; |
| 4110 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4111 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4112 | goto exit; |
| 4113 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4114 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4115 | if (data_buf && data == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4116 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4117 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4118 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4119 | glBufferData( |
| 4120 | (GLenum)target, |
| 4121 | (GLsizeiptr)size, |
| 4122 | (GLvoid *)data, |
| 4123 | (GLenum)usage |
| 4124 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4125 | |
| 4126 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4127 | if (_array) { |
| 4128 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4129 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4130 | if (_exception) { |
| 4131 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4132 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4133 | } |
| 4134 | |
| 4135 | /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ |
| 4136 | static void |
| 4137 | android_glBufferSubData__IIILjava_nio_Buffer_2 |
| 4138 | (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4139 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4140 | const char * _exceptionType = NULL; |
| 4141 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4142 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4143 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4144 | jint _remaining; |
| 4145 | GLvoid *data = (GLvoid *) 0; |
| 4146 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4147 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4148 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4149 | _exception = 1; |
| 4150 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4151 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4152 | goto exit; |
| 4153 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4154 | if (data == NULL) { |
| 4155 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4156 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4157 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4158 | glBufferSubData( |
| 4159 | (GLenum)target, |
| 4160 | (GLintptr)offset, |
| 4161 | (GLsizeiptr)size, |
| 4162 | (GLvoid *)data |
| 4163 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4164 | |
| 4165 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4166 | if (_array) { |
| 4167 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4168 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4169 | if (_exception) { |
| 4170 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4171 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4172 | } |
| 4173 | |
| 4174 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4175 | static void |
| 4176 | android_glClipPlanef__I_3FI |
| 4177 | (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4178 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4179 | const char * _exceptionType = NULL; |
| 4180 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4181 | GLfloat *equation_base = (GLfloat *) 0; |
| 4182 | jint _remaining; |
| 4183 | GLfloat *equation = (GLfloat *) 0; |
| 4184 | |
| 4185 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4186 | _exception = 1; |
| 4187 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4188 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4189 | goto exit; |
| 4190 | } |
| 4191 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4192 | _exception = 1; |
| 4193 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4194 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4195 | goto exit; |
| 4196 | } |
| 4197 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4198 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4199 | _exception = 1; |
| 4200 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4201 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4202 | goto exit; |
| 4203 | } |
| 4204 | equation_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4205 | _env->GetFloatArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4206 | equation = equation_base + offset; |
| 4207 | |
| 4208 | glClipPlanef( |
| 4209 | (GLenum)plane, |
| 4210 | (GLfloat *)equation |
| 4211 | ); |
| 4212 | |
| 4213 | exit: |
| 4214 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4215 | _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4216 | JNI_ABORT); |
| 4217 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4218 | if (_exception) { |
| 4219 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4220 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4221 | } |
| 4222 | |
| 4223 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4224 | static void |
| 4225 | android_glClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4226 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4227 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4228 | const char * _exceptionType = NULL; |
| 4229 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4230 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4231 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4232 | jint _remaining; |
| 4233 | GLfloat *equation = (GLfloat *) 0; |
| 4234 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4235 | equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4236 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4237 | _exception = 1; |
| 4238 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4239 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4240 | goto exit; |
| 4241 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4242 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4243 | char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4244 | equation = (GLfloat *) (_equationBase + _bufferOffset); |
| 4245 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4246 | glClipPlanef( |
| 4247 | (GLenum)plane, |
| 4248 | (GLfloat *)equation |
| 4249 | ); |
| 4250 | |
| 4251 | exit: |
| 4252 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4253 | _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4254 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4255 | if (_exception) { |
| 4256 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4257 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4258 | } |
| 4259 | |
| 4260 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4261 | static void |
| 4262 | android_glClipPlanex__I_3II |
| 4263 | (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4264 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4265 | const char * _exceptionType = NULL; |
| 4266 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4267 | GLfixed *equation_base = (GLfixed *) 0; |
| 4268 | jint _remaining; |
| 4269 | GLfixed *equation = (GLfixed *) 0; |
| 4270 | |
| 4271 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4272 | _exception = 1; |
| 4273 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4274 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4275 | goto exit; |
| 4276 | } |
| 4277 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4278 | _exception = 1; |
| 4279 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4280 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4281 | goto exit; |
| 4282 | } |
| 4283 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4284 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4285 | _exception = 1; |
| 4286 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4287 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4288 | goto exit; |
| 4289 | } |
| 4290 | equation_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4291 | _env->GetIntArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4292 | equation = equation_base + offset; |
| 4293 | |
| 4294 | glClipPlanex( |
| 4295 | (GLenum)plane, |
| 4296 | (GLfixed *)equation |
| 4297 | ); |
| 4298 | |
| 4299 | exit: |
| 4300 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4301 | _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4302 | JNI_ABORT); |
| 4303 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4304 | if (_exception) { |
| 4305 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4306 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4307 | } |
| 4308 | |
| 4309 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4310 | static void |
| 4311 | android_glClipPlanex__ILjava_nio_IntBuffer_2 |
| 4312 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4313 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4314 | const char * _exceptionType = NULL; |
| 4315 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4316 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4317 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4318 | jint _remaining; |
| 4319 | GLfixed *equation = (GLfixed *) 0; |
| 4320 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4321 | equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4322 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4323 | _exception = 1; |
| 4324 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4325 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4326 | goto exit; |
| 4327 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4328 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4329 | char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4330 | equation = (GLfixed *) (_equationBase + _bufferOffset); |
| 4331 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4332 | glClipPlanex( |
| 4333 | (GLenum)plane, |
| 4334 | (GLfixed *)equation |
| 4335 | ); |
| 4336 | |
| 4337 | exit: |
| 4338 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4339 | _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4340 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4341 | if (_exception) { |
| 4342 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4343 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4344 | } |
| 4345 | |
| 4346 | /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ |
| 4347 | static void |
| 4348 | android_glColor4ub__BBBB |
| 4349 | (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { |
| 4350 | glColor4ub( |
| 4351 | (GLubyte)red, |
| 4352 | (GLubyte)green, |
| 4353 | (GLubyte)blue, |
| 4354 | (GLubyte)alpha |
| 4355 | ); |
| 4356 | } |
| 4357 | |
| 4358 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 4359 | static void |
| 4360 | android_glColorPointer__IIII |
| 4361 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 4362 | glColorPointer( |
| 4363 | (GLint)size, |
| 4364 | (GLenum)type, |
| 4365 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4366 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4367 | ); |
| 4368 | } |
| 4369 | |
| 4370 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4371 | static void |
| 4372 | android_glDeleteBuffers__I_3II |
| 4373 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4374 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4375 | const char * _exceptionType = NULL; |
| 4376 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4377 | GLuint *buffers_base = (GLuint *) 0; |
| 4378 | jint _remaining; |
| 4379 | GLuint *buffers = (GLuint *) 0; |
| 4380 | |
| 4381 | if (!buffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4382 | _exception = 1; |
| 4383 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4384 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4385 | goto exit; |
| 4386 | } |
| 4387 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4388 | _exception = 1; |
| 4389 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4390 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4391 | goto exit; |
| 4392 | } |
| 4393 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4394 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4395 | _exception = 1; |
| 4396 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4397 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4398 | goto exit; |
| 4399 | } |
| 4400 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4401 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4402 | buffers = buffers_base + offset; |
| 4403 | |
| 4404 | glDeleteBuffers( |
| 4405 | (GLsizei)n, |
| 4406 | (GLuint *)buffers |
| 4407 | ); |
| 4408 | |
| 4409 | exit: |
| 4410 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4411 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4412 | JNI_ABORT); |
| 4413 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4414 | if (_exception) { |
| 4415 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4416 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4417 | } |
| 4418 | |
| 4419 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4420 | static void |
| 4421 | android_glDeleteBuffers__ILjava_nio_IntBuffer_2 |
| 4422 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4423 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4424 | const char * _exceptionType = NULL; |
| 4425 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4426 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4427 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4428 | jint _remaining; |
| 4429 | GLuint *buffers = (GLuint *) 0; |
| 4430 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4431 | buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4433 | _exception = 1; |
| 4434 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4435 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4436 | goto exit; |
| 4437 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4438 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4439 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4440 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4441 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4442 | glDeleteBuffers( |
| 4443 | (GLsizei)n, |
| 4444 | (GLuint *)buffers |
| 4445 | ); |
| 4446 | |
| 4447 | exit: |
| 4448 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4449 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4450 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4451 | if (_exception) { |
| 4452 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4453 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4454 | } |
| 4455 | |
| 4456 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ |
| 4457 | static void |
| 4458 | android_glDrawElements__IIII |
| 4459 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4460 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4461 | const char * _exceptionType = NULL; |
| 4462 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4463 | glDrawElements( |
| 4464 | (GLenum)mode, |
| 4465 | (GLsizei)count, |
| 4466 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4467 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4468 | ); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4469 | if (_exception) { |
| 4470 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4471 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4472 | } |
| 4473 | |
| 4474 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4475 | static void |
| 4476 | android_glGenBuffers__I_3II |
| 4477 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 4478 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4479 | const char * _exceptionType = NULL; |
| 4480 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4481 | GLuint *buffers_base = (GLuint *) 0; |
| 4482 | jint _remaining; |
| 4483 | GLuint *buffers = (GLuint *) 0; |
| 4484 | |
| 4485 | if (!buffers_ref) { |
| 4486 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4487 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4488 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4489 | goto exit; |
| 4490 | } |
| 4491 | if (offset < 0) { |
| 4492 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4493 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4494 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4495 | goto exit; |
| 4496 | } |
| 4497 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4498 | if (_remaining < n) { |
| 4499 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4500 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4501 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4502 | goto exit; |
| 4503 | } |
| 4504 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4505 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4506 | buffers = buffers_base + offset; |
| 4507 | |
| 4508 | glGenBuffers( |
| 4509 | (GLsizei)n, |
| 4510 | (GLuint *)buffers |
| 4511 | ); |
| 4512 | |
| 4513 | exit: |
| 4514 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4515 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4516 | _exception ? JNI_ABORT: 0); |
| 4517 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4518 | if (_exception) { |
| 4519 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4520 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4521 | } |
| 4522 | |
| 4523 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4524 | static void |
| 4525 | android_glGenBuffers__ILjava_nio_IntBuffer_2 |
| 4526 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 4527 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4528 | const char * _exceptionType = NULL; |
| 4529 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4530 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4531 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4532 | jint _remaining; |
| 4533 | GLuint *buffers = (GLuint *) 0; |
| 4534 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4535 | buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4536 | if (_remaining < n) { |
| 4537 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4538 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4539 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4540 | goto exit; |
| 4541 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4542 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4543 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4544 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4545 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4546 | glGenBuffers( |
| 4547 | (GLsizei)n, |
| 4548 | (GLuint *)buffers |
| 4549 | ); |
| 4550 | |
| 4551 | exit: |
| 4552 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4553 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4554 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4555 | if (_exception) { |
| 4556 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4557 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4558 | } |
| 4559 | |
| 4560 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4561 | static void |
| 4562 | android_glGetBooleanv__I_3ZI |
| 4563 | (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { |
| 4564 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4565 | const char * _exceptionType = NULL; |
| 4566 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4567 | GLboolean *params_base = (GLboolean *) 0; |
| 4568 | jint _remaining; |
| 4569 | GLboolean *params = (GLboolean *) 0; |
| 4570 | |
| 4571 | if (!params_ref) { |
| 4572 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4573 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4574 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4575 | goto exit; |
| 4576 | } |
| 4577 | if (offset < 0) { |
| 4578 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4579 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4580 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4581 | goto exit; |
| 4582 | } |
| 4583 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4584 | params_base = (GLboolean *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4585 | _env->GetBooleanArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4586 | params = params_base + offset; |
| 4587 | |
| 4588 | glGetBooleanv( |
| 4589 | (GLenum)pname, |
| 4590 | (GLboolean *)params |
| 4591 | ); |
| 4592 | |
| 4593 | exit: |
| 4594 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4595 | _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4596 | _exception ? JNI_ABORT: 0); |
| 4597 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4598 | if (_exception) { |
| 4599 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4600 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4601 | } |
| 4602 | |
| 4603 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4604 | static void |
| 4605 | android_glGetBooleanv__ILjava_nio_IntBuffer_2 |
| 4606 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4607 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4608 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | jint _remaining; |
| 4610 | GLboolean *params = (GLboolean *) 0; |
| 4611 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4612 | params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4613 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4614 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4615 | params = (GLboolean *) (_paramsBase + _bufferOffset); |
| 4616 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4617 | glGetBooleanv( |
| 4618 | (GLenum)pname, |
| 4619 | (GLboolean *)params |
| 4620 | ); |
| 4621 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4622 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4623 | } |
| 4624 | } |
| 4625 | |
| 4626 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4627 | static void |
| 4628 | android_glGetBufferParameteriv__II_3II |
| 4629 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4630 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4631 | "glGetBufferParameteriv"); |
| 4632 | } |
| 4633 | |
| 4634 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4635 | static void |
| 4636 | android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 |
| 4637 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4638 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4639 | "glGetBufferParameteriv"); |
| 4640 | } |
| 4641 | |
| 4642 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4643 | static void |
| 4644 | android_glGetClipPlanef__I_3FI |
| 4645 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { |
| 4646 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4647 | const char * _exceptionType = NULL; |
| 4648 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4649 | GLfloat *eqn_base = (GLfloat *) 0; |
| 4650 | jint _remaining; |
| 4651 | GLfloat *eqn = (GLfloat *) 0; |
| 4652 | |
| 4653 | if (!eqn_ref) { |
| 4654 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4655 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4656 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4657 | goto exit; |
| 4658 | } |
| 4659 | if (offset < 0) { |
| 4660 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4661 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4662 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4663 | goto exit; |
| 4664 | } |
| 4665 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4666 | eqn_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4667 | _env->GetFloatArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4668 | eqn = eqn_base + offset; |
| 4669 | |
| 4670 | glGetClipPlanef( |
| 4671 | (GLenum)pname, |
| 4672 | (GLfloat *)eqn |
| 4673 | ); |
| 4674 | |
| 4675 | exit: |
| 4676 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4677 | _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4678 | _exception ? JNI_ABORT: 0); |
| 4679 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4680 | if (_exception) { |
| 4681 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4682 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4683 | } |
| 4684 | |
| 4685 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4686 | static void |
| 4687 | android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4688 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4689 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4690 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4691 | jint _remaining; |
| 4692 | GLfloat *eqn = (GLfloat *) 0; |
| 4693 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4694 | eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4695 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4696 | char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4697 | eqn = (GLfloat *) (_eqnBase + _bufferOffset); |
| 4698 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4699 | glGetClipPlanef( |
| 4700 | (GLenum)pname, |
| 4701 | (GLfloat *)eqn |
| 4702 | ); |
| 4703 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4704 | _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4705 | } |
| 4706 | } |
| 4707 | |
| 4708 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4709 | static void |
| 4710 | android_glGetClipPlanex__I_3II |
| 4711 | (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { |
| 4712 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4713 | const char * _exceptionType = NULL; |
| 4714 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4715 | GLfixed *eqn_base = (GLfixed *) 0; |
| 4716 | jint _remaining; |
| 4717 | GLfixed *eqn = (GLfixed *) 0; |
| 4718 | |
| 4719 | if (!eqn_ref) { |
| 4720 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4721 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4722 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4723 | goto exit; |
| 4724 | } |
| 4725 | if (offset < 0) { |
| 4726 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4727 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4728 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4729 | goto exit; |
| 4730 | } |
| 4731 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4732 | eqn_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4733 | _env->GetIntArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4734 | eqn = eqn_base + offset; |
| 4735 | |
| 4736 | glGetClipPlanex( |
| 4737 | (GLenum)pname, |
| 4738 | (GLfixed *)eqn |
| 4739 | ); |
| 4740 | |
| 4741 | exit: |
| 4742 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4743 | _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4744 | _exception ? JNI_ABORT: 0); |
| 4745 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4746 | if (_exception) { |
| 4747 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4748 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4749 | } |
| 4750 | |
| 4751 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4752 | static void |
| 4753 | android_glGetClipPlanex__ILjava_nio_IntBuffer_2 |
| 4754 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4755 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4756 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4757 | jint _remaining; |
| 4758 | GLfixed *eqn = (GLfixed *) 0; |
| 4759 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4760 | eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4761 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4762 | char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4763 | eqn = (GLfixed *) (_eqnBase + _bufferOffset); |
| 4764 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4765 | glGetClipPlanex( |
| 4766 | (GLenum)pname, |
| 4767 | (GLfixed *)eqn |
| 4768 | ); |
| 4769 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4770 | _env->ReleaseIntArrayElements(_array, (jint*)eqn, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4771 | } |
| 4772 | } |
| 4773 | |
| 4774 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 4775 | static void |
| 4776 | android_glGetFixedv__I_3II |
| 4777 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 4778 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4779 | const char * _exceptionType = NULL; |
| 4780 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4781 | GLfixed *params_base = (GLfixed *) 0; |
| 4782 | jint _remaining; |
| 4783 | GLfixed *params = (GLfixed *) 0; |
| 4784 | |
| 4785 | if (!params_ref) { |
| 4786 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4787 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4788 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4789 | goto exit; |
| 4790 | } |
| 4791 | if (offset < 0) { |
| 4792 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4793 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4794 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4795 | goto exit; |
| 4796 | } |
| 4797 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4798 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4799 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4800 | params = params_base + offset; |
| 4801 | |
| 4802 | glGetFixedv( |
| 4803 | (GLenum)pname, |
| 4804 | (GLfixed *)params |
| 4805 | ); |
| 4806 | |
| 4807 | exit: |
| 4808 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4809 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4810 | _exception ? JNI_ABORT: 0); |
| 4811 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4812 | if (_exception) { |
| 4813 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4814 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4815 | } |
| 4816 | |
| 4817 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 4818 | static void |
| 4819 | android_glGetFixedv__ILjava_nio_IntBuffer_2 |
| 4820 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4821 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4822 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4823 | jint _remaining; |
| 4824 | GLfixed *params = (GLfixed *) 0; |
| 4825 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4826 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4827 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4828 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4829 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 4830 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4831 | glGetFixedv( |
| 4832 | (GLenum)pname, |
| 4833 | (GLfixed *)params |
| 4834 | ); |
| 4835 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4836 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4837 | } |
| 4838 | } |
| 4839 | |
| 4840 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 4841 | static void |
| 4842 | android_glGetFloatv__I_3FI |
| 4843 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
| 4844 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4845 | const char * _exceptionType = NULL; |
| 4846 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4847 | GLfloat *params_base = (GLfloat *) 0; |
| 4848 | jint _remaining; |
| 4849 | GLfloat *params = (GLfloat *) 0; |
| 4850 | |
| 4851 | if (!params_ref) { |
| 4852 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4853 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4854 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4855 | goto exit; |
| 4856 | } |
| 4857 | if (offset < 0) { |
| 4858 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4859 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4860 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4861 | goto exit; |
| 4862 | } |
| 4863 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4864 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4865 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4866 | params = params_base + offset; |
| 4867 | |
| 4868 | glGetFloatv( |
| 4869 | (GLenum)pname, |
| 4870 | (GLfloat *)params |
| 4871 | ); |
| 4872 | |
| 4873 | exit: |
| 4874 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4875 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4876 | _exception ? JNI_ABORT: 0); |
| 4877 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4878 | if (_exception) { |
| 4879 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4880 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4881 | } |
| 4882 | |
| 4883 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 4884 | static void |
| 4885 | android_glGetFloatv__ILjava_nio_FloatBuffer_2 |
| 4886 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4887 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4888 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4889 | jint _remaining; |
| 4890 | GLfloat *params = (GLfloat *) 0; |
| 4891 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4892 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4893 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4894 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4895 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 4896 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4897 | glGetFloatv( |
| 4898 | (GLenum)pname, |
| 4899 | (GLfloat *)params |
| 4900 | ); |
| 4901 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4902 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4903 | } |
| 4904 | } |
| 4905 | |
| 4906 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 4907 | static void |
| 4908 | android_glGetLightfv__II_3FI |
| 4909 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
| 4910 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4911 | const char * _exceptionType = NULL; |
| 4912 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4913 | GLfloat *params_base = (GLfloat *) 0; |
| 4914 | jint _remaining; |
| 4915 | GLfloat *params = (GLfloat *) 0; |
| 4916 | |
| 4917 | if (!params_ref) { |
| 4918 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4919 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4920 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4921 | goto exit; |
| 4922 | } |
| 4923 | if (offset < 0) { |
| 4924 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4925 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4926 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4927 | goto exit; |
| 4928 | } |
| 4929 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4930 | int _needed; |
| 4931 | switch (pname) { |
| 4932 | #if defined(GL_SPOT_EXPONENT) |
| 4933 | case GL_SPOT_EXPONENT: |
| 4934 | #endif // defined(GL_SPOT_EXPONENT) |
| 4935 | #if defined(GL_SPOT_CUTOFF) |
| 4936 | case GL_SPOT_CUTOFF: |
| 4937 | #endif // defined(GL_SPOT_CUTOFF) |
| 4938 | #if defined(GL_CONSTANT_ATTENUATION) |
| 4939 | case GL_CONSTANT_ATTENUATION: |
| 4940 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 4941 | #if defined(GL_LINEAR_ATTENUATION) |
| 4942 | case GL_LINEAR_ATTENUATION: |
| 4943 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 4944 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 4945 | case GL_QUADRATIC_ATTENUATION: |
| 4946 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 4947 | _needed = 1; |
| 4948 | break; |
| 4949 | #if defined(GL_SPOT_DIRECTION) |
| 4950 | case GL_SPOT_DIRECTION: |
| 4951 | #endif // defined(GL_SPOT_DIRECTION) |
| 4952 | _needed = 3; |
| 4953 | break; |
| 4954 | #if defined(GL_AMBIENT) |
| 4955 | case GL_AMBIENT: |
| 4956 | #endif // defined(GL_AMBIENT) |
| 4957 | #if defined(GL_DIFFUSE) |
| 4958 | case GL_DIFFUSE: |
| 4959 | #endif // defined(GL_DIFFUSE) |
| 4960 | #if defined(GL_SPECULAR) |
| 4961 | case GL_SPECULAR: |
| 4962 | #endif // defined(GL_SPECULAR) |
| 4963 | #if defined(GL_EMISSION) |
| 4964 | case GL_EMISSION: |
| 4965 | #endif // defined(GL_EMISSION) |
| 4966 | _needed = 4; |
| 4967 | break; |
| 4968 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4969 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4970 | break; |
| 4971 | } |
| 4972 | if (_remaining < _needed) { |
| 4973 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4974 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4975 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4976 | goto exit; |
| 4977 | } |
| 4978 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4979 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4980 | params = params_base + offset; |
| 4981 | |
| 4982 | glGetLightfv( |
| 4983 | (GLenum)light, |
| 4984 | (GLenum)pname, |
| 4985 | (GLfloat *)params |
| 4986 | ); |
| 4987 | |
| 4988 | exit: |
| 4989 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4990 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4991 | _exception ? JNI_ABORT: 0); |
| 4992 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4993 | if (_exception) { |
| 4994 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4995 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4996 | } |
| 4997 | |
| 4998 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 4999 | static void |
| 5000 | android_glGetLightfv__IILjava_nio_FloatBuffer_2 |
| 5001 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5002 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5003 | const char * _exceptionType = NULL; |
| 5004 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5005 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5006 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5007 | jint _remaining; |
| 5008 | GLfloat *params = (GLfloat *) 0; |
| 5009 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5010 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5011 | int _needed; |
| 5012 | switch (pname) { |
| 5013 | #if defined(GL_SPOT_EXPONENT) |
| 5014 | case GL_SPOT_EXPONENT: |
| 5015 | #endif // defined(GL_SPOT_EXPONENT) |
| 5016 | #if defined(GL_SPOT_CUTOFF) |
| 5017 | case GL_SPOT_CUTOFF: |
| 5018 | #endif // defined(GL_SPOT_CUTOFF) |
| 5019 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5020 | case GL_CONSTANT_ATTENUATION: |
| 5021 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5022 | #if defined(GL_LINEAR_ATTENUATION) |
| 5023 | case GL_LINEAR_ATTENUATION: |
| 5024 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5025 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5026 | case GL_QUADRATIC_ATTENUATION: |
| 5027 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5028 | _needed = 1; |
| 5029 | break; |
| 5030 | #if defined(GL_SPOT_DIRECTION) |
| 5031 | case GL_SPOT_DIRECTION: |
| 5032 | #endif // defined(GL_SPOT_DIRECTION) |
| 5033 | _needed = 3; |
| 5034 | break; |
| 5035 | #if defined(GL_AMBIENT) |
| 5036 | case GL_AMBIENT: |
| 5037 | #endif // defined(GL_AMBIENT) |
| 5038 | #if defined(GL_DIFFUSE) |
| 5039 | case GL_DIFFUSE: |
| 5040 | #endif // defined(GL_DIFFUSE) |
| 5041 | #if defined(GL_SPECULAR) |
| 5042 | case GL_SPECULAR: |
| 5043 | #endif // defined(GL_SPECULAR) |
| 5044 | #if defined(GL_EMISSION) |
| 5045 | case GL_EMISSION: |
| 5046 | #endif // defined(GL_EMISSION) |
| 5047 | _needed = 4; |
| 5048 | break; |
| 5049 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5050 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5051 | break; |
| 5052 | } |
| 5053 | if (_remaining < _needed) { |
| 5054 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5055 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5056 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5057 | goto exit; |
| 5058 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5059 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5060 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5061 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5062 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5063 | glGetLightfv( |
| 5064 | (GLenum)light, |
| 5065 | (GLenum)pname, |
| 5066 | (GLfloat *)params |
| 5067 | ); |
| 5068 | |
| 5069 | exit: |
| 5070 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5071 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5072 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5073 | if (_exception) { |
| 5074 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5075 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5076 | } |
| 5077 | |
| 5078 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5079 | static void |
| 5080 | android_glGetLightxv__II_3II |
| 5081 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
| 5082 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5083 | const char * _exceptionType = NULL; |
| 5084 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5085 | GLfixed *params_base = (GLfixed *) 0; |
| 5086 | jint _remaining; |
| 5087 | GLfixed *params = (GLfixed *) 0; |
| 5088 | |
| 5089 | if (!params_ref) { |
| 5090 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5091 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5092 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5093 | goto exit; |
| 5094 | } |
| 5095 | if (offset < 0) { |
| 5096 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5097 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5098 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5099 | goto exit; |
| 5100 | } |
| 5101 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5102 | int _needed; |
| 5103 | switch (pname) { |
| 5104 | #if defined(GL_SPOT_EXPONENT) |
| 5105 | case GL_SPOT_EXPONENT: |
| 5106 | #endif // defined(GL_SPOT_EXPONENT) |
| 5107 | #if defined(GL_SPOT_CUTOFF) |
| 5108 | case GL_SPOT_CUTOFF: |
| 5109 | #endif // defined(GL_SPOT_CUTOFF) |
| 5110 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5111 | case GL_CONSTANT_ATTENUATION: |
| 5112 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5113 | #if defined(GL_LINEAR_ATTENUATION) |
| 5114 | case GL_LINEAR_ATTENUATION: |
| 5115 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5116 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5117 | case GL_QUADRATIC_ATTENUATION: |
| 5118 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5119 | _needed = 1; |
| 5120 | break; |
| 5121 | #if defined(GL_SPOT_DIRECTION) |
| 5122 | case GL_SPOT_DIRECTION: |
| 5123 | #endif // defined(GL_SPOT_DIRECTION) |
| 5124 | _needed = 3; |
| 5125 | break; |
| 5126 | #if defined(GL_AMBIENT) |
| 5127 | case GL_AMBIENT: |
| 5128 | #endif // defined(GL_AMBIENT) |
| 5129 | #if defined(GL_DIFFUSE) |
| 5130 | case GL_DIFFUSE: |
| 5131 | #endif // defined(GL_DIFFUSE) |
| 5132 | #if defined(GL_SPECULAR) |
| 5133 | case GL_SPECULAR: |
| 5134 | #endif // defined(GL_SPECULAR) |
| 5135 | #if defined(GL_EMISSION) |
| 5136 | case GL_EMISSION: |
| 5137 | #endif // defined(GL_EMISSION) |
| 5138 | _needed = 4; |
| 5139 | break; |
| 5140 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5141 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5142 | break; |
| 5143 | } |
| 5144 | if (_remaining < _needed) { |
| 5145 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5146 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5147 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5148 | goto exit; |
| 5149 | } |
| 5150 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5151 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5152 | params = params_base + offset; |
| 5153 | |
| 5154 | glGetLightxv( |
| 5155 | (GLenum)light, |
| 5156 | (GLenum)pname, |
| 5157 | (GLfixed *)params |
| 5158 | ); |
| 5159 | |
| 5160 | exit: |
| 5161 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5162 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5163 | _exception ? JNI_ABORT: 0); |
| 5164 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5165 | if (_exception) { |
| 5166 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5167 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5168 | } |
| 5169 | |
| 5170 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5171 | static void |
| 5172 | android_glGetLightxv__IILjava_nio_IntBuffer_2 |
| 5173 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5174 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5175 | const char * _exceptionType = NULL; |
| 5176 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5177 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5178 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5179 | jint _remaining; |
| 5180 | GLfixed *params = (GLfixed *) 0; |
| 5181 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5182 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5183 | int _needed; |
| 5184 | switch (pname) { |
| 5185 | #if defined(GL_SPOT_EXPONENT) |
| 5186 | case GL_SPOT_EXPONENT: |
| 5187 | #endif // defined(GL_SPOT_EXPONENT) |
| 5188 | #if defined(GL_SPOT_CUTOFF) |
| 5189 | case GL_SPOT_CUTOFF: |
| 5190 | #endif // defined(GL_SPOT_CUTOFF) |
| 5191 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5192 | case GL_CONSTANT_ATTENUATION: |
| 5193 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5194 | #if defined(GL_LINEAR_ATTENUATION) |
| 5195 | case GL_LINEAR_ATTENUATION: |
| 5196 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5197 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5198 | case GL_QUADRATIC_ATTENUATION: |
| 5199 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5200 | _needed = 1; |
| 5201 | break; |
| 5202 | #if defined(GL_SPOT_DIRECTION) |
| 5203 | case GL_SPOT_DIRECTION: |
| 5204 | #endif // defined(GL_SPOT_DIRECTION) |
| 5205 | _needed = 3; |
| 5206 | break; |
| 5207 | #if defined(GL_AMBIENT) |
| 5208 | case GL_AMBIENT: |
| 5209 | #endif // defined(GL_AMBIENT) |
| 5210 | #if defined(GL_DIFFUSE) |
| 5211 | case GL_DIFFUSE: |
| 5212 | #endif // defined(GL_DIFFUSE) |
| 5213 | #if defined(GL_SPECULAR) |
| 5214 | case GL_SPECULAR: |
| 5215 | #endif // defined(GL_SPECULAR) |
| 5216 | #if defined(GL_EMISSION) |
| 5217 | case GL_EMISSION: |
| 5218 | #endif // defined(GL_EMISSION) |
| 5219 | _needed = 4; |
| 5220 | break; |
| 5221 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5222 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5223 | break; |
| 5224 | } |
| 5225 | if (_remaining < _needed) { |
| 5226 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5227 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5228 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5229 | goto exit; |
| 5230 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5231 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5232 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5233 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5234 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5235 | glGetLightxv( |
| 5236 | (GLenum)light, |
| 5237 | (GLenum)pname, |
| 5238 | (GLfixed *)params |
| 5239 | ); |
| 5240 | |
| 5241 | exit: |
| 5242 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5243 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5244 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5245 | if (_exception) { |
| 5246 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5247 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5248 | } |
| 5249 | |
| 5250 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5251 | static void |
| 5252 | android_glGetMaterialfv__II_3FI |
| 5253 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
| 5254 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5255 | const char * _exceptionType = NULL; |
| 5256 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5257 | GLfloat *params_base = (GLfloat *) 0; |
| 5258 | jint _remaining; |
| 5259 | GLfloat *params = (GLfloat *) 0; |
| 5260 | |
| 5261 | if (!params_ref) { |
| 5262 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5263 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5264 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5265 | goto exit; |
| 5266 | } |
| 5267 | if (offset < 0) { |
| 5268 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5269 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5270 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5271 | goto exit; |
| 5272 | } |
| 5273 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5274 | int _needed; |
| 5275 | switch (pname) { |
| 5276 | #if defined(GL_SHININESS) |
| 5277 | case GL_SHININESS: |
| 5278 | #endif // defined(GL_SHININESS) |
| 5279 | _needed = 1; |
| 5280 | break; |
| 5281 | #if defined(GL_AMBIENT) |
| 5282 | case GL_AMBIENT: |
| 5283 | #endif // defined(GL_AMBIENT) |
| 5284 | #if defined(GL_DIFFUSE) |
| 5285 | case GL_DIFFUSE: |
| 5286 | #endif // defined(GL_DIFFUSE) |
| 5287 | #if defined(GL_SPECULAR) |
| 5288 | case GL_SPECULAR: |
| 5289 | #endif // defined(GL_SPECULAR) |
| 5290 | #if defined(GL_EMISSION) |
| 5291 | case GL_EMISSION: |
| 5292 | #endif // defined(GL_EMISSION) |
| 5293 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5294 | case GL_AMBIENT_AND_DIFFUSE: |
| 5295 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5296 | _needed = 4; |
| 5297 | break; |
| 5298 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5299 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5300 | break; |
| 5301 | } |
| 5302 | if (_remaining < _needed) { |
| 5303 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5304 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5305 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5306 | goto exit; |
| 5307 | } |
| 5308 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5309 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5310 | params = params_base + offset; |
| 5311 | |
| 5312 | glGetMaterialfv( |
| 5313 | (GLenum)face, |
| 5314 | (GLenum)pname, |
| 5315 | (GLfloat *)params |
| 5316 | ); |
| 5317 | |
| 5318 | exit: |
| 5319 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5320 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5321 | _exception ? JNI_ABORT: 0); |
| 5322 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5323 | if (_exception) { |
| 5324 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5325 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5326 | } |
| 5327 | |
| 5328 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5329 | static void |
| 5330 | android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 |
| 5331 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5332 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5333 | const char * _exceptionType = NULL; |
| 5334 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5335 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5336 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5337 | jint _remaining; |
| 5338 | GLfloat *params = (GLfloat *) 0; |
| 5339 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5340 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5341 | int _needed; |
| 5342 | switch (pname) { |
| 5343 | #if defined(GL_SHININESS) |
| 5344 | case GL_SHININESS: |
| 5345 | #endif // defined(GL_SHININESS) |
| 5346 | _needed = 1; |
| 5347 | break; |
| 5348 | #if defined(GL_AMBIENT) |
| 5349 | case GL_AMBIENT: |
| 5350 | #endif // defined(GL_AMBIENT) |
| 5351 | #if defined(GL_DIFFUSE) |
| 5352 | case GL_DIFFUSE: |
| 5353 | #endif // defined(GL_DIFFUSE) |
| 5354 | #if defined(GL_SPECULAR) |
| 5355 | case GL_SPECULAR: |
| 5356 | #endif // defined(GL_SPECULAR) |
| 5357 | #if defined(GL_EMISSION) |
| 5358 | case GL_EMISSION: |
| 5359 | #endif // defined(GL_EMISSION) |
| 5360 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5361 | case GL_AMBIENT_AND_DIFFUSE: |
| 5362 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5363 | _needed = 4; |
| 5364 | break; |
| 5365 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5366 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5367 | break; |
| 5368 | } |
| 5369 | if (_remaining < _needed) { |
| 5370 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5371 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5372 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5373 | goto exit; |
| 5374 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5375 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5376 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5377 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5378 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5379 | glGetMaterialfv( |
| 5380 | (GLenum)face, |
| 5381 | (GLenum)pname, |
| 5382 | (GLfloat *)params |
| 5383 | ); |
| 5384 | |
| 5385 | exit: |
| 5386 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5387 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5388 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5389 | if (_exception) { |
| 5390 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5391 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5392 | } |
| 5393 | |
| 5394 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5395 | static void |
| 5396 | android_glGetMaterialxv__II_3II |
| 5397 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
| 5398 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5399 | const char * _exceptionType = NULL; |
| 5400 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5401 | GLfixed *params_base = (GLfixed *) 0; |
| 5402 | jint _remaining; |
| 5403 | GLfixed *params = (GLfixed *) 0; |
| 5404 | |
| 5405 | if (!params_ref) { |
| 5406 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5407 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5408 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5409 | goto exit; |
| 5410 | } |
| 5411 | if (offset < 0) { |
| 5412 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5413 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5414 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5415 | goto exit; |
| 5416 | } |
| 5417 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5418 | int _needed; |
| 5419 | switch (pname) { |
| 5420 | #if defined(GL_SHININESS) |
| 5421 | case GL_SHININESS: |
| 5422 | #endif // defined(GL_SHININESS) |
| 5423 | _needed = 1; |
| 5424 | break; |
| 5425 | #if defined(GL_AMBIENT) |
| 5426 | case GL_AMBIENT: |
| 5427 | #endif // defined(GL_AMBIENT) |
| 5428 | #if defined(GL_DIFFUSE) |
| 5429 | case GL_DIFFUSE: |
| 5430 | #endif // defined(GL_DIFFUSE) |
| 5431 | #if defined(GL_SPECULAR) |
| 5432 | case GL_SPECULAR: |
| 5433 | #endif // defined(GL_SPECULAR) |
| 5434 | #if defined(GL_EMISSION) |
| 5435 | case GL_EMISSION: |
| 5436 | #endif // defined(GL_EMISSION) |
| 5437 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5438 | case GL_AMBIENT_AND_DIFFUSE: |
| 5439 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5440 | _needed = 4; |
| 5441 | break; |
| 5442 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5443 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5444 | break; |
| 5445 | } |
| 5446 | if (_remaining < _needed) { |
| 5447 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5448 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5449 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5450 | goto exit; |
| 5451 | } |
| 5452 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5453 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5454 | params = params_base + offset; |
| 5455 | |
| 5456 | glGetMaterialxv( |
| 5457 | (GLenum)face, |
| 5458 | (GLenum)pname, |
| 5459 | (GLfixed *)params |
| 5460 | ); |
| 5461 | |
| 5462 | exit: |
| 5463 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5464 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5465 | _exception ? JNI_ABORT: 0); |
| 5466 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5467 | if (_exception) { |
| 5468 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5469 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5470 | } |
| 5471 | |
| 5472 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5473 | static void |
| 5474 | android_glGetMaterialxv__IILjava_nio_IntBuffer_2 |
| 5475 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5476 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5477 | const char * _exceptionType = NULL; |
| 5478 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5479 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5480 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5481 | jint _remaining; |
| 5482 | GLfixed *params = (GLfixed *) 0; |
| 5483 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5484 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5485 | int _needed; |
| 5486 | switch (pname) { |
| 5487 | #if defined(GL_SHININESS) |
| 5488 | case GL_SHININESS: |
| 5489 | #endif // defined(GL_SHININESS) |
| 5490 | _needed = 1; |
| 5491 | break; |
| 5492 | #if defined(GL_AMBIENT) |
| 5493 | case GL_AMBIENT: |
| 5494 | #endif // defined(GL_AMBIENT) |
| 5495 | #if defined(GL_DIFFUSE) |
| 5496 | case GL_DIFFUSE: |
| 5497 | #endif // defined(GL_DIFFUSE) |
| 5498 | #if defined(GL_SPECULAR) |
| 5499 | case GL_SPECULAR: |
| 5500 | #endif // defined(GL_SPECULAR) |
| 5501 | #if defined(GL_EMISSION) |
| 5502 | case GL_EMISSION: |
| 5503 | #endif // defined(GL_EMISSION) |
| 5504 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5505 | case GL_AMBIENT_AND_DIFFUSE: |
| 5506 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5507 | _needed = 4; |
| 5508 | break; |
| 5509 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5510 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5511 | break; |
| 5512 | } |
| 5513 | if (_remaining < _needed) { |
| 5514 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5515 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5516 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5517 | goto exit; |
| 5518 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5519 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5520 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5521 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5522 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5523 | glGetMaterialxv( |
| 5524 | (GLenum)face, |
| 5525 | (GLenum)pname, |
| 5526 | (GLfixed *)params |
| 5527 | ); |
| 5528 | |
| 5529 | exit: |
| 5530 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5531 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5532 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5533 | if (_exception) { |
| 5534 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5535 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5536 | } |
| 5537 | |
| 5538 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5539 | static void |
| 5540 | android_glGetTexEnviv__II_3II |
| 5541 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5542 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5543 | const char * _exceptionType = NULL; |
| 5544 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5545 | GLint *params_base = (GLint *) 0; |
| 5546 | jint _remaining; |
| 5547 | GLint *params = (GLint *) 0; |
| 5548 | |
| 5549 | if (!params_ref) { |
| 5550 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5551 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5552 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5553 | goto exit; |
| 5554 | } |
| 5555 | if (offset < 0) { |
| 5556 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5557 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5558 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5559 | goto exit; |
| 5560 | } |
| 5561 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5562 | int _needed; |
| 5563 | switch (pname) { |
| 5564 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5565 | case GL_TEXTURE_ENV_MODE: |
| 5566 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5567 | #if defined(GL_COMBINE_RGB) |
| 5568 | case GL_COMBINE_RGB: |
| 5569 | #endif // defined(GL_COMBINE_RGB) |
| 5570 | #if defined(GL_COMBINE_ALPHA) |
| 5571 | case GL_COMBINE_ALPHA: |
| 5572 | #endif // defined(GL_COMBINE_ALPHA) |
| 5573 | _needed = 1; |
| 5574 | break; |
| 5575 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5576 | case GL_TEXTURE_ENV_COLOR: |
| 5577 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5578 | _needed = 4; |
| 5579 | break; |
| 5580 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5581 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5582 | break; |
| 5583 | } |
| 5584 | if (_remaining < _needed) { |
| 5585 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5586 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5587 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5588 | goto exit; |
| 5589 | } |
| 5590 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5591 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5592 | params = params_base + offset; |
| 5593 | |
| 5594 | glGetTexEnviv( |
| 5595 | (GLenum)env, |
| 5596 | (GLenum)pname, |
| 5597 | (GLint *)params |
| 5598 | ); |
| 5599 | |
| 5600 | exit: |
| 5601 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5602 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5603 | _exception ? JNI_ABORT: 0); |
| 5604 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5605 | if (_exception) { |
| 5606 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5607 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5608 | } |
| 5609 | |
| 5610 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5611 | static void |
| 5612 | android_glGetTexEnviv__IILjava_nio_IntBuffer_2 |
| 5613 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5614 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5615 | const char * _exceptionType = NULL; |
| 5616 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5617 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5618 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5619 | jint _remaining; |
| 5620 | GLint *params = (GLint *) 0; |
| 5621 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5622 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5623 | int _needed; |
| 5624 | switch (pname) { |
| 5625 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5626 | case GL_TEXTURE_ENV_MODE: |
| 5627 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5628 | #if defined(GL_COMBINE_RGB) |
| 5629 | case GL_COMBINE_RGB: |
| 5630 | #endif // defined(GL_COMBINE_RGB) |
| 5631 | #if defined(GL_COMBINE_ALPHA) |
| 5632 | case GL_COMBINE_ALPHA: |
| 5633 | #endif // defined(GL_COMBINE_ALPHA) |
| 5634 | _needed = 1; |
| 5635 | break; |
| 5636 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5637 | case GL_TEXTURE_ENV_COLOR: |
| 5638 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5639 | _needed = 4; |
| 5640 | break; |
| 5641 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5642 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5643 | break; |
| 5644 | } |
| 5645 | if (_remaining < _needed) { |
| 5646 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5647 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5648 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5649 | goto exit; |
| 5650 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5651 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5652 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5653 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5654 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5655 | glGetTexEnviv( |
| 5656 | (GLenum)env, |
| 5657 | (GLenum)pname, |
| 5658 | (GLint *)params |
| 5659 | ); |
| 5660 | |
| 5661 | exit: |
| 5662 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5663 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5664 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5665 | if (_exception) { |
| 5666 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5667 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5668 | } |
| 5669 | |
| 5670 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 5671 | static void |
| 5672 | android_glGetTexEnvxv__II_3II |
| 5673 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5674 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5675 | const char * _exceptionType = NULL; |
| 5676 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5677 | GLfixed *params_base = (GLfixed *) 0; |
| 5678 | jint _remaining; |
| 5679 | GLfixed *params = (GLfixed *) 0; |
| 5680 | |
| 5681 | if (!params_ref) { |
| 5682 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5683 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5684 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5685 | goto exit; |
| 5686 | } |
| 5687 | if (offset < 0) { |
| 5688 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5689 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5690 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5691 | goto exit; |
| 5692 | } |
| 5693 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5694 | int _needed; |
| 5695 | switch (pname) { |
| 5696 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5697 | case GL_TEXTURE_ENV_MODE: |
| 5698 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5699 | #if defined(GL_COMBINE_RGB) |
| 5700 | case GL_COMBINE_RGB: |
| 5701 | #endif // defined(GL_COMBINE_RGB) |
| 5702 | #if defined(GL_COMBINE_ALPHA) |
| 5703 | case GL_COMBINE_ALPHA: |
| 5704 | #endif // defined(GL_COMBINE_ALPHA) |
| 5705 | _needed = 1; |
| 5706 | break; |
| 5707 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5708 | case GL_TEXTURE_ENV_COLOR: |
| 5709 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5710 | _needed = 4; |
| 5711 | break; |
| 5712 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5713 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5714 | break; |
| 5715 | } |
| 5716 | if (_remaining < _needed) { |
| 5717 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5718 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5719 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5720 | goto exit; |
| 5721 | } |
| 5722 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5723 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5724 | params = params_base + offset; |
| 5725 | |
| 5726 | glGetTexEnvxv( |
| 5727 | (GLenum)env, |
| 5728 | (GLenum)pname, |
| 5729 | (GLfixed *)params |
| 5730 | ); |
| 5731 | |
| 5732 | exit: |
| 5733 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5734 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5735 | _exception ? JNI_ABORT: 0); |
| 5736 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5737 | if (_exception) { |
| 5738 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5739 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5740 | } |
| 5741 | |
| 5742 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 5743 | static void |
| 5744 | android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 |
| 5745 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5746 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5747 | const char * _exceptionType = NULL; |
| 5748 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5749 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5750 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5751 | jint _remaining; |
| 5752 | GLfixed *params = (GLfixed *) 0; |
| 5753 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5754 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5755 | int _needed; |
| 5756 | switch (pname) { |
| 5757 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5758 | case GL_TEXTURE_ENV_MODE: |
| 5759 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5760 | #if defined(GL_COMBINE_RGB) |
| 5761 | case GL_COMBINE_RGB: |
| 5762 | #endif // defined(GL_COMBINE_RGB) |
| 5763 | #if defined(GL_COMBINE_ALPHA) |
| 5764 | case GL_COMBINE_ALPHA: |
| 5765 | #endif // defined(GL_COMBINE_ALPHA) |
| 5766 | _needed = 1; |
| 5767 | break; |
| 5768 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5769 | case GL_TEXTURE_ENV_COLOR: |
| 5770 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5771 | _needed = 4; |
| 5772 | break; |
| 5773 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5774 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5775 | break; |
| 5776 | } |
| 5777 | if (_remaining < _needed) { |
| 5778 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5779 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5780 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5781 | goto exit; |
| 5782 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5783 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5784 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5785 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5786 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5787 | glGetTexEnvxv( |
| 5788 | (GLenum)env, |
| 5789 | (GLenum)pname, |
| 5790 | (GLfixed *)params |
| 5791 | ); |
| 5792 | |
| 5793 | exit: |
| 5794 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5795 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5796 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5797 | if (_exception) { |
| 5798 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5799 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5800 | } |
| 5801 | |
| 5802 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 5803 | static void |
| 5804 | android_glGetTexParameterfv__II_3FI |
| 5805 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 5806 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5807 | const char * _exceptionType = NULL; |
| 5808 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5809 | GLfloat *params_base = (GLfloat *) 0; |
| 5810 | jint _remaining; |
| 5811 | GLfloat *params = (GLfloat *) 0; |
| 5812 | |
| 5813 | if (!params_ref) { |
| 5814 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5815 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5816 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5817 | goto exit; |
| 5818 | } |
| 5819 | if (offset < 0) { |
| 5820 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5821 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5822 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5823 | goto exit; |
| 5824 | } |
| 5825 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5826 | if (_remaining < 1) { |
| 5827 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5828 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5829 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5830 | goto exit; |
| 5831 | } |
| 5832 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5833 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5834 | params = params_base + offset; |
| 5835 | |
| 5836 | glGetTexParameterfv( |
| 5837 | (GLenum)target, |
| 5838 | (GLenum)pname, |
| 5839 | (GLfloat *)params |
| 5840 | ); |
| 5841 | |
| 5842 | exit: |
| 5843 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5844 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5845 | _exception ? JNI_ABORT: 0); |
| 5846 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5847 | if (_exception) { |
| 5848 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5849 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5850 | } |
| 5851 | |
| 5852 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 5853 | static void |
| 5854 | android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 5855 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 5856 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5857 | const char * _exceptionType = NULL; |
| 5858 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5859 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5860 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5861 | jint _remaining; |
| 5862 | GLfloat *params = (GLfloat *) 0; |
| 5863 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5864 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5865 | if (_remaining < 1) { |
| 5866 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5867 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5868 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5869 | goto exit; |
| 5870 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5871 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5872 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5873 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5874 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5875 | glGetTexParameterfv( |
| 5876 | (GLenum)target, |
| 5877 | (GLenum)pname, |
| 5878 | (GLfloat *)params |
| 5879 | ); |
| 5880 | |
| 5881 | exit: |
| 5882 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5883 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5884 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5885 | if (_exception) { |
| 5886 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5887 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5888 | } |
| 5889 | |
| 5890 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 5891 | static void |
| 5892 | android_glGetTexParameteriv__II_3II |
| 5893 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 5894 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5895 | const char * _exceptionType = NULL; |
| 5896 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5897 | GLint *params_base = (GLint *) 0; |
| 5898 | jint _remaining; |
| 5899 | GLint *params = (GLint *) 0; |
| 5900 | |
| 5901 | if (!params_ref) { |
| 5902 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5903 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5904 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5905 | goto exit; |
| 5906 | } |
| 5907 | if (offset < 0) { |
| 5908 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5909 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5910 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5911 | goto exit; |
| 5912 | } |
| 5913 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5914 | if (_remaining < 1) { |
| 5915 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5916 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5917 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5918 | goto exit; |
| 5919 | } |
| 5920 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5921 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5922 | params = params_base + offset; |
| 5923 | |
| 5924 | glGetTexParameteriv( |
| 5925 | (GLenum)target, |
| 5926 | (GLenum)pname, |
| 5927 | (GLint *)params |
| 5928 | ); |
| 5929 | |
| 5930 | exit: |
| 5931 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5932 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5933 | _exception ? JNI_ABORT: 0); |
| 5934 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5935 | if (_exception) { |
| 5936 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5937 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5938 | } |
| 5939 | |
| 5940 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 5941 | static void |
| 5942 | android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 |
| 5943 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 5944 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5945 | const char * _exceptionType = NULL; |
| 5946 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5947 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5948 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5949 | jint _remaining; |
| 5950 | GLint *params = (GLint *) 0; |
| 5951 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5952 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5953 | if (_remaining < 1) { |
| 5954 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5955 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5956 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5957 | goto exit; |
| 5958 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5959 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5960 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5961 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5962 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5963 | glGetTexParameteriv( |
| 5964 | (GLenum)target, |
| 5965 | (GLenum)pname, |
| 5966 | (GLint *)params |
| 5967 | ); |
| 5968 | |
| 5969 | exit: |
| 5970 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5971 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5972 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5973 | if (_exception) { |
| 5974 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5975 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5976 | } |
| 5977 | |
| 5978 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 5979 | static void |
| 5980 | android_glGetTexParameterxv__II_3II |
| 5981 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 5982 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5983 | const char * _exceptionType = NULL; |
| 5984 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5985 | GLfixed *params_base = (GLfixed *) 0; |
| 5986 | jint _remaining; |
| 5987 | GLfixed *params = (GLfixed *) 0; |
| 5988 | |
| 5989 | if (!params_ref) { |
| 5990 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5991 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5992 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5993 | goto exit; |
| 5994 | } |
| 5995 | if (offset < 0) { |
| 5996 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5997 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5998 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5999 | goto exit; |
| 6000 | } |
| 6001 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6002 | if (_remaining < 1) { |
| 6003 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6004 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6005 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6006 | goto exit; |
| 6007 | } |
| 6008 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6009 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6010 | params = params_base + offset; |
| 6011 | |
| 6012 | glGetTexParameterxv( |
| 6013 | (GLenum)target, |
| 6014 | (GLenum)pname, |
| 6015 | (GLfixed *)params |
| 6016 | ); |
| 6017 | |
| 6018 | exit: |
| 6019 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6020 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6021 | _exception ? JNI_ABORT: 0); |
| 6022 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6023 | if (_exception) { |
| 6024 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6025 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6026 | } |
| 6027 | |
| 6028 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6029 | static void |
| 6030 | android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6031 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6032 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6033 | const char * _exceptionType = NULL; |
| 6034 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6035 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6036 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6037 | jint _remaining; |
| 6038 | GLfixed *params = (GLfixed *) 0; |
| 6039 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6040 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6041 | if (_remaining < 1) { |
| 6042 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6043 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6044 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6045 | goto exit; |
| 6046 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6047 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6048 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6049 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6050 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6051 | glGetTexParameterxv( |
| 6052 | (GLenum)target, |
| 6053 | (GLenum)pname, |
| 6054 | (GLfixed *)params |
| 6055 | ); |
| 6056 | |
| 6057 | exit: |
| 6058 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6059 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6060 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6061 | if (_exception) { |
| 6062 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6063 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6064 | } |
| 6065 | |
| 6066 | /* GLboolean glIsBuffer ( GLuint buffer ) */ |
| 6067 | static jboolean |
| 6068 | android_glIsBuffer__I |
| 6069 | (JNIEnv *_env, jobject _this, jint buffer) { |
| 6070 | GLboolean _returnValue; |
| 6071 | _returnValue = glIsBuffer( |
| 6072 | (GLuint)buffer |
| 6073 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6074 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6075 | } |
| 6076 | |
| 6077 | /* GLboolean glIsEnabled ( GLenum cap ) */ |
| 6078 | static jboolean |
| 6079 | android_glIsEnabled__I |
| 6080 | (JNIEnv *_env, jobject _this, jint cap) { |
| 6081 | GLboolean _returnValue; |
| 6082 | _returnValue = glIsEnabled( |
| 6083 | (GLenum)cap |
| 6084 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6085 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6086 | } |
| 6087 | |
| 6088 | /* GLboolean glIsTexture ( GLuint texture ) */ |
| 6089 | static jboolean |
| 6090 | android_glIsTexture__I |
| 6091 | (JNIEnv *_env, jobject _this, jint texture) { |
| 6092 | GLboolean _returnValue; |
| 6093 | _returnValue = glIsTexture( |
| 6094 | (GLuint)texture |
| 6095 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6096 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6097 | } |
| 6098 | |
| 6099 | /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ |
| 6100 | static void |
| 6101 | android_glNormalPointer__III |
| 6102 | (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { |
| 6103 | glNormalPointer( |
| 6104 | (GLenum)type, |
| 6105 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6106 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6107 | ); |
| 6108 | } |
| 6109 | |
| 6110 | /* void glPointParameterf ( GLenum pname, GLfloat param ) */ |
| 6111 | static void |
| 6112 | android_glPointParameterf__IF |
| 6113 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 6114 | glPointParameterf( |
| 6115 | (GLenum)pname, |
| 6116 | (GLfloat)param |
| 6117 | ); |
| 6118 | } |
| 6119 | |
| 6120 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6121 | static void |
| 6122 | android_glPointParameterfv__I_3FI |
| 6123 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6124 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6125 | const char * _exceptionType = NULL; |
| 6126 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6127 | GLfloat *params_base = (GLfloat *) 0; |
| 6128 | jint _remaining; |
| 6129 | GLfloat *params = (GLfloat *) 0; |
| 6130 | |
| 6131 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6132 | _exception = 1; |
| 6133 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6134 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6135 | goto exit; |
| 6136 | } |
| 6137 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6138 | _exception = 1; |
| 6139 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6140 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6141 | goto exit; |
| 6142 | } |
| 6143 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6144 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6145 | _exception = 1; |
| 6146 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6147 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6148 | goto exit; |
| 6149 | } |
| 6150 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6151 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6152 | params = params_base + offset; |
| 6153 | |
| 6154 | glPointParameterfv( |
| 6155 | (GLenum)pname, |
| 6156 | (GLfloat *)params |
| 6157 | ); |
| 6158 | |
| 6159 | exit: |
| 6160 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6161 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6162 | JNI_ABORT); |
| 6163 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6164 | if (_exception) { |
| 6165 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6166 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6167 | } |
| 6168 | |
| 6169 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6170 | static void |
| 6171 | android_glPointParameterfv__ILjava_nio_FloatBuffer_2 |
| 6172 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6173 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6174 | const char * _exceptionType = NULL; |
| 6175 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6176 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6177 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6178 | jint _remaining; |
| 6179 | GLfloat *params = (GLfloat *) 0; |
| 6180 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6181 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6182 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6183 | _exception = 1; |
| 6184 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6185 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6186 | goto exit; |
| 6187 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6188 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6189 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6190 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6191 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6192 | glPointParameterfv( |
| 6193 | (GLenum)pname, |
| 6194 | (GLfloat *)params |
| 6195 | ); |
| 6196 | |
| 6197 | exit: |
| 6198 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6199 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6200 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6201 | if (_exception) { |
| 6202 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6203 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6204 | } |
| 6205 | |
| 6206 | /* void glPointParameterx ( GLenum pname, GLfixed param ) */ |
| 6207 | static void |
| 6208 | android_glPointParameterx__II |
| 6209 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 6210 | glPointParameterx( |
| 6211 | (GLenum)pname, |
| 6212 | (GLfixed)param |
| 6213 | ); |
| 6214 | } |
| 6215 | |
| 6216 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6217 | static void |
| 6218 | android_glPointParameterxv__I_3II |
| 6219 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6220 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6221 | const char * _exceptionType = NULL; |
| 6222 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6223 | GLfixed *params_base = (GLfixed *) 0; |
| 6224 | jint _remaining; |
| 6225 | GLfixed *params = (GLfixed *) 0; |
| 6226 | |
| 6227 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6228 | _exception = 1; |
| 6229 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6230 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6231 | goto exit; |
| 6232 | } |
| 6233 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6234 | _exception = 1; |
| 6235 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6236 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6237 | goto exit; |
| 6238 | } |
| 6239 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6240 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6241 | _exception = 1; |
| 6242 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6243 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6244 | goto exit; |
| 6245 | } |
| 6246 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6247 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6248 | params = params_base + offset; |
| 6249 | |
| 6250 | glPointParameterxv( |
| 6251 | (GLenum)pname, |
| 6252 | (GLfixed *)params |
| 6253 | ); |
| 6254 | |
| 6255 | exit: |
| 6256 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6257 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6258 | JNI_ABORT); |
| 6259 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6260 | if (_exception) { |
| 6261 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6262 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6263 | } |
| 6264 | |
| 6265 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6266 | static void |
| 6267 | android_glPointParameterxv__ILjava_nio_IntBuffer_2 |
| 6268 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6269 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6270 | const char * _exceptionType = NULL; |
| 6271 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6272 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6273 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6274 | jint _remaining; |
| 6275 | GLfixed *params = (GLfixed *) 0; |
| 6276 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6277 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6278 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6279 | _exception = 1; |
| 6280 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6281 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6282 | goto exit; |
| 6283 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6284 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6285 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6286 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6287 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6288 | glPointParameterxv( |
| 6289 | (GLenum)pname, |
| 6290 | (GLfixed *)params |
| 6291 | ); |
| 6292 | |
| 6293 | exit: |
| 6294 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6295 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6296 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6297 | if (_exception) { |
| 6298 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6299 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6300 | } |
| 6301 | |
| 6302 | /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 6303 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6304 | android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I |
| 6305 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6306 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6307 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6308 | jint _remaining; |
| 6309 | GLvoid *pointer = (GLvoid *) 0; |
| 6310 | |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6311 | if (pointer_buf) { |
| 6312 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 6313 | if ( ! pointer ) { |
| 6314 | return; |
| 6315 | } |
| 6316 | } |
| 6317 | glPointSizePointerOESBounds( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6318 | (GLenum)type, |
| 6319 | (GLsizei)stride, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6320 | (GLvoid *)pointer, |
| 6321 | (GLsizei)remaining |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6322 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6323 | } |
| 6324 | |
| 6325 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6326 | static void |
| 6327 | android_glTexCoordPointer__IIII |
| 6328 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6329 | glTexCoordPointer( |
| 6330 | (GLint)size, |
| 6331 | (GLenum)type, |
| 6332 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6333 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6334 | ); |
| 6335 | } |
| 6336 | |
| 6337 | /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ |
| 6338 | static void |
| 6339 | android_glTexEnvi__III |
| 6340 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6341 | glTexEnvi( |
| 6342 | (GLenum)target, |
| 6343 | (GLenum)pname, |
| 6344 | (GLint)param |
| 6345 | ); |
| 6346 | } |
| 6347 | |
| 6348 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6349 | static void |
| 6350 | android_glTexEnviv__II_3II |
| 6351 | (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] | 6352 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6353 | const char * _exceptionType = NULL; |
| 6354 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6355 | GLint *params_base = (GLint *) 0; |
| 6356 | jint _remaining; |
| 6357 | GLint *params = (GLint *) 0; |
| 6358 | |
| 6359 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6360 | _exception = 1; |
| 6361 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6362 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6363 | goto exit; |
| 6364 | } |
| 6365 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6366 | _exception = 1; |
| 6367 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6368 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6369 | goto exit; |
| 6370 | } |
| 6371 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6372 | int _needed; |
| 6373 | switch (pname) { |
| 6374 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6375 | case GL_TEXTURE_ENV_MODE: |
| 6376 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6377 | #if defined(GL_COMBINE_RGB) |
| 6378 | case GL_COMBINE_RGB: |
| 6379 | #endif // defined(GL_COMBINE_RGB) |
| 6380 | #if defined(GL_COMBINE_ALPHA) |
| 6381 | case GL_COMBINE_ALPHA: |
| 6382 | #endif // defined(GL_COMBINE_ALPHA) |
| 6383 | _needed = 1; |
| 6384 | break; |
| 6385 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6386 | case GL_TEXTURE_ENV_COLOR: |
| 6387 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6388 | _needed = 4; |
| 6389 | break; |
| 6390 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6391 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6392 | break; |
| 6393 | } |
| 6394 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6395 | _exception = 1; |
| 6396 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6397 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6398 | goto exit; |
| 6399 | } |
| 6400 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6401 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6402 | params = params_base + offset; |
| 6403 | |
| 6404 | glTexEnviv( |
| 6405 | (GLenum)target, |
| 6406 | (GLenum)pname, |
| 6407 | (GLint *)params |
| 6408 | ); |
| 6409 | |
| 6410 | exit: |
| 6411 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6412 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6413 | JNI_ABORT); |
| 6414 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6415 | if (_exception) { |
| 6416 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6417 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6418 | } |
| 6419 | |
| 6420 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6421 | static void |
| 6422 | android_glTexEnviv__IILjava_nio_IntBuffer_2 |
| 6423 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6424 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6425 | const char * _exceptionType = NULL; |
| 6426 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6427 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6428 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6429 | jint _remaining; |
| 6430 | GLint *params = (GLint *) 0; |
| 6431 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6432 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6433 | int _needed; |
| 6434 | switch (pname) { |
| 6435 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6436 | case GL_TEXTURE_ENV_MODE: |
| 6437 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6438 | #if defined(GL_COMBINE_RGB) |
| 6439 | case GL_COMBINE_RGB: |
| 6440 | #endif // defined(GL_COMBINE_RGB) |
| 6441 | #if defined(GL_COMBINE_ALPHA) |
| 6442 | case GL_COMBINE_ALPHA: |
| 6443 | #endif // defined(GL_COMBINE_ALPHA) |
| 6444 | _needed = 1; |
| 6445 | break; |
| 6446 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6447 | case GL_TEXTURE_ENV_COLOR: |
| 6448 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6449 | _needed = 4; |
| 6450 | break; |
| 6451 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6452 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6453 | break; |
| 6454 | } |
| 6455 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6456 | _exception = 1; |
| 6457 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6458 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6459 | goto exit; |
| 6460 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6461 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6462 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6463 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6464 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6465 | glTexEnviv( |
| 6466 | (GLenum)target, |
| 6467 | (GLenum)pname, |
| 6468 | (GLint *)params |
| 6469 | ); |
| 6470 | |
| 6471 | exit: |
| 6472 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6473 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6474 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6475 | if (_exception) { |
| 6476 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6477 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6478 | } |
| 6479 | |
| 6480 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6481 | static void |
| 6482 | android_glTexParameterfv__II_3FI |
| 6483 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6484 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6485 | const char * _exceptionType = NULL; |
| 6486 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6487 | GLfloat *params_base = (GLfloat *) 0; |
| 6488 | jint _remaining; |
| 6489 | GLfloat *params = (GLfloat *) 0; |
| 6490 | |
| 6491 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6492 | _exception = 1; |
| 6493 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6494 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6495 | goto exit; |
| 6496 | } |
| 6497 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6498 | _exception = 1; |
| 6499 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6500 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6501 | goto exit; |
| 6502 | } |
| 6503 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6504 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6505 | _exception = 1; |
| 6506 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6507 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6508 | goto exit; |
| 6509 | } |
| 6510 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6511 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6512 | params = params_base + offset; |
| 6513 | |
| 6514 | glTexParameterfv( |
| 6515 | (GLenum)target, |
| 6516 | (GLenum)pname, |
| 6517 | (GLfloat *)params |
| 6518 | ); |
| 6519 | |
| 6520 | exit: |
| 6521 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6522 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6523 | JNI_ABORT); |
| 6524 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6525 | if (_exception) { |
| 6526 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6527 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6528 | } |
| 6529 | |
| 6530 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6531 | static void |
| 6532 | android_glTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6533 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6534 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6535 | const char * _exceptionType = NULL; |
| 6536 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6537 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6538 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6539 | jint _remaining; |
| 6540 | GLfloat *params = (GLfloat *) 0; |
| 6541 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6542 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6543 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6544 | _exception = 1; |
| 6545 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6546 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6547 | goto exit; |
| 6548 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6549 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6550 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6551 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6552 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6553 | glTexParameterfv( |
| 6554 | (GLenum)target, |
| 6555 | (GLenum)pname, |
| 6556 | (GLfloat *)params |
| 6557 | ); |
| 6558 | |
| 6559 | exit: |
| 6560 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6561 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6562 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6563 | if (_exception) { |
| 6564 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6565 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6566 | } |
| 6567 | |
| 6568 | /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ |
| 6569 | static void |
| 6570 | android_glTexParameteri__III |
| 6571 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6572 | glTexParameteri( |
| 6573 | (GLenum)target, |
| 6574 | (GLenum)pname, |
| 6575 | (GLint)param |
| 6576 | ); |
| 6577 | } |
| 6578 | |
| 6579 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6580 | static void |
| 6581 | android_glTexParameteriv__II_3II |
| 6582 | (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] | 6583 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6584 | const char * _exceptionType = NULL; |
| 6585 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6586 | GLint *params_base = (GLint *) 0; |
| 6587 | jint _remaining; |
| 6588 | GLint *params = (GLint *) 0; |
| 6589 | |
| 6590 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6591 | _exception = 1; |
| 6592 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6593 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6594 | goto exit; |
| 6595 | } |
| 6596 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6597 | _exception = 1; |
| 6598 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6599 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6600 | goto exit; |
| 6601 | } |
| 6602 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6603 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6604 | _exception = 1; |
| 6605 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6606 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6607 | goto exit; |
| 6608 | } |
| 6609 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6610 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6611 | params = params_base + offset; |
| 6612 | |
| 6613 | glTexParameteriv( |
| 6614 | (GLenum)target, |
| 6615 | (GLenum)pname, |
| 6616 | (GLint *)params |
| 6617 | ); |
| 6618 | |
| 6619 | exit: |
| 6620 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6621 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6622 | JNI_ABORT); |
| 6623 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6624 | if (_exception) { |
| 6625 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6626 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6627 | } |
| 6628 | |
| 6629 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6630 | static void |
| 6631 | android_glTexParameteriv__IILjava_nio_IntBuffer_2 |
| 6632 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6633 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6634 | const char * _exceptionType = NULL; |
| 6635 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6636 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6637 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6638 | jint _remaining; |
| 6639 | GLint *params = (GLint *) 0; |
| 6640 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6641 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6642 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6643 | _exception = 1; |
| 6644 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6645 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6646 | goto exit; |
| 6647 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6648 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6649 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6650 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6651 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6652 | glTexParameteriv( |
| 6653 | (GLenum)target, |
| 6654 | (GLenum)pname, |
| 6655 | (GLint *)params |
| 6656 | ); |
| 6657 | |
| 6658 | exit: |
| 6659 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6660 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6661 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6662 | if (_exception) { |
| 6663 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6664 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6665 | } |
| 6666 | |
| 6667 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 6668 | static void |
| 6669 | android_glTexParameterxv__II_3II |
| 6670 | (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] | 6671 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6672 | const char * _exceptionType = NULL; |
| 6673 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6674 | GLfixed *params_base = (GLfixed *) 0; |
| 6675 | jint _remaining; |
| 6676 | GLfixed *params = (GLfixed *) 0; |
| 6677 | |
| 6678 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6679 | _exception = 1; |
| 6680 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6681 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6682 | goto exit; |
| 6683 | } |
| 6684 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6685 | _exception = 1; |
| 6686 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6687 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6688 | goto exit; |
| 6689 | } |
| 6690 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6691 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6692 | _exception = 1; |
| 6693 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6694 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6695 | goto exit; |
| 6696 | } |
| 6697 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6698 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6699 | params = params_base + offset; |
| 6700 | |
| 6701 | glTexParameterxv( |
| 6702 | (GLenum)target, |
| 6703 | (GLenum)pname, |
| 6704 | (GLfixed *)params |
| 6705 | ); |
| 6706 | |
| 6707 | exit: |
| 6708 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6709 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6710 | JNI_ABORT); |
| 6711 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6712 | if (_exception) { |
| 6713 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6714 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6715 | } |
| 6716 | |
| 6717 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 6718 | static void |
| 6719 | android_glTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6720 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6721 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6722 | const char * _exceptionType = NULL; |
| 6723 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6724 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6725 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6726 | jint _remaining; |
| 6727 | GLfixed *params = (GLfixed *) 0; |
| 6728 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6729 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6730 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6731 | _exception = 1; |
| 6732 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6733 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6734 | goto exit; |
| 6735 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6736 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6737 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6738 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6739 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6740 | glTexParameterxv( |
| 6741 | (GLenum)target, |
| 6742 | (GLenum)pname, |
| 6743 | (GLfixed *)params |
| 6744 | ); |
| 6745 | |
| 6746 | exit: |
| 6747 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6748 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6749 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6750 | if (_exception) { |
| 6751 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6752 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6753 | } |
| 6754 | |
| 6755 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6756 | static void |
| 6757 | android_glVertexPointer__IIII |
| 6758 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6759 | glVertexPointer( |
| 6760 | (GLint)size, |
| 6761 | (GLenum)type, |
| 6762 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6763 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6764 | ); |
| 6765 | } |
| 6766 | |
| 6767 | /* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */ |
| 6768 | static void |
| 6769 | android_glCurrentPaletteMatrixOES__I |
| 6770 | (JNIEnv *_env, jobject _this, jint matrixpaletteindex) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6771 | glCurrentPaletteMatrixOES( |
| 6772 | (GLuint)matrixpaletteindex |
| 6773 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6774 | } |
| 6775 | |
| 6776 | /* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */ |
| 6777 | static void |
| 6778 | android_glDrawTexfOES__FFFFF |
| 6779 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) { |
| 6780 | glDrawTexfOES( |
| 6781 | (GLfloat)x, |
| 6782 | (GLfloat)y, |
| 6783 | (GLfloat)z, |
| 6784 | (GLfloat)width, |
| 6785 | (GLfloat)height |
| 6786 | ); |
| 6787 | } |
| 6788 | |
| 6789 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 6790 | static void |
| 6791 | android_glDrawTexfvOES___3FI |
| 6792 | (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6793 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6794 | const char * _exceptionType = NULL; |
| 6795 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6796 | GLfloat *coords_base = (GLfloat *) 0; |
| 6797 | jint _remaining; |
| 6798 | GLfloat *coords = (GLfloat *) 0; |
| 6799 | |
| 6800 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6801 | _exception = 1; |
| 6802 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6803 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6804 | goto exit; |
| 6805 | } |
| 6806 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6807 | _exception = 1; |
| 6808 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6809 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6810 | goto exit; |
| 6811 | } |
| 6812 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 6813 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6814 | _exception = 1; |
| 6815 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6816 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6817 | goto exit; |
| 6818 | } |
| 6819 | coords_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6820 | _env->GetFloatArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6821 | coords = coords_base + offset; |
| 6822 | |
| 6823 | glDrawTexfvOES( |
| 6824 | (GLfloat *)coords |
| 6825 | ); |
| 6826 | |
| 6827 | exit: |
| 6828 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6829 | _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6830 | JNI_ABORT); |
| 6831 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6832 | if (_exception) { |
| 6833 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6834 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6835 | } |
| 6836 | |
| 6837 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 6838 | static void |
| 6839 | android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 |
| 6840 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6841 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6842 | const char * _exceptionType = NULL; |
| 6843 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6844 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6845 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6846 | jint _remaining; |
| 6847 | GLfloat *coords = (GLfloat *) 0; |
| 6848 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6849 | coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6850 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6851 | _exception = 1; |
| 6852 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6853 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6854 | goto exit; |
| 6855 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6856 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6857 | char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6858 | coords = (GLfloat *) (_coordsBase + _bufferOffset); |
| 6859 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6860 | glDrawTexfvOES( |
| 6861 | (GLfloat *)coords |
| 6862 | ); |
| 6863 | |
| 6864 | exit: |
| 6865 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6866 | _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6867 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6868 | if (_exception) { |
| 6869 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6870 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6871 | } |
| 6872 | |
| 6873 | /* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */ |
| 6874 | static void |
| 6875 | android_glDrawTexiOES__IIIII |
| 6876 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 6877 | glDrawTexiOES( |
| 6878 | (GLint)x, |
| 6879 | (GLint)y, |
| 6880 | (GLint)z, |
| 6881 | (GLint)width, |
| 6882 | (GLint)height |
| 6883 | ); |
| 6884 | } |
| 6885 | |
| 6886 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 6887 | static void |
| 6888 | android_glDrawTexivOES___3II |
| 6889 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6890 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6891 | const char * _exceptionType = NULL; |
| 6892 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6893 | GLint *coords_base = (GLint *) 0; |
| 6894 | jint _remaining; |
| 6895 | GLint *coords = (GLint *) 0; |
| 6896 | |
| 6897 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6898 | _exception = 1; |
| 6899 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6900 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6901 | goto exit; |
| 6902 | } |
| 6903 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6904 | _exception = 1; |
| 6905 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6906 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6907 | goto exit; |
| 6908 | } |
| 6909 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 6910 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6911 | _exception = 1; |
| 6912 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6913 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6914 | goto exit; |
| 6915 | } |
| 6916 | coords_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6917 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6918 | coords = coords_base + offset; |
| 6919 | |
| 6920 | glDrawTexivOES( |
| 6921 | (GLint *)coords |
| 6922 | ); |
| 6923 | |
| 6924 | exit: |
| 6925 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6926 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6927 | JNI_ABORT); |
| 6928 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6929 | if (_exception) { |
| 6930 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6931 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6932 | } |
| 6933 | |
| 6934 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 6935 | static void |
| 6936 | android_glDrawTexivOES__Ljava_nio_IntBuffer_2 |
| 6937 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6938 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6939 | const char * _exceptionType = NULL; |
| 6940 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6941 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6942 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6943 | jint _remaining; |
| 6944 | GLint *coords = (GLint *) 0; |
| 6945 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6946 | coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6947 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6948 | _exception = 1; |
| 6949 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6950 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6951 | goto exit; |
| 6952 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6953 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6954 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6955 | coords = (GLint *) (_coordsBase + _bufferOffset); |
| 6956 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6957 | glDrawTexivOES( |
| 6958 | (GLint *)coords |
| 6959 | ); |
| 6960 | |
| 6961 | exit: |
| 6962 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6963 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6964 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6965 | if (_exception) { |
| 6966 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6967 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6968 | } |
| 6969 | |
| 6970 | /* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */ |
| 6971 | static void |
| 6972 | android_glDrawTexsOES__SSSSS |
| 6973 | (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) { |
| 6974 | glDrawTexsOES( |
| 6975 | (GLshort)x, |
| 6976 | (GLshort)y, |
| 6977 | (GLshort)z, |
| 6978 | (GLshort)width, |
| 6979 | (GLshort)height |
| 6980 | ); |
| 6981 | } |
| 6982 | |
| 6983 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 6984 | static void |
| 6985 | android_glDrawTexsvOES___3SI |
| 6986 | (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6987 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6988 | const char * _exceptionType = NULL; |
| 6989 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6990 | GLshort *coords_base = (GLshort *) 0; |
| 6991 | jint _remaining; |
| 6992 | GLshort *coords = (GLshort *) 0; |
| 6993 | |
| 6994 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6995 | _exception = 1; |
| 6996 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6997 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6998 | goto exit; |
| 6999 | } |
| 7000 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7001 | _exception = 1; |
| 7002 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7003 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7004 | goto exit; |
| 7005 | } |
| 7006 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7007 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7008 | _exception = 1; |
| 7009 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7010 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7011 | goto exit; |
| 7012 | } |
| 7013 | coords_base = (GLshort *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7014 | _env->GetShortArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7015 | coords = coords_base + offset; |
| 7016 | |
| 7017 | glDrawTexsvOES( |
| 7018 | (GLshort *)coords |
| 7019 | ); |
| 7020 | |
| 7021 | exit: |
| 7022 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7023 | _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7024 | JNI_ABORT); |
| 7025 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7026 | if (_exception) { |
| 7027 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7028 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7029 | } |
| 7030 | |
| 7031 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7032 | static void |
| 7033 | android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 |
| 7034 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7035 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7036 | const char * _exceptionType = NULL; |
| 7037 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7038 | jshortArray _array = (jshortArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7039 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7040 | jint _remaining; |
| 7041 | GLshort *coords = (GLshort *) 0; |
| 7042 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7043 | coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7044 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7045 | _exception = 1; |
| 7046 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7047 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7048 | goto exit; |
| 7049 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7050 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7051 | char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7052 | coords = (GLshort *) (_coordsBase + _bufferOffset); |
| 7053 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7054 | glDrawTexsvOES( |
| 7055 | (GLshort *)coords |
| 7056 | ); |
| 7057 | |
| 7058 | exit: |
| 7059 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7060 | _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7061 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7062 | if (_exception) { |
| 7063 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7064 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7065 | } |
| 7066 | |
| 7067 | /* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */ |
| 7068 | static void |
| 7069 | android_glDrawTexxOES__IIIII |
| 7070 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7071 | glDrawTexxOES( |
| 7072 | (GLfixed)x, |
| 7073 | (GLfixed)y, |
| 7074 | (GLfixed)z, |
| 7075 | (GLfixed)width, |
| 7076 | (GLfixed)height |
| 7077 | ); |
| 7078 | } |
| 7079 | |
| 7080 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7081 | static void |
| 7082 | android_glDrawTexxvOES___3II |
| 7083 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7084 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7085 | const char * _exceptionType = NULL; |
| 7086 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7087 | GLfixed *coords_base = (GLfixed *) 0; |
| 7088 | jint _remaining; |
| 7089 | GLfixed *coords = (GLfixed *) 0; |
| 7090 | |
| 7091 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7092 | _exception = 1; |
| 7093 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7094 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7095 | goto exit; |
| 7096 | } |
| 7097 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7098 | _exception = 1; |
| 7099 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7100 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7101 | goto exit; |
| 7102 | } |
| 7103 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7104 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7105 | _exception = 1; |
| 7106 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7107 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7108 | goto exit; |
| 7109 | } |
| 7110 | coords_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7111 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7112 | coords = coords_base + offset; |
| 7113 | |
| 7114 | glDrawTexxvOES( |
| 7115 | (GLfixed *)coords |
| 7116 | ); |
| 7117 | |
| 7118 | exit: |
| 7119 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7120 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7121 | JNI_ABORT); |
| 7122 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7123 | if (_exception) { |
| 7124 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7125 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7126 | } |
| 7127 | |
| 7128 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7129 | static void |
| 7130 | android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 |
| 7131 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7132 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7133 | const char * _exceptionType = NULL; |
| 7134 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7135 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7136 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7137 | jint _remaining; |
| 7138 | GLfixed *coords = (GLfixed *) 0; |
| 7139 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7140 | coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7141 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7142 | _exception = 1; |
| 7143 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7144 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7145 | goto exit; |
| 7146 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7147 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7148 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7149 | coords = (GLfixed *) (_coordsBase + _bufferOffset); |
| 7150 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7151 | glDrawTexxvOES( |
| 7152 | (GLfixed *)coords |
| 7153 | ); |
| 7154 | |
| 7155 | exit: |
| 7156 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7157 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7158 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7159 | if (_exception) { |
| 7160 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7161 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7162 | } |
| 7163 | |
| 7164 | /* void glLoadPaletteFromModelViewMatrixOES ( void ) */ |
| 7165 | static void |
| 7166 | android_glLoadPaletteFromModelViewMatrixOES__ |
| 7167 | (JNIEnv *_env, jobject _this) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7168 | glLoadPaletteFromModelViewMatrixOES(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7169 | } |
| 7170 | |
| 7171 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7172 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7173 | android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7174 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 7175 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7176 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7177 | jint _remaining; |
| 7178 | GLvoid *pointer = (GLvoid *) 0; |
| 7179 | |
| 7180 | if (pointer_buf) { |
| 7181 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7182 | if ( ! pointer ) { |
| 7183 | return; |
| 7184 | } |
| 7185 | } |
| 7186 | glMatrixIndexPointerOESBounds( |
| 7187 | (GLint)size, |
| 7188 | (GLenum)type, |
| 7189 | (GLsizei)stride, |
| 7190 | (GLvoid *)pointer, |
| 7191 | (GLsizei)remaining |
| 7192 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7193 | } |
| 7194 | |
| 7195 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7196 | static void |
| 7197 | android_glMatrixIndexPointerOES__IIII |
| 7198 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7199 | glMatrixIndexPointerOES( |
| 7200 | (GLint)size, |
| 7201 | (GLenum)type, |
| 7202 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7203 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7204 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7205 | } |
| 7206 | |
| 7207 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7208 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7209 | android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7210 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
| 7211 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7212 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7213 | jint _remaining; |
| 7214 | GLvoid *pointer = (GLvoid *) 0; |
| 7215 | |
| 7216 | if (pointer_buf) { |
| 7217 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7218 | if ( ! pointer ) { |
| 7219 | return; |
| 7220 | } |
| 7221 | } |
| 7222 | glWeightPointerOESBounds( |
| 7223 | (GLint)size, |
| 7224 | (GLenum)type, |
| 7225 | (GLsizei)stride, |
| 7226 | (GLvoid *)pointer, |
| 7227 | (GLsizei)remaining |
| 7228 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7229 | } |
| 7230 | |
| 7231 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7232 | static void |
| 7233 | android_glWeightPointerOES__IIII |
| 7234 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7235 | glWeightPointerOES( |
| 7236 | (GLint)size, |
| 7237 | (GLenum)type, |
| 7238 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7239 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7240 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7241 | } |
| 7242 | |
| 7243 | /* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */ |
| 7244 | static void |
| 7245 | android_glBindFramebufferOES__II |
| 7246 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7247 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7248 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7249 | "glBindFramebufferOES"); |
| 7250 | return; |
| 7251 | } |
| 7252 | glBindFramebufferOES( |
| 7253 | (GLint)target, |
| 7254 | (GLint)framebuffer |
| 7255 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7256 | } |
| 7257 | |
| 7258 | /* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */ |
| 7259 | static void |
| 7260 | android_glBindRenderbufferOES__II |
| 7261 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7262 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7263 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7264 | "glBindRenderbufferOES"); |
| 7265 | return; |
| 7266 | } |
| 7267 | glBindRenderbufferOES( |
| 7268 | (GLint)target, |
| 7269 | (GLint)renderbuffer |
| 7270 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7271 | } |
| 7272 | |
| 7273 | /* void glBlendEquation ( GLint mode ) */ |
| 7274 | static void |
| 7275 | android_glBlendEquation__I |
| 7276 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7277 | if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7278 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7279 | "glBlendEquation"); |
| 7280 | return; |
| 7281 | } |
| 7282 | glBlendEquation( |
| 7283 | (GLint)mode |
| 7284 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7285 | } |
| 7286 | |
| 7287 | /* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */ |
| 7288 | static void |
| 7289 | android_glBlendEquationSeparate__II |
| 7290 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7291 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7292 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7293 | "glBlendEquationSeparate"); |
| 7294 | return; |
| 7295 | } |
| 7296 | glBlendEquationSeparate( |
| 7297 | (GLint)modeRGB, |
| 7298 | (GLint)modeAlpha |
| 7299 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7300 | } |
| 7301 | |
| 7302 | /* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */ |
| 7303 | static void |
| 7304 | android_glBlendFuncSeparate__IIII |
| 7305 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7306 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7307 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7308 | "glBlendFuncSeparate"); |
| 7309 | return; |
| 7310 | } |
| 7311 | glBlendFuncSeparate( |
| 7312 | (GLint)srcRGB, |
| 7313 | (GLint)dstRGB, |
| 7314 | (GLint)srcAlpha, |
| 7315 | (GLint)dstAlpha |
| 7316 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7317 | } |
| 7318 | |
| 7319 | /* GLint glCheckFramebufferStatusOES ( GLint target ) */ |
| 7320 | static jint |
| 7321 | android_glCheckFramebufferStatusOES__I |
| 7322 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7323 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7324 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7325 | "glCheckFramebufferStatusOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7326 | return 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7327 | } |
| 7328 | GLint _returnValue = 0; |
| 7329 | _returnValue = glCheckFramebufferStatusOES( |
| 7330 | (GLint)target |
| 7331 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 7332 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7333 | } |
| 7334 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7335 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7336 | static void |
| 7337 | android_glDeleteFramebuffersOES__I_3II |
| 7338 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7339 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7340 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7341 | "glDeleteFramebuffersOES"); |
| 7342 | return; |
| 7343 | } |
| 7344 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7345 | const char * _exceptionType = NULL; |
| 7346 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7347 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7348 | jint _remaining; |
| 7349 | GLuint *framebuffers = (GLuint *) 0; |
| 7350 | |
| 7351 | if (!framebuffers_ref) { |
| 7352 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7353 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7354 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7355 | goto exit; |
| 7356 | } |
| 7357 | if (offset < 0) { |
| 7358 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7359 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7360 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7361 | goto exit; |
| 7362 | } |
| 7363 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7364 | if (_remaining < n) { |
| 7365 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7366 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7367 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7368 | goto exit; |
| 7369 | } |
| 7370 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7371 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7372 | framebuffers = framebuffers_base + offset; |
| 7373 | |
| 7374 | glDeleteFramebuffersOES( |
| 7375 | (GLint)n, |
| 7376 | (GLuint *)framebuffers |
| 7377 | ); |
| 7378 | |
| 7379 | exit: |
| 7380 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7381 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7382 | _exception ? JNI_ABORT: 0); |
| 7383 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7384 | if (_exception) { |
| 7385 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7386 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7387 | } |
| 7388 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7389 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7390 | static void |
| 7391 | android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 7392 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7393 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7394 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7395 | "glDeleteFramebuffersOES"); |
| 7396 | return; |
| 7397 | } |
| 7398 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7399 | const char * _exceptionType = NULL; |
| 7400 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7401 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7402 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7403 | jint _remaining; |
| 7404 | GLuint *framebuffers = (GLuint *) 0; |
| 7405 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7406 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7407 | if (_remaining < n) { |
| 7408 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7409 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7410 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7411 | goto exit; |
| 7412 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7413 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7414 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7415 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7416 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7417 | glDeleteFramebuffersOES( |
| 7418 | (GLint)n, |
| 7419 | (GLuint *)framebuffers |
| 7420 | ); |
| 7421 | |
| 7422 | exit: |
| 7423 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7424 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7425 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7426 | if (_exception) { |
| 7427 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7428 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7429 | } |
| 7430 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7431 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7432 | static void |
| 7433 | android_glDeleteRenderbuffersOES__I_3II |
| 7434 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7435 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7436 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7437 | "glDeleteRenderbuffersOES"); |
| 7438 | return; |
| 7439 | } |
| 7440 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7441 | const char * _exceptionType = NULL; |
| 7442 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7443 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7444 | jint _remaining; |
| 7445 | GLuint *renderbuffers = (GLuint *) 0; |
| 7446 | |
| 7447 | if (!renderbuffers_ref) { |
| 7448 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7449 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7450 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7451 | goto exit; |
| 7452 | } |
| 7453 | if (offset < 0) { |
| 7454 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7455 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7456 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7457 | goto exit; |
| 7458 | } |
| 7459 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7460 | if (_remaining < n) { |
| 7461 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7462 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7463 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7464 | goto exit; |
| 7465 | } |
| 7466 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7467 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7468 | renderbuffers = renderbuffers_base + offset; |
| 7469 | |
| 7470 | glDeleteRenderbuffersOES( |
| 7471 | (GLint)n, |
| 7472 | (GLuint *)renderbuffers |
| 7473 | ); |
| 7474 | |
| 7475 | exit: |
| 7476 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7477 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7478 | _exception ? JNI_ABORT: 0); |
| 7479 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7480 | if (_exception) { |
| 7481 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7482 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7483 | } |
| 7484 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7485 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7486 | static void |
| 7487 | android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 7488 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7489 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7490 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7491 | "glDeleteRenderbuffersOES"); |
| 7492 | return; |
| 7493 | } |
| 7494 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7495 | const char * _exceptionType = NULL; |
| 7496 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7497 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7498 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7499 | jint _remaining; |
| 7500 | GLuint *renderbuffers = (GLuint *) 0; |
| 7501 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7502 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7503 | if (_remaining < n) { |
| 7504 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7505 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7506 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7507 | goto exit; |
| 7508 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7509 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7510 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7511 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7512 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7513 | glDeleteRenderbuffersOES( |
| 7514 | (GLint)n, |
| 7515 | (GLuint *)renderbuffers |
| 7516 | ); |
| 7517 | |
| 7518 | exit: |
| 7519 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7520 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7521 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7522 | if (_exception) { |
| 7523 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7524 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7525 | } |
| 7526 | |
| 7527 | /* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */ |
| 7528 | static void |
| 7529 | android_glFramebufferRenderbufferOES__IIII |
| 7530 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7531 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7532 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7533 | "glFramebufferRenderbufferOES"); |
| 7534 | return; |
| 7535 | } |
| 7536 | glFramebufferRenderbufferOES( |
| 7537 | (GLint)target, |
| 7538 | (GLint)attachment, |
| 7539 | (GLint)renderbuffertarget, |
| 7540 | (GLint)renderbuffer |
| 7541 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7542 | } |
| 7543 | |
| 7544 | /* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */ |
| 7545 | static void |
| 7546 | android_glFramebufferTexture2DOES__IIIII |
| 7547 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7548 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7549 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7550 | "glFramebufferTexture2DOES"); |
| 7551 | return; |
| 7552 | } |
| 7553 | glFramebufferTexture2DOES( |
| 7554 | (GLint)target, |
| 7555 | (GLint)attachment, |
| 7556 | (GLint)textarget, |
| 7557 | (GLint)texture, |
| 7558 | (GLint)level |
| 7559 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7560 | } |
| 7561 | |
| 7562 | /* void glGenerateMipmapOES ( GLint target ) */ |
| 7563 | static void |
| 7564 | android_glGenerateMipmapOES__I |
| 7565 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7566 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7567 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7568 | "glGenerateMipmapOES"); |
| 7569 | return; |
| 7570 | } |
| 7571 | glGenerateMipmapOES( |
| 7572 | (GLint)target |
| 7573 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7574 | } |
| 7575 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7576 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7577 | static void |
| 7578 | android_glGenFramebuffersOES__I_3II |
| 7579 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7580 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7581 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7582 | "glGenFramebuffersOES"); |
| 7583 | return; |
| 7584 | } |
| 7585 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7586 | const char * _exceptionType = NULL; |
| 7587 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7588 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7589 | jint _remaining; |
| 7590 | GLuint *framebuffers = (GLuint *) 0; |
| 7591 | |
| 7592 | if (!framebuffers_ref) { |
| 7593 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7594 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7595 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7596 | goto exit; |
| 7597 | } |
| 7598 | if (offset < 0) { |
| 7599 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7600 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7601 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7602 | goto exit; |
| 7603 | } |
| 7604 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7605 | if (_remaining < n) { |
| 7606 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7607 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7608 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7609 | goto exit; |
| 7610 | } |
| 7611 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7612 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7613 | framebuffers = framebuffers_base + offset; |
| 7614 | |
| 7615 | glGenFramebuffersOES( |
| 7616 | (GLint)n, |
| 7617 | (GLuint *)framebuffers |
| 7618 | ); |
| 7619 | |
| 7620 | exit: |
| 7621 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7622 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7623 | _exception ? JNI_ABORT: 0); |
| 7624 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7625 | if (_exception) { |
| 7626 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7627 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7628 | } |
| 7629 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7630 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7631 | static void |
| 7632 | android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 7633 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7634 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7635 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7636 | "glGenFramebuffersOES"); |
| 7637 | return; |
| 7638 | } |
| 7639 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7640 | const char * _exceptionType = NULL; |
| 7641 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7642 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7643 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7644 | jint _remaining; |
| 7645 | GLuint *framebuffers = (GLuint *) 0; |
| 7646 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7647 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7648 | if (_remaining < n) { |
| 7649 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7650 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7651 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7652 | goto exit; |
| 7653 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7654 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7655 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7656 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7657 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7658 | glGenFramebuffersOES( |
| 7659 | (GLint)n, |
| 7660 | (GLuint *)framebuffers |
| 7661 | ); |
| 7662 | |
| 7663 | exit: |
| 7664 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7665 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7666 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7667 | if (_exception) { |
| 7668 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7669 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7670 | } |
| 7671 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7672 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7673 | static void |
| 7674 | android_glGenRenderbuffersOES__I_3II |
| 7675 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7676 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7677 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7678 | "glGenRenderbuffersOES"); |
| 7679 | return; |
| 7680 | } |
| 7681 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7682 | const char * _exceptionType = NULL; |
| 7683 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7684 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7685 | jint _remaining; |
| 7686 | GLuint *renderbuffers = (GLuint *) 0; |
| 7687 | |
| 7688 | if (!renderbuffers_ref) { |
| 7689 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7690 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7691 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7692 | goto exit; |
| 7693 | } |
| 7694 | if (offset < 0) { |
| 7695 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7696 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7697 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7698 | goto exit; |
| 7699 | } |
| 7700 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7701 | if (_remaining < n) { |
| 7702 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7703 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7704 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7705 | goto exit; |
| 7706 | } |
| 7707 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7708 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7709 | renderbuffers = renderbuffers_base + offset; |
| 7710 | |
| 7711 | glGenRenderbuffersOES( |
| 7712 | (GLint)n, |
| 7713 | (GLuint *)renderbuffers |
| 7714 | ); |
| 7715 | |
| 7716 | exit: |
| 7717 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7718 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7719 | _exception ? JNI_ABORT: 0); |
| 7720 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7721 | if (_exception) { |
| 7722 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7723 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7724 | } |
| 7725 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7726 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7727 | static void |
| 7728 | android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 7729 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7730 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7731 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7732 | "glGenRenderbuffersOES"); |
| 7733 | return; |
| 7734 | } |
| 7735 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7736 | const char * _exceptionType = NULL; |
| 7737 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7738 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7739 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7740 | jint _remaining; |
| 7741 | GLuint *renderbuffers = (GLuint *) 0; |
| 7742 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7743 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7744 | if (_remaining < n) { |
| 7745 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7746 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7747 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7748 | goto exit; |
| 7749 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7750 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7751 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7752 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7753 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7754 | glGenRenderbuffersOES( |
| 7755 | (GLint)n, |
| 7756 | (GLuint *)renderbuffers |
| 7757 | ); |
| 7758 | |
| 7759 | exit: |
| 7760 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7761 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7762 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7763 | if (_exception) { |
| 7764 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7765 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7766 | } |
| 7767 | |
| 7768 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 7769 | static void |
| 7770 | android_glGetFramebufferAttachmentParameterivOES__III_3II |
| 7771 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7772 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7773 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7774 | "glGetFramebufferAttachmentParameterivOES"); |
| 7775 | return; |
| 7776 | } |
| 7777 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7778 | const char * _exceptionType = NULL; |
| 7779 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7780 | GLint *params_base = (GLint *) 0; |
| 7781 | jint _remaining; |
| 7782 | GLint *params = (GLint *) 0; |
| 7783 | |
| 7784 | if (!params_ref) { |
| 7785 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7786 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7787 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7788 | goto exit; |
| 7789 | } |
| 7790 | if (offset < 0) { |
| 7791 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7792 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7793 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7794 | goto exit; |
| 7795 | } |
| 7796 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7797 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7798 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7799 | params = params_base + offset; |
| 7800 | |
| 7801 | glGetFramebufferAttachmentParameterivOES( |
| 7802 | (GLint)target, |
| 7803 | (GLint)attachment, |
| 7804 | (GLint)pname, |
| 7805 | (GLint *)params |
| 7806 | ); |
| 7807 | |
| 7808 | exit: |
| 7809 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7810 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7811 | _exception ? JNI_ABORT: 0); |
| 7812 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7813 | if (_exception) { |
| 7814 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7815 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7816 | } |
| 7817 | |
| 7818 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 7819 | static void |
| 7820 | android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 |
| 7821 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7822 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7823 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7824 | "glGetFramebufferAttachmentParameterivOES"); |
| 7825 | return; |
| 7826 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7827 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7828 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7829 | jint _remaining; |
| 7830 | GLint *params = (GLint *) 0; |
| 7831 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7832 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7833 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7834 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7835 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7836 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7837 | glGetFramebufferAttachmentParameterivOES( |
| 7838 | (GLint)target, |
| 7839 | (GLint)attachment, |
| 7840 | (GLint)pname, |
| 7841 | (GLint *)params |
| 7842 | ); |
| 7843 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7844 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7845 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7846 | } |
| 7847 | |
| 7848 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 7849 | static void |
| 7850 | android_glGetRenderbufferParameterivOES__II_3II |
| 7851 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7852 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7853 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7854 | "glGetRenderbufferParameterivOES"); |
| 7855 | return; |
| 7856 | } |
| 7857 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7858 | const char * _exceptionType = NULL; |
| 7859 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7860 | GLint *params_base = (GLint *) 0; |
| 7861 | jint _remaining; |
| 7862 | GLint *params = (GLint *) 0; |
| 7863 | |
| 7864 | if (!params_ref) { |
| 7865 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7866 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7867 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7868 | goto exit; |
| 7869 | } |
| 7870 | if (offset < 0) { |
| 7871 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7872 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7873 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7874 | goto exit; |
| 7875 | } |
| 7876 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7877 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7878 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7879 | params = params_base + offset; |
| 7880 | |
| 7881 | glGetRenderbufferParameterivOES( |
| 7882 | (GLint)target, |
| 7883 | (GLint)pname, |
| 7884 | (GLint *)params |
| 7885 | ); |
| 7886 | |
| 7887 | exit: |
| 7888 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7889 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7890 | _exception ? JNI_ABORT: 0); |
| 7891 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7892 | if (_exception) { |
| 7893 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7894 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7895 | } |
| 7896 | |
| 7897 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 7898 | static void |
| 7899 | android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 |
| 7900 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7901 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7902 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7903 | "glGetRenderbufferParameterivOES"); |
| 7904 | return; |
| 7905 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7906 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7907 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7908 | jint _remaining; |
| 7909 | GLint *params = (GLint *) 0; |
| 7910 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7911 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7912 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7913 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7914 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7915 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7916 | glGetRenderbufferParameterivOES( |
| 7917 | (GLint)target, |
| 7918 | (GLint)pname, |
| 7919 | (GLint *)params |
| 7920 | ); |
| 7921 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7922 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7923 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7924 | } |
| 7925 | |
| 7926 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 7927 | static void |
| 7928 | android_glGetTexGenfv__II_3FI |
| 7929 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7930 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7931 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7932 | "glGetTexGenfv"); |
| 7933 | return; |
| 7934 | } |
| 7935 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7936 | const char * _exceptionType = NULL; |
| 7937 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7938 | GLfloat *params_base = (GLfloat *) 0; |
| 7939 | jint _remaining; |
| 7940 | GLfloat *params = (GLfloat *) 0; |
| 7941 | |
| 7942 | if (!params_ref) { |
| 7943 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7944 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7945 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7946 | goto exit; |
| 7947 | } |
| 7948 | if (offset < 0) { |
| 7949 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7950 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7951 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7952 | goto exit; |
| 7953 | } |
| 7954 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7955 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7956 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7957 | params = params_base + offset; |
| 7958 | |
| 7959 | glGetTexGenfv( |
| 7960 | (GLint)coord, |
| 7961 | (GLint)pname, |
| 7962 | (GLfloat *)params |
| 7963 | ); |
| 7964 | |
| 7965 | exit: |
| 7966 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7967 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7968 | _exception ? JNI_ABORT: 0); |
| 7969 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7970 | if (_exception) { |
| 7971 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7972 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7973 | } |
| 7974 | |
| 7975 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 7976 | static void |
| 7977 | android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 |
| 7978 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7979 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7980 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7981 | "glGetTexGenfv"); |
| 7982 | return; |
| 7983 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7984 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7985 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7986 | jint _remaining; |
| 7987 | GLfloat *params = (GLfloat *) 0; |
| 7988 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7989 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7990 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7991 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7992 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 7993 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7994 | glGetTexGenfv( |
| 7995 | (GLint)coord, |
| 7996 | (GLint)pname, |
| 7997 | (GLfloat *)params |
| 7998 | ); |
| 7999 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8000 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8001 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8002 | } |
| 8003 | |
| 8004 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8005 | static void |
| 8006 | android_glGetTexGeniv__II_3II |
| 8007 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8008 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8009 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8010 | "glGetTexGeniv"); |
| 8011 | return; |
| 8012 | } |
| 8013 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8014 | const char * _exceptionType = NULL; |
| 8015 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8016 | GLint *params_base = (GLint *) 0; |
| 8017 | jint _remaining; |
| 8018 | GLint *params = (GLint *) 0; |
| 8019 | |
| 8020 | if (!params_ref) { |
| 8021 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8022 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8023 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8024 | goto exit; |
| 8025 | } |
| 8026 | if (offset < 0) { |
| 8027 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8028 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8029 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8030 | goto exit; |
| 8031 | } |
| 8032 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8033 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8034 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8035 | params = params_base + offset; |
| 8036 | |
| 8037 | glGetTexGeniv( |
| 8038 | (GLint)coord, |
| 8039 | (GLint)pname, |
| 8040 | (GLint *)params |
| 8041 | ); |
| 8042 | |
| 8043 | exit: |
| 8044 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8045 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8046 | _exception ? JNI_ABORT: 0); |
| 8047 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8048 | if (_exception) { |
| 8049 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8050 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8051 | } |
| 8052 | |
| 8053 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8054 | static void |
| 8055 | android_glGetTexGeniv__IILjava_nio_IntBuffer_2 |
| 8056 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8057 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8058 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8059 | "glGetTexGeniv"); |
| 8060 | return; |
| 8061 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8062 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8063 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8064 | jint _remaining; |
| 8065 | GLint *params = (GLint *) 0; |
| 8066 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8067 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8068 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8069 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8070 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8071 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8072 | glGetTexGeniv( |
| 8073 | (GLint)coord, |
| 8074 | (GLint)pname, |
| 8075 | (GLint *)params |
| 8076 | ); |
| 8077 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8078 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8079 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8080 | } |
| 8081 | |
| 8082 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8083 | static void |
| 8084 | android_glGetTexGenxv__II_3II |
| 8085 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8086 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8087 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8088 | "glGetTexGenxv"); |
| 8089 | return; |
| 8090 | } |
| 8091 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8092 | const char * _exceptionType = NULL; |
| 8093 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8094 | GLint *params_base = (GLint *) 0; |
| 8095 | jint _remaining; |
| 8096 | GLint *params = (GLint *) 0; |
| 8097 | |
| 8098 | if (!params_ref) { |
| 8099 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8100 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8101 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8102 | goto exit; |
| 8103 | } |
| 8104 | if (offset < 0) { |
| 8105 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8106 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8107 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8108 | goto exit; |
| 8109 | } |
| 8110 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8111 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8112 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8113 | params = params_base + offset; |
| 8114 | |
| 8115 | glGetTexGenxv( |
| 8116 | (GLint)coord, |
| 8117 | (GLint)pname, |
| 8118 | (GLint *)params |
| 8119 | ); |
| 8120 | |
| 8121 | exit: |
| 8122 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8123 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8124 | _exception ? JNI_ABORT: 0); |
| 8125 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8126 | if (_exception) { |
| 8127 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8128 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8129 | } |
| 8130 | |
| 8131 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8132 | static void |
| 8133 | android_glGetTexGenxv__IILjava_nio_IntBuffer_2 |
| 8134 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8135 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8136 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8137 | "glGetTexGenxv"); |
| 8138 | return; |
| 8139 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8140 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8141 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8142 | jint _remaining; |
| 8143 | GLint *params = (GLint *) 0; |
| 8144 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8145 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8146 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8147 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8148 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8149 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8150 | glGetTexGenxv( |
| 8151 | (GLint)coord, |
| 8152 | (GLint)pname, |
| 8153 | (GLint *)params |
| 8154 | ); |
| 8155 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8156 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8157 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8158 | } |
| 8159 | |
| 8160 | /* GLboolean glIsFramebufferOES ( GLint framebuffer ) */ |
| 8161 | static jboolean |
| 8162 | android_glIsFramebufferOES__I |
| 8163 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8164 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8165 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8166 | "glIsFramebufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8167 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8168 | } |
| 8169 | GLboolean _returnValue = JNI_FALSE; |
| 8170 | _returnValue = glIsFramebufferOES( |
| 8171 | (GLint)framebuffer |
| 8172 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8173 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8174 | } |
| 8175 | |
| 8176 | /* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */ |
| 8177 | static jboolean |
| 8178 | android_glIsRenderbufferOES__I |
| 8179 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8180 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8181 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8182 | "glIsRenderbufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8183 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8184 | } |
| 8185 | GLboolean _returnValue = JNI_FALSE; |
| 8186 | _returnValue = glIsRenderbufferOES( |
| 8187 | (GLint)renderbuffer |
| 8188 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8189 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8190 | } |
| 8191 | |
| 8192 | /* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */ |
| 8193 | static void |
| 8194 | android_glRenderbufferStorageOES__IIII |
| 8195 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8196 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8197 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8198 | "glRenderbufferStorageOES"); |
| 8199 | return; |
| 8200 | } |
| 8201 | glRenderbufferStorageOES( |
| 8202 | (GLint)target, |
| 8203 | (GLint)internalformat, |
| 8204 | (GLint)width, |
| 8205 | (GLint)height |
| 8206 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8207 | } |
| 8208 | |
| 8209 | /* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */ |
| 8210 | static void |
| 8211 | android_glTexGenf__IIF |
| 8212 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8213 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8214 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8215 | "glTexGenf"); |
| 8216 | return; |
| 8217 | } |
| 8218 | glTexGenf( |
| 8219 | (GLint)coord, |
| 8220 | (GLint)pname, |
| 8221 | (GLfloat)param |
| 8222 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8223 | } |
| 8224 | |
| 8225 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8226 | static void |
| 8227 | android_glTexGenfv__II_3FI |
| 8228 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8229 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8230 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8231 | "glTexGenfv"); |
| 8232 | return; |
| 8233 | } |
| 8234 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8235 | const char * _exceptionType = NULL; |
| 8236 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8237 | GLfloat *params_base = (GLfloat *) 0; |
| 8238 | jint _remaining; |
| 8239 | GLfloat *params = (GLfloat *) 0; |
| 8240 | |
| 8241 | if (!params_ref) { |
| 8242 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8243 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8244 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8245 | goto exit; |
| 8246 | } |
| 8247 | if (offset < 0) { |
| 8248 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8249 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8250 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8251 | goto exit; |
| 8252 | } |
| 8253 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8254 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8255 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8256 | params = params_base + offset; |
| 8257 | |
| 8258 | glTexGenfv( |
| 8259 | (GLint)coord, |
| 8260 | (GLint)pname, |
| 8261 | (GLfloat *)params |
| 8262 | ); |
| 8263 | |
| 8264 | exit: |
| 8265 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8266 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8267 | _exception ? JNI_ABORT: 0); |
| 8268 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8269 | if (_exception) { |
| 8270 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8271 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8272 | } |
| 8273 | |
| 8274 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8275 | static void |
| 8276 | android_glTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8277 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8278 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8279 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8280 | "glTexGenfv"); |
| 8281 | return; |
| 8282 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8283 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8284 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8285 | jint _remaining; |
| 8286 | GLfloat *params = (GLfloat *) 0; |
| 8287 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8288 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8289 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8290 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8291 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8292 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8293 | glTexGenfv( |
| 8294 | (GLint)coord, |
| 8295 | (GLint)pname, |
| 8296 | (GLfloat *)params |
| 8297 | ); |
| 8298 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8299 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8300 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8301 | } |
| 8302 | |
| 8303 | /* void glTexGeni ( GLint coord, GLint pname, GLint param ) */ |
| 8304 | static void |
| 8305 | android_glTexGeni__III |
| 8306 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8307 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8308 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8309 | "glTexGeni"); |
| 8310 | return; |
| 8311 | } |
| 8312 | glTexGeni( |
| 8313 | (GLint)coord, |
| 8314 | (GLint)pname, |
| 8315 | (GLint)param |
| 8316 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8317 | } |
| 8318 | |
| 8319 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8320 | static void |
| 8321 | android_glTexGeniv__II_3II |
| 8322 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8323 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8324 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8325 | "glTexGeniv"); |
| 8326 | return; |
| 8327 | } |
| 8328 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8329 | const char * _exceptionType = NULL; |
| 8330 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8331 | GLint *params_base = (GLint *) 0; |
| 8332 | jint _remaining; |
| 8333 | GLint *params = (GLint *) 0; |
| 8334 | |
| 8335 | if (!params_ref) { |
| 8336 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8337 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8338 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8339 | goto exit; |
| 8340 | } |
| 8341 | if (offset < 0) { |
| 8342 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8343 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8344 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8345 | goto exit; |
| 8346 | } |
| 8347 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8348 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8349 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8350 | params = params_base + offset; |
| 8351 | |
| 8352 | glTexGeniv( |
| 8353 | (GLint)coord, |
| 8354 | (GLint)pname, |
| 8355 | (GLint *)params |
| 8356 | ); |
| 8357 | |
| 8358 | exit: |
| 8359 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8360 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8361 | _exception ? JNI_ABORT: 0); |
| 8362 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8363 | if (_exception) { |
| 8364 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8365 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8366 | } |
| 8367 | |
| 8368 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8369 | static void |
| 8370 | android_glTexGeniv__IILjava_nio_IntBuffer_2 |
| 8371 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8372 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8373 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8374 | "glTexGeniv"); |
| 8375 | return; |
| 8376 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8377 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8378 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8379 | jint _remaining; |
| 8380 | GLint *params = (GLint *) 0; |
| 8381 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8382 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8383 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8384 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8385 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8386 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8387 | glTexGeniv( |
| 8388 | (GLint)coord, |
| 8389 | (GLint)pname, |
| 8390 | (GLint *)params |
| 8391 | ); |
| 8392 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8393 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8394 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8395 | } |
| 8396 | |
| 8397 | /* void glTexGenx ( GLint coord, GLint pname, GLint param ) */ |
| 8398 | static void |
| 8399 | android_glTexGenx__III |
| 8400 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8401 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8402 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8403 | "glTexGenx"); |
| 8404 | return; |
| 8405 | } |
| 8406 | glTexGenx( |
| 8407 | (GLint)coord, |
| 8408 | (GLint)pname, |
| 8409 | (GLint)param |
| 8410 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8411 | } |
| 8412 | |
| 8413 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8414 | static void |
| 8415 | android_glTexGenxv__II_3II |
| 8416 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8417 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8418 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8419 | "glTexGenxv"); |
| 8420 | return; |
| 8421 | } |
| 8422 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8423 | const char * _exceptionType = NULL; |
| 8424 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8425 | GLint *params_base = (GLint *) 0; |
| 8426 | jint _remaining; |
| 8427 | GLint *params = (GLint *) 0; |
| 8428 | |
| 8429 | if (!params_ref) { |
| 8430 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8431 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8432 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8433 | goto exit; |
| 8434 | } |
| 8435 | if (offset < 0) { |
| 8436 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8437 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8438 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8439 | goto exit; |
| 8440 | } |
| 8441 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8442 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8443 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8444 | params = params_base + offset; |
| 8445 | |
| 8446 | glTexGenxv( |
| 8447 | (GLint)coord, |
| 8448 | (GLint)pname, |
| 8449 | (GLint *)params |
| 8450 | ); |
| 8451 | |
| 8452 | exit: |
| 8453 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8454 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8455 | _exception ? JNI_ABORT: 0); |
| 8456 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8457 | if (_exception) { |
| 8458 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8459 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8460 | } |
| 8461 | |
| 8462 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8463 | static void |
| 8464 | android_glTexGenxv__IILjava_nio_IntBuffer_2 |
| 8465 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8466 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8467 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8468 | "glTexGenxv"); |
| 8469 | return; |
| 8470 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8471 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8472 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8473 | jint _remaining; |
| 8474 | GLint *params = (GLint *) 0; |
| 8475 | |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8476 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8477 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8478 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8479 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8480 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8481 | glTexGenxv( |
| 8482 | (GLint)coord, |
| 8483 | (GLint)pname, |
| 8484 | (GLint *)params |
| 8485 | ); |
| 8486 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8487 | _env->ReleaseIntArrayElements(_array, (jint*)params, 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8488 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8489 | } |
| 8490 | |
| 8491 | static const char *classPathName = "com/google/android/gles_jni/GLImpl"; |
| 8492 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 8493 | static const JNINativeMethod methods[] = { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8494 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 8495 | {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, |
| 8496 | {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF }, |
| 8497 | {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II }, |
| 8498 | {"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, |
| 8499 | {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, |
| 8500 | {"glClear", "(I)V", (void *) android_glClear__I }, |
| 8501 | {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, |
| 8502 | {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII }, |
| 8503 | {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, |
| 8504 | {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I }, |
| 8505 | {"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, |
| 8506 | {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I }, |
| 8507 | {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF }, |
| 8508 | {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII }, |
| 8509 | {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, |
| 8510 | {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8511 | {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, |
| 8512 | {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8513 | {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, |
| 8514 | {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, |
| 8515 | {"glCullFace", "(I)V", (void *) android_glCullFace__I }, |
| 8516 | {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, |
| 8517 | {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, |
| 8518 | {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, |
| 8519 | {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, |
| 8520 | {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, |
| 8521 | {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II }, |
| 8522 | {"glDisable", "(I)V", (void *) android_glDisable__I }, |
| 8523 | {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I }, |
| 8524 | {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, |
| 8525 | {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, |
| 8526 | {"glEnable", "(I)V", (void *) android_glEnable__I }, |
| 8527 | {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I }, |
| 8528 | {"glFinish", "()V", (void *) android_glFinish__ }, |
| 8529 | {"glFlush", "()V", (void *) android_glFlush__ }, |
| 8530 | {"glFogf", "(IF)V", (void *) android_glFogf__IF }, |
| 8531 | {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI }, |
| 8532 | {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 }, |
| 8533 | {"glFogx", "(II)V", (void *) android_glFogx__II }, |
| 8534 | {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II }, |
| 8535 | {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 }, |
| 8536 | {"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, |
| 8537 | {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF }, |
| 8538 | {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII }, |
| 8539 | {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, |
| 8540 | {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, |
| 8541 | {"glGetError", "()I", (void *) android_glGetError__ }, |
| 8542 | {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, |
| 8543 | {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, |
| 8544 | {"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, |
| 8545 | {"glHint", "(II)V", (void *) android_glHint__II }, |
| 8546 | {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF }, |
| 8547 | {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI }, |
| 8548 | {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 }, |
| 8549 | {"glLightModelx", "(II)V", (void *) android_glLightModelx__II }, |
| 8550 | {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II }, |
| 8551 | {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 }, |
| 8552 | {"glLightf", "(IIF)V", (void *) android_glLightf__IIF }, |
| 8553 | {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI }, |
| 8554 | {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 }, |
| 8555 | {"glLightx", "(III)V", (void *) android_glLightx__III }, |
| 8556 | {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II }, |
| 8557 | {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 }, |
| 8558 | {"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, |
| 8559 | {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I }, |
| 8560 | {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ }, |
| 8561 | {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI }, |
| 8562 | {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 8563 | {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II }, |
| 8564 | {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 }, |
| 8565 | {"glLogicOp", "(I)V", (void *) android_glLogicOp__I }, |
| 8566 | {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF }, |
| 8567 | {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI }, |
| 8568 | {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 8569 | {"glMaterialx", "(III)V", (void *) android_glMaterialx__III }, |
| 8570 | {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II }, |
| 8571 | {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 8572 | {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I }, |
| 8573 | {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI }, |
| 8574 | {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 8575 | {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II }, |
| 8576 | {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 }, |
| 8577 | {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF }, |
| 8578 | {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII }, |
| 8579 | {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF }, |
| 8580 | {"glNormal3x", "(III)V", (void *) android_glNormal3x__III }, |
| 8581 | {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I }, |
| 8582 | {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF }, |
| 8583 | {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII }, |
| 8584 | {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, |
| 8585 | {"glPointSize", "(F)V", (void *) android_glPointSize__F }, |
| 8586 | {"glPointSizex", "(I)V", (void *) android_glPointSizex__I }, |
| 8587 | {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, |
| 8588 | {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II }, |
| 8589 | {"glPopMatrix", "()V", (void *) android_glPopMatrix__ }, |
| 8590 | {"glPushMatrix", "()V", (void *) android_glPushMatrix__ }, |
| 8591 | {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, |
| 8592 | {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF }, |
| 8593 | {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII }, |
| 8594 | {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, |
| 8595 | {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ }, |
| 8596 | {"glScalef", "(FFF)V", (void *) android_glScalef__FFF }, |
| 8597 | {"glScalex", "(III)V", (void *) android_glScalex__III }, |
| 8598 | {"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, |
| 8599 | {"glShadeModel", "(I)V", (void *) android_glShadeModel__I }, |
| 8600 | {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, |
| 8601 | {"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, |
| 8602 | {"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, |
| 8603 | {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8604 | {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF }, |
| 8605 | {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI }, |
| 8606 | {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 }, |
| 8607 | {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III }, |
| 8608 | {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II }, |
| 8609 | {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 8610 | {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8611 | {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, |
| 8612 | {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III }, |
| 8613 | {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 8614 | {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF }, |
| 8615 | {"glTranslatex", "(III)V", (void *) android_glTranslatex__III }, |
| 8616 | {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I }, |
| 8617 | {"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, |
| 8618 | {"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II }, |
| 8619 | {"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 8620 | {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, |
| 8621 | {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, |
| 8622 | {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, |
| 8623 | {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, |
| 8624 | {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 8625 | {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, |
| 8626 | {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 8627 | {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, |
| 8628 | {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, |
| 8629 | {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, |
| 8630 | {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, |
| 8631 | {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, |
| 8632 | {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, |
| 8633 | {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, |
| 8634 | {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, |
| 8635 | {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, |
| 8636 | {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, |
| 8637 | {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8638 | {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, |
| 8639 | {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 8640 | {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, |
| 8641 | {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 8642 | {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, |
| 8643 | {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, |
| 8644 | {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, |
| 8645 | {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, |
| 8646 | {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, |
| 8647 | {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, |
| 8648 | {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, |
| 8649 | {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, |
| 8650 | {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, |
| 8651 | {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 8652 | {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, |
| 8653 | {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 8654 | {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, |
| 8655 | {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 8656 | {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, |
| 8657 | {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 8658 | {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, |
| 8659 | {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 8660 | {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, |
| 8661 | {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8662 | {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, |
| 8663 | {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 8664 | {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, |
| 8665 | {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, |
| 8666 | {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, |
| 8667 | {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, |
| 8668 | {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, |
| 8669 | {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, |
| 8670 | {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, |
| 8671 | {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, |
| 8672 | {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, |
| 8673 | {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8674 | {"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8675 | {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, |
| 8676 | {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, |
| 8677 | {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, |
| 8678 | {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 8679 | {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, |
| 8680 | {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 8681 | {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, |
| 8682 | {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, |
| 8683 | {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 8684 | {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, |
| 8685 | {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 8686 | {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, |
| 8687 | {"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I }, |
| 8688 | {"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF }, |
| 8689 | {"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI }, |
| 8690 | {"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 }, |
| 8691 | {"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII }, |
| 8692 | {"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II }, |
| 8693 | {"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 }, |
| 8694 | {"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS }, |
| 8695 | {"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI }, |
| 8696 | {"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 }, |
| 8697 | {"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII }, |
| 8698 | {"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II }, |
| 8699 | {"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 }, |
| 8700 | {"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8701 | {"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8702 | {"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 8703 | {"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I }, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8704 | {"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII }, |
| 8705 | {"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II }, |
| 8706 | {"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II }, |
| 8707 | {"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, |
| 8708 | {"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, |
| 8709 | {"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, |
| 8710 | {"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I }, |
| 8711 | {"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II }, |
| 8712 | {"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8713 | {"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II }, |
| 8714 | {"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8715 | {"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII }, |
| 8716 | {"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII }, |
| 8717 | {"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I }, |
| 8718 | {"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II }, |
| 8719 | {"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8720 | {"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II }, |
| 8721 | {"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 8722 | {"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II }, |
| 8723 | {"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 }, |
| 8724 | {"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II }, |
| 8725 | {"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 }, |
| 8726 | {"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI }, |
| 8727 | {"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 8728 | {"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II }, |
| 8729 | {"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 8730 | {"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II }, |
| 8731 | {"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 8732 | {"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I }, |
| 8733 | {"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I }, |
| 8734 | {"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII }, |
| 8735 | {"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF }, |
| 8736 | {"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI }, |
| 8737 | {"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 8738 | {"glTexGeni", "(III)V", (void *) android_glTexGeni__III }, |
| 8739 | {"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II }, |
| 8740 | {"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 8741 | {"glTexGenx", "(III)V", (void *) android_glTexGenx__III }, |
| 8742 | {"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II }, |
| 8743 | {"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 8744 | }; |
| 8745 | |
| 8746 | int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env) |
| 8747 | { |
| 8748 | int err; |
| 8749 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 8750 | return err; |
| 8751 | } |