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) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 423 | jint _exception = 0; |
| 424 | const char * _exceptionType = NULL; |
| 425 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 426 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 427 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 428 | jint _remaining; |
| 429 | GLvoid *pointer = (GLvoid *) 0; |
| 430 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 431 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 432 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 433 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 434 | return; |
| 435 | } |
| 436 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 437 | glColorPointerBounds( |
| 438 | (GLint)size, |
| 439 | (GLenum)type, |
| 440 | (GLsizei)stride, |
| 441 | (GLvoid *)pointer, |
| 442 | (GLsizei)remaining |
| 443 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 444 | if (_exception) { |
| 445 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 446 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | } |
| 448 | |
| 449 | /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 450 | static void |
| 451 | android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 |
| 452 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 453 | jint _exception = 0; |
| 454 | const char * _exceptionType = NULL; |
| 455 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 456 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 457 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 458 | jint _remaining; |
| 459 | GLvoid *data = (GLvoid *) 0; |
| 460 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 461 | if (!data_buf) { |
| 462 | _exception = 1; |
| 463 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 464 | _exceptionMessage = "data == null"; |
| 465 | goto exit; |
| 466 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 467 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 468 | if (data == NULL) { |
| 469 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 470 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 471 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 472 | glCompressedTexImage2D( |
| 473 | (GLenum)target, |
| 474 | (GLint)level, |
| 475 | (GLenum)internalformat, |
| 476 | (GLsizei)width, |
| 477 | (GLsizei)height, |
| 478 | (GLint)border, |
| 479 | (GLsizei)imageSize, |
| 480 | (GLvoid *)data |
| 481 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 482 | |
| 483 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 484 | if (_array) { |
| 485 | releasePointer(_env, _array, data, JNI_FALSE); |
| 486 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 487 | if (_exception) { |
| 488 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 489 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 490 | } |
| 491 | |
| 492 | /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 493 | static void |
| 494 | android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 495 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 496 | jint _exception = 0; |
| 497 | const char * _exceptionType = NULL; |
| 498 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 499 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 500 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 501 | jint _remaining; |
| 502 | GLvoid *data = (GLvoid *) 0; |
| 503 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 504 | if (!data_buf) { |
| 505 | _exception = 1; |
| 506 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 507 | _exceptionMessage = "data == null"; |
| 508 | goto exit; |
| 509 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 510 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 511 | if (data == NULL) { |
| 512 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 513 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 514 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 515 | glCompressedTexSubImage2D( |
| 516 | (GLenum)target, |
| 517 | (GLint)level, |
| 518 | (GLint)xoffset, |
| 519 | (GLint)yoffset, |
| 520 | (GLsizei)width, |
| 521 | (GLsizei)height, |
| 522 | (GLenum)format, |
| 523 | (GLsizei)imageSize, |
| 524 | (GLvoid *)data |
| 525 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 526 | |
| 527 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 528 | if (_array) { |
| 529 | releasePointer(_env, _array, data, JNI_FALSE); |
| 530 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 531 | if (_exception) { |
| 532 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 533 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ |
| 537 | static void |
| 538 | android_glCopyTexImage2D__IIIIIIII |
| 539 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { |
| 540 | glCopyTexImage2D( |
| 541 | (GLenum)target, |
| 542 | (GLint)level, |
| 543 | (GLenum)internalformat, |
| 544 | (GLint)x, |
| 545 | (GLint)y, |
| 546 | (GLsizei)width, |
| 547 | (GLsizei)height, |
| 548 | (GLint)border |
| 549 | ); |
| 550 | } |
| 551 | |
| 552 | /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 553 | static void |
| 554 | android_glCopyTexSubImage2D__IIIIIIII |
| 555 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { |
| 556 | glCopyTexSubImage2D( |
| 557 | (GLenum)target, |
| 558 | (GLint)level, |
| 559 | (GLint)xoffset, |
| 560 | (GLint)yoffset, |
| 561 | (GLint)x, |
| 562 | (GLint)y, |
| 563 | (GLsizei)width, |
| 564 | (GLsizei)height |
| 565 | ); |
| 566 | } |
| 567 | |
| 568 | /* void glCullFace ( GLenum mode ) */ |
| 569 | static void |
| 570 | android_glCullFace__I |
| 571 | (JNIEnv *_env, jobject _this, jint mode) { |
| 572 | glCullFace( |
| 573 | (GLenum)mode |
| 574 | ); |
| 575 | } |
| 576 | |
| 577 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 578 | static void |
| 579 | android_glDeleteTextures__I_3II |
| 580 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 581 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 582 | const char * _exceptionType = NULL; |
| 583 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 584 | GLuint *textures_base = (GLuint *) 0; |
| 585 | jint _remaining; |
| 586 | GLuint *textures = (GLuint *) 0; |
| 587 | |
| 588 | if (!textures_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 589 | _exception = 1; |
| 590 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 591 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 592 | goto exit; |
| 593 | } |
| 594 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 595 | _exception = 1; |
| 596 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 597 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 598 | goto exit; |
| 599 | } |
| 600 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 601 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 602 | _exception = 1; |
| 603 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 604 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | goto exit; |
| 606 | } |
| 607 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 608 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | textures = textures_base + offset; |
| 610 | |
| 611 | glDeleteTextures( |
| 612 | (GLsizei)n, |
| 613 | (GLuint *)textures |
| 614 | ); |
| 615 | |
| 616 | exit: |
| 617 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 618 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 619 | JNI_ABORT); |
| 620 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 621 | if (_exception) { |
| 622 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 623 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 624 | } |
| 625 | |
| 626 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 627 | static void |
| 628 | android_glDeleteTextures__ILjava_nio_IntBuffer_2 |
| 629 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 630 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 631 | const char * _exceptionType = NULL; |
| 632 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 633 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 634 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 635 | jint _remaining; |
| 636 | GLuint *textures = (GLuint *) 0; |
| 637 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 638 | if (!textures_buf) { |
| 639 | _exception = 1; |
| 640 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 641 | _exceptionMessage = "textures == null"; |
| 642 | goto exit; |
| 643 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 644 | 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] | 645 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 646 | _exception = 1; |
| 647 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 648 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 649 | goto exit; |
| 650 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 651 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 652 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 653 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 654 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 655 | glDeleteTextures( |
| 656 | (GLsizei)n, |
| 657 | (GLuint *)textures |
| 658 | ); |
| 659 | |
| 660 | exit: |
| 661 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 662 | _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 663 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 664 | if (_exception) { |
| 665 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 666 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 667 | } |
| 668 | |
| 669 | /* void glDepthFunc ( GLenum func ) */ |
| 670 | static void |
| 671 | android_glDepthFunc__I |
| 672 | (JNIEnv *_env, jobject _this, jint func) { |
| 673 | glDepthFunc( |
| 674 | (GLenum)func |
| 675 | ); |
| 676 | } |
| 677 | |
| 678 | /* void glDepthMask ( GLboolean flag ) */ |
| 679 | static void |
| 680 | android_glDepthMask__Z |
| 681 | (JNIEnv *_env, jobject _this, jboolean flag) { |
| 682 | glDepthMask( |
| 683 | (GLboolean)flag |
| 684 | ); |
| 685 | } |
| 686 | |
| 687 | /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ |
| 688 | static void |
| 689 | android_glDepthRangef__FF |
| 690 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
| 691 | glDepthRangef( |
| 692 | (GLclampf)zNear, |
| 693 | (GLclampf)zFar |
| 694 | ); |
| 695 | } |
| 696 | |
| 697 | /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */ |
| 698 | static void |
| 699 | android_glDepthRangex__II |
| 700 | (JNIEnv *_env, jobject _this, jint zNear, jint zFar) { |
| 701 | glDepthRangex( |
| 702 | (GLclampx)zNear, |
| 703 | (GLclampx)zFar |
| 704 | ); |
| 705 | } |
| 706 | |
| 707 | /* void glDisable ( GLenum cap ) */ |
| 708 | static void |
| 709 | android_glDisable__I |
| 710 | (JNIEnv *_env, jobject _this, jint cap) { |
| 711 | glDisable( |
| 712 | (GLenum)cap |
| 713 | ); |
| 714 | } |
| 715 | |
| 716 | /* void glDisableClientState ( GLenum array ) */ |
| 717 | static void |
| 718 | android_glDisableClientState__I |
| 719 | (JNIEnv *_env, jobject _this, jint array) { |
| 720 | glDisableClientState( |
| 721 | (GLenum)array |
| 722 | ); |
| 723 | } |
| 724 | |
| 725 | /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ |
| 726 | static void |
| 727 | android_glDrawArrays__III |
| 728 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { |
| 729 | glDrawArrays( |
| 730 | (GLenum)mode, |
| 731 | (GLint)first, |
| 732 | (GLsizei)count |
| 733 | ); |
| 734 | } |
| 735 | |
| 736 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 737 | static void |
| 738 | android_glDrawElements__IIILjava_nio_Buffer_2 |
| 739 | (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] | 740 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 741 | const char * _exceptionType = NULL; |
| 742 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 743 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 744 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 745 | jint _remaining; |
| 746 | GLvoid *indices = (GLvoid *) 0; |
| 747 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 748 | if (!indices_buf) { |
| 749 | _exception = 1; |
| 750 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 751 | _exceptionMessage = "indices == null"; |
| 752 | goto exit; |
| 753 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 754 | 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] | 755 | if (_remaining < count) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 756 | _exception = 1; |
| 757 | _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; |
| 758 | _exceptionMessage = "remaining() < count < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 759 | goto exit; |
| 760 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 761 | if (indices == NULL) { |
| 762 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 763 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 764 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 765 | glDrawElements( |
| 766 | (GLenum)mode, |
| 767 | (GLsizei)count, |
| 768 | (GLenum)type, |
| 769 | (GLvoid *)indices |
| 770 | ); |
| 771 | |
| 772 | exit: |
| 773 | if (_array) { |
| 774 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 775 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 776 | if (_exception) { |
| 777 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 778 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 779 | } |
| 780 | |
| 781 | /* void glEnable ( GLenum cap ) */ |
| 782 | static void |
| 783 | android_glEnable__I |
| 784 | (JNIEnv *_env, jobject _this, jint cap) { |
| 785 | glEnable( |
| 786 | (GLenum)cap |
| 787 | ); |
| 788 | } |
| 789 | |
| 790 | /* void glEnableClientState ( GLenum array ) */ |
| 791 | static void |
| 792 | android_glEnableClientState__I |
| 793 | (JNIEnv *_env, jobject _this, jint array) { |
| 794 | glEnableClientState( |
| 795 | (GLenum)array |
| 796 | ); |
| 797 | } |
| 798 | |
| 799 | /* void glFinish ( void ) */ |
| 800 | static void |
| 801 | android_glFinish__ |
| 802 | (JNIEnv *_env, jobject _this) { |
| 803 | glFinish(); |
| 804 | } |
| 805 | |
| 806 | /* void glFlush ( void ) */ |
| 807 | static void |
| 808 | android_glFlush__ |
| 809 | (JNIEnv *_env, jobject _this) { |
| 810 | glFlush(); |
| 811 | } |
| 812 | |
| 813 | /* void glFogf ( GLenum pname, GLfloat param ) */ |
| 814 | static void |
| 815 | android_glFogf__IF |
| 816 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 817 | glFogf( |
| 818 | (GLenum)pname, |
| 819 | (GLfloat)param |
| 820 | ); |
| 821 | } |
| 822 | |
| 823 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 824 | static void |
| 825 | android_glFogfv__I_3FI |
| 826 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 827 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 828 | const char * _exceptionType = NULL; |
| 829 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 830 | GLfloat *params_base = (GLfloat *) 0; |
| 831 | jint _remaining; |
| 832 | GLfloat *params = (GLfloat *) 0; |
| 833 | |
| 834 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 835 | _exception = 1; |
| 836 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 837 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 838 | goto exit; |
| 839 | } |
| 840 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 841 | _exception = 1; |
| 842 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 843 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 844 | goto exit; |
| 845 | } |
| 846 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 847 | int _needed; |
| 848 | switch (pname) { |
| 849 | #if defined(GL_FOG_MODE) |
| 850 | case GL_FOG_MODE: |
| 851 | #endif // defined(GL_FOG_MODE) |
| 852 | #if defined(GL_FOG_DENSITY) |
| 853 | case GL_FOG_DENSITY: |
| 854 | #endif // defined(GL_FOG_DENSITY) |
| 855 | #if defined(GL_FOG_START) |
| 856 | case GL_FOG_START: |
| 857 | #endif // defined(GL_FOG_START) |
| 858 | #if defined(GL_FOG_END) |
| 859 | case GL_FOG_END: |
| 860 | #endif // defined(GL_FOG_END) |
| 861 | _needed = 1; |
| 862 | break; |
| 863 | #if defined(GL_FOG_COLOR) |
| 864 | case GL_FOG_COLOR: |
| 865 | #endif // defined(GL_FOG_COLOR) |
| 866 | _needed = 4; |
| 867 | break; |
| 868 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 869 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 870 | break; |
| 871 | } |
| 872 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 873 | _exception = 1; |
| 874 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 875 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 876 | goto exit; |
| 877 | } |
| 878 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 879 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 880 | params = params_base + offset; |
| 881 | |
| 882 | glFogfv( |
| 883 | (GLenum)pname, |
| 884 | (GLfloat *)params |
| 885 | ); |
| 886 | |
| 887 | exit: |
| 888 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 889 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 890 | JNI_ABORT); |
| 891 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 892 | if (_exception) { |
| 893 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 894 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 895 | } |
| 896 | |
| 897 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 898 | static void |
| 899 | android_glFogfv__ILjava_nio_FloatBuffer_2 |
| 900 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 901 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 902 | const char * _exceptionType = NULL; |
| 903 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 904 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 905 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 906 | jint _remaining; |
| 907 | GLfloat *params = (GLfloat *) 0; |
| 908 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 909 | if (!params_buf) { |
| 910 | _exception = 1; |
| 911 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 912 | _exceptionMessage = "params == null"; |
| 913 | goto exit; |
| 914 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 915 | 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] | 916 | int _needed; |
| 917 | switch (pname) { |
| 918 | #if defined(GL_FOG_MODE) |
| 919 | case GL_FOG_MODE: |
| 920 | #endif // defined(GL_FOG_MODE) |
| 921 | #if defined(GL_FOG_DENSITY) |
| 922 | case GL_FOG_DENSITY: |
| 923 | #endif // defined(GL_FOG_DENSITY) |
| 924 | #if defined(GL_FOG_START) |
| 925 | case GL_FOG_START: |
| 926 | #endif // defined(GL_FOG_START) |
| 927 | #if defined(GL_FOG_END) |
| 928 | case GL_FOG_END: |
| 929 | #endif // defined(GL_FOG_END) |
| 930 | _needed = 1; |
| 931 | break; |
| 932 | #if defined(GL_FOG_COLOR) |
| 933 | case GL_FOG_COLOR: |
| 934 | #endif // defined(GL_FOG_COLOR) |
| 935 | _needed = 4; |
| 936 | break; |
| 937 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 938 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 939 | break; |
| 940 | } |
| 941 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 942 | _exception = 1; |
| 943 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 944 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 945 | goto exit; |
| 946 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 947 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 948 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 949 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 950 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 951 | glFogfv( |
| 952 | (GLenum)pname, |
| 953 | (GLfloat *)params |
| 954 | ); |
| 955 | |
| 956 | exit: |
| 957 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 958 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 959 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 960 | if (_exception) { |
| 961 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 962 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 963 | } |
| 964 | |
| 965 | /* void glFogx ( GLenum pname, GLfixed param ) */ |
| 966 | static void |
| 967 | android_glFogx__II |
| 968 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 969 | glFogx( |
| 970 | (GLenum)pname, |
| 971 | (GLfixed)param |
| 972 | ); |
| 973 | } |
| 974 | |
| 975 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 976 | static void |
| 977 | android_glFogxv__I_3II |
| 978 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 979 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 980 | const char * _exceptionType = NULL; |
| 981 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 982 | GLfixed *params_base = (GLfixed *) 0; |
| 983 | jint _remaining; |
| 984 | GLfixed *params = (GLfixed *) 0; |
| 985 | |
| 986 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 987 | _exception = 1; |
| 988 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 989 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 990 | goto exit; |
| 991 | } |
| 992 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 993 | _exception = 1; |
| 994 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 995 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 996 | goto exit; |
| 997 | } |
| 998 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 999 | int _needed; |
| 1000 | switch (pname) { |
| 1001 | #if defined(GL_FOG_MODE) |
| 1002 | case GL_FOG_MODE: |
| 1003 | #endif // defined(GL_FOG_MODE) |
| 1004 | #if defined(GL_FOG_DENSITY) |
| 1005 | case GL_FOG_DENSITY: |
| 1006 | #endif // defined(GL_FOG_DENSITY) |
| 1007 | #if defined(GL_FOG_START) |
| 1008 | case GL_FOG_START: |
| 1009 | #endif // defined(GL_FOG_START) |
| 1010 | #if defined(GL_FOG_END) |
| 1011 | case GL_FOG_END: |
| 1012 | #endif // defined(GL_FOG_END) |
| 1013 | _needed = 1; |
| 1014 | break; |
| 1015 | #if defined(GL_FOG_COLOR) |
| 1016 | case GL_FOG_COLOR: |
| 1017 | #endif // defined(GL_FOG_COLOR) |
| 1018 | _needed = 4; |
| 1019 | break; |
| 1020 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1021 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1022 | break; |
| 1023 | } |
| 1024 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1025 | _exception = 1; |
| 1026 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1027 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1028 | goto exit; |
| 1029 | } |
| 1030 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1031 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1032 | params = params_base + offset; |
| 1033 | |
| 1034 | glFogxv( |
| 1035 | (GLenum)pname, |
| 1036 | (GLfixed *)params |
| 1037 | ); |
| 1038 | |
| 1039 | exit: |
| 1040 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1041 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1042 | JNI_ABORT); |
| 1043 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1044 | if (_exception) { |
| 1045 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1046 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1047 | } |
| 1048 | |
| 1049 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 1050 | static void |
| 1051 | android_glFogxv__ILjava_nio_IntBuffer_2 |
| 1052 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1053 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1054 | const char * _exceptionType = NULL; |
| 1055 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1056 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1057 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1058 | jint _remaining; |
| 1059 | GLfixed *params = (GLfixed *) 0; |
| 1060 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 1061 | if (!params_buf) { |
| 1062 | _exception = 1; |
| 1063 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1064 | _exceptionMessage = "params == null"; |
| 1065 | goto exit; |
| 1066 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1067 | 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] | 1068 | int _needed; |
| 1069 | switch (pname) { |
| 1070 | #if defined(GL_FOG_MODE) |
| 1071 | case GL_FOG_MODE: |
| 1072 | #endif // defined(GL_FOG_MODE) |
| 1073 | #if defined(GL_FOG_DENSITY) |
| 1074 | case GL_FOG_DENSITY: |
| 1075 | #endif // defined(GL_FOG_DENSITY) |
| 1076 | #if defined(GL_FOG_START) |
| 1077 | case GL_FOG_START: |
| 1078 | #endif // defined(GL_FOG_START) |
| 1079 | #if defined(GL_FOG_END) |
| 1080 | case GL_FOG_END: |
| 1081 | #endif // defined(GL_FOG_END) |
| 1082 | _needed = 1; |
| 1083 | break; |
| 1084 | #if defined(GL_FOG_COLOR) |
| 1085 | case GL_FOG_COLOR: |
| 1086 | #endif // defined(GL_FOG_COLOR) |
| 1087 | _needed = 4; |
| 1088 | break; |
| 1089 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1090 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1091 | break; |
| 1092 | } |
| 1093 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1094 | _exception = 1; |
| 1095 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1096 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1097 | goto exit; |
| 1098 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1099 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1100 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1101 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1102 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1103 | glFogxv( |
| 1104 | (GLenum)pname, |
| 1105 | (GLfixed *)params |
| 1106 | ); |
| 1107 | |
| 1108 | exit: |
| 1109 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1110 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1111 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1112 | if (_exception) { |
| 1113 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1114 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1115 | } |
| 1116 | |
| 1117 | /* void glFrontFace ( GLenum mode ) */ |
| 1118 | static void |
| 1119 | android_glFrontFace__I |
| 1120 | (JNIEnv *_env, jobject _this, jint mode) { |
| 1121 | glFrontFace( |
| 1122 | (GLenum)mode |
| 1123 | ); |
| 1124 | } |
| 1125 | |
| 1126 | /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 1127 | static void |
| 1128 | android_glFrustumf__FFFFFF |
| 1129 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 1130 | glFrustumf( |
| 1131 | (GLfloat)left, |
| 1132 | (GLfloat)right, |
| 1133 | (GLfloat)bottom, |
| 1134 | (GLfloat)top, |
| 1135 | (GLfloat)zNear, |
| 1136 | (GLfloat)zFar |
| 1137 | ); |
| 1138 | } |
| 1139 | |
| 1140 | /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 1141 | static void |
| 1142 | android_glFrustumx__IIIIII |
| 1143 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 1144 | glFrustumx( |
| 1145 | (GLfixed)left, |
| 1146 | (GLfixed)right, |
| 1147 | (GLfixed)bottom, |
| 1148 | (GLfixed)top, |
| 1149 | (GLfixed)zNear, |
| 1150 | (GLfixed)zFar |
| 1151 | ); |
| 1152 | } |
| 1153 | |
| 1154 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1155 | static void |
| 1156 | android_glGenTextures__I_3II |
| 1157 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 1158 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1159 | const char * _exceptionType = NULL; |
| 1160 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1161 | GLuint *textures_base = (GLuint *) 0; |
| 1162 | jint _remaining; |
| 1163 | GLuint *textures = (GLuint *) 0; |
| 1164 | |
| 1165 | if (!textures_ref) { |
| 1166 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1167 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1168 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1169 | goto exit; |
| 1170 | } |
| 1171 | if (offset < 0) { |
| 1172 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1173 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1174 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1175 | goto exit; |
| 1176 | } |
| 1177 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 1178 | if (_remaining < n) { |
| 1179 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1180 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1181 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1182 | goto exit; |
| 1183 | } |
| 1184 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1185 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1186 | textures = textures_base + offset; |
| 1187 | |
| 1188 | glGenTextures( |
| 1189 | (GLsizei)n, |
| 1190 | (GLuint *)textures |
| 1191 | ); |
| 1192 | |
| 1193 | exit: |
| 1194 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1195 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1196 | _exception ? JNI_ABORT: 0); |
| 1197 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1198 | if (_exception) { |
| 1199 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1200 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1201 | } |
| 1202 | |
| 1203 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1204 | static void |
| 1205 | android_glGenTextures__ILjava_nio_IntBuffer_2 |
| 1206 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 1207 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1208 | const char * _exceptionType = NULL; |
| 1209 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1210 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1211 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1212 | jint _remaining; |
| 1213 | GLuint *textures = (GLuint *) 0; |
| 1214 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 1215 | if (!textures_buf) { |
| 1216 | _exception = 1; |
| 1217 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1218 | _exceptionMessage = "textures == null"; |
| 1219 | goto exit; |
| 1220 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1221 | 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] | 1222 | if (_remaining < n) { |
| 1223 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1224 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1225 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1226 | goto exit; |
| 1227 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1228 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1229 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1230 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 1231 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1232 | glGenTextures( |
| 1233 | (GLsizei)n, |
| 1234 | (GLuint *)textures |
| 1235 | ); |
| 1236 | |
| 1237 | exit: |
| 1238 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1239 | _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1240 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1241 | if (_exception) { |
| 1242 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1243 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1244 | } |
| 1245 | |
| 1246 | /* GLenum glGetError ( void ) */ |
| 1247 | static jint |
| 1248 | android_glGetError__ |
| 1249 | (JNIEnv *_env, jobject _this) { |
| 1250 | GLenum _returnValue; |
| 1251 | _returnValue = glGetError(); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 1252 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1253 | } |
| 1254 | |
| 1255 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1256 | static void |
| 1257 | android_glGetIntegerv__I_3II |
| 1258 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 1259 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1260 | const char * _exceptionType = NULL; |
| 1261 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1262 | GLint *params_base = (GLint *) 0; |
| 1263 | jint _remaining; |
| 1264 | GLint *params = (GLint *) 0; |
| 1265 | |
| 1266 | if (!params_ref) { |
| 1267 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1268 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1269 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1270 | goto exit; |
| 1271 | } |
| 1272 | if (offset < 0) { |
| 1273 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1274 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1275 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1276 | goto exit; |
| 1277 | } |
| 1278 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1279 | int _needed; |
| 1280 | switch (pname) { |
| 1281 | #if defined(GL_ALPHA_BITS) |
| 1282 | case GL_ALPHA_BITS: |
| 1283 | #endif // defined(GL_ALPHA_BITS) |
| 1284 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1285 | case GL_ALPHA_TEST_FUNC: |
| 1286 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1287 | #if defined(GL_ALPHA_TEST_REF) |
| 1288 | case GL_ALPHA_TEST_REF: |
| 1289 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1290 | #if defined(GL_BLEND_DST) |
| 1291 | case GL_BLEND_DST: |
| 1292 | #endif // defined(GL_BLEND_DST) |
| 1293 | #if defined(GL_BLUE_BITS) |
| 1294 | case GL_BLUE_BITS: |
| 1295 | #endif // defined(GL_BLUE_BITS) |
| 1296 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1297 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1298 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1299 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1300 | case GL_COLOR_ARRAY_SIZE: |
| 1301 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1302 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1303 | case GL_COLOR_ARRAY_STRIDE: |
| 1304 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1305 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1306 | case GL_COLOR_ARRAY_TYPE: |
| 1307 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1308 | #if defined(GL_CULL_FACE) |
| 1309 | case GL_CULL_FACE: |
| 1310 | #endif // defined(GL_CULL_FACE) |
| 1311 | #if defined(GL_DEPTH_BITS) |
| 1312 | case GL_DEPTH_BITS: |
| 1313 | #endif // defined(GL_DEPTH_BITS) |
| 1314 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1315 | case GL_DEPTH_CLEAR_VALUE: |
| 1316 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1317 | #if defined(GL_DEPTH_FUNC) |
| 1318 | case GL_DEPTH_FUNC: |
| 1319 | #endif // defined(GL_DEPTH_FUNC) |
| 1320 | #if defined(GL_DEPTH_WRITEMASK) |
| 1321 | case GL_DEPTH_WRITEMASK: |
| 1322 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1323 | #if defined(GL_FOG_DENSITY) |
| 1324 | case GL_FOG_DENSITY: |
| 1325 | #endif // defined(GL_FOG_DENSITY) |
| 1326 | #if defined(GL_FOG_END) |
| 1327 | case GL_FOG_END: |
| 1328 | #endif // defined(GL_FOG_END) |
| 1329 | #if defined(GL_FOG_MODE) |
| 1330 | case GL_FOG_MODE: |
| 1331 | #endif // defined(GL_FOG_MODE) |
| 1332 | #if defined(GL_FOG_START) |
| 1333 | case GL_FOG_START: |
| 1334 | #endif // defined(GL_FOG_START) |
| 1335 | #if defined(GL_FRONT_FACE) |
| 1336 | case GL_FRONT_FACE: |
| 1337 | #endif // defined(GL_FRONT_FACE) |
| 1338 | #if defined(GL_GREEN_BITS) |
| 1339 | case GL_GREEN_BITS: |
| 1340 | #endif // defined(GL_GREEN_BITS) |
| 1341 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1342 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1343 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1344 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1345 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1346 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1347 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1348 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1349 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1350 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1351 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1352 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1353 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1354 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1355 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1356 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1357 | case GL_LINE_SMOOTH_HINT: |
| 1358 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1359 | #if defined(GL_LINE_WIDTH) |
| 1360 | case GL_LINE_WIDTH: |
| 1361 | #endif // defined(GL_LINE_WIDTH) |
| 1362 | #if defined(GL_LOGIC_OP_MODE) |
| 1363 | case GL_LOGIC_OP_MODE: |
| 1364 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1365 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1366 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1367 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1368 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1369 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1370 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1371 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1372 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1373 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1374 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1375 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1376 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1377 | #if defined(GL_MATRIX_MODE) |
| 1378 | case GL_MATRIX_MODE: |
| 1379 | #endif // defined(GL_MATRIX_MODE) |
| 1380 | #if defined(GL_MAX_CLIP_PLANES) |
| 1381 | case GL_MAX_CLIP_PLANES: |
| 1382 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1383 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1384 | case GL_MAX_ELEMENTS_INDICES: |
| 1385 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1386 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1387 | case GL_MAX_ELEMENTS_VERTICES: |
| 1388 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1389 | #if defined(GL_MAX_LIGHTS) |
| 1390 | case GL_MAX_LIGHTS: |
| 1391 | #endif // defined(GL_MAX_LIGHTS) |
| 1392 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1393 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1394 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1395 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1396 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1397 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1398 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1399 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1400 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1401 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1402 | case GL_MAX_TEXTURE_SIZE: |
| 1403 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1404 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1405 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1406 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1407 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1408 | case GL_MAX_TEXTURE_UNITS: |
| 1409 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1410 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1411 | case GL_MAX_VERTEX_UNITS_OES: |
| 1412 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1413 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1414 | case GL_MODELVIEW_STACK_DEPTH: |
| 1415 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1416 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1417 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1418 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1419 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1420 | case GL_NORMAL_ARRAY_STRIDE: |
| 1421 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1422 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1423 | case GL_NORMAL_ARRAY_TYPE: |
| 1424 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1425 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1426 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1427 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1428 | #if defined(GL_PACK_ALIGNMENT) |
| 1429 | case GL_PACK_ALIGNMENT: |
| 1430 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1431 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1432 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1433 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1434 | #if defined(GL_POINT_SIZE) |
| 1435 | case GL_POINT_SIZE: |
| 1436 | #endif // defined(GL_POINT_SIZE) |
| 1437 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1438 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1439 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1440 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1441 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1442 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1443 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1444 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1445 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1446 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1447 | case GL_POINT_SMOOTH_HINT: |
| 1448 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1449 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1450 | case GL_POLYGON_OFFSET_FACTOR: |
| 1451 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1452 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1453 | case GL_POLYGON_OFFSET_UNITS: |
| 1454 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1455 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1456 | case GL_PROJECTION_STACK_DEPTH: |
| 1457 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1458 | #if defined(GL_RED_BITS) |
| 1459 | case GL_RED_BITS: |
| 1460 | #endif // defined(GL_RED_BITS) |
| 1461 | #if defined(GL_SHADE_MODEL) |
| 1462 | case GL_SHADE_MODEL: |
| 1463 | #endif // defined(GL_SHADE_MODEL) |
| 1464 | #if defined(GL_STENCIL_BITS) |
| 1465 | case GL_STENCIL_BITS: |
| 1466 | #endif // defined(GL_STENCIL_BITS) |
| 1467 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1468 | case GL_STENCIL_CLEAR_VALUE: |
| 1469 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1470 | #if defined(GL_STENCIL_FAIL) |
| 1471 | case GL_STENCIL_FAIL: |
| 1472 | #endif // defined(GL_STENCIL_FAIL) |
| 1473 | #if defined(GL_STENCIL_FUNC) |
| 1474 | case GL_STENCIL_FUNC: |
| 1475 | #endif // defined(GL_STENCIL_FUNC) |
| 1476 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1477 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1478 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1479 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1480 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1481 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1482 | #if defined(GL_STENCIL_REF) |
| 1483 | case GL_STENCIL_REF: |
| 1484 | #endif // defined(GL_STENCIL_REF) |
| 1485 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1486 | case GL_STENCIL_VALUE_MASK: |
| 1487 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1488 | #if defined(GL_STENCIL_WRITEMASK) |
| 1489 | case GL_STENCIL_WRITEMASK: |
| 1490 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1491 | #if defined(GL_SUBPIXEL_BITS) |
| 1492 | case GL_SUBPIXEL_BITS: |
| 1493 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1494 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1495 | case GL_TEXTURE_BINDING_2D: |
| 1496 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1497 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1498 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1499 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1500 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1501 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1502 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1503 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1504 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1505 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1506 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1507 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1508 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1509 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1510 | case GL_TEXTURE_STACK_DEPTH: |
| 1511 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1512 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1513 | case GL_UNPACK_ALIGNMENT: |
| 1514 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1515 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1516 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1517 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1518 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1519 | case GL_VERTEX_ARRAY_SIZE: |
| 1520 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1521 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1522 | case GL_VERTEX_ARRAY_STRIDE: |
| 1523 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1524 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1525 | case GL_VERTEX_ARRAY_TYPE: |
| 1526 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1527 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1528 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1529 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1530 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1531 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1532 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1533 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1534 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1535 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1536 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1537 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1538 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1539 | _needed = 1; |
| 1540 | break; |
| 1541 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1542 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1543 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1544 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1545 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1546 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1547 | #if defined(GL_DEPTH_RANGE) |
| 1548 | case GL_DEPTH_RANGE: |
| 1549 | #endif // defined(GL_DEPTH_RANGE) |
| 1550 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1551 | case GL_MAX_VIEWPORT_DIMS: |
| 1552 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1553 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1554 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1555 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1556 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1557 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1558 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1559 | _needed = 2; |
| 1560 | break; |
| 1561 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1562 | case GL_COLOR_CLEAR_VALUE: |
| 1563 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1564 | #if defined(GL_COLOR_WRITEMASK) |
| 1565 | case GL_COLOR_WRITEMASK: |
| 1566 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1567 | #if defined(GL_FOG_COLOR) |
| 1568 | case GL_FOG_COLOR: |
| 1569 | #endif // defined(GL_FOG_COLOR) |
| 1570 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1571 | case GL_LIGHT_MODEL_AMBIENT: |
| 1572 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1573 | #if defined(GL_SCISSOR_BOX) |
| 1574 | case GL_SCISSOR_BOX: |
| 1575 | #endif // defined(GL_SCISSOR_BOX) |
| 1576 | #if defined(GL_VIEWPORT) |
| 1577 | case GL_VIEWPORT: |
| 1578 | #endif // defined(GL_VIEWPORT) |
| 1579 | _needed = 4; |
| 1580 | break; |
| 1581 | #if defined(GL_MODELVIEW_MATRIX) |
| 1582 | case GL_MODELVIEW_MATRIX: |
| 1583 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1584 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1585 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1586 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1587 | #if defined(GL_PROJECTION_MATRIX) |
| 1588 | case GL_PROJECTION_MATRIX: |
| 1589 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1590 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1591 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1592 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1593 | #if defined(GL_TEXTURE_MATRIX) |
| 1594 | case GL_TEXTURE_MATRIX: |
| 1595 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1596 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1597 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1598 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1599 | _needed = 16; |
| 1600 | break; |
| 1601 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1602 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1603 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1604 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1605 | break; |
| 1606 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1607 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1608 | break; |
| 1609 | } |
| 1610 | if (_remaining < _needed) { |
| 1611 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1612 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1613 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1614 | goto exit; |
| 1615 | } |
| 1616 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1617 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1618 | params = params_base + offset; |
| 1619 | |
| 1620 | glGetIntegerv( |
| 1621 | (GLenum)pname, |
| 1622 | (GLint *)params |
| 1623 | ); |
| 1624 | |
| 1625 | exit: |
| 1626 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1627 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1628 | _exception ? JNI_ABORT: 0); |
| 1629 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1630 | if (_exception) { |
| 1631 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1632 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1633 | } |
| 1634 | |
| 1635 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1636 | static void |
| 1637 | android_glGetIntegerv__ILjava_nio_IntBuffer_2 |
| 1638 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1639 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1640 | const char * _exceptionType = NULL; |
| 1641 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1642 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1643 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1644 | jint _remaining; |
| 1645 | GLint *params = (GLint *) 0; |
| 1646 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 1647 | if (!params_buf) { |
| 1648 | _exception = 1; |
| 1649 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1650 | _exceptionMessage = "params == null"; |
| 1651 | goto exit; |
| 1652 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1653 | 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] | 1654 | int _needed; |
| 1655 | switch (pname) { |
| 1656 | #if defined(GL_ALPHA_BITS) |
| 1657 | case GL_ALPHA_BITS: |
| 1658 | #endif // defined(GL_ALPHA_BITS) |
| 1659 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1660 | case GL_ALPHA_TEST_FUNC: |
| 1661 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1662 | #if defined(GL_ALPHA_TEST_REF) |
| 1663 | case GL_ALPHA_TEST_REF: |
| 1664 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1665 | #if defined(GL_BLEND_DST) |
| 1666 | case GL_BLEND_DST: |
| 1667 | #endif // defined(GL_BLEND_DST) |
| 1668 | #if defined(GL_BLUE_BITS) |
| 1669 | case GL_BLUE_BITS: |
| 1670 | #endif // defined(GL_BLUE_BITS) |
| 1671 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1672 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1673 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1674 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1675 | case GL_COLOR_ARRAY_SIZE: |
| 1676 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1677 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1678 | case GL_COLOR_ARRAY_STRIDE: |
| 1679 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1680 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1681 | case GL_COLOR_ARRAY_TYPE: |
| 1682 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1683 | #if defined(GL_CULL_FACE) |
| 1684 | case GL_CULL_FACE: |
| 1685 | #endif // defined(GL_CULL_FACE) |
| 1686 | #if defined(GL_DEPTH_BITS) |
| 1687 | case GL_DEPTH_BITS: |
| 1688 | #endif // defined(GL_DEPTH_BITS) |
| 1689 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1690 | case GL_DEPTH_CLEAR_VALUE: |
| 1691 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1692 | #if defined(GL_DEPTH_FUNC) |
| 1693 | case GL_DEPTH_FUNC: |
| 1694 | #endif // defined(GL_DEPTH_FUNC) |
| 1695 | #if defined(GL_DEPTH_WRITEMASK) |
| 1696 | case GL_DEPTH_WRITEMASK: |
| 1697 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1698 | #if defined(GL_FOG_DENSITY) |
| 1699 | case GL_FOG_DENSITY: |
| 1700 | #endif // defined(GL_FOG_DENSITY) |
| 1701 | #if defined(GL_FOG_END) |
| 1702 | case GL_FOG_END: |
| 1703 | #endif // defined(GL_FOG_END) |
| 1704 | #if defined(GL_FOG_MODE) |
| 1705 | case GL_FOG_MODE: |
| 1706 | #endif // defined(GL_FOG_MODE) |
| 1707 | #if defined(GL_FOG_START) |
| 1708 | case GL_FOG_START: |
| 1709 | #endif // defined(GL_FOG_START) |
| 1710 | #if defined(GL_FRONT_FACE) |
| 1711 | case GL_FRONT_FACE: |
| 1712 | #endif // defined(GL_FRONT_FACE) |
| 1713 | #if defined(GL_GREEN_BITS) |
| 1714 | case GL_GREEN_BITS: |
| 1715 | #endif // defined(GL_GREEN_BITS) |
| 1716 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1717 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1718 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1719 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1720 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1721 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1722 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1723 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1724 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1725 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1726 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1727 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1728 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1729 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1730 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1731 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1732 | case GL_LINE_SMOOTH_HINT: |
| 1733 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1734 | #if defined(GL_LINE_WIDTH) |
| 1735 | case GL_LINE_WIDTH: |
| 1736 | #endif // defined(GL_LINE_WIDTH) |
| 1737 | #if defined(GL_LOGIC_OP_MODE) |
| 1738 | case GL_LOGIC_OP_MODE: |
| 1739 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1740 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1741 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1742 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1743 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1744 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1745 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1746 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1747 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1748 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1749 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1750 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1751 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1752 | #if defined(GL_MATRIX_MODE) |
| 1753 | case GL_MATRIX_MODE: |
| 1754 | #endif // defined(GL_MATRIX_MODE) |
| 1755 | #if defined(GL_MAX_CLIP_PLANES) |
| 1756 | case GL_MAX_CLIP_PLANES: |
| 1757 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1758 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1759 | case GL_MAX_ELEMENTS_INDICES: |
| 1760 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1761 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1762 | case GL_MAX_ELEMENTS_VERTICES: |
| 1763 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1764 | #if defined(GL_MAX_LIGHTS) |
| 1765 | case GL_MAX_LIGHTS: |
| 1766 | #endif // defined(GL_MAX_LIGHTS) |
| 1767 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1768 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1769 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1770 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1771 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1772 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1773 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1774 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1775 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1776 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1777 | case GL_MAX_TEXTURE_SIZE: |
| 1778 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1779 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1780 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1781 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1782 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1783 | case GL_MAX_TEXTURE_UNITS: |
| 1784 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1785 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1786 | case GL_MAX_VERTEX_UNITS_OES: |
| 1787 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1788 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1789 | case GL_MODELVIEW_STACK_DEPTH: |
| 1790 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1791 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1792 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1793 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1794 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1795 | case GL_NORMAL_ARRAY_STRIDE: |
| 1796 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1797 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1798 | case GL_NORMAL_ARRAY_TYPE: |
| 1799 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1800 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1801 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1802 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1803 | #if defined(GL_PACK_ALIGNMENT) |
| 1804 | case GL_PACK_ALIGNMENT: |
| 1805 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1806 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1807 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1808 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1809 | #if defined(GL_POINT_SIZE) |
| 1810 | case GL_POINT_SIZE: |
| 1811 | #endif // defined(GL_POINT_SIZE) |
| 1812 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1813 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1814 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1815 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1816 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1817 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1818 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1819 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1820 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1821 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1822 | case GL_POINT_SMOOTH_HINT: |
| 1823 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1824 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1825 | case GL_POLYGON_OFFSET_FACTOR: |
| 1826 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1827 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1828 | case GL_POLYGON_OFFSET_UNITS: |
| 1829 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1830 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1831 | case GL_PROJECTION_STACK_DEPTH: |
| 1832 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1833 | #if defined(GL_RED_BITS) |
| 1834 | case GL_RED_BITS: |
| 1835 | #endif // defined(GL_RED_BITS) |
| 1836 | #if defined(GL_SHADE_MODEL) |
| 1837 | case GL_SHADE_MODEL: |
| 1838 | #endif // defined(GL_SHADE_MODEL) |
| 1839 | #if defined(GL_STENCIL_BITS) |
| 1840 | case GL_STENCIL_BITS: |
| 1841 | #endif // defined(GL_STENCIL_BITS) |
| 1842 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1843 | case GL_STENCIL_CLEAR_VALUE: |
| 1844 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1845 | #if defined(GL_STENCIL_FAIL) |
| 1846 | case GL_STENCIL_FAIL: |
| 1847 | #endif // defined(GL_STENCIL_FAIL) |
| 1848 | #if defined(GL_STENCIL_FUNC) |
| 1849 | case GL_STENCIL_FUNC: |
| 1850 | #endif // defined(GL_STENCIL_FUNC) |
| 1851 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1852 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1853 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1854 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1855 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1856 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1857 | #if defined(GL_STENCIL_REF) |
| 1858 | case GL_STENCIL_REF: |
| 1859 | #endif // defined(GL_STENCIL_REF) |
| 1860 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1861 | case GL_STENCIL_VALUE_MASK: |
| 1862 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1863 | #if defined(GL_STENCIL_WRITEMASK) |
| 1864 | case GL_STENCIL_WRITEMASK: |
| 1865 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1866 | #if defined(GL_SUBPIXEL_BITS) |
| 1867 | case GL_SUBPIXEL_BITS: |
| 1868 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1869 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1870 | case GL_TEXTURE_BINDING_2D: |
| 1871 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1872 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1873 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1874 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1875 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1876 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1877 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1878 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1879 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1880 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1881 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1882 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1883 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1884 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1885 | case GL_TEXTURE_STACK_DEPTH: |
| 1886 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1887 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1888 | case GL_UNPACK_ALIGNMENT: |
| 1889 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1890 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1891 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1892 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1893 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1894 | case GL_VERTEX_ARRAY_SIZE: |
| 1895 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1896 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1897 | case GL_VERTEX_ARRAY_STRIDE: |
| 1898 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1899 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1900 | case GL_VERTEX_ARRAY_TYPE: |
| 1901 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1902 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1903 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1904 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1905 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1906 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1907 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1908 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1909 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1910 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1911 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1912 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1913 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1914 | _needed = 1; |
| 1915 | break; |
| 1916 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1917 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1918 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1919 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1920 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1921 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1922 | #if defined(GL_DEPTH_RANGE) |
| 1923 | case GL_DEPTH_RANGE: |
| 1924 | #endif // defined(GL_DEPTH_RANGE) |
| 1925 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1926 | case GL_MAX_VIEWPORT_DIMS: |
| 1927 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1928 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1929 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1930 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1931 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1932 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1933 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1934 | _needed = 2; |
| 1935 | break; |
| 1936 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1937 | case GL_COLOR_CLEAR_VALUE: |
| 1938 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1939 | #if defined(GL_COLOR_WRITEMASK) |
| 1940 | case GL_COLOR_WRITEMASK: |
| 1941 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1942 | #if defined(GL_FOG_COLOR) |
| 1943 | case GL_FOG_COLOR: |
| 1944 | #endif // defined(GL_FOG_COLOR) |
| 1945 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1946 | case GL_LIGHT_MODEL_AMBIENT: |
| 1947 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1948 | #if defined(GL_SCISSOR_BOX) |
| 1949 | case GL_SCISSOR_BOX: |
| 1950 | #endif // defined(GL_SCISSOR_BOX) |
| 1951 | #if defined(GL_VIEWPORT) |
| 1952 | case GL_VIEWPORT: |
| 1953 | #endif // defined(GL_VIEWPORT) |
| 1954 | _needed = 4; |
| 1955 | break; |
| 1956 | #if defined(GL_MODELVIEW_MATRIX) |
| 1957 | case GL_MODELVIEW_MATRIX: |
| 1958 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1959 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1960 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1961 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1962 | #if defined(GL_PROJECTION_MATRIX) |
| 1963 | case GL_PROJECTION_MATRIX: |
| 1964 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1965 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1966 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1967 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1968 | #if defined(GL_TEXTURE_MATRIX) |
| 1969 | case GL_TEXTURE_MATRIX: |
| 1970 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1971 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1972 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1973 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1974 | _needed = 16; |
| 1975 | break; |
| 1976 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1977 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1978 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1979 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1980 | break; |
| 1981 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1982 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1983 | break; |
| 1984 | } |
| 1985 | if (_remaining < _needed) { |
| 1986 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1987 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1988 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1989 | goto exit; |
| 1990 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1991 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1992 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1993 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 1994 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1995 | glGetIntegerv( |
| 1996 | (GLenum)pname, |
| 1997 | (GLint *)params |
| 1998 | ); |
| 1999 | |
| 2000 | exit: |
| 2001 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2002 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2003 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2004 | if (_exception) { |
| 2005 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2006 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2007 | } |
| 2008 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2009 | /* const GLubyte * glGetString ( GLenum name ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 2010 | static jstring android_glGetString(JNIEnv *_env, jobject, jint name) { |
| 2011 | const char* chars = (const char*) glGetString((GLenum) name); |
| 2012 | return _env->NewStringUTF(chars); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2013 | } |
| 2014 | /* void glHint ( GLenum target, GLenum mode ) */ |
| 2015 | static void |
| 2016 | android_glHint__II |
| 2017 | (JNIEnv *_env, jobject _this, jint target, jint mode) { |
| 2018 | glHint( |
| 2019 | (GLenum)target, |
| 2020 | (GLenum)mode |
| 2021 | ); |
| 2022 | } |
| 2023 | |
| 2024 | /* void glLightModelf ( GLenum pname, GLfloat param ) */ |
| 2025 | static void |
| 2026 | android_glLightModelf__IF |
| 2027 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 2028 | glLightModelf( |
| 2029 | (GLenum)pname, |
| 2030 | (GLfloat)param |
| 2031 | ); |
| 2032 | } |
| 2033 | |
| 2034 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 2035 | static void |
| 2036 | android_glLightModelfv__I_3FI |
| 2037 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2038 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2039 | const char * _exceptionType = NULL; |
| 2040 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2041 | GLfloat *params_base = (GLfloat *) 0; |
| 2042 | jint _remaining; |
| 2043 | GLfloat *params = (GLfloat *) 0; |
| 2044 | |
| 2045 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2046 | _exception = 1; |
| 2047 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2048 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2049 | goto exit; |
| 2050 | } |
| 2051 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2052 | _exception = 1; |
| 2053 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2054 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2055 | goto exit; |
| 2056 | } |
| 2057 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2058 | int _needed; |
| 2059 | switch (pname) { |
| 2060 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2061 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2062 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2063 | _needed = 1; |
| 2064 | break; |
| 2065 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2066 | case GL_LIGHT_MODEL_AMBIENT: |
| 2067 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2068 | _needed = 4; |
| 2069 | break; |
| 2070 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2071 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2072 | break; |
| 2073 | } |
| 2074 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2075 | _exception = 1; |
| 2076 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2077 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2078 | goto exit; |
| 2079 | } |
| 2080 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2081 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2082 | params = params_base + offset; |
| 2083 | |
| 2084 | glLightModelfv( |
| 2085 | (GLenum)pname, |
| 2086 | (GLfloat *)params |
| 2087 | ); |
| 2088 | |
| 2089 | exit: |
| 2090 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2091 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2092 | JNI_ABORT); |
| 2093 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2094 | if (_exception) { |
| 2095 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2096 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2097 | } |
| 2098 | |
| 2099 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 2100 | static void |
| 2101 | android_glLightModelfv__ILjava_nio_FloatBuffer_2 |
| 2102 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2103 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2104 | const char * _exceptionType = NULL; |
| 2105 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2106 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2107 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2108 | jint _remaining; |
| 2109 | GLfloat *params = (GLfloat *) 0; |
| 2110 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2111 | if (!params_buf) { |
| 2112 | _exception = 1; |
| 2113 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2114 | _exceptionMessage = "params == null"; |
| 2115 | goto exit; |
| 2116 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2117 | 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] | 2118 | int _needed; |
| 2119 | switch (pname) { |
| 2120 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2121 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2122 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2123 | _needed = 1; |
| 2124 | break; |
| 2125 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2126 | case GL_LIGHT_MODEL_AMBIENT: |
| 2127 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2128 | _needed = 4; |
| 2129 | break; |
| 2130 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2131 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2132 | break; |
| 2133 | } |
| 2134 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2135 | _exception = 1; |
| 2136 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2137 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2138 | goto exit; |
| 2139 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2140 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2141 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2142 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2143 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2144 | glLightModelfv( |
| 2145 | (GLenum)pname, |
| 2146 | (GLfloat *)params |
| 2147 | ); |
| 2148 | |
| 2149 | exit: |
| 2150 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2151 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2152 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2153 | if (_exception) { |
| 2154 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2155 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2156 | } |
| 2157 | |
| 2158 | /* void glLightModelx ( GLenum pname, GLfixed param ) */ |
| 2159 | static void |
| 2160 | android_glLightModelx__II |
| 2161 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 2162 | glLightModelx( |
| 2163 | (GLenum)pname, |
| 2164 | (GLfixed)param |
| 2165 | ); |
| 2166 | } |
| 2167 | |
| 2168 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2169 | static void |
| 2170 | android_glLightModelxv__I_3II |
| 2171 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2172 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2173 | const char * _exceptionType = NULL; |
| 2174 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2175 | GLfixed *params_base = (GLfixed *) 0; |
| 2176 | jint _remaining; |
| 2177 | GLfixed *params = (GLfixed *) 0; |
| 2178 | |
| 2179 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2180 | _exception = 1; |
| 2181 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2182 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2183 | goto exit; |
| 2184 | } |
| 2185 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2186 | _exception = 1; |
| 2187 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2188 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2189 | goto exit; |
| 2190 | } |
| 2191 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2192 | int _needed; |
| 2193 | switch (pname) { |
| 2194 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2195 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2196 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2197 | _needed = 1; |
| 2198 | break; |
| 2199 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2200 | case GL_LIGHT_MODEL_AMBIENT: |
| 2201 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2202 | _needed = 4; |
| 2203 | break; |
| 2204 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2205 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2206 | break; |
| 2207 | } |
| 2208 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2209 | _exception = 1; |
| 2210 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2211 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2212 | goto exit; |
| 2213 | } |
| 2214 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2215 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2216 | params = params_base + offset; |
| 2217 | |
| 2218 | glLightModelxv( |
| 2219 | (GLenum)pname, |
| 2220 | (GLfixed *)params |
| 2221 | ); |
| 2222 | |
| 2223 | exit: |
| 2224 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2225 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2226 | JNI_ABORT); |
| 2227 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2228 | if (_exception) { |
| 2229 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2230 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2231 | } |
| 2232 | |
| 2233 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2234 | static void |
| 2235 | android_glLightModelxv__ILjava_nio_IntBuffer_2 |
| 2236 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2237 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2238 | const char * _exceptionType = NULL; |
| 2239 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2240 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2241 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2242 | jint _remaining; |
| 2243 | GLfixed *params = (GLfixed *) 0; |
| 2244 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2245 | if (!params_buf) { |
| 2246 | _exception = 1; |
| 2247 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2248 | _exceptionMessage = "params == null"; |
| 2249 | goto exit; |
| 2250 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2251 | 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] | 2252 | int _needed; |
| 2253 | switch (pname) { |
| 2254 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2255 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2256 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2257 | _needed = 1; |
| 2258 | break; |
| 2259 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2260 | case GL_LIGHT_MODEL_AMBIENT: |
| 2261 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2262 | _needed = 4; |
| 2263 | break; |
| 2264 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2265 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2266 | break; |
| 2267 | } |
| 2268 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2269 | _exception = 1; |
| 2270 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2271 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2272 | goto exit; |
| 2273 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2274 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2275 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2276 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2277 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2278 | glLightModelxv( |
| 2279 | (GLenum)pname, |
| 2280 | (GLfixed *)params |
| 2281 | ); |
| 2282 | |
| 2283 | exit: |
| 2284 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2285 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2286 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2287 | if (_exception) { |
| 2288 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2289 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2290 | } |
| 2291 | |
| 2292 | /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */ |
| 2293 | static void |
| 2294 | android_glLightf__IIF |
| 2295 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) { |
| 2296 | glLightf( |
| 2297 | (GLenum)light, |
| 2298 | (GLenum)pname, |
| 2299 | (GLfloat)param |
| 2300 | ); |
| 2301 | } |
| 2302 | |
| 2303 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2304 | static void |
| 2305 | android_glLightfv__II_3FI |
| 2306 | (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] | 2307 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2308 | const char * _exceptionType = NULL; |
| 2309 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2310 | GLfloat *params_base = (GLfloat *) 0; |
| 2311 | jint _remaining; |
| 2312 | GLfloat *params = (GLfloat *) 0; |
| 2313 | |
| 2314 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2315 | _exception = 1; |
| 2316 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2317 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2318 | goto exit; |
| 2319 | } |
| 2320 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2321 | _exception = 1; |
| 2322 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2323 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2324 | goto exit; |
| 2325 | } |
| 2326 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2327 | int _needed; |
| 2328 | switch (pname) { |
| 2329 | #if defined(GL_SPOT_EXPONENT) |
| 2330 | case GL_SPOT_EXPONENT: |
| 2331 | #endif // defined(GL_SPOT_EXPONENT) |
| 2332 | #if defined(GL_SPOT_CUTOFF) |
| 2333 | case GL_SPOT_CUTOFF: |
| 2334 | #endif // defined(GL_SPOT_CUTOFF) |
| 2335 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2336 | case GL_CONSTANT_ATTENUATION: |
| 2337 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2338 | #if defined(GL_LINEAR_ATTENUATION) |
| 2339 | case GL_LINEAR_ATTENUATION: |
| 2340 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2341 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2342 | case GL_QUADRATIC_ATTENUATION: |
| 2343 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2344 | _needed = 1; |
| 2345 | break; |
| 2346 | #if defined(GL_SPOT_DIRECTION) |
| 2347 | case GL_SPOT_DIRECTION: |
| 2348 | #endif // defined(GL_SPOT_DIRECTION) |
| 2349 | _needed = 3; |
| 2350 | break; |
| 2351 | #if defined(GL_AMBIENT) |
| 2352 | case GL_AMBIENT: |
| 2353 | #endif // defined(GL_AMBIENT) |
| 2354 | #if defined(GL_DIFFUSE) |
| 2355 | case GL_DIFFUSE: |
| 2356 | #endif // defined(GL_DIFFUSE) |
| 2357 | #if defined(GL_SPECULAR) |
| 2358 | case GL_SPECULAR: |
| 2359 | #endif // defined(GL_SPECULAR) |
| 2360 | #if defined(GL_EMISSION) |
| 2361 | case GL_EMISSION: |
| 2362 | #endif // defined(GL_EMISSION) |
| 2363 | _needed = 4; |
| 2364 | break; |
| 2365 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2366 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2367 | break; |
| 2368 | } |
| 2369 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2370 | _exception = 1; |
| 2371 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2372 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2373 | goto exit; |
| 2374 | } |
| 2375 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2376 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2377 | params = params_base + offset; |
| 2378 | |
| 2379 | glLightfv( |
| 2380 | (GLenum)light, |
| 2381 | (GLenum)pname, |
| 2382 | (GLfloat *)params |
| 2383 | ); |
| 2384 | |
| 2385 | exit: |
| 2386 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2387 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2388 | JNI_ABORT); |
| 2389 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2390 | if (_exception) { |
| 2391 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2392 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2393 | } |
| 2394 | |
| 2395 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2396 | static void |
| 2397 | android_glLightfv__IILjava_nio_FloatBuffer_2 |
| 2398 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2399 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2400 | const char * _exceptionType = NULL; |
| 2401 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2402 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2403 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2404 | jint _remaining; |
| 2405 | GLfloat *params = (GLfloat *) 0; |
| 2406 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2407 | if (!params_buf) { |
| 2408 | _exception = 1; |
| 2409 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2410 | _exceptionMessage = "params == null"; |
| 2411 | goto exit; |
| 2412 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2413 | 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] | 2414 | int _needed; |
| 2415 | switch (pname) { |
| 2416 | #if defined(GL_SPOT_EXPONENT) |
| 2417 | case GL_SPOT_EXPONENT: |
| 2418 | #endif // defined(GL_SPOT_EXPONENT) |
| 2419 | #if defined(GL_SPOT_CUTOFF) |
| 2420 | case GL_SPOT_CUTOFF: |
| 2421 | #endif // defined(GL_SPOT_CUTOFF) |
| 2422 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2423 | case GL_CONSTANT_ATTENUATION: |
| 2424 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2425 | #if defined(GL_LINEAR_ATTENUATION) |
| 2426 | case GL_LINEAR_ATTENUATION: |
| 2427 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2428 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2429 | case GL_QUADRATIC_ATTENUATION: |
| 2430 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2431 | _needed = 1; |
| 2432 | break; |
| 2433 | #if defined(GL_SPOT_DIRECTION) |
| 2434 | case GL_SPOT_DIRECTION: |
| 2435 | #endif // defined(GL_SPOT_DIRECTION) |
| 2436 | _needed = 3; |
| 2437 | break; |
| 2438 | #if defined(GL_AMBIENT) |
| 2439 | case GL_AMBIENT: |
| 2440 | #endif // defined(GL_AMBIENT) |
| 2441 | #if defined(GL_DIFFUSE) |
| 2442 | case GL_DIFFUSE: |
| 2443 | #endif // defined(GL_DIFFUSE) |
| 2444 | #if defined(GL_SPECULAR) |
| 2445 | case GL_SPECULAR: |
| 2446 | #endif // defined(GL_SPECULAR) |
| 2447 | #if defined(GL_EMISSION) |
| 2448 | case GL_EMISSION: |
| 2449 | #endif // defined(GL_EMISSION) |
| 2450 | _needed = 4; |
| 2451 | break; |
| 2452 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2453 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2454 | break; |
| 2455 | } |
| 2456 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2457 | _exception = 1; |
| 2458 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2459 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2460 | goto exit; |
| 2461 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2462 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2463 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2464 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2465 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2466 | glLightfv( |
| 2467 | (GLenum)light, |
| 2468 | (GLenum)pname, |
| 2469 | (GLfloat *)params |
| 2470 | ); |
| 2471 | |
| 2472 | exit: |
| 2473 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2474 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2475 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2476 | if (_exception) { |
| 2477 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2478 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2479 | } |
| 2480 | |
| 2481 | /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */ |
| 2482 | static void |
| 2483 | android_glLightx__III |
| 2484 | (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) { |
| 2485 | glLightx( |
| 2486 | (GLenum)light, |
| 2487 | (GLenum)pname, |
| 2488 | (GLfixed)param |
| 2489 | ); |
| 2490 | } |
| 2491 | |
| 2492 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2493 | static void |
| 2494 | android_glLightxv__II_3II |
| 2495 | (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] | 2496 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2497 | const char * _exceptionType = NULL; |
| 2498 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2499 | GLfixed *params_base = (GLfixed *) 0; |
| 2500 | jint _remaining; |
| 2501 | GLfixed *params = (GLfixed *) 0; |
| 2502 | |
| 2503 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2504 | _exception = 1; |
| 2505 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2506 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2507 | goto exit; |
| 2508 | } |
| 2509 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2510 | _exception = 1; |
| 2511 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2512 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2513 | goto exit; |
| 2514 | } |
| 2515 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2516 | int _needed; |
| 2517 | switch (pname) { |
| 2518 | #if defined(GL_SPOT_EXPONENT) |
| 2519 | case GL_SPOT_EXPONENT: |
| 2520 | #endif // defined(GL_SPOT_EXPONENT) |
| 2521 | #if defined(GL_SPOT_CUTOFF) |
| 2522 | case GL_SPOT_CUTOFF: |
| 2523 | #endif // defined(GL_SPOT_CUTOFF) |
| 2524 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2525 | case GL_CONSTANT_ATTENUATION: |
| 2526 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2527 | #if defined(GL_LINEAR_ATTENUATION) |
| 2528 | case GL_LINEAR_ATTENUATION: |
| 2529 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2530 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2531 | case GL_QUADRATIC_ATTENUATION: |
| 2532 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2533 | _needed = 1; |
| 2534 | break; |
| 2535 | #if defined(GL_SPOT_DIRECTION) |
| 2536 | case GL_SPOT_DIRECTION: |
| 2537 | #endif // defined(GL_SPOT_DIRECTION) |
| 2538 | _needed = 3; |
| 2539 | break; |
| 2540 | #if defined(GL_AMBIENT) |
| 2541 | case GL_AMBIENT: |
| 2542 | #endif // defined(GL_AMBIENT) |
| 2543 | #if defined(GL_DIFFUSE) |
| 2544 | case GL_DIFFUSE: |
| 2545 | #endif // defined(GL_DIFFUSE) |
| 2546 | #if defined(GL_SPECULAR) |
| 2547 | case GL_SPECULAR: |
| 2548 | #endif // defined(GL_SPECULAR) |
| 2549 | #if defined(GL_EMISSION) |
| 2550 | case GL_EMISSION: |
| 2551 | #endif // defined(GL_EMISSION) |
| 2552 | _needed = 4; |
| 2553 | break; |
| 2554 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2555 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2556 | break; |
| 2557 | } |
| 2558 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2559 | _exception = 1; |
| 2560 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2561 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2562 | goto exit; |
| 2563 | } |
| 2564 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2565 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2566 | params = params_base + offset; |
| 2567 | |
| 2568 | glLightxv( |
| 2569 | (GLenum)light, |
| 2570 | (GLenum)pname, |
| 2571 | (GLfixed *)params |
| 2572 | ); |
| 2573 | |
| 2574 | exit: |
| 2575 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2576 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2577 | JNI_ABORT); |
| 2578 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2579 | if (_exception) { |
| 2580 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2581 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2582 | } |
| 2583 | |
| 2584 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2585 | static void |
| 2586 | android_glLightxv__IILjava_nio_IntBuffer_2 |
| 2587 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2588 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2589 | const char * _exceptionType = NULL; |
| 2590 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2591 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2592 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2593 | jint _remaining; |
| 2594 | GLfixed *params = (GLfixed *) 0; |
| 2595 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2596 | if (!params_buf) { |
| 2597 | _exception = 1; |
| 2598 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2599 | _exceptionMessage = "params == null"; |
| 2600 | goto exit; |
| 2601 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2602 | 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] | 2603 | int _needed; |
| 2604 | switch (pname) { |
| 2605 | #if defined(GL_SPOT_EXPONENT) |
| 2606 | case GL_SPOT_EXPONENT: |
| 2607 | #endif // defined(GL_SPOT_EXPONENT) |
| 2608 | #if defined(GL_SPOT_CUTOFF) |
| 2609 | case GL_SPOT_CUTOFF: |
| 2610 | #endif // defined(GL_SPOT_CUTOFF) |
| 2611 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2612 | case GL_CONSTANT_ATTENUATION: |
| 2613 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2614 | #if defined(GL_LINEAR_ATTENUATION) |
| 2615 | case GL_LINEAR_ATTENUATION: |
| 2616 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2617 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2618 | case GL_QUADRATIC_ATTENUATION: |
| 2619 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2620 | _needed = 1; |
| 2621 | break; |
| 2622 | #if defined(GL_SPOT_DIRECTION) |
| 2623 | case GL_SPOT_DIRECTION: |
| 2624 | #endif // defined(GL_SPOT_DIRECTION) |
| 2625 | _needed = 3; |
| 2626 | break; |
| 2627 | #if defined(GL_AMBIENT) |
| 2628 | case GL_AMBIENT: |
| 2629 | #endif // defined(GL_AMBIENT) |
| 2630 | #if defined(GL_DIFFUSE) |
| 2631 | case GL_DIFFUSE: |
| 2632 | #endif // defined(GL_DIFFUSE) |
| 2633 | #if defined(GL_SPECULAR) |
| 2634 | case GL_SPECULAR: |
| 2635 | #endif // defined(GL_SPECULAR) |
| 2636 | #if defined(GL_EMISSION) |
| 2637 | case GL_EMISSION: |
| 2638 | #endif // defined(GL_EMISSION) |
| 2639 | _needed = 4; |
| 2640 | break; |
| 2641 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2642 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2643 | break; |
| 2644 | } |
| 2645 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2646 | _exception = 1; |
| 2647 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2648 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2649 | goto exit; |
| 2650 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2651 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2652 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2653 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2654 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2655 | glLightxv( |
| 2656 | (GLenum)light, |
| 2657 | (GLenum)pname, |
| 2658 | (GLfixed *)params |
| 2659 | ); |
| 2660 | |
| 2661 | exit: |
| 2662 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2663 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2664 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2665 | if (_exception) { |
| 2666 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2667 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2668 | } |
| 2669 | |
| 2670 | /* void glLineWidth ( GLfloat width ) */ |
| 2671 | static void |
| 2672 | android_glLineWidth__F |
| 2673 | (JNIEnv *_env, jobject _this, jfloat width) { |
| 2674 | glLineWidth( |
| 2675 | (GLfloat)width |
| 2676 | ); |
| 2677 | } |
| 2678 | |
| 2679 | /* void glLineWidthx ( GLfixed width ) */ |
| 2680 | static void |
| 2681 | android_glLineWidthx__I |
| 2682 | (JNIEnv *_env, jobject _this, jint width) { |
| 2683 | glLineWidthx( |
| 2684 | (GLfixed)width |
| 2685 | ); |
| 2686 | } |
| 2687 | |
| 2688 | /* void glLoadIdentity ( void ) */ |
| 2689 | static void |
| 2690 | android_glLoadIdentity__ |
| 2691 | (JNIEnv *_env, jobject _this) { |
| 2692 | glLoadIdentity(); |
| 2693 | } |
| 2694 | |
| 2695 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2696 | static void |
| 2697 | android_glLoadMatrixf___3FI |
| 2698 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2699 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2700 | const char * _exceptionType = NULL; |
| 2701 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2702 | GLfloat *m_base = (GLfloat *) 0; |
| 2703 | jint _remaining; |
| 2704 | GLfloat *m = (GLfloat *) 0; |
| 2705 | |
| 2706 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2707 | _exception = 1; |
| 2708 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2709 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2710 | goto exit; |
| 2711 | } |
| 2712 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2713 | _exception = 1; |
| 2714 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2715 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2716 | goto exit; |
| 2717 | } |
| 2718 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2719 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2720 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2721 | m = m_base + offset; |
| 2722 | |
| 2723 | glLoadMatrixf( |
| 2724 | (GLfloat *)m |
| 2725 | ); |
| 2726 | |
| 2727 | exit: |
| 2728 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2729 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2730 | JNI_ABORT); |
| 2731 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2732 | if (_exception) { |
| 2733 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2734 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2735 | } |
| 2736 | |
| 2737 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2738 | static void |
| 2739 | android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 |
| 2740 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2741 | jint _exception = 0; |
| 2742 | const char * _exceptionType = NULL; |
| 2743 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2744 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2745 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2746 | jint _remaining; |
| 2747 | GLfloat *m = (GLfloat *) 0; |
| 2748 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2749 | if (!m_buf) { |
| 2750 | _exception = 1; |
| 2751 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2752 | _exceptionMessage = "m == null"; |
| 2753 | goto exit; |
| 2754 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2755 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2756 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2757 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2758 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 2759 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2760 | glLoadMatrixf( |
| 2761 | (GLfloat *)m |
| 2762 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2763 | |
| 2764 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2765 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2766 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2767 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2768 | if (_exception) { |
| 2769 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2770 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2771 | } |
| 2772 | |
| 2773 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2774 | static void |
| 2775 | android_glLoadMatrixx___3II |
| 2776 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2777 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2778 | const char * _exceptionType = NULL; |
| 2779 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2780 | GLfixed *m_base = (GLfixed *) 0; |
| 2781 | jint _remaining; |
| 2782 | GLfixed *m = (GLfixed *) 0; |
| 2783 | |
| 2784 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2785 | _exception = 1; |
| 2786 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2787 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2788 | goto exit; |
| 2789 | } |
| 2790 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2791 | _exception = 1; |
| 2792 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2793 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2794 | goto exit; |
| 2795 | } |
| 2796 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2797 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2798 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2799 | m = m_base + offset; |
| 2800 | |
| 2801 | glLoadMatrixx( |
| 2802 | (GLfixed *)m |
| 2803 | ); |
| 2804 | |
| 2805 | exit: |
| 2806 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2807 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2808 | JNI_ABORT); |
| 2809 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2810 | if (_exception) { |
| 2811 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2812 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2813 | } |
| 2814 | |
| 2815 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2816 | static void |
| 2817 | android_glLoadMatrixx__Ljava_nio_IntBuffer_2 |
| 2818 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2819 | jint _exception = 0; |
| 2820 | const char * _exceptionType = NULL; |
| 2821 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2822 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2823 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2824 | jint _remaining; |
| 2825 | GLfixed *m = (GLfixed *) 0; |
| 2826 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2827 | if (!m_buf) { |
| 2828 | _exception = 1; |
| 2829 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2830 | _exceptionMessage = "m == null"; |
| 2831 | goto exit; |
| 2832 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2833 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2834 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2835 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2836 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 2837 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2838 | glLoadMatrixx( |
| 2839 | (GLfixed *)m |
| 2840 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2841 | |
| 2842 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2843 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2844 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2845 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2846 | if (_exception) { |
| 2847 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2848 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2849 | } |
| 2850 | |
| 2851 | /* void glLogicOp ( GLenum opcode ) */ |
| 2852 | static void |
| 2853 | android_glLogicOp__I |
| 2854 | (JNIEnv *_env, jobject _this, jint opcode) { |
| 2855 | glLogicOp( |
| 2856 | (GLenum)opcode |
| 2857 | ); |
| 2858 | } |
| 2859 | |
| 2860 | /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */ |
| 2861 | static void |
| 2862 | android_glMaterialf__IIF |
| 2863 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) { |
| 2864 | glMaterialf( |
| 2865 | (GLenum)face, |
| 2866 | (GLenum)pname, |
| 2867 | (GLfloat)param |
| 2868 | ); |
| 2869 | } |
| 2870 | |
| 2871 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2872 | static void |
| 2873 | android_glMaterialfv__II_3FI |
| 2874 | (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] | 2875 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2876 | const char * _exceptionType = NULL; |
| 2877 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2878 | GLfloat *params_base = (GLfloat *) 0; |
| 2879 | jint _remaining; |
| 2880 | GLfloat *params = (GLfloat *) 0; |
| 2881 | |
| 2882 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2883 | _exception = 1; |
| 2884 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2885 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2886 | goto exit; |
| 2887 | } |
| 2888 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2889 | _exception = 1; |
| 2890 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2891 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2892 | goto exit; |
| 2893 | } |
| 2894 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2895 | int _needed; |
| 2896 | switch (pname) { |
| 2897 | #if defined(GL_SHININESS) |
| 2898 | case GL_SHININESS: |
| 2899 | #endif // defined(GL_SHININESS) |
| 2900 | _needed = 1; |
| 2901 | break; |
| 2902 | #if defined(GL_AMBIENT) |
| 2903 | case GL_AMBIENT: |
| 2904 | #endif // defined(GL_AMBIENT) |
| 2905 | #if defined(GL_DIFFUSE) |
| 2906 | case GL_DIFFUSE: |
| 2907 | #endif // defined(GL_DIFFUSE) |
| 2908 | #if defined(GL_SPECULAR) |
| 2909 | case GL_SPECULAR: |
| 2910 | #endif // defined(GL_SPECULAR) |
| 2911 | #if defined(GL_EMISSION) |
| 2912 | case GL_EMISSION: |
| 2913 | #endif // defined(GL_EMISSION) |
| 2914 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2915 | case GL_AMBIENT_AND_DIFFUSE: |
| 2916 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2917 | _needed = 4; |
| 2918 | break; |
| 2919 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2920 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | break; |
| 2922 | } |
| 2923 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2924 | _exception = 1; |
| 2925 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2926 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2927 | goto exit; |
| 2928 | } |
| 2929 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2930 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2931 | params = params_base + offset; |
| 2932 | |
| 2933 | glMaterialfv( |
| 2934 | (GLenum)face, |
| 2935 | (GLenum)pname, |
| 2936 | (GLfloat *)params |
| 2937 | ); |
| 2938 | |
| 2939 | exit: |
| 2940 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2941 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2942 | JNI_ABORT); |
| 2943 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2944 | if (_exception) { |
| 2945 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2946 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2947 | } |
| 2948 | |
| 2949 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2950 | static void |
| 2951 | android_glMaterialfv__IILjava_nio_FloatBuffer_2 |
| 2952 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2953 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2954 | const char * _exceptionType = NULL; |
| 2955 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2956 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2957 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2958 | jint _remaining; |
| 2959 | GLfloat *params = (GLfloat *) 0; |
| 2960 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 2961 | if (!params_buf) { |
| 2962 | _exception = 1; |
| 2963 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2964 | _exceptionMessage = "params == null"; |
| 2965 | goto exit; |
| 2966 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2967 | 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] | 2968 | int _needed; |
| 2969 | switch (pname) { |
| 2970 | #if defined(GL_SHININESS) |
| 2971 | case GL_SHININESS: |
| 2972 | #endif // defined(GL_SHININESS) |
| 2973 | _needed = 1; |
| 2974 | break; |
| 2975 | #if defined(GL_AMBIENT) |
| 2976 | case GL_AMBIENT: |
| 2977 | #endif // defined(GL_AMBIENT) |
| 2978 | #if defined(GL_DIFFUSE) |
| 2979 | case GL_DIFFUSE: |
| 2980 | #endif // defined(GL_DIFFUSE) |
| 2981 | #if defined(GL_SPECULAR) |
| 2982 | case GL_SPECULAR: |
| 2983 | #endif // defined(GL_SPECULAR) |
| 2984 | #if defined(GL_EMISSION) |
| 2985 | case GL_EMISSION: |
| 2986 | #endif // defined(GL_EMISSION) |
| 2987 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2988 | case GL_AMBIENT_AND_DIFFUSE: |
| 2989 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2990 | _needed = 4; |
| 2991 | break; |
| 2992 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2993 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2994 | break; |
| 2995 | } |
| 2996 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2997 | _exception = 1; |
| 2998 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2999 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3000 | goto exit; |
| 3001 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3002 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3003 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3004 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3005 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3006 | glMaterialfv( |
| 3007 | (GLenum)face, |
| 3008 | (GLenum)pname, |
| 3009 | (GLfloat *)params |
| 3010 | ); |
| 3011 | |
| 3012 | exit: |
| 3013 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3014 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3015 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3016 | if (_exception) { |
| 3017 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3018 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3019 | } |
| 3020 | |
| 3021 | /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */ |
| 3022 | static void |
| 3023 | android_glMaterialx__III |
| 3024 | (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) { |
| 3025 | glMaterialx( |
| 3026 | (GLenum)face, |
| 3027 | (GLenum)pname, |
| 3028 | (GLfixed)param |
| 3029 | ); |
| 3030 | } |
| 3031 | |
| 3032 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 3033 | static void |
| 3034 | android_glMaterialxv__II_3II |
| 3035 | (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] | 3036 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3037 | const char * _exceptionType = NULL; |
| 3038 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3039 | GLfixed *params_base = (GLfixed *) 0; |
| 3040 | jint _remaining; |
| 3041 | GLfixed *params = (GLfixed *) 0; |
| 3042 | |
| 3043 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3044 | _exception = 1; |
| 3045 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3046 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3047 | goto exit; |
| 3048 | } |
| 3049 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3050 | _exception = 1; |
| 3051 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3052 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3053 | goto exit; |
| 3054 | } |
| 3055 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3056 | int _needed; |
| 3057 | switch (pname) { |
| 3058 | #if defined(GL_SHININESS) |
| 3059 | case GL_SHININESS: |
| 3060 | #endif // defined(GL_SHININESS) |
| 3061 | _needed = 1; |
| 3062 | break; |
| 3063 | #if defined(GL_AMBIENT) |
| 3064 | case GL_AMBIENT: |
| 3065 | #endif // defined(GL_AMBIENT) |
| 3066 | #if defined(GL_DIFFUSE) |
| 3067 | case GL_DIFFUSE: |
| 3068 | #endif // defined(GL_DIFFUSE) |
| 3069 | #if defined(GL_SPECULAR) |
| 3070 | case GL_SPECULAR: |
| 3071 | #endif // defined(GL_SPECULAR) |
| 3072 | #if defined(GL_EMISSION) |
| 3073 | case GL_EMISSION: |
| 3074 | #endif // defined(GL_EMISSION) |
| 3075 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3076 | case GL_AMBIENT_AND_DIFFUSE: |
| 3077 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3078 | _needed = 4; |
| 3079 | break; |
| 3080 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3081 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3082 | break; |
| 3083 | } |
| 3084 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3085 | _exception = 1; |
| 3086 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3087 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3088 | goto exit; |
| 3089 | } |
| 3090 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3091 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3092 | params = params_base + offset; |
| 3093 | |
| 3094 | glMaterialxv( |
| 3095 | (GLenum)face, |
| 3096 | (GLenum)pname, |
| 3097 | (GLfixed *)params |
| 3098 | ); |
| 3099 | |
| 3100 | exit: |
| 3101 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3102 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3103 | JNI_ABORT); |
| 3104 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3105 | if (_exception) { |
| 3106 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3107 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3108 | } |
| 3109 | |
| 3110 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 3111 | static void |
| 3112 | android_glMaterialxv__IILjava_nio_IntBuffer_2 |
| 3113 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3114 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3115 | const char * _exceptionType = NULL; |
| 3116 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3117 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3118 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3119 | jint _remaining; |
| 3120 | GLfixed *params = (GLfixed *) 0; |
| 3121 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3122 | if (!params_buf) { |
| 3123 | _exception = 1; |
| 3124 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3125 | _exceptionMessage = "params == null"; |
| 3126 | goto exit; |
| 3127 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3128 | 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] | 3129 | int _needed; |
| 3130 | switch (pname) { |
| 3131 | #if defined(GL_SHININESS) |
| 3132 | case GL_SHININESS: |
| 3133 | #endif // defined(GL_SHININESS) |
| 3134 | _needed = 1; |
| 3135 | break; |
| 3136 | #if defined(GL_AMBIENT) |
| 3137 | case GL_AMBIENT: |
| 3138 | #endif // defined(GL_AMBIENT) |
| 3139 | #if defined(GL_DIFFUSE) |
| 3140 | case GL_DIFFUSE: |
| 3141 | #endif // defined(GL_DIFFUSE) |
| 3142 | #if defined(GL_SPECULAR) |
| 3143 | case GL_SPECULAR: |
| 3144 | #endif // defined(GL_SPECULAR) |
| 3145 | #if defined(GL_EMISSION) |
| 3146 | case GL_EMISSION: |
| 3147 | #endif // defined(GL_EMISSION) |
| 3148 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3149 | case GL_AMBIENT_AND_DIFFUSE: |
| 3150 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3151 | _needed = 4; |
| 3152 | break; |
| 3153 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3154 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3155 | break; |
| 3156 | } |
| 3157 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3158 | _exception = 1; |
| 3159 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3160 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3161 | goto exit; |
| 3162 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3163 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3164 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3165 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3166 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3167 | glMaterialxv( |
| 3168 | (GLenum)face, |
| 3169 | (GLenum)pname, |
| 3170 | (GLfixed *)params |
| 3171 | ); |
| 3172 | |
| 3173 | exit: |
| 3174 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3175 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3176 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3177 | if (_exception) { |
| 3178 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3179 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3180 | } |
| 3181 | |
| 3182 | /* void glMatrixMode ( GLenum mode ) */ |
| 3183 | static void |
| 3184 | android_glMatrixMode__I |
| 3185 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3186 | glMatrixMode( |
| 3187 | (GLenum)mode |
| 3188 | ); |
| 3189 | } |
| 3190 | |
| 3191 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3192 | static void |
| 3193 | android_glMultMatrixf___3FI |
| 3194 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3195 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3196 | const char * _exceptionType = NULL; |
| 3197 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3198 | GLfloat *m_base = (GLfloat *) 0; |
| 3199 | jint _remaining; |
| 3200 | GLfloat *m = (GLfloat *) 0; |
| 3201 | |
| 3202 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3203 | _exception = 1; |
| 3204 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3205 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3206 | goto exit; |
| 3207 | } |
| 3208 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3209 | _exception = 1; |
| 3210 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3211 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3212 | goto exit; |
| 3213 | } |
| 3214 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3215 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3216 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3217 | m = m_base + offset; |
| 3218 | |
| 3219 | glMultMatrixf( |
| 3220 | (GLfloat *)m |
| 3221 | ); |
| 3222 | |
| 3223 | exit: |
| 3224 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3225 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3226 | JNI_ABORT); |
| 3227 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3228 | if (_exception) { |
| 3229 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3230 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3231 | } |
| 3232 | |
| 3233 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3234 | static void |
| 3235 | android_glMultMatrixf__Ljava_nio_FloatBuffer_2 |
| 3236 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3237 | jint _exception = 0; |
| 3238 | const char * _exceptionType = NULL; |
| 3239 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3240 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3241 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3242 | jint _remaining; |
| 3243 | GLfloat *m = (GLfloat *) 0; |
| 3244 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3245 | if (!m_buf) { |
| 3246 | _exception = 1; |
| 3247 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3248 | _exceptionMessage = "m == null"; |
| 3249 | goto exit; |
| 3250 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3251 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3252 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3253 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3254 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 3255 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3256 | glMultMatrixf( |
| 3257 | (GLfloat *)m |
| 3258 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3259 | |
| 3260 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3261 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3262 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3263 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3264 | if (_exception) { |
| 3265 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3266 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3267 | } |
| 3268 | |
| 3269 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3270 | static void |
| 3271 | android_glMultMatrixx___3II |
| 3272 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3273 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3274 | const char * _exceptionType = NULL; |
| 3275 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3276 | GLfixed *m_base = (GLfixed *) 0; |
| 3277 | jint _remaining; |
| 3278 | GLfixed *m = (GLfixed *) 0; |
| 3279 | |
| 3280 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3281 | _exception = 1; |
| 3282 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3283 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3284 | goto exit; |
| 3285 | } |
| 3286 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3287 | _exception = 1; |
| 3288 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3289 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3290 | goto exit; |
| 3291 | } |
| 3292 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3293 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3294 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3295 | m = m_base + offset; |
| 3296 | |
| 3297 | glMultMatrixx( |
| 3298 | (GLfixed *)m |
| 3299 | ); |
| 3300 | |
| 3301 | exit: |
| 3302 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3303 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3304 | JNI_ABORT); |
| 3305 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3306 | if (_exception) { |
| 3307 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3308 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3309 | } |
| 3310 | |
| 3311 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3312 | static void |
| 3313 | android_glMultMatrixx__Ljava_nio_IntBuffer_2 |
| 3314 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3315 | jint _exception = 0; |
| 3316 | const char * _exceptionType = NULL; |
| 3317 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3318 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3319 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3320 | jint _remaining; |
| 3321 | GLfixed *m = (GLfixed *) 0; |
| 3322 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3323 | if (!m_buf) { |
| 3324 | _exception = 1; |
| 3325 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3326 | _exceptionMessage = "m == null"; |
| 3327 | goto exit; |
| 3328 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3329 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3330 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3331 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3332 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 3333 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3334 | glMultMatrixx( |
| 3335 | (GLfixed *)m |
| 3336 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3337 | |
| 3338 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3339 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3340 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3341 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3342 | if (_exception) { |
| 3343 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3344 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3345 | } |
| 3346 | |
| 3347 | /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */ |
| 3348 | static void |
| 3349 | android_glMultiTexCoord4f__IFFFF |
| 3350 | (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) { |
| 3351 | glMultiTexCoord4f( |
| 3352 | (GLenum)target, |
| 3353 | (GLfloat)s, |
| 3354 | (GLfloat)t, |
| 3355 | (GLfloat)r, |
| 3356 | (GLfloat)q |
| 3357 | ); |
| 3358 | } |
| 3359 | |
| 3360 | /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */ |
| 3361 | static void |
| 3362 | android_glMultiTexCoord4x__IIIII |
| 3363 | (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) { |
| 3364 | glMultiTexCoord4x( |
| 3365 | (GLenum)target, |
| 3366 | (GLfixed)s, |
| 3367 | (GLfixed)t, |
| 3368 | (GLfixed)r, |
| 3369 | (GLfixed)q |
| 3370 | ); |
| 3371 | } |
| 3372 | |
| 3373 | /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */ |
| 3374 | static void |
| 3375 | android_glNormal3f__FFF |
| 3376 | (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) { |
| 3377 | glNormal3f( |
| 3378 | (GLfloat)nx, |
| 3379 | (GLfloat)ny, |
| 3380 | (GLfloat)nz |
| 3381 | ); |
| 3382 | } |
| 3383 | |
| 3384 | /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */ |
| 3385 | static void |
| 3386 | android_glNormal3x__III |
| 3387 | (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) { |
| 3388 | glNormal3x( |
| 3389 | (GLfixed)nx, |
| 3390 | (GLfixed)ny, |
| 3391 | (GLfixed)nz |
| 3392 | ); |
| 3393 | } |
| 3394 | |
| 3395 | /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3396 | static void |
| 3397 | android_glNormalPointerBounds__IILjava_nio_Buffer_2I |
| 3398 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3399 | jint _exception = 0; |
| 3400 | const char * _exceptionType = NULL; |
| 3401 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3402 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3403 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3404 | jint _remaining; |
| 3405 | GLvoid *pointer = (GLvoid *) 0; |
| 3406 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3407 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3408 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3409 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3410 | return; |
| 3411 | } |
| 3412 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3413 | glNormalPointerBounds( |
| 3414 | (GLenum)type, |
| 3415 | (GLsizei)stride, |
| 3416 | (GLvoid *)pointer, |
| 3417 | (GLsizei)remaining |
| 3418 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3419 | if (_exception) { |
| 3420 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3421 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3422 | } |
| 3423 | |
| 3424 | /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3425 | static void |
| 3426 | android_glOrthof__FFFFFF |
| 3427 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 3428 | glOrthof( |
| 3429 | (GLfloat)left, |
| 3430 | (GLfloat)right, |
| 3431 | (GLfloat)bottom, |
| 3432 | (GLfloat)top, |
| 3433 | (GLfloat)zNear, |
| 3434 | (GLfloat)zFar |
| 3435 | ); |
| 3436 | } |
| 3437 | |
| 3438 | /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 3439 | static void |
| 3440 | android_glOrthox__IIIIII |
| 3441 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 3442 | glOrthox( |
| 3443 | (GLfixed)left, |
| 3444 | (GLfixed)right, |
| 3445 | (GLfixed)bottom, |
| 3446 | (GLfixed)top, |
| 3447 | (GLfixed)zNear, |
| 3448 | (GLfixed)zFar |
| 3449 | ); |
| 3450 | } |
| 3451 | |
| 3452 | /* void glPixelStorei ( GLenum pname, GLint param ) */ |
| 3453 | static void |
| 3454 | android_glPixelStorei__II |
| 3455 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 3456 | glPixelStorei( |
| 3457 | (GLenum)pname, |
| 3458 | (GLint)param |
| 3459 | ); |
| 3460 | } |
| 3461 | |
| 3462 | /* void glPointSize ( GLfloat size ) */ |
| 3463 | static void |
| 3464 | android_glPointSize__F |
| 3465 | (JNIEnv *_env, jobject _this, jfloat size) { |
| 3466 | glPointSize( |
| 3467 | (GLfloat)size |
| 3468 | ); |
| 3469 | } |
| 3470 | |
| 3471 | /* void glPointSizex ( GLfixed size ) */ |
| 3472 | static void |
| 3473 | android_glPointSizex__I |
| 3474 | (JNIEnv *_env, jobject _this, jint size) { |
| 3475 | glPointSizex( |
| 3476 | (GLfixed)size |
| 3477 | ); |
| 3478 | } |
| 3479 | |
| 3480 | /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ |
| 3481 | static void |
| 3482 | android_glPolygonOffset__FF |
| 3483 | (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { |
| 3484 | glPolygonOffset( |
| 3485 | (GLfloat)factor, |
| 3486 | (GLfloat)units |
| 3487 | ); |
| 3488 | } |
| 3489 | |
| 3490 | /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */ |
| 3491 | static void |
| 3492 | android_glPolygonOffsetx__II |
| 3493 | (JNIEnv *_env, jobject _this, jint factor, jint units) { |
| 3494 | glPolygonOffsetx( |
| 3495 | (GLfixed)factor, |
| 3496 | (GLfixed)units |
| 3497 | ); |
| 3498 | } |
| 3499 | |
| 3500 | /* void glPopMatrix ( void ) */ |
| 3501 | static void |
| 3502 | android_glPopMatrix__ |
| 3503 | (JNIEnv *_env, jobject _this) { |
| 3504 | glPopMatrix(); |
| 3505 | } |
| 3506 | |
| 3507 | /* void glPushMatrix ( void ) */ |
| 3508 | static void |
| 3509 | android_glPushMatrix__ |
| 3510 | (JNIEnv *_env, jobject _this) { |
| 3511 | glPushMatrix(); |
| 3512 | } |
| 3513 | |
| 3514 | /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ |
| 3515 | static void |
| 3516 | android_glReadPixels__IIIIIILjava_nio_Buffer_2 |
| 3517 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3518 | jint _exception = 0; |
| 3519 | const char * _exceptionType = NULL; |
| 3520 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3521 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3522 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3523 | jint _remaining; |
| 3524 | GLvoid *pixels = (GLvoid *) 0; |
| 3525 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3526 | if (!pixels_buf) { |
| 3527 | _exception = 1; |
| 3528 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3529 | _exceptionMessage = "pixels == null"; |
| 3530 | goto exit; |
| 3531 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3532 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3533 | if (pixels == NULL) { |
| 3534 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3535 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 3536 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3537 | glReadPixels( |
| 3538 | (GLint)x, |
| 3539 | (GLint)y, |
| 3540 | (GLsizei)width, |
| 3541 | (GLsizei)height, |
| 3542 | (GLenum)format, |
| 3543 | (GLenum)type, |
| 3544 | (GLvoid *)pixels |
| 3545 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3546 | |
| 3547 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3548 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3549 | releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE); |
| 3550 | } |
| 3551 | if (_exception) { |
| 3552 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3553 | } |
| 3554 | } |
| 3555 | |
| 3556 | /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */ |
| 3557 | static void |
| 3558 | android_glRotatef__FFFF |
| 3559 | (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) { |
| 3560 | glRotatef( |
| 3561 | (GLfloat)angle, |
| 3562 | (GLfloat)x, |
| 3563 | (GLfloat)y, |
| 3564 | (GLfloat)z |
| 3565 | ); |
| 3566 | } |
| 3567 | |
| 3568 | /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */ |
| 3569 | static void |
| 3570 | android_glRotatex__IIII |
| 3571 | (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) { |
| 3572 | glRotatex( |
| 3573 | (GLfixed)angle, |
| 3574 | (GLfixed)x, |
| 3575 | (GLfixed)y, |
| 3576 | (GLfixed)z |
| 3577 | ); |
| 3578 | } |
| 3579 | |
| 3580 | /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ |
| 3581 | static void |
| 3582 | android_glSampleCoverage__FZ |
| 3583 | (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { |
| 3584 | glSampleCoverage( |
| 3585 | (GLclampf)value, |
| 3586 | (GLboolean)invert |
| 3587 | ); |
| 3588 | } |
| 3589 | |
| 3590 | /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */ |
| 3591 | static void |
| 3592 | android_glSampleCoveragex__IZ |
| 3593 | (JNIEnv *_env, jobject _this, jint value, jboolean invert) { |
| 3594 | glSampleCoveragex( |
| 3595 | (GLclampx)value, |
| 3596 | (GLboolean)invert |
| 3597 | ); |
| 3598 | } |
| 3599 | |
| 3600 | /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3601 | static void |
| 3602 | android_glScalef__FFF |
| 3603 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3604 | glScalef( |
| 3605 | (GLfloat)x, |
| 3606 | (GLfloat)y, |
| 3607 | (GLfloat)z |
| 3608 | ); |
| 3609 | } |
| 3610 | |
| 3611 | /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3612 | static void |
| 3613 | android_glScalex__III |
| 3614 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3615 | glScalex( |
| 3616 | (GLfixed)x, |
| 3617 | (GLfixed)y, |
| 3618 | (GLfixed)z |
| 3619 | ); |
| 3620 | } |
| 3621 | |
| 3622 | /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3623 | static void |
| 3624 | android_glScissor__IIII |
| 3625 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3626 | glScissor( |
| 3627 | (GLint)x, |
| 3628 | (GLint)y, |
| 3629 | (GLsizei)width, |
| 3630 | (GLsizei)height |
| 3631 | ); |
| 3632 | } |
| 3633 | |
| 3634 | /* void glShadeModel ( GLenum mode ) */ |
| 3635 | static void |
| 3636 | android_glShadeModel__I |
| 3637 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3638 | glShadeModel( |
| 3639 | (GLenum)mode |
| 3640 | ); |
| 3641 | } |
| 3642 | |
| 3643 | /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ |
| 3644 | static void |
| 3645 | android_glStencilFunc__III |
| 3646 | (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { |
| 3647 | glStencilFunc( |
| 3648 | (GLenum)func, |
| 3649 | (GLint)ref, |
| 3650 | (GLuint)mask |
| 3651 | ); |
| 3652 | } |
| 3653 | |
| 3654 | /* void glStencilMask ( GLuint mask ) */ |
| 3655 | static void |
| 3656 | android_glStencilMask__I |
| 3657 | (JNIEnv *_env, jobject _this, jint mask) { |
| 3658 | glStencilMask( |
| 3659 | (GLuint)mask |
| 3660 | ); |
| 3661 | } |
| 3662 | |
| 3663 | /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3664 | static void |
| 3665 | android_glStencilOp__III |
| 3666 | (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { |
| 3667 | glStencilOp( |
| 3668 | (GLenum)fail, |
| 3669 | (GLenum)zfail, |
| 3670 | (GLenum)zpass |
| 3671 | ); |
| 3672 | } |
| 3673 | |
| 3674 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3675 | static void |
| 3676 | android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I |
| 3677 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3678 | jint _exception = 0; |
| 3679 | const char * _exceptionType = NULL; |
| 3680 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3681 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3682 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3683 | jint _remaining; |
| 3684 | GLvoid *pointer = (GLvoid *) 0; |
| 3685 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3686 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3687 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3688 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3689 | return; |
| 3690 | } |
| 3691 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | glTexCoordPointerBounds( |
| 3693 | (GLint)size, |
| 3694 | (GLenum)type, |
| 3695 | (GLsizei)stride, |
| 3696 | (GLvoid *)pointer, |
| 3697 | (GLsizei)remaining |
| 3698 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3699 | if (_exception) { |
| 3700 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3701 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3702 | } |
| 3703 | |
| 3704 | /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3705 | static void |
| 3706 | android_glTexEnvf__IIF |
| 3707 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3708 | glTexEnvf( |
| 3709 | (GLenum)target, |
| 3710 | (GLenum)pname, |
| 3711 | (GLfloat)param |
| 3712 | ); |
| 3713 | } |
| 3714 | |
| 3715 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3716 | static void |
| 3717 | android_glTexEnvfv__II_3FI |
| 3718 | (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] | 3719 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3720 | const char * _exceptionType = NULL; |
| 3721 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3722 | GLfloat *params_base = (GLfloat *) 0; |
| 3723 | jint _remaining; |
| 3724 | GLfloat *params = (GLfloat *) 0; |
| 3725 | |
| 3726 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3727 | _exception = 1; |
| 3728 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3729 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3730 | goto exit; |
| 3731 | } |
| 3732 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3733 | _exception = 1; |
| 3734 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3735 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3736 | goto exit; |
| 3737 | } |
| 3738 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3739 | int _needed; |
| 3740 | switch (pname) { |
| 3741 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3742 | case GL_TEXTURE_ENV_MODE: |
| 3743 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3744 | #if defined(GL_COMBINE_RGB) |
| 3745 | case GL_COMBINE_RGB: |
| 3746 | #endif // defined(GL_COMBINE_RGB) |
| 3747 | #if defined(GL_COMBINE_ALPHA) |
| 3748 | case GL_COMBINE_ALPHA: |
| 3749 | #endif // defined(GL_COMBINE_ALPHA) |
| 3750 | _needed = 1; |
| 3751 | break; |
| 3752 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3753 | case GL_TEXTURE_ENV_COLOR: |
| 3754 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3755 | _needed = 4; |
| 3756 | break; |
| 3757 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3758 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3759 | break; |
| 3760 | } |
| 3761 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3762 | _exception = 1; |
| 3763 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3764 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3765 | goto exit; |
| 3766 | } |
| 3767 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3768 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3769 | params = params_base + offset; |
| 3770 | |
| 3771 | glTexEnvfv( |
| 3772 | (GLenum)target, |
| 3773 | (GLenum)pname, |
| 3774 | (GLfloat *)params |
| 3775 | ); |
| 3776 | |
| 3777 | exit: |
| 3778 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3779 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3780 | JNI_ABORT); |
| 3781 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3782 | if (_exception) { |
| 3783 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3784 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3785 | } |
| 3786 | |
| 3787 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3788 | static void |
| 3789 | android_glTexEnvfv__IILjava_nio_FloatBuffer_2 |
| 3790 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3791 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3792 | const char * _exceptionType = NULL; |
| 3793 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3794 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3795 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3796 | jint _remaining; |
| 3797 | GLfloat *params = (GLfloat *) 0; |
| 3798 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3799 | if (!params_buf) { |
| 3800 | _exception = 1; |
| 3801 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3802 | _exceptionMessage = "params == null"; |
| 3803 | goto exit; |
| 3804 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3805 | 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] | 3806 | int _needed; |
| 3807 | switch (pname) { |
| 3808 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3809 | case GL_TEXTURE_ENV_MODE: |
| 3810 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3811 | #if defined(GL_COMBINE_RGB) |
| 3812 | case GL_COMBINE_RGB: |
| 3813 | #endif // defined(GL_COMBINE_RGB) |
| 3814 | #if defined(GL_COMBINE_ALPHA) |
| 3815 | case GL_COMBINE_ALPHA: |
| 3816 | #endif // defined(GL_COMBINE_ALPHA) |
| 3817 | _needed = 1; |
| 3818 | break; |
| 3819 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3820 | case GL_TEXTURE_ENV_COLOR: |
| 3821 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3822 | _needed = 4; |
| 3823 | break; |
| 3824 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3825 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3826 | break; |
| 3827 | } |
| 3828 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3829 | _exception = 1; |
| 3830 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3831 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3832 | goto exit; |
| 3833 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3834 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3835 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3836 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3837 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3838 | glTexEnvfv( |
| 3839 | (GLenum)target, |
| 3840 | (GLenum)pname, |
| 3841 | (GLfloat *)params |
| 3842 | ); |
| 3843 | |
| 3844 | exit: |
| 3845 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3846 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3847 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3848 | if (_exception) { |
| 3849 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3850 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3851 | } |
| 3852 | |
| 3853 | /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3854 | static void |
| 3855 | android_glTexEnvx__III |
| 3856 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3857 | glTexEnvx( |
| 3858 | (GLenum)target, |
| 3859 | (GLenum)pname, |
| 3860 | (GLfixed)param |
| 3861 | ); |
| 3862 | } |
| 3863 | |
| 3864 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3865 | static void |
| 3866 | android_glTexEnvxv__II_3II |
| 3867 | (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] | 3868 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3869 | const char * _exceptionType = NULL; |
| 3870 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3871 | GLfixed *params_base = (GLfixed *) 0; |
| 3872 | jint _remaining; |
| 3873 | GLfixed *params = (GLfixed *) 0; |
| 3874 | |
| 3875 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3876 | _exception = 1; |
| 3877 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3878 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3879 | goto exit; |
| 3880 | } |
| 3881 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3882 | _exception = 1; |
| 3883 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3884 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3885 | goto exit; |
| 3886 | } |
| 3887 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3888 | int _needed; |
| 3889 | switch (pname) { |
| 3890 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3891 | case GL_TEXTURE_ENV_MODE: |
| 3892 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3893 | #if defined(GL_COMBINE_RGB) |
| 3894 | case GL_COMBINE_RGB: |
| 3895 | #endif // defined(GL_COMBINE_RGB) |
| 3896 | #if defined(GL_COMBINE_ALPHA) |
| 3897 | case GL_COMBINE_ALPHA: |
| 3898 | #endif // defined(GL_COMBINE_ALPHA) |
| 3899 | _needed = 1; |
| 3900 | break; |
| 3901 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3902 | case GL_TEXTURE_ENV_COLOR: |
| 3903 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3904 | _needed = 4; |
| 3905 | break; |
| 3906 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3907 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3908 | break; |
| 3909 | } |
| 3910 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3911 | _exception = 1; |
| 3912 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3913 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3914 | goto exit; |
| 3915 | } |
| 3916 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3917 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3918 | params = params_base + offset; |
| 3919 | |
| 3920 | glTexEnvxv( |
| 3921 | (GLenum)target, |
| 3922 | (GLenum)pname, |
| 3923 | (GLfixed *)params |
| 3924 | ); |
| 3925 | |
| 3926 | exit: |
| 3927 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3928 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3929 | JNI_ABORT); |
| 3930 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3931 | if (_exception) { |
| 3932 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3933 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3934 | } |
| 3935 | |
| 3936 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3937 | static void |
| 3938 | android_glTexEnvxv__IILjava_nio_IntBuffer_2 |
| 3939 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3940 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3941 | const char * _exceptionType = NULL; |
| 3942 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3943 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3944 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3945 | jint _remaining; |
| 3946 | GLfixed *params = (GLfixed *) 0; |
| 3947 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 3948 | if (!params_buf) { |
| 3949 | _exception = 1; |
| 3950 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3951 | _exceptionMessage = "params == null"; |
| 3952 | goto exit; |
| 3953 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3954 | 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] | 3955 | int _needed; |
| 3956 | switch (pname) { |
| 3957 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3958 | case GL_TEXTURE_ENV_MODE: |
| 3959 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3960 | #if defined(GL_COMBINE_RGB) |
| 3961 | case GL_COMBINE_RGB: |
| 3962 | #endif // defined(GL_COMBINE_RGB) |
| 3963 | #if defined(GL_COMBINE_ALPHA) |
| 3964 | case GL_COMBINE_ALPHA: |
| 3965 | #endif // defined(GL_COMBINE_ALPHA) |
| 3966 | _needed = 1; |
| 3967 | break; |
| 3968 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3969 | case GL_TEXTURE_ENV_COLOR: |
| 3970 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3971 | _needed = 4; |
| 3972 | break; |
| 3973 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3974 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3975 | break; |
| 3976 | } |
| 3977 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3978 | _exception = 1; |
| 3979 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3980 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3981 | goto exit; |
| 3982 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3983 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3984 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3985 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3986 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3987 | glTexEnvxv( |
| 3988 | (GLenum)target, |
| 3989 | (GLenum)pname, |
| 3990 | (GLfixed *)params |
| 3991 | ); |
| 3992 | |
| 3993 | exit: |
| 3994 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3995 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3996 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3997 | if (_exception) { |
| 3998 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3999 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4000 | } |
| 4001 | |
| 4002 | /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 4003 | static void |
| 4004 | android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 4005 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4006 | jint _exception = 0; |
| 4007 | const char * _exceptionType = NULL; |
| 4008 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4009 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4010 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4011 | jint _remaining; |
| 4012 | GLvoid *pixels = (GLvoid *) 0; |
| 4013 | |
| 4014 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4015 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4016 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4017 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4018 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4019 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4020 | } |
| 4021 | glTexImage2D( |
| 4022 | (GLenum)target, |
| 4023 | (GLint)level, |
| 4024 | (GLint)internalformat, |
| 4025 | (GLsizei)width, |
| 4026 | (GLsizei)height, |
| 4027 | (GLint)border, |
| 4028 | (GLenum)format, |
| 4029 | (GLenum)type, |
| 4030 | (GLvoid *)pixels |
| 4031 | ); |
| 4032 | if (_array) { |
| 4033 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 4034 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4035 | if (_exception) { |
| 4036 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4037 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4038 | } |
| 4039 | |
| 4040 | /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 4041 | static void |
| 4042 | android_glTexParameterf__IIF |
| 4043 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 4044 | glTexParameterf( |
| 4045 | (GLenum)target, |
| 4046 | (GLenum)pname, |
| 4047 | (GLfloat)param |
| 4048 | ); |
| 4049 | } |
| 4050 | |
| 4051 | /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 4052 | static void |
| 4053 | android_glTexParameterx__III |
| 4054 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 4055 | glTexParameterx( |
| 4056 | (GLenum)target, |
| 4057 | (GLenum)pname, |
| 4058 | (GLfixed)param |
| 4059 | ); |
| 4060 | } |
| 4061 | |
| 4062 | /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 4063 | static void |
| 4064 | android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 4065 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4066 | jint _exception = 0; |
| 4067 | const char * _exceptionType = NULL; |
| 4068 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4069 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4070 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4071 | jint _remaining; |
| 4072 | GLvoid *pixels = (GLvoid *) 0; |
| 4073 | |
| 4074 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4075 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4076 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4077 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4078 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4079 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4080 | } |
| 4081 | glTexSubImage2D( |
| 4082 | (GLenum)target, |
| 4083 | (GLint)level, |
| 4084 | (GLint)xoffset, |
| 4085 | (GLint)yoffset, |
| 4086 | (GLsizei)width, |
| 4087 | (GLsizei)height, |
| 4088 | (GLenum)format, |
| 4089 | (GLenum)type, |
| 4090 | (GLvoid *)pixels |
| 4091 | ); |
| 4092 | if (_array) { |
| 4093 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 4094 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4095 | if (_exception) { |
| 4096 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4097 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4098 | } |
| 4099 | |
| 4100 | /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 4101 | static void |
| 4102 | android_glTranslatef__FFF |
| 4103 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 4104 | glTranslatef( |
| 4105 | (GLfloat)x, |
| 4106 | (GLfloat)y, |
| 4107 | (GLfloat)z |
| 4108 | ); |
| 4109 | } |
| 4110 | |
| 4111 | /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 4112 | static void |
| 4113 | android_glTranslatex__III |
| 4114 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 4115 | glTranslatex( |
| 4116 | (GLfixed)x, |
| 4117 | (GLfixed)y, |
| 4118 | (GLfixed)z |
| 4119 | ); |
| 4120 | } |
| 4121 | |
| 4122 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 4123 | static void |
| 4124 | android_glVertexPointerBounds__IIILjava_nio_Buffer_2I |
| 4125 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4126 | jint _exception = 0; |
| 4127 | const char * _exceptionType = NULL; |
| 4128 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4129 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4130 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4131 | jint _remaining; |
| 4132 | GLvoid *pointer = (GLvoid *) 0; |
| 4133 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4134 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 4135 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4136 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4137 | return; |
| 4138 | } |
| 4139 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4140 | glVertexPointerBounds( |
| 4141 | (GLint)size, |
| 4142 | (GLenum)type, |
| 4143 | (GLsizei)stride, |
| 4144 | (GLvoid *)pointer, |
| 4145 | (GLsizei)remaining |
| 4146 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4147 | if (_exception) { |
| 4148 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4149 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4150 | } |
| 4151 | |
| 4152 | /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 4153 | static void |
| 4154 | android_glViewport__IIII |
| 4155 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 4156 | glViewport( |
| 4157 | (GLint)x, |
| 4158 | (GLint)y, |
| 4159 | (GLsizei)width, |
| 4160 | (GLsizei)height |
| 4161 | ); |
| 4162 | } |
| 4163 | |
| 4164 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4165 | static jint |
| 4166 | android_glQueryMatrixxOES___3II_3II |
| 4167 | (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) { |
| 4168 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4169 | const char * _exceptionType = NULL; |
| 4170 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4171 | GLbitfield _returnValue = -1; |
| 4172 | GLfixed *mantissa_base = (GLfixed *) 0; |
| 4173 | jint _mantissaRemaining; |
| 4174 | GLfixed *mantissa = (GLfixed *) 0; |
| 4175 | GLint *exponent_base = (GLint *) 0; |
| 4176 | jint _exponentRemaining; |
| 4177 | GLint *exponent = (GLint *) 0; |
| 4178 | |
| 4179 | if (!mantissa_ref) { |
| 4180 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4181 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4182 | _exceptionMessage = "mantissa == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4183 | goto exit; |
| 4184 | } |
| 4185 | if (mantissaOffset < 0) { |
| 4186 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4187 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4188 | _exceptionMessage = "mantissaOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4189 | goto exit; |
| 4190 | } |
| 4191 | _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; |
| 4192 | if (_mantissaRemaining < 16) { |
| 4193 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4194 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4195 | _exceptionMessage = "length - mantissaOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4196 | goto exit; |
| 4197 | } |
| 4198 | mantissa_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4199 | _env->GetIntArrayElements(mantissa_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4200 | mantissa = mantissa_base + mantissaOffset; |
| 4201 | |
| 4202 | if (!exponent_ref) { |
| 4203 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4204 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4205 | _exceptionMessage = "exponent == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4206 | goto exit; |
| 4207 | } |
| 4208 | if (exponentOffset < 0) { |
| 4209 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4210 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4211 | _exceptionMessage = "exponentOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4212 | goto exit; |
| 4213 | } |
| 4214 | _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; |
| 4215 | if (_exponentRemaining < 16) { |
| 4216 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4217 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4218 | _exceptionMessage = "length - exponentOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4219 | goto exit; |
| 4220 | } |
| 4221 | exponent_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4222 | _env->GetIntArrayElements(exponent_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4223 | exponent = exponent_base + exponentOffset; |
| 4224 | |
| 4225 | _returnValue = glQueryMatrixxOES( |
| 4226 | (GLfixed *)mantissa, |
| 4227 | (GLint *)exponent |
| 4228 | ); |
| 4229 | |
| 4230 | exit: |
| 4231 | if (exponent_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4232 | _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4233 | _exception ? JNI_ABORT: 0); |
| 4234 | } |
| 4235 | if (mantissa_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4236 | _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4237 | _exception ? JNI_ABORT: 0); |
| 4238 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4239 | if (_exception) { |
| 4240 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4241 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4242 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4243 | } |
| 4244 | |
| 4245 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4246 | static jint |
| 4247 | android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 4248 | (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) { |
| 4249 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4250 | const char * _exceptionType = NULL; |
| 4251 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4252 | jintArray _mantissaArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4253 | jint _mantissaBufferOffset = (jint) 0; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4254 | jintArray _exponentArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4255 | jint _exponentBufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4256 | GLbitfield _returnValue = -1; |
| 4257 | jint _mantissaRemaining; |
| 4258 | GLfixed *mantissa = (GLfixed *) 0; |
| 4259 | jint _exponentRemaining; |
| 4260 | GLint *exponent = (GLint *) 0; |
| 4261 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4262 | if (!mantissa_buf) { |
| 4263 | _exception = 1; |
| 4264 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4265 | _exceptionMessage = "mantissa == null"; |
| 4266 | goto exit; |
| 4267 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4268 | 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] | 4269 | if (_mantissaRemaining < 16) { |
| 4270 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4271 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4272 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4273 | goto exit; |
| 4274 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4275 | if (!exponent_buf) { |
| 4276 | _exception = 1; |
| 4277 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4278 | _exceptionMessage = "exponent == null"; |
| 4279 | goto exit; |
| 4280 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4281 | 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] | 4282 | if (_exponentRemaining < 16) { |
| 4283 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4284 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4285 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4286 | goto exit; |
| 4287 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4288 | if (mantissa == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4289 | char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4290 | mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset); |
| 4291 | } |
| 4292 | if (exponent == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4293 | char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4294 | exponent = (GLint *) (_exponentBase + _exponentBufferOffset); |
| 4295 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4296 | _returnValue = glQueryMatrixxOES( |
| 4297 | (GLfixed *)mantissa, |
| 4298 | (GLint *)exponent |
| 4299 | ); |
| 4300 | |
| 4301 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4302 | if (_exponentArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4303 | _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4304 | } |
| 4305 | if (_mantissaArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4306 | _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4307 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4308 | if (_exception) { |
| 4309 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4310 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4311 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4312 | } |
| 4313 | |
| 4314 | /* void glBindBuffer ( GLenum target, GLuint buffer ) */ |
| 4315 | static void |
| 4316 | android_glBindBuffer__II |
| 4317 | (JNIEnv *_env, jobject _this, jint target, jint buffer) { |
| 4318 | glBindBuffer( |
| 4319 | (GLenum)target, |
| 4320 | (GLuint)buffer |
| 4321 | ); |
| 4322 | } |
| 4323 | |
| 4324 | /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ |
| 4325 | static void |
| 4326 | android_glBufferData__IILjava_nio_Buffer_2I |
| 4327 | (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] | 4328 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4329 | const char * _exceptionType = NULL; |
| 4330 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4331 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4332 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4333 | jint _remaining; |
| 4334 | GLvoid *data = (GLvoid *) 0; |
| 4335 | |
| 4336 | if (data_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4337 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4338 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4339 | _exception = 1; |
| 4340 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4341 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4342 | goto exit; |
| 4343 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4344 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4345 | if (data_buf && data == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4346 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4347 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4348 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4349 | glBufferData( |
| 4350 | (GLenum)target, |
| 4351 | (GLsizeiptr)size, |
| 4352 | (GLvoid *)data, |
| 4353 | (GLenum)usage |
| 4354 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4355 | |
| 4356 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4357 | if (_array) { |
| 4358 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4359 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4360 | if (_exception) { |
| 4361 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4362 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4363 | } |
| 4364 | |
| 4365 | /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ |
| 4366 | static void |
| 4367 | android_glBufferSubData__IIILjava_nio_Buffer_2 |
| 4368 | (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] | 4369 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4370 | const char * _exceptionType = NULL; |
| 4371 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4372 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4373 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4374 | jint _remaining; |
| 4375 | GLvoid *data = (GLvoid *) 0; |
| 4376 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4377 | if (!data_buf) { |
| 4378 | _exception = 1; |
| 4379 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4380 | _exceptionMessage = "data == null"; |
| 4381 | goto exit; |
| 4382 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4383 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4384 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4385 | _exception = 1; |
| 4386 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4387 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4388 | goto exit; |
| 4389 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4390 | if (data == NULL) { |
| 4391 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4392 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4393 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4394 | glBufferSubData( |
| 4395 | (GLenum)target, |
| 4396 | (GLintptr)offset, |
| 4397 | (GLsizeiptr)size, |
| 4398 | (GLvoid *)data |
| 4399 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4400 | |
| 4401 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4402 | if (_array) { |
| 4403 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4404 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4405 | if (_exception) { |
| 4406 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4407 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4408 | } |
| 4409 | |
| 4410 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4411 | static void |
| 4412 | android_glClipPlanef__I_3FI |
| 4413 | (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4414 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4415 | const char * _exceptionType = NULL; |
| 4416 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4417 | GLfloat *equation_base = (GLfloat *) 0; |
| 4418 | jint _remaining; |
| 4419 | GLfloat *equation = (GLfloat *) 0; |
| 4420 | |
| 4421 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4422 | _exception = 1; |
| 4423 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4424 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4425 | goto exit; |
| 4426 | } |
| 4427 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4428 | _exception = 1; |
| 4429 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4430 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4431 | goto exit; |
| 4432 | } |
| 4433 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4434 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4435 | _exception = 1; |
| 4436 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4437 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4438 | goto exit; |
| 4439 | } |
| 4440 | equation_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4441 | _env->GetFloatArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4442 | equation = equation_base + offset; |
| 4443 | |
| 4444 | glClipPlanef( |
| 4445 | (GLenum)plane, |
| 4446 | (GLfloat *)equation |
| 4447 | ); |
| 4448 | |
| 4449 | exit: |
| 4450 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4451 | _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4452 | JNI_ABORT); |
| 4453 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4454 | if (_exception) { |
| 4455 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4456 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4457 | } |
| 4458 | |
| 4459 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4460 | static void |
| 4461 | android_glClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4462 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4463 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4464 | const char * _exceptionType = NULL; |
| 4465 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4466 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4467 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4468 | jint _remaining; |
| 4469 | GLfloat *equation = (GLfloat *) 0; |
| 4470 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4471 | if (!equation_buf) { |
| 4472 | _exception = 1; |
| 4473 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4474 | _exceptionMessage = "equation == null"; |
| 4475 | goto exit; |
| 4476 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4477 | 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] | 4478 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4479 | _exception = 1; |
| 4480 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4481 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4482 | goto exit; |
| 4483 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4484 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4485 | char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4486 | equation = (GLfloat *) (_equationBase + _bufferOffset); |
| 4487 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4488 | glClipPlanef( |
| 4489 | (GLenum)plane, |
| 4490 | (GLfloat *)equation |
| 4491 | ); |
| 4492 | |
| 4493 | exit: |
| 4494 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4495 | _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4496 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4497 | if (_exception) { |
| 4498 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4499 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4500 | } |
| 4501 | |
| 4502 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4503 | static void |
| 4504 | android_glClipPlanex__I_3II |
| 4505 | (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4506 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4507 | const char * _exceptionType = NULL; |
| 4508 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4509 | GLfixed *equation_base = (GLfixed *) 0; |
| 4510 | jint _remaining; |
| 4511 | GLfixed *equation = (GLfixed *) 0; |
| 4512 | |
| 4513 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4514 | _exception = 1; |
| 4515 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4516 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4517 | goto exit; |
| 4518 | } |
| 4519 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4520 | _exception = 1; |
| 4521 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4522 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4523 | goto exit; |
| 4524 | } |
| 4525 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4526 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4527 | _exception = 1; |
| 4528 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4529 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4530 | goto exit; |
| 4531 | } |
| 4532 | equation_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4533 | _env->GetIntArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4534 | equation = equation_base + offset; |
| 4535 | |
| 4536 | glClipPlanex( |
| 4537 | (GLenum)plane, |
| 4538 | (GLfixed *)equation |
| 4539 | ); |
| 4540 | |
| 4541 | exit: |
| 4542 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4543 | _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4544 | JNI_ABORT); |
| 4545 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4546 | if (_exception) { |
| 4547 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4548 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4549 | } |
| 4550 | |
| 4551 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4552 | static void |
| 4553 | android_glClipPlanex__ILjava_nio_IntBuffer_2 |
| 4554 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4555 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4556 | const char * _exceptionType = NULL; |
| 4557 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4558 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4559 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4560 | jint _remaining; |
| 4561 | GLfixed *equation = (GLfixed *) 0; |
| 4562 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4563 | if (!equation_buf) { |
| 4564 | _exception = 1; |
| 4565 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4566 | _exceptionMessage = "equation == null"; |
| 4567 | goto exit; |
| 4568 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4569 | 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] | 4570 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4571 | _exception = 1; |
| 4572 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4573 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4574 | goto exit; |
| 4575 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4576 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4577 | char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4578 | equation = (GLfixed *) (_equationBase + _bufferOffset); |
| 4579 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4580 | glClipPlanex( |
| 4581 | (GLenum)plane, |
| 4582 | (GLfixed *)equation |
| 4583 | ); |
| 4584 | |
| 4585 | exit: |
| 4586 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4587 | _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4588 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4589 | if (_exception) { |
| 4590 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4591 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4592 | } |
| 4593 | |
| 4594 | /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ |
| 4595 | static void |
| 4596 | android_glColor4ub__BBBB |
| 4597 | (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { |
| 4598 | glColor4ub( |
| 4599 | (GLubyte)red, |
| 4600 | (GLubyte)green, |
| 4601 | (GLubyte)blue, |
| 4602 | (GLubyte)alpha |
| 4603 | ); |
| 4604 | } |
| 4605 | |
| 4606 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 4607 | static void |
| 4608 | android_glColorPointer__IIII |
| 4609 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 4610 | glColorPointer( |
| 4611 | (GLint)size, |
| 4612 | (GLenum)type, |
| 4613 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4614 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4615 | ); |
| 4616 | } |
| 4617 | |
| 4618 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4619 | static void |
| 4620 | android_glDeleteBuffers__I_3II |
| 4621 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4622 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4623 | const char * _exceptionType = NULL; |
| 4624 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4625 | GLuint *buffers_base = (GLuint *) 0; |
| 4626 | jint _remaining; |
| 4627 | GLuint *buffers = (GLuint *) 0; |
| 4628 | |
| 4629 | if (!buffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4630 | _exception = 1; |
| 4631 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4632 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4633 | goto exit; |
| 4634 | } |
| 4635 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4636 | _exception = 1; |
| 4637 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4638 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4639 | goto exit; |
| 4640 | } |
| 4641 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4642 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4643 | _exception = 1; |
| 4644 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4645 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4646 | goto exit; |
| 4647 | } |
| 4648 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4649 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4650 | buffers = buffers_base + offset; |
| 4651 | |
| 4652 | glDeleteBuffers( |
| 4653 | (GLsizei)n, |
| 4654 | (GLuint *)buffers |
| 4655 | ); |
| 4656 | |
| 4657 | exit: |
| 4658 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4659 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4660 | JNI_ABORT); |
| 4661 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4662 | if (_exception) { |
| 4663 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4664 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4665 | } |
| 4666 | |
| 4667 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4668 | static void |
| 4669 | android_glDeleteBuffers__ILjava_nio_IntBuffer_2 |
| 4670 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4671 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4672 | const char * _exceptionType = NULL; |
| 4673 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4674 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4675 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4676 | jint _remaining; |
| 4677 | GLuint *buffers = (GLuint *) 0; |
| 4678 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4679 | if (!buffers_buf) { |
| 4680 | _exception = 1; |
| 4681 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4682 | _exceptionMessage = "buffers == null"; |
| 4683 | goto exit; |
| 4684 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4685 | 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] | 4686 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4687 | _exception = 1; |
| 4688 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4689 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4690 | goto exit; |
| 4691 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4692 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4693 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4694 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4695 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4696 | glDeleteBuffers( |
| 4697 | (GLsizei)n, |
| 4698 | (GLuint *)buffers |
| 4699 | ); |
| 4700 | |
| 4701 | exit: |
| 4702 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4703 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4704 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4705 | if (_exception) { |
| 4706 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4707 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4708 | } |
| 4709 | |
| 4710 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ |
| 4711 | static void |
| 4712 | android_glDrawElements__IIII |
| 4713 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4714 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4715 | const char * _exceptionType = NULL; |
| 4716 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4717 | glDrawElements( |
| 4718 | (GLenum)mode, |
| 4719 | (GLsizei)count, |
| 4720 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4721 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4722 | ); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4723 | if (_exception) { |
| 4724 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4725 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4726 | } |
| 4727 | |
| 4728 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4729 | static void |
| 4730 | android_glGenBuffers__I_3II |
| 4731 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 4732 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4733 | const char * _exceptionType = NULL; |
| 4734 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4735 | GLuint *buffers_base = (GLuint *) 0; |
| 4736 | jint _remaining; |
| 4737 | GLuint *buffers = (GLuint *) 0; |
| 4738 | |
| 4739 | if (!buffers_ref) { |
| 4740 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4741 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4742 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4743 | goto exit; |
| 4744 | } |
| 4745 | if (offset < 0) { |
| 4746 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4747 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4748 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4749 | goto exit; |
| 4750 | } |
| 4751 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4752 | if (_remaining < n) { |
| 4753 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4754 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4755 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4756 | goto exit; |
| 4757 | } |
| 4758 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4759 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4760 | buffers = buffers_base + offset; |
| 4761 | |
| 4762 | glGenBuffers( |
| 4763 | (GLsizei)n, |
| 4764 | (GLuint *)buffers |
| 4765 | ); |
| 4766 | |
| 4767 | exit: |
| 4768 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4769 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4770 | _exception ? JNI_ABORT: 0); |
| 4771 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4772 | if (_exception) { |
| 4773 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4774 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4775 | } |
| 4776 | |
| 4777 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4778 | static void |
| 4779 | android_glGenBuffers__ILjava_nio_IntBuffer_2 |
| 4780 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 4781 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4782 | const char * _exceptionType = NULL; |
| 4783 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4784 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4785 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4786 | jint _remaining; |
| 4787 | GLuint *buffers = (GLuint *) 0; |
| 4788 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4789 | if (!buffers_buf) { |
| 4790 | _exception = 1; |
| 4791 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4792 | _exceptionMessage = "buffers == null"; |
| 4793 | goto exit; |
| 4794 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4795 | 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] | 4796 | if (_remaining < n) { |
| 4797 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4798 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4799 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4800 | goto exit; |
| 4801 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4802 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4803 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4804 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4805 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4806 | glGenBuffers( |
| 4807 | (GLsizei)n, |
| 4808 | (GLuint *)buffers |
| 4809 | ); |
| 4810 | |
| 4811 | exit: |
| 4812 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4813 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4814 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4815 | if (_exception) { |
| 4816 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4817 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4818 | } |
| 4819 | |
| 4820 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4821 | static void |
| 4822 | android_glGetBooleanv__I_3ZI |
| 4823 | (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { |
| 4824 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4825 | const char * _exceptionType = NULL; |
| 4826 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4827 | GLboolean *params_base = (GLboolean *) 0; |
| 4828 | jint _remaining; |
| 4829 | GLboolean *params = (GLboolean *) 0; |
| 4830 | |
| 4831 | if (!params_ref) { |
| 4832 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4833 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4834 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4835 | goto exit; |
| 4836 | } |
| 4837 | if (offset < 0) { |
| 4838 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4839 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4840 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4841 | goto exit; |
| 4842 | } |
| 4843 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4844 | params_base = (GLboolean *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4845 | _env->GetBooleanArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4846 | params = params_base + offset; |
| 4847 | |
| 4848 | glGetBooleanv( |
| 4849 | (GLenum)pname, |
| 4850 | (GLboolean *)params |
| 4851 | ); |
| 4852 | |
| 4853 | exit: |
| 4854 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4855 | _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4856 | _exception ? JNI_ABORT: 0); |
| 4857 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4858 | if (_exception) { |
| 4859 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4860 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4861 | } |
| 4862 | |
| 4863 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4864 | static void |
| 4865 | android_glGetBooleanv__ILjava_nio_IntBuffer_2 |
| 4866 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4867 | jint _exception = 0; |
| 4868 | const char * _exceptionType = NULL; |
| 4869 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4870 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4871 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4872 | jint _remaining; |
| 4873 | GLboolean *params = (GLboolean *) 0; |
| 4874 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4875 | if (!params_buf) { |
| 4876 | _exception = 1; |
| 4877 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4878 | _exceptionMessage = "params == null"; |
| 4879 | goto exit; |
| 4880 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4881 | params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4882 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4883 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4884 | params = (GLboolean *) (_paramsBase + _bufferOffset); |
| 4885 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4886 | glGetBooleanv( |
| 4887 | (GLenum)pname, |
| 4888 | (GLboolean *)params |
| 4889 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4890 | |
| 4891 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4892 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4893 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 4894 | } |
| 4895 | if (_exception) { |
| 4896 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4897 | } |
| 4898 | } |
| 4899 | |
| 4900 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4901 | static void |
| 4902 | android_glGetBufferParameteriv__II_3II |
| 4903 | (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] | 4904 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4905 | "glGetBufferParameteriv"); |
| 4906 | } |
| 4907 | |
| 4908 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4909 | static void |
| 4910 | android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 |
| 4911 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4912 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4913 | "glGetBufferParameteriv"); |
| 4914 | } |
| 4915 | |
| 4916 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4917 | static void |
| 4918 | android_glGetClipPlanef__I_3FI |
| 4919 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { |
| 4920 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4921 | const char * _exceptionType = NULL; |
| 4922 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4923 | GLfloat *eqn_base = (GLfloat *) 0; |
| 4924 | jint _remaining; |
| 4925 | GLfloat *eqn = (GLfloat *) 0; |
| 4926 | |
| 4927 | if (!eqn_ref) { |
| 4928 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4929 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4930 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4931 | goto exit; |
| 4932 | } |
| 4933 | if (offset < 0) { |
| 4934 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4935 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4936 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4937 | goto exit; |
| 4938 | } |
| 4939 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4940 | eqn_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4941 | _env->GetFloatArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4942 | eqn = eqn_base + offset; |
| 4943 | |
| 4944 | glGetClipPlanef( |
| 4945 | (GLenum)pname, |
| 4946 | (GLfloat *)eqn |
| 4947 | ); |
| 4948 | |
| 4949 | exit: |
| 4950 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4951 | _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4952 | _exception ? JNI_ABORT: 0); |
| 4953 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4954 | if (_exception) { |
| 4955 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4956 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4957 | } |
| 4958 | |
| 4959 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4960 | static void |
| 4961 | android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4962 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4963 | jint _exception = 0; |
| 4964 | const char * _exceptionType = NULL; |
| 4965 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4966 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4967 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4968 | jint _remaining; |
| 4969 | GLfloat *eqn = (GLfloat *) 0; |
| 4970 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4971 | if (!eqn_buf) { |
| 4972 | _exception = 1; |
| 4973 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4974 | _exceptionMessage = "eqn == null"; |
| 4975 | goto exit; |
| 4976 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4977 | eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4978 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4979 | char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4980 | eqn = (GLfloat *) (_eqnBase + _bufferOffset); |
| 4981 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4982 | glGetClipPlanef( |
| 4983 | (GLenum)pname, |
| 4984 | (GLfloat *)eqn |
| 4985 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4986 | |
| 4987 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4988 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 4989 | _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0); |
| 4990 | } |
| 4991 | if (_exception) { |
| 4992 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4993 | } |
| 4994 | } |
| 4995 | |
| 4996 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4997 | static void |
| 4998 | android_glGetClipPlanex__I_3II |
| 4999 | (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { |
| 5000 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5001 | const char * _exceptionType = NULL; |
| 5002 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5003 | GLfixed *eqn_base = (GLfixed *) 0; |
| 5004 | jint _remaining; |
| 5005 | GLfixed *eqn = (GLfixed *) 0; |
| 5006 | |
| 5007 | if (!eqn_ref) { |
| 5008 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5009 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5010 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5011 | goto exit; |
| 5012 | } |
| 5013 | if (offset < 0) { |
| 5014 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5015 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5016 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5017 | goto exit; |
| 5018 | } |
| 5019 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 5020 | eqn_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5021 | _env->GetIntArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5022 | eqn = eqn_base + offset; |
| 5023 | |
| 5024 | glGetClipPlanex( |
| 5025 | (GLenum)pname, |
| 5026 | (GLfixed *)eqn |
| 5027 | ); |
| 5028 | |
| 5029 | exit: |
| 5030 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5031 | _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5032 | _exception ? JNI_ABORT: 0); |
| 5033 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5034 | if (_exception) { |
| 5035 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5036 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5037 | } |
| 5038 | |
| 5039 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 5040 | static void |
| 5041 | android_glGetClipPlanex__ILjava_nio_IntBuffer_2 |
| 5042 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5043 | jint _exception = 0; |
| 5044 | const char * _exceptionType = NULL; |
| 5045 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5046 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5047 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5048 | jint _remaining; |
| 5049 | GLfixed *eqn = (GLfixed *) 0; |
| 5050 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5051 | if (!eqn_buf) { |
| 5052 | _exception = 1; |
| 5053 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5054 | _exceptionMessage = "eqn == null"; |
| 5055 | goto exit; |
| 5056 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5057 | eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5058 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5059 | char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5060 | eqn = (GLfixed *) (_eqnBase + _bufferOffset); |
| 5061 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5062 | glGetClipPlanex( |
| 5063 | (GLenum)pname, |
| 5064 | (GLfixed *)eqn |
| 5065 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5066 | |
| 5067 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5068 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5069 | _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0); |
| 5070 | } |
| 5071 | if (_exception) { |
| 5072 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5073 | } |
| 5074 | } |
| 5075 | |
| 5076 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 5077 | static void |
| 5078 | android_glGetFixedv__I_3II |
| 5079 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 5080 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5081 | const char * _exceptionType = NULL; |
| 5082 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5083 | GLfixed *params_base = (GLfixed *) 0; |
| 5084 | jint _remaining; |
| 5085 | GLfixed *params = (GLfixed *) 0; |
| 5086 | |
| 5087 | if (!params_ref) { |
| 5088 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5089 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5090 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5091 | goto exit; |
| 5092 | } |
| 5093 | if (offset < 0) { |
| 5094 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5095 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5096 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5097 | goto exit; |
| 5098 | } |
| 5099 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5100 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5101 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5102 | params = params_base + offset; |
| 5103 | |
| 5104 | glGetFixedv( |
| 5105 | (GLenum)pname, |
| 5106 | (GLfixed *)params |
| 5107 | ); |
| 5108 | |
| 5109 | exit: |
| 5110 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5111 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5112 | _exception ? JNI_ABORT: 0); |
| 5113 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5114 | if (_exception) { |
| 5115 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5116 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5117 | } |
| 5118 | |
| 5119 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 5120 | static void |
| 5121 | android_glGetFixedv__ILjava_nio_IntBuffer_2 |
| 5122 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5123 | jint _exception = 0; |
| 5124 | const char * _exceptionType = NULL; |
| 5125 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5126 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5127 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5128 | jint _remaining; |
| 5129 | GLfixed *params = (GLfixed *) 0; |
| 5130 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5131 | if (!params_buf) { |
| 5132 | _exception = 1; |
| 5133 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5134 | _exceptionMessage = "params == null"; |
| 5135 | goto exit; |
| 5136 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5137 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5138 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5139 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5140 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5141 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5142 | glGetFixedv( |
| 5143 | (GLenum)pname, |
| 5144 | (GLfixed *)params |
| 5145 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5146 | |
| 5147 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5148 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5149 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 5150 | } |
| 5151 | if (_exception) { |
| 5152 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5153 | } |
| 5154 | } |
| 5155 | |
| 5156 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 5157 | static void |
| 5158 | android_glGetFloatv__I_3FI |
| 5159 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
| 5160 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5161 | const char * _exceptionType = NULL; |
| 5162 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5163 | GLfloat *params_base = (GLfloat *) 0; |
| 5164 | jint _remaining; |
| 5165 | GLfloat *params = (GLfloat *) 0; |
| 5166 | |
| 5167 | if (!params_ref) { |
| 5168 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5169 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5170 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5171 | goto exit; |
| 5172 | } |
| 5173 | if (offset < 0) { |
| 5174 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5175 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5176 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5177 | goto exit; |
| 5178 | } |
| 5179 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5180 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5181 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5182 | params = params_base + offset; |
| 5183 | |
| 5184 | glGetFloatv( |
| 5185 | (GLenum)pname, |
| 5186 | (GLfloat *)params |
| 5187 | ); |
| 5188 | |
| 5189 | exit: |
| 5190 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5191 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5192 | _exception ? JNI_ABORT: 0); |
| 5193 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5194 | if (_exception) { |
| 5195 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5196 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5197 | } |
| 5198 | |
| 5199 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 5200 | static void |
| 5201 | android_glGetFloatv__ILjava_nio_FloatBuffer_2 |
| 5202 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5203 | jint _exception = 0; |
| 5204 | const char * _exceptionType = NULL; |
| 5205 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5206 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5207 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5208 | jint _remaining; |
| 5209 | GLfloat *params = (GLfloat *) 0; |
| 5210 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5211 | if (!params_buf) { |
| 5212 | _exception = 1; |
| 5213 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5214 | _exceptionMessage = "params == null"; |
| 5215 | goto exit; |
| 5216 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5217 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5218 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5219 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5220 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5221 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5222 | glGetFloatv( |
| 5223 | (GLenum)pname, |
| 5224 | (GLfloat *)params |
| 5225 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5226 | |
| 5227 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5228 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5229 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 5230 | } |
| 5231 | if (_exception) { |
| 5232 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5233 | } |
| 5234 | } |
| 5235 | |
| 5236 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 5237 | static void |
| 5238 | android_glGetLightfv__II_3FI |
| 5239 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
| 5240 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5241 | const char * _exceptionType = NULL; |
| 5242 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5243 | GLfloat *params_base = (GLfloat *) 0; |
| 5244 | jint _remaining; |
| 5245 | GLfloat *params = (GLfloat *) 0; |
| 5246 | |
| 5247 | if (!params_ref) { |
| 5248 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5249 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5250 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5251 | goto exit; |
| 5252 | } |
| 5253 | if (offset < 0) { |
| 5254 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5255 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5256 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5257 | goto exit; |
| 5258 | } |
| 5259 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5260 | int _needed; |
| 5261 | switch (pname) { |
| 5262 | #if defined(GL_SPOT_EXPONENT) |
| 5263 | case GL_SPOT_EXPONENT: |
| 5264 | #endif // defined(GL_SPOT_EXPONENT) |
| 5265 | #if defined(GL_SPOT_CUTOFF) |
| 5266 | case GL_SPOT_CUTOFF: |
| 5267 | #endif // defined(GL_SPOT_CUTOFF) |
| 5268 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5269 | case GL_CONSTANT_ATTENUATION: |
| 5270 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5271 | #if defined(GL_LINEAR_ATTENUATION) |
| 5272 | case GL_LINEAR_ATTENUATION: |
| 5273 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5274 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5275 | case GL_QUADRATIC_ATTENUATION: |
| 5276 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5277 | _needed = 1; |
| 5278 | break; |
| 5279 | #if defined(GL_SPOT_DIRECTION) |
| 5280 | case GL_SPOT_DIRECTION: |
| 5281 | #endif // defined(GL_SPOT_DIRECTION) |
| 5282 | _needed = 3; |
| 5283 | break; |
| 5284 | #if defined(GL_AMBIENT) |
| 5285 | case GL_AMBIENT: |
| 5286 | #endif // defined(GL_AMBIENT) |
| 5287 | #if defined(GL_DIFFUSE) |
| 5288 | case GL_DIFFUSE: |
| 5289 | #endif // defined(GL_DIFFUSE) |
| 5290 | #if defined(GL_SPECULAR) |
| 5291 | case GL_SPECULAR: |
| 5292 | #endif // defined(GL_SPECULAR) |
| 5293 | #if defined(GL_EMISSION) |
| 5294 | case GL_EMISSION: |
| 5295 | #endif // defined(GL_EMISSION) |
| 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 | glGetLightfv( |
| 5313 | (GLenum)light, |
| 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 glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 5329 | static void |
| 5330 | android_glGetLightfv__IILjava_nio_FloatBuffer_2 |
| 5331 | (JNIEnv *_env, jobject _this, jint light, 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 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5340 | if (!params_buf) { |
| 5341 | _exception = 1; |
| 5342 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5343 | _exceptionMessage = "params == null"; |
| 5344 | goto exit; |
| 5345 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5346 | 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] | 5347 | int _needed; |
| 5348 | switch (pname) { |
| 5349 | #if defined(GL_SPOT_EXPONENT) |
| 5350 | case GL_SPOT_EXPONENT: |
| 5351 | #endif // defined(GL_SPOT_EXPONENT) |
| 5352 | #if defined(GL_SPOT_CUTOFF) |
| 5353 | case GL_SPOT_CUTOFF: |
| 5354 | #endif // defined(GL_SPOT_CUTOFF) |
| 5355 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5356 | case GL_CONSTANT_ATTENUATION: |
| 5357 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5358 | #if defined(GL_LINEAR_ATTENUATION) |
| 5359 | case GL_LINEAR_ATTENUATION: |
| 5360 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5361 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5362 | case GL_QUADRATIC_ATTENUATION: |
| 5363 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5364 | _needed = 1; |
| 5365 | break; |
| 5366 | #if defined(GL_SPOT_DIRECTION) |
| 5367 | case GL_SPOT_DIRECTION: |
| 5368 | #endif // defined(GL_SPOT_DIRECTION) |
| 5369 | _needed = 3; |
| 5370 | break; |
| 5371 | #if defined(GL_AMBIENT) |
| 5372 | case GL_AMBIENT: |
| 5373 | #endif // defined(GL_AMBIENT) |
| 5374 | #if defined(GL_DIFFUSE) |
| 5375 | case GL_DIFFUSE: |
| 5376 | #endif // defined(GL_DIFFUSE) |
| 5377 | #if defined(GL_SPECULAR) |
| 5378 | case GL_SPECULAR: |
| 5379 | #endif // defined(GL_SPECULAR) |
| 5380 | #if defined(GL_EMISSION) |
| 5381 | case GL_EMISSION: |
| 5382 | #endif // defined(GL_EMISSION) |
| 5383 | _needed = 4; |
| 5384 | break; |
| 5385 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5386 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5387 | break; |
| 5388 | } |
| 5389 | if (_remaining < _needed) { |
| 5390 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5391 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5392 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5393 | goto exit; |
| 5394 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5395 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5396 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5397 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5398 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5399 | glGetLightfv( |
| 5400 | (GLenum)light, |
| 5401 | (GLenum)pname, |
| 5402 | (GLfloat *)params |
| 5403 | ); |
| 5404 | |
| 5405 | exit: |
| 5406 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5407 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5408 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5409 | if (_exception) { |
| 5410 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5411 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5412 | } |
| 5413 | |
| 5414 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5415 | static void |
| 5416 | android_glGetLightxv__II_3II |
| 5417 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
| 5418 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5419 | const char * _exceptionType = NULL; |
| 5420 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5421 | GLfixed *params_base = (GLfixed *) 0; |
| 5422 | jint _remaining; |
| 5423 | GLfixed *params = (GLfixed *) 0; |
| 5424 | |
| 5425 | if (!params_ref) { |
| 5426 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5427 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5428 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5429 | goto exit; |
| 5430 | } |
| 5431 | if (offset < 0) { |
| 5432 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5433 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5434 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5435 | goto exit; |
| 5436 | } |
| 5437 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5438 | int _needed; |
| 5439 | switch (pname) { |
| 5440 | #if defined(GL_SPOT_EXPONENT) |
| 5441 | case GL_SPOT_EXPONENT: |
| 5442 | #endif // defined(GL_SPOT_EXPONENT) |
| 5443 | #if defined(GL_SPOT_CUTOFF) |
| 5444 | case GL_SPOT_CUTOFF: |
| 5445 | #endif // defined(GL_SPOT_CUTOFF) |
| 5446 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5447 | case GL_CONSTANT_ATTENUATION: |
| 5448 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5449 | #if defined(GL_LINEAR_ATTENUATION) |
| 5450 | case GL_LINEAR_ATTENUATION: |
| 5451 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5452 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5453 | case GL_QUADRATIC_ATTENUATION: |
| 5454 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5455 | _needed = 1; |
| 5456 | break; |
| 5457 | #if defined(GL_SPOT_DIRECTION) |
| 5458 | case GL_SPOT_DIRECTION: |
| 5459 | #endif // defined(GL_SPOT_DIRECTION) |
| 5460 | _needed = 3; |
| 5461 | break; |
| 5462 | #if defined(GL_AMBIENT) |
| 5463 | case GL_AMBIENT: |
| 5464 | #endif // defined(GL_AMBIENT) |
| 5465 | #if defined(GL_DIFFUSE) |
| 5466 | case GL_DIFFUSE: |
| 5467 | #endif // defined(GL_DIFFUSE) |
| 5468 | #if defined(GL_SPECULAR) |
| 5469 | case GL_SPECULAR: |
| 5470 | #endif // defined(GL_SPECULAR) |
| 5471 | #if defined(GL_EMISSION) |
| 5472 | case GL_EMISSION: |
| 5473 | #endif // defined(GL_EMISSION) |
| 5474 | _needed = 4; |
| 5475 | break; |
| 5476 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5477 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5478 | break; |
| 5479 | } |
| 5480 | if (_remaining < _needed) { |
| 5481 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5482 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5483 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5484 | goto exit; |
| 5485 | } |
| 5486 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5487 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5488 | params = params_base + offset; |
| 5489 | |
| 5490 | glGetLightxv( |
| 5491 | (GLenum)light, |
| 5492 | (GLenum)pname, |
| 5493 | (GLfixed *)params |
| 5494 | ); |
| 5495 | |
| 5496 | exit: |
| 5497 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5498 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5499 | _exception ? JNI_ABORT: 0); |
| 5500 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5501 | if (_exception) { |
| 5502 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5503 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5504 | } |
| 5505 | |
| 5506 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5507 | static void |
| 5508 | android_glGetLightxv__IILjava_nio_IntBuffer_2 |
| 5509 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5510 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5511 | const char * _exceptionType = NULL; |
| 5512 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5513 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5514 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5515 | jint _remaining; |
| 5516 | GLfixed *params = (GLfixed *) 0; |
| 5517 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5518 | if (!params_buf) { |
| 5519 | _exception = 1; |
| 5520 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5521 | _exceptionMessage = "params == null"; |
| 5522 | goto exit; |
| 5523 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5524 | 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] | 5525 | int _needed; |
| 5526 | switch (pname) { |
| 5527 | #if defined(GL_SPOT_EXPONENT) |
| 5528 | case GL_SPOT_EXPONENT: |
| 5529 | #endif // defined(GL_SPOT_EXPONENT) |
| 5530 | #if defined(GL_SPOT_CUTOFF) |
| 5531 | case GL_SPOT_CUTOFF: |
| 5532 | #endif // defined(GL_SPOT_CUTOFF) |
| 5533 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5534 | case GL_CONSTANT_ATTENUATION: |
| 5535 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5536 | #if defined(GL_LINEAR_ATTENUATION) |
| 5537 | case GL_LINEAR_ATTENUATION: |
| 5538 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5539 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5540 | case GL_QUADRATIC_ATTENUATION: |
| 5541 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5542 | _needed = 1; |
| 5543 | break; |
| 5544 | #if defined(GL_SPOT_DIRECTION) |
| 5545 | case GL_SPOT_DIRECTION: |
| 5546 | #endif // defined(GL_SPOT_DIRECTION) |
| 5547 | _needed = 3; |
| 5548 | break; |
| 5549 | #if defined(GL_AMBIENT) |
| 5550 | case GL_AMBIENT: |
| 5551 | #endif // defined(GL_AMBIENT) |
| 5552 | #if defined(GL_DIFFUSE) |
| 5553 | case GL_DIFFUSE: |
| 5554 | #endif // defined(GL_DIFFUSE) |
| 5555 | #if defined(GL_SPECULAR) |
| 5556 | case GL_SPECULAR: |
| 5557 | #endif // defined(GL_SPECULAR) |
| 5558 | #if defined(GL_EMISSION) |
| 5559 | case GL_EMISSION: |
| 5560 | #endif // defined(GL_EMISSION) |
| 5561 | _needed = 4; |
| 5562 | break; |
| 5563 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5564 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5565 | break; |
| 5566 | } |
| 5567 | if (_remaining < _needed) { |
| 5568 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5569 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5570 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5571 | goto exit; |
| 5572 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5573 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5574 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5575 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5576 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5577 | glGetLightxv( |
| 5578 | (GLenum)light, |
| 5579 | (GLenum)pname, |
| 5580 | (GLfixed *)params |
| 5581 | ); |
| 5582 | |
| 5583 | exit: |
| 5584 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5585 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5586 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5587 | if (_exception) { |
| 5588 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5589 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5590 | } |
| 5591 | |
| 5592 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5593 | static void |
| 5594 | android_glGetMaterialfv__II_3FI |
| 5595 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
| 5596 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5597 | const char * _exceptionType = NULL; |
| 5598 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5599 | GLfloat *params_base = (GLfloat *) 0; |
| 5600 | jint _remaining; |
| 5601 | GLfloat *params = (GLfloat *) 0; |
| 5602 | |
| 5603 | if (!params_ref) { |
| 5604 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5605 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5606 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5607 | goto exit; |
| 5608 | } |
| 5609 | if (offset < 0) { |
| 5610 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5611 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5612 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5613 | goto exit; |
| 5614 | } |
| 5615 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5616 | int _needed; |
| 5617 | switch (pname) { |
| 5618 | #if defined(GL_SHININESS) |
| 5619 | case GL_SHININESS: |
| 5620 | #endif // defined(GL_SHININESS) |
| 5621 | _needed = 1; |
| 5622 | break; |
| 5623 | #if defined(GL_AMBIENT) |
| 5624 | case GL_AMBIENT: |
| 5625 | #endif // defined(GL_AMBIENT) |
| 5626 | #if defined(GL_DIFFUSE) |
| 5627 | case GL_DIFFUSE: |
| 5628 | #endif // defined(GL_DIFFUSE) |
| 5629 | #if defined(GL_SPECULAR) |
| 5630 | case GL_SPECULAR: |
| 5631 | #endif // defined(GL_SPECULAR) |
| 5632 | #if defined(GL_EMISSION) |
| 5633 | case GL_EMISSION: |
| 5634 | #endif // defined(GL_EMISSION) |
| 5635 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5636 | case GL_AMBIENT_AND_DIFFUSE: |
| 5637 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5638 | _needed = 4; |
| 5639 | break; |
| 5640 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5641 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5642 | break; |
| 5643 | } |
| 5644 | if (_remaining < _needed) { |
| 5645 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5646 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5647 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5648 | goto exit; |
| 5649 | } |
| 5650 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5651 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5652 | params = params_base + offset; |
| 5653 | |
| 5654 | glGetMaterialfv( |
| 5655 | (GLenum)face, |
| 5656 | (GLenum)pname, |
| 5657 | (GLfloat *)params |
| 5658 | ); |
| 5659 | |
| 5660 | exit: |
| 5661 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5662 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5663 | _exception ? JNI_ABORT: 0); |
| 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 glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5671 | static void |
| 5672 | android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 |
| 5673 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 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; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5677 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5678 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5679 | jint _remaining; |
| 5680 | GLfloat *params = (GLfloat *) 0; |
| 5681 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5682 | if (!params_buf) { |
| 5683 | _exception = 1; |
| 5684 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5685 | _exceptionMessage = "params == null"; |
| 5686 | goto exit; |
| 5687 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5688 | 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] | 5689 | int _needed; |
| 5690 | switch (pname) { |
| 5691 | #if defined(GL_SHININESS) |
| 5692 | case GL_SHININESS: |
| 5693 | #endif // defined(GL_SHININESS) |
| 5694 | _needed = 1; |
| 5695 | break; |
| 5696 | #if defined(GL_AMBIENT) |
| 5697 | case GL_AMBIENT: |
| 5698 | #endif // defined(GL_AMBIENT) |
| 5699 | #if defined(GL_DIFFUSE) |
| 5700 | case GL_DIFFUSE: |
| 5701 | #endif // defined(GL_DIFFUSE) |
| 5702 | #if defined(GL_SPECULAR) |
| 5703 | case GL_SPECULAR: |
| 5704 | #endif // defined(GL_SPECULAR) |
| 5705 | #if defined(GL_EMISSION) |
| 5706 | case GL_EMISSION: |
| 5707 | #endif // defined(GL_EMISSION) |
| 5708 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5709 | case GL_AMBIENT_AND_DIFFUSE: |
| 5710 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5711 | _needed = 4; |
| 5712 | break; |
| 5713 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5714 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5715 | break; |
| 5716 | } |
| 5717 | if (_remaining < _needed) { |
| 5718 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5719 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5720 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5721 | goto exit; |
| 5722 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5723 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5724 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5725 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5726 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5727 | glGetMaterialfv( |
| 5728 | (GLenum)face, |
| 5729 | (GLenum)pname, |
| 5730 | (GLfloat *)params |
| 5731 | ); |
| 5732 | |
| 5733 | exit: |
| 5734 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5735 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5743 | static void |
| 5744 | android_glGetMaterialxv__II_3II |
| 5745 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
| 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; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5749 | GLfixed *params_base = (GLfixed *) 0; |
| 5750 | jint _remaining; |
| 5751 | GLfixed *params = (GLfixed *) 0; |
| 5752 | |
| 5753 | if (!params_ref) { |
| 5754 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5755 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5756 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5757 | goto exit; |
| 5758 | } |
| 5759 | if (offset < 0) { |
| 5760 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5761 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5762 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5763 | goto exit; |
| 5764 | } |
| 5765 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5766 | int _needed; |
| 5767 | switch (pname) { |
| 5768 | #if defined(GL_SHININESS) |
| 5769 | case GL_SHININESS: |
| 5770 | #endif // defined(GL_SHININESS) |
| 5771 | _needed = 1; |
| 5772 | break; |
| 5773 | #if defined(GL_AMBIENT) |
| 5774 | case GL_AMBIENT: |
| 5775 | #endif // defined(GL_AMBIENT) |
| 5776 | #if defined(GL_DIFFUSE) |
| 5777 | case GL_DIFFUSE: |
| 5778 | #endif // defined(GL_DIFFUSE) |
| 5779 | #if defined(GL_SPECULAR) |
| 5780 | case GL_SPECULAR: |
| 5781 | #endif // defined(GL_SPECULAR) |
| 5782 | #if defined(GL_EMISSION) |
| 5783 | case GL_EMISSION: |
| 5784 | #endif // defined(GL_EMISSION) |
| 5785 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5786 | case GL_AMBIENT_AND_DIFFUSE: |
| 5787 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5788 | _needed = 4; |
| 5789 | break; |
| 5790 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5791 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5792 | break; |
| 5793 | } |
| 5794 | if (_remaining < _needed) { |
| 5795 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5796 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5797 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5798 | goto exit; |
| 5799 | } |
| 5800 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5801 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5802 | params = params_base + offset; |
| 5803 | |
| 5804 | glGetMaterialxv( |
| 5805 | (GLenum)face, |
| 5806 | (GLenum)pname, |
| 5807 | (GLfixed *)params |
| 5808 | ); |
| 5809 | |
| 5810 | exit: |
| 5811 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5812 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5813 | _exception ? JNI_ABORT: 0); |
| 5814 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5815 | if (_exception) { |
| 5816 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5817 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5818 | } |
| 5819 | |
| 5820 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5821 | static void |
| 5822 | android_glGetMaterialxv__IILjava_nio_IntBuffer_2 |
| 5823 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5824 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5825 | const char * _exceptionType = NULL; |
| 5826 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5827 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5828 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5829 | jint _remaining; |
| 5830 | GLfixed *params = (GLfixed *) 0; |
| 5831 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5832 | if (!params_buf) { |
| 5833 | _exception = 1; |
| 5834 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5835 | _exceptionMessage = "params == null"; |
| 5836 | goto exit; |
| 5837 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5838 | 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] | 5839 | int _needed; |
| 5840 | switch (pname) { |
| 5841 | #if defined(GL_SHININESS) |
| 5842 | case GL_SHININESS: |
| 5843 | #endif // defined(GL_SHININESS) |
| 5844 | _needed = 1; |
| 5845 | break; |
| 5846 | #if defined(GL_AMBIENT) |
| 5847 | case GL_AMBIENT: |
| 5848 | #endif // defined(GL_AMBIENT) |
| 5849 | #if defined(GL_DIFFUSE) |
| 5850 | case GL_DIFFUSE: |
| 5851 | #endif // defined(GL_DIFFUSE) |
| 5852 | #if defined(GL_SPECULAR) |
| 5853 | case GL_SPECULAR: |
| 5854 | #endif // defined(GL_SPECULAR) |
| 5855 | #if defined(GL_EMISSION) |
| 5856 | case GL_EMISSION: |
| 5857 | #endif // defined(GL_EMISSION) |
| 5858 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5859 | case GL_AMBIENT_AND_DIFFUSE: |
| 5860 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5861 | _needed = 4; |
| 5862 | break; |
| 5863 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5864 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5865 | break; |
| 5866 | } |
| 5867 | if (_remaining < _needed) { |
| 5868 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5869 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5870 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5871 | goto exit; |
| 5872 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5873 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5874 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5875 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5876 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5877 | glGetMaterialxv( |
| 5878 | (GLenum)face, |
| 5879 | (GLenum)pname, |
| 5880 | (GLfixed *)params |
| 5881 | ); |
| 5882 | |
| 5883 | exit: |
| 5884 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5885 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5886 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5887 | if (_exception) { |
| 5888 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5889 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5890 | } |
| 5891 | |
| 5892 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5893 | static void |
| 5894 | android_glGetTexEnviv__II_3II |
| 5895 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5896 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5897 | const char * _exceptionType = NULL; |
| 5898 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5899 | GLint *params_base = (GLint *) 0; |
| 5900 | jint _remaining; |
| 5901 | GLint *params = (GLint *) 0; |
| 5902 | |
| 5903 | if (!params_ref) { |
| 5904 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5905 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5906 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5907 | goto exit; |
| 5908 | } |
| 5909 | if (offset < 0) { |
| 5910 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5911 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5912 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5913 | goto exit; |
| 5914 | } |
| 5915 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5916 | int _needed; |
| 5917 | switch (pname) { |
| 5918 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5919 | case GL_TEXTURE_ENV_MODE: |
| 5920 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5921 | #if defined(GL_COMBINE_RGB) |
| 5922 | case GL_COMBINE_RGB: |
| 5923 | #endif // defined(GL_COMBINE_RGB) |
| 5924 | #if defined(GL_COMBINE_ALPHA) |
| 5925 | case GL_COMBINE_ALPHA: |
| 5926 | #endif // defined(GL_COMBINE_ALPHA) |
| 5927 | _needed = 1; |
| 5928 | break; |
| 5929 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5930 | case GL_TEXTURE_ENV_COLOR: |
| 5931 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5932 | _needed = 4; |
| 5933 | break; |
| 5934 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5935 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5936 | break; |
| 5937 | } |
| 5938 | if (_remaining < _needed) { |
| 5939 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5940 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5941 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5942 | goto exit; |
| 5943 | } |
| 5944 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5945 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5946 | params = params_base + offset; |
| 5947 | |
| 5948 | glGetTexEnviv( |
| 5949 | (GLenum)env, |
| 5950 | (GLenum)pname, |
| 5951 | (GLint *)params |
| 5952 | ); |
| 5953 | |
| 5954 | exit: |
| 5955 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5956 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5957 | _exception ? JNI_ABORT: 0); |
| 5958 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5959 | if (_exception) { |
| 5960 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5961 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5962 | } |
| 5963 | |
| 5964 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5965 | static void |
| 5966 | android_glGetTexEnviv__IILjava_nio_IntBuffer_2 |
| 5967 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5968 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5969 | const char * _exceptionType = NULL; |
| 5970 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5971 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5972 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5973 | jint _remaining; |
| 5974 | GLint *params = (GLint *) 0; |
| 5975 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 5976 | if (!params_buf) { |
| 5977 | _exception = 1; |
| 5978 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5979 | _exceptionMessage = "params == null"; |
| 5980 | goto exit; |
| 5981 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5982 | 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] | 5983 | int _needed; |
| 5984 | switch (pname) { |
| 5985 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5986 | case GL_TEXTURE_ENV_MODE: |
| 5987 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5988 | #if defined(GL_COMBINE_RGB) |
| 5989 | case GL_COMBINE_RGB: |
| 5990 | #endif // defined(GL_COMBINE_RGB) |
| 5991 | #if defined(GL_COMBINE_ALPHA) |
| 5992 | case GL_COMBINE_ALPHA: |
| 5993 | #endif // defined(GL_COMBINE_ALPHA) |
| 5994 | _needed = 1; |
| 5995 | break; |
| 5996 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5997 | case GL_TEXTURE_ENV_COLOR: |
| 5998 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5999 | _needed = 4; |
| 6000 | break; |
| 6001 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6002 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6003 | break; |
| 6004 | } |
| 6005 | if (_remaining < _needed) { |
| 6006 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6007 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6008 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6009 | goto exit; |
| 6010 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6011 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6012 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6013 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6014 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6015 | glGetTexEnviv( |
| 6016 | (GLenum)env, |
| 6017 | (GLenum)pname, |
| 6018 | (GLint *)params |
| 6019 | ); |
| 6020 | |
| 6021 | exit: |
| 6022 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6023 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6024 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6025 | if (_exception) { |
| 6026 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6027 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6028 | } |
| 6029 | |
| 6030 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 6031 | static void |
| 6032 | android_glGetTexEnvxv__II_3II |
| 6033 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 6034 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6035 | const char * _exceptionType = NULL; |
| 6036 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6037 | GLfixed *params_base = (GLfixed *) 0; |
| 6038 | jint _remaining; |
| 6039 | GLfixed *params = (GLfixed *) 0; |
| 6040 | |
| 6041 | if (!params_ref) { |
| 6042 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6043 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6044 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6045 | goto exit; |
| 6046 | } |
| 6047 | if (offset < 0) { |
| 6048 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6049 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6050 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6051 | goto exit; |
| 6052 | } |
| 6053 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6054 | int _needed; |
| 6055 | switch (pname) { |
| 6056 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6057 | case GL_TEXTURE_ENV_MODE: |
| 6058 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6059 | #if defined(GL_COMBINE_RGB) |
| 6060 | case GL_COMBINE_RGB: |
| 6061 | #endif // defined(GL_COMBINE_RGB) |
| 6062 | #if defined(GL_COMBINE_ALPHA) |
| 6063 | case GL_COMBINE_ALPHA: |
| 6064 | #endif // defined(GL_COMBINE_ALPHA) |
| 6065 | _needed = 1; |
| 6066 | break; |
| 6067 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6068 | case GL_TEXTURE_ENV_COLOR: |
| 6069 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6070 | _needed = 4; |
| 6071 | break; |
| 6072 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6073 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6074 | break; |
| 6075 | } |
| 6076 | if (_remaining < _needed) { |
| 6077 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6078 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6079 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6080 | goto exit; |
| 6081 | } |
| 6082 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6083 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6084 | params = params_base + offset; |
| 6085 | |
| 6086 | glGetTexEnvxv( |
| 6087 | (GLenum)env, |
| 6088 | (GLenum)pname, |
| 6089 | (GLfixed *)params |
| 6090 | ); |
| 6091 | |
| 6092 | exit: |
| 6093 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6094 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6095 | _exception ? JNI_ABORT: 0); |
| 6096 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6097 | if (_exception) { |
| 6098 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6099 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6100 | } |
| 6101 | |
| 6102 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 6103 | static void |
| 6104 | android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 |
| 6105 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 6106 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6107 | const char * _exceptionType = NULL; |
| 6108 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6109 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6110 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6111 | jint _remaining; |
| 6112 | GLfixed *params = (GLfixed *) 0; |
| 6113 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6114 | if (!params_buf) { |
| 6115 | _exception = 1; |
| 6116 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6117 | _exceptionMessage = "params == null"; |
| 6118 | goto exit; |
| 6119 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6120 | 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] | 6121 | int _needed; |
| 6122 | switch (pname) { |
| 6123 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6124 | case GL_TEXTURE_ENV_MODE: |
| 6125 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6126 | #if defined(GL_COMBINE_RGB) |
| 6127 | case GL_COMBINE_RGB: |
| 6128 | #endif // defined(GL_COMBINE_RGB) |
| 6129 | #if defined(GL_COMBINE_ALPHA) |
| 6130 | case GL_COMBINE_ALPHA: |
| 6131 | #endif // defined(GL_COMBINE_ALPHA) |
| 6132 | _needed = 1; |
| 6133 | break; |
| 6134 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6135 | case GL_TEXTURE_ENV_COLOR: |
| 6136 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6137 | _needed = 4; |
| 6138 | break; |
| 6139 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6140 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6141 | break; |
| 6142 | } |
| 6143 | if (_remaining < _needed) { |
| 6144 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6145 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6146 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6147 | goto exit; |
| 6148 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6149 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6150 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6151 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6152 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6153 | glGetTexEnvxv( |
| 6154 | (GLenum)env, |
| 6155 | (GLenum)pname, |
| 6156 | (GLfixed *)params |
| 6157 | ); |
| 6158 | |
| 6159 | exit: |
| 6160 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6161 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6162 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6163 | if (_exception) { |
| 6164 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6165 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6166 | } |
| 6167 | |
| 6168 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 6169 | static void |
| 6170 | android_glGetTexParameterfv__II_3FI |
| 6171 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 6172 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6173 | const char * _exceptionType = NULL; |
| 6174 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6175 | GLfloat *params_base = (GLfloat *) 0; |
| 6176 | jint _remaining; |
| 6177 | GLfloat *params = (GLfloat *) 0; |
| 6178 | |
| 6179 | if (!params_ref) { |
| 6180 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6181 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6182 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6183 | goto exit; |
| 6184 | } |
| 6185 | if (offset < 0) { |
| 6186 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6187 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6188 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6189 | goto exit; |
| 6190 | } |
| 6191 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6192 | if (_remaining < 1) { |
| 6193 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6194 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6195 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6196 | goto exit; |
| 6197 | } |
| 6198 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6199 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6200 | params = params_base + offset; |
| 6201 | |
| 6202 | glGetTexParameterfv( |
| 6203 | (GLenum)target, |
| 6204 | (GLenum)pname, |
| 6205 | (GLfloat *)params |
| 6206 | ); |
| 6207 | |
| 6208 | exit: |
| 6209 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6210 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6211 | _exception ? JNI_ABORT: 0); |
| 6212 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6213 | if (_exception) { |
| 6214 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6215 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6216 | } |
| 6217 | |
| 6218 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 6219 | static void |
| 6220 | android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6221 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6222 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6223 | const char * _exceptionType = NULL; |
| 6224 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6225 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6226 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6227 | jint _remaining; |
| 6228 | GLfloat *params = (GLfloat *) 0; |
| 6229 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6230 | if (!params_buf) { |
| 6231 | _exception = 1; |
| 6232 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6233 | _exceptionMessage = "params == null"; |
| 6234 | goto exit; |
| 6235 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6236 | 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] | 6237 | if (_remaining < 1) { |
| 6238 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6239 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6240 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6241 | goto exit; |
| 6242 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6243 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6244 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6245 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6246 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6247 | glGetTexParameterfv( |
| 6248 | (GLenum)target, |
| 6249 | (GLenum)pname, |
| 6250 | (GLfloat *)params |
| 6251 | ); |
| 6252 | |
| 6253 | exit: |
| 6254 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6255 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6256 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6257 | if (_exception) { |
| 6258 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6259 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6260 | } |
| 6261 | |
| 6262 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 6263 | static void |
| 6264 | android_glGetTexParameteriv__II_3II |
| 6265 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 6266 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6267 | const char * _exceptionType = NULL; |
| 6268 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6269 | GLint *params_base = (GLint *) 0; |
| 6270 | jint _remaining; |
| 6271 | GLint *params = (GLint *) 0; |
| 6272 | |
| 6273 | if (!params_ref) { |
| 6274 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6275 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6276 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6277 | goto exit; |
| 6278 | } |
| 6279 | if (offset < 0) { |
| 6280 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6281 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6282 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6283 | goto exit; |
| 6284 | } |
| 6285 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6286 | if (_remaining < 1) { |
| 6287 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6288 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6289 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6290 | goto exit; |
| 6291 | } |
| 6292 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6293 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6294 | params = params_base + offset; |
| 6295 | |
| 6296 | glGetTexParameteriv( |
| 6297 | (GLenum)target, |
| 6298 | (GLenum)pname, |
| 6299 | (GLint *)params |
| 6300 | ); |
| 6301 | |
| 6302 | exit: |
| 6303 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6304 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6305 | _exception ? JNI_ABORT: 0); |
| 6306 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6307 | if (_exception) { |
| 6308 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6309 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6310 | } |
| 6311 | |
| 6312 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 6313 | static void |
| 6314 | android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 |
| 6315 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6316 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6317 | const char * _exceptionType = NULL; |
| 6318 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6319 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6320 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6321 | jint _remaining; |
| 6322 | GLint *params = (GLint *) 0; |
| 6323 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6324 | if (!params_buf) { |
| 6325 | _exception = 1; |
| 6326 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6327 | _exceptionMessage = "params == null"; |
| 6328 | goto exit; |
| 6329 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6330 | 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] | 6331 | if (_remaining < 1) { |
| 6332 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6333 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6334 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6335 | goto exit; |
| 6336 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6337 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6338 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6339 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6340 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6341 | glGetTexParameteriv( |
| 6342 | (GLenum)target, |
| 6343 | (GLenum)pname, |
| 6344 | (GLint *)params |
| 6345 | ); |
| 6346 | |
| 6347 | exit: |
| 6348 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6349 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6350 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6351 | if (_exception) { |
| 6352 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6353 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6354 | } |
| 6355 | |
| 6356 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6357 | static void |
| 6358 | android_glGetTexParameterxv__II_3II |
| 6359 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 6360 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6361 | const char * _exceptionType = NULL; |
| 6362 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6363 | GLfixed *params_base = (GLfixed *) 0; |
| 6364 | jint _remaining; |
| 6365 | GLfixed *params = (GLfixed *) 0; |
| 6366 | |
| 6367 | if (!params_ref) { |
| 6368 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6369 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6370 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6371 | goto exit; |
| 6372 | } |
| 6373 | if (offset < 0) { |
| 6374 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6375 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6376 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6377 | goto exit; |
| 6378 | } |
| 6379 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6380 | if (_remaining < 1) { |
| 6381 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6382 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6383 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6384 | goto exit; |
| 6385 | } |
| 6386 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6387 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6388 | params = params_base + offset; |
| 6389 | |
| 6390 | glGetTexParameterxv( |
| 6391 | (GLenum)target, |
| 6392 | (GLenum)pname, |
| 6393 | (GLfixed *)params |
| 6394 | ); |
| 6395 | |
| 6396 | exit: |
| 6397 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6398 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6399 | _exception ? JNI_ABORT: 0); |
| 6400 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6401 | if (_exception) { |
| 6402 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6403 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6404 | } |
| 6405 | |
| 6406 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6407 | static void |
| 6408 | android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6409 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6410 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6411 | const char * _exceptionType = NULL; |
| 6412 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6413 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6414 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6415 | jint _remaining; |
| 6416 | GLfixed *params = (GLfixed *) 0; |
| 6417 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6418 | if (!params_buf) { |
| 6419 | _exception = 1; |
| 6420 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6421 | _exceptionMessage = "params == null"; |
| 6422 | goto exit; |
| 6423 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6424 | 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] | 6425 | if (_remaining < 1) { |
| 6426 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6427 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6428 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6429 | goto exit; |
| 6430 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6431 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6432 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6433 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6434 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6435 | glGetTexParameterxv( |
| 6436 | (GLenum)target, |
| 6437 | (GLenum)pname, |
| 6438 | (GLfixed *)params |
| 6439 | ); |
| 6440 | |
| 6441 | exit: |
| 6442 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6443 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6444 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6445 | if (_exception) { |
| 6446 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6447 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6448 | } |
| 6449 | |
| 6450 | /* GLboolean glIsBuffer ( GLuint buffer ) */ |
| 6451 | static jboolean |
| 6452 | android_glIsBuffer__I |
| 6453 | (JNIEnv *_env, jobject _this, jint buffer) { |
| 6454 | GLboolean _returnValue; |
| 6455 | _returnValue = glIsBuffer( |
| 6456 | (GLuint)buffer |
| 6457 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6458 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6459 | } |
| 6460 | |
| 6461 | /* GLboolean glIsEnabled ( GLenum cap ) */ |
| 6462 | static jboolean |
| 6463 | android_glIsEnabled__I |
| 6464 | (JNIEnv *_env, jobject _this, jint cap) { |
| 6465 | GLboolean _returnValue; |
| 6466 | _returnValue = glIsEnabled( |
| 6467 | (GLenum)cap |
| 6468 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6469 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6470 | } |
| 6471 | |
| 6472 | /* GLboolean glIsTexture ( GLuint texture ) */ |
| 6473 | static jboolean |
| 6474 | android_glIsTexture__I |
| 6475 | (JNIEnv *_env, jobject _this, jint texture) { |
| 6476 | GLboolean _returnValue; |
| 6477 | _returnValue = glIsTexture( |
| 6478 | (GLuint)texture |
| 6479 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6480 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6481 | } |
| 6482 | |
| 6483 | /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ |
| 6484 | static void |
| 6485 | android_glNormalPointer__III |
| 6486 | (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { |
| 6487 | glNormalPointer( |
| 6488 | (GLenum)type, |
| 6489 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6490 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6491 | ); |
| 6492 | } |
| 6493 | |
| 6494 | /* void glPointParameterf ( GLenum pname, GLfloat param ) */ |
| 6495 | static void |
| 6496 | android_glPointParameterf__IF |
| 6497 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 6498 | glPointParameterf( |
| 6499 | (GLenum)pname, |
| 6500 | (GLfloat)param |
| 6501 | ); |
| 6502 | } |
| 6503 | |
| 6504 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6505 | static void |
| 6506 | android_glPointParameterfv__I_3FI |
| 6507 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6508 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6509 | const char * _exceptionType = NULL; |
| 6510 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6511 | GLfloat *params_base = (GLfloat *) 0; |
| 6512 | jint _remaining; |
| 6513 | GLfloat *params = (GLfloat *) 0; |
| 6514 | |
| 6515 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6516 | _exception = 1; |
| 6517 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6518 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6519 | goto exit; |
| 6520 | } |
| 6521 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6522 | _exception = 1; |
| 6523 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6524 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6525 | goto exit; |
| 6526 | } |
| 6527 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6528 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6529 | _exception = 1; |
| 6530 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6531 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6532 | goto exit; |
| 6533 | } |
| 6534 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6535 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6536 | params = params_base + offset; |
| 6537 | |
| 6538 | glPointParameterfv( |
| 6539 | (GLenum)pname, |
| 6540 | (GLfloat *)params |
| 6541 | ); |
| 6542 | |
| 6543 | exit: |
| 6544 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6545 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6546 | JNI_ABORT); |
| 6547 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6548 | if (_exception) { |
| 6549 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6550 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6551 | } |
| 6552 | |
| 6553 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6554 | static void |
| 6555 | android_glPointParameterfv__ILjava_nio_FloatBuffer_2 |
| 6556 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6557 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6558 | const char * _exceptionType = NULL; |
| 6559 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6560 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6561 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6562 | jint _remaining; |
| 6563 | GLfloat *params = (GLfloat *) 0; |
| 6564 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6565 | if (!params_buf) { |
| 6566 | _exception = 1; |
| 6567 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6568 | _exceptionMessage = "params == null"; |
| 6569 | goto exit; |
| 6570 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6571 | 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] | 6572 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6573 | _exception = 1; |
| 6574 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6575 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6576 | goto exit; |
| 6577 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6578 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6579 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6580 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6581 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6582 | glPointParameterfv( |
| 6583 | (GLenum)pname, |
| 6584 | (GLfloat *)params |
| 6585 | ); |
| 6586 | |
| 6587 | exit: |
| 6588 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6589 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6590 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6591 | if (_exception) { |
| 6592 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6593 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6594 | } |
| 6595 | |
| 6596 | /* void glPointParameterx ( GLenum pname, GLfixed param ) */ |
| 6597 | static void |
| 6598 | android_glPointParameterx__II |
| 6599 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 6600 | glPointParameterx( |
| 6601 | (GLenum)pname, |
| 6602 | (GLfixed)param |
| 6603 | ); |
| 6604 | } |
| 6605 | |
| 6606 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6607 | static void |
| 6608 | android_glPointParameterxv__I_3II |
| 6609 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6610 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6611 | const char * _exceptionType = NULL; |
| 6612 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6613 | GLfixed *params_base = (GLfixed *) 0; |
| 6614 | jint _remaining; |
| 6615 | GLfixed *params = (GLfixed *) 0; |
| 6616 | |
| 6617 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6618 | _exception = 1; |
| 6619 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6620 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6621 | goto exit; |
| 6622 | } |
| 6623 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6624 | _exception = 1; |
| 6625 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6626 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6627 | goto exit; |
| 6628 | } |
| 6629 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6630 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6631 | _exception = 1; |
| 6632 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6633 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6634 | goto exit; |
| 6635 | } |
| 6636 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6637 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6638 | params = params_base + offset; |
| 6639 | |
| 6640 | glPointParameterxv( |
| 6641 | (GLenum)pname, |
| 6642 | (GLfixed *)params |
| 6643 | ); |
| 6644 | |
| 6645 | exit: |
| 6646 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6647 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6648 | JNI_ABORT); |
| 6649 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6650 | if (_exception) { |
| 6651 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6652 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6653 | } |
| 6654 | |
| 6655 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6656 | static void |
| 6657 | android_glPointParameterxv__ILjava_nio_IntBuffer_2 |
| 6658 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6659 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6660 | const char * _exceptionType = NULL; |
| 6661 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6662 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6663 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6664 | jint _remaining; |
| 6665 | GLfixed *params = (GLfixed *) 0; |
| 6666 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6667 | if (!params_buf) { |
| 6668 | _exception = 1; |
| 6669 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6670 | _exceptionMessage = "params == null"; |
| 6671 | goto exit; |
| 6672 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6673 | 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] | 6674 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6675 | _exception = 1; |
| 6676 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6677 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6678 | goto exit; |
| 6679 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6680 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6681 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6682 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6683 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6684 | glPointParameterxv( |
| 6685 | (GLenum)pname, |
| 6686 | (GLfixed *)params |
| 6687 | ); |
| 6688 | |
| 6689 | exit: |
| 6690 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6691 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6692 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6693 | if (_exception) { |
| 6694 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6695 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6696 | } |
| 6697 | |
| 6698 | /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 6699 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6700 | android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I |
| 6701 | (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6702 | jint _exception = 0; |
| 6703 | const char * _exceptionType = NULL; |
| 6704 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6705 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6706 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6707 | jint _remaining; |
| 6708 | GLvoid *pointer = (GLvoid *) 0; |
| 6709 | |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6710 | if (pointer_buf) { |
| 6711 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 6712 | if ( ! pointer ) { |
| 6713 | return; |
| 6714 | } |
| 6715 | } |
| 6716 | glPointSizePointerOESBounds( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6717 | (GLenum)type, |
| 6718 | (GLsizei)stride, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6719 | (GLvoid *)pointer, |
| 6720 | (GLsizei)remaining |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6721 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6722 | if (_exception) { |
| 6723 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6724 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6725 | } |
| 6726 | |
| 6727 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6728 | static void |
| 6729 | android_glTexCoordPointer__IIII |
| 6730 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6731 | glTexCoordPointer( |
| 6732 | (GLint)size, |
| 6733 | (GLenum)type, |
| 6734 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6735 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6736 | ); |
| 6737 | } |
| 6738 | |
| 6739 | /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ |
| 6740 | static void |
| 6741 | android_glTexEnvi__III |
| 6742 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6743 | glTexEnvi( |
| 6744 | (GLenum)target, |
| 6745 | (GLenum)pname, |
| 6746 | (GLint)param |
| 6747 | ); |
| 6748 | } |
| 6749 | |
| 6750 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6751 | static void |
| 6752 | android_glTexEnviv__II_3II |
| 6753 | (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] | 6754 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6755 | const char * _exceptionType = NULL; |
| 6756 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6757 | GLint *params_base = (GLint *) 0; |
| 6758 | jint _remaining; |
| 6759 | GLint *params = (GLint *) 0; |
| 6760 | |
| 6761 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6762 | _exception = 1; |
| 6763 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6764 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6765 | goto exit; |
| 6766 | } |
| 6767 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6768 | _exception = 1; |
| 6769 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6770 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6771 | goto exit; |
| 6772 | } |
| 6773 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6774 | int _needed; |
| 6775 | switch (pname) { |
| 6776 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6777 | case GL_TEXTURE_ENV_MODE: |
| 6778 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6779 | #if defined(GL_COMBINE_RGB) |
| 6780 | case GL_COMBINE_RGB: |
| 6781 | #endif // defined(GL_COMBINE_RGB) |
| 6782 | #if defined(GL_COMBINE_ALPHA) |
| 6783 | case GL_COMBINE_ALPHA: |
| 6784 | #endif // defined(GL_COMBINE_ALPHA) |
| 6785 | _needed = 1; |
| 6786 | break; |
| 6787 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6788 | case GL_TEXTURE_ENV_COLOR: |
| 6789 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6790 | _needed = 4; |
| 6791 | break; |
| 6792 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6793 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6794 | break; |
| 6795 | } |
| 6796 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6797 | _exception = 1; |
| 6798 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6799 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6800 | goto exit; |
| 6801 | } |
| 6802 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6803 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6804 | params = params_base + offset; |
| 6805 | |
| 6806 | glTexEnviv( |
| 6807 | (GLenum)target, |
| 6808 | (GLenum)pname, |
| 6809 | (GLint *)params |
| 6810 | ); |
| 6811 | |
| 6812 | exit: |
| 6813 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6814 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6815 | JNI_ABORT); |
| 6816 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6817 | if (_exception) { |
| 6818 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6819 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6820 | } |
| 6821 | |
| 6822 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6823 | static void |
| 6824 | android_glTexEnviv__IILjava_nio_IntBuffer_2 |
| 6825 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6826 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6827 | const char * _exceptionType = NULL; |
| 6828 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6829 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6830 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6831 | jint _remaining; |
| 6832 | GLint *params = (GLint *) 0; |
| 6833 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6834 | if (!params_buf) { |
| 6835 | _exception = 1; |
| 6836 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6837 | _exceptionMessage = "params == null"; |
| 6838 | goto exit; |
| 6839 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6840 | 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] | 6841 | int _needed; |
| 6842 | switch (pname) { |
| 6843 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6844 | case GL_TEXTURE_ENV_MODE: |
| 6845 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6846 | #if defined(GL_COMBINE_RGB) |
| 6847 | case GL_COMBINE_RGB: |
| 6848 | #endif // defined(GL_COMBINE_RGB) |
| 6849 | #if defined(GL_COMBINE_ALPHA) |
| 6850 | case GL_COMBINE_ALPHA: |
| 6851 | #endif // defined(GL_COMBINE_ALPHA) |
| 6852 | _needed = 1; |
| 6853 | break; |
| 6854 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6855 | case GL_TEXTURE_ENV_COLOR: |
| 6856 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6857 | _needed = 4; |
| 6858 | break; |
| 6859 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6860 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6861 | break; |
| 6862 | } |
| 6863 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6864 | _exception = 1; |
| 6865 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6866 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6867 | goto exit; |
| 6868 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6869 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6870 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6871 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6872 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6873 | glTexEnviv( |
| 6874 | (GLenum)target, |
| 6875 | (GLenum)pname, |
| 6876 | (GLint *)params |
| 6877 | ); |
| 6878 | |
| 6879 | exit: |
| 6880 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6881 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6882 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6883 | if (_exception) { |
| 6884 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6885 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6886 | } |
| 6887 | |
| 6888 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6889 | static void |
| 6890 | android_glTexParameterfv__II_3FI |
| 6891 | (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] | 6892 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6893 | const char * _exceptionType = NULL; |
| 6894 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6895 | GLfloat *params_base = (GLfloat *) 0; |
| 6896 | jint _remaining; |
| 6897 | GLfloat *params = (GLfloat *) 0; |
| 6898 | |
| 6899 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6900 | _exception = 1; |
| 6901 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6902 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6903 | goto exit; |
| 6904 | } |
| 6905 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6906 | _exception = 1; |
| 6907 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6908 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6909 | goto exit; |
| 6910 | } |
| 6911 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6912 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6913 | _exception = 1; |
| 6914 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6915 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6916 | goto exit; |
| 6917 | } |
| 6918 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6919 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6920 | params = params_base + offset; |
| 6921 | |
| 6922 | glTexParameterfv( |
| 6923 | (GLenum)target, |
| 6924 | (GLenum)pname, |
| 6925 | (GLfloat *)params |
| 6926 | ); |
| 6927 | |
| 6928 | exit: |
| 6929 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6930 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6931 | JNI_ABORT); |
| 6932 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6933 | if (_exception) { |
| 6934 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6935 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6936 | } |
| 6937 | |
| 6938 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6939 | static void |
| 6940 | android_glTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6941 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6942 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6943 | const char * _exceptionType = NULL; |
| 6944 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6945 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6946 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6947 | jint _remaining; |
| 6948 | GLfloat *params = (GLfloat *) 0; |
| 6949 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 6950 | if (!params_buf) { |
| 6951 | _exception = 1; |
| 6952 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6953 | _exceptionMessage = "params == null"; |
| 6954 | goto exit; |
| 6955 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6956 | 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] | 6957 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6958 | _exception = 1; |
| 6959 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6960 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6961 | goto exit; |
| 6962 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6963 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6964 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6965 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6966 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6967 | glTexParameterfv( |
| 6968 | (GLenum)target, |
| 6969 | (GLenum)pname, |
| 6970 | (GLfloat *)params |
| 6971 | ); |
| 6972 | |
| 6973 | exit: |
| 6974 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6975 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6976 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6977 | if (_exception) { |
| 6978 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6979 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6980 | } |
| 6981 | |
| 6982 | /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ |
| 6983 | static void |
| 6984 | android_glTexParameteri__III |
| 6985 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6986 | glTexParameteri( |
| 6987 | (GLenum)target, |
| 6988 | (GLenum)pname, |
| 6989 | (GLint)param |
| 6990 | ); |
| 6991 | } |
| 6992 | |
| 6993 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6994 | static void |
| 6995 | android_glTexParameteriv__II_3II |
| 6996 | (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] | 6997 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6998 | const char * _exceptionType = NULL; |
| 6999 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7000 | GLint *params_base = (GLint *) 0; |
| 7001 | jint _remaining; |
| 7002 | GLint *params = (GLint *) 0; |
| 7003 | |
| 7004 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7005 | _exception = 1; |
| 7006 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7007 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7008 | goto exit; |
| 7009 | } |
| 7010 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7011 | _exception = 1; |
| 7012 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7013 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7014 | goto exit; |
| 7015 | } |
| 7016 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7017 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7018 | _exception = 1; |
| 7019 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7020 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7021 | goto exit; |
| 7022 | } |
| 7023 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7024 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7025 | params = params_base + offset; |
| 7026 | |
| 7027 | glTexParameteriv( |
| 7028 | (GLenum)target, |
| 7029 | (GLenum)pname, |
| 7030 | (GLint *)params |
| 7031 | ); |
| 7032 | |
| 7033 | exit: |
| 7034 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7035 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7036 | JNI_ABORT); |
| 7037 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7038 | if (_exception) { |
| 7039 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7040 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7041 | } |
| 7042 | |
| 7043 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 7044 | static void |
| 7045 | android_glTexParameteriv__IILjava_nio_IntBuffer_2 |
| 7046 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7047 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7048 | const char * _exceptionType = NULL; |
| 7049 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7050 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7051 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7052 | jint _remaining; |
| 7053 | GLint *params = (GLint *) 0; |
| 7054 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7055 | if (!params_buf) { |
| 7056 | _exception = 1; |
| 7057 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7058 | _exceptionMessage = "params == null"; |
| 7059 | goto exit; |
| 7060 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7061 | 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] | 7062 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7063 | _exception = 1; |
| 7064 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7065 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7066 | goto exit; |
| 7067 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7068 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7069 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7070 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7071 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7072 | glTexParameteriv( |
| 7073 | (GLenum)target, |
| 7074 | (GLenum)pname, |
| 7075 | (GLint *)params |
| 7076 | ); |
| 7077 | |
| 7078 | exit: |
| 7079 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7080 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7081 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7082 | if (_exception) { |
| 7083 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7084 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7085 | } |
| 7086 | |
| 7087 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 7088 | static void |
| 7089 | android_glTexParameterxv__II_3II |
| 7090 | (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] | 7091 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7092 | const char * _exceptionType = NULL; |
| 7093 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7094 | GLfixed *params_base = (GLfixed *) 0; |
| 7095 | jint _remaining; |
| 7096 | GLfixed *params = (GLfixed *) 0; |
| 7097 | |
| 7098 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7099 | _exception = 1; |
| 7100 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7101 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7102 | goto exit; |
| 7103 | } |
| 7104 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7105 | _exception = 1; |
| 7106 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7107 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7108 | goto exit; |
| 7109 | } |
| 7110 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7111 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7112 | _exception = 1; |
| 7113 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7114 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7115 | goto exit; |
| 7116 | } |
| 7117 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7118 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7119 | params = params_base + offset; |
| 7120 | |
| 7121 | glTexParameterxv( |
| 7122 | (GLenum)target, |
| 7123 | (GLenum)pname, |
| 7124 | (GLfixed *)params |
| 7125 | ); |
| 7126 | |
| 7127 | exit: |
| 7128 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7129 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7130 | JNI_ABORT); |
| 7131 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7132 | if (_exception) { |
| 7133 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7134 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7135 | } |
| 7136 | |
| 7137 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 7138 | static void |
| 7139 | android_glTexParameterxv__IILjava_nio_IntBuffer_2 |
| 7140 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7141 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7142 | const char * _exceptionType = NULL; |
| 7143 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7144 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7145 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7146 | jint _remaining; |
| 7147 | GLfixed *params = (GLfixed *) 0; |
| 7148 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7149 | if (!params_buf) { |
| 7150 | _exception = 1; |
| 7151 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7152 | _exceptionMessage = "params == null"; |
| 7153 | goto exit; |
| 7154 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7155 | 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] | 7156 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7157 | _exception = 1; |
| 7158 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7159 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7160 | goto exit; |
| 7161 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7162 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7163 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7164 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 7165 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7166 | glTexParameterxv( |
| 7167 | (GLenum)target, |
| 7168 | (GLenum)pname, |
| 7169 | (GLfixed *)params |
| 7170 | ); |
| 7171 | |
| 7172 | exit: |
| 7173 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7174 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7175 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7176 | if (_exception) { |
| 7177 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7178 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7179 | } |
| 7180 | |
| 7181 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7182 | static void |
| 7183 | android_glVertexPointer__IIII |
| 7184 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 7185 | glVertexPointer( |
| 7186 | (GLint)size, |
| 7187 | (GLenum)type, |
| 7188 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7189 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7190 | ); |
| 7191 | } |
| 7192 | |
| 7193 | /* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */ |
| 7194 | static void |
| 7195 | android_glCurrentPaletteMatrixOES__I |
| 7196 | (JNIEnv *_env, jobject _this, jint matrixpaletteindex) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7197 | glCurrentPaletteMatrixOES( |
| 7198 | (GLuint)matrixpaletteindex |
| 7199 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7200 | } |
| 7201 | |
| 7202 | /* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */ |
| 7203 | static void |
| 7204 | android_glDrawTexfOES__FFFFF |
| 7205 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) { |
| 7206 | glDrawTexfOES( |
| 7207 | (GLfloat)x, |
| 7208 | (GLfloat)y, |
| 7209 | (GLfloat)z, |
| 7210 | (GLfloat)width, |
| 7211 | (GLfloat)height |
| 7212 | ); |
| 7213 | } |
| 7214 | |
| 7215 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 7216 | static void |
| 7217 | android_glDrawTexfvOES___3FI |
| 7218 | (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7219 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7220 | const char * _exceptionType = NULL; |
| 7221 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7222 | GLfloat *coords_base = (GLfloat *) 0; |
| 7223 | jint _remaining; |
| 7224 | GLfloat *coords = (GLfloat *) 0; |
| 7225 | |
| 7226 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7227 | _exception = 1; |
| 7228 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7229 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7230 | goto exit; |
| 7231 | } |
| 7232 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7233 | _exception = 1; |
| 7234 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7235 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7236 | goto exit; |
| 7237 | } |
| 7238 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7239 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7240 | _exception = 1; |
| 7241 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7242 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7243 | goto exit; |
| 7244 | } |
| 7245 | coords_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7246 | _env->GetFloatArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7247 | coords = coords_base + offset; |
| 7248 | |
| 7249 | glDrawTexfvOES( |
| 7250 | (GLfloat *)coords |
| 7251 | ); |
| 7252 | |
| 7253 | exit: |
| 7254 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7255 | _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7256 | JNI_ABORT); |
| 7257 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7258 | if (_exception) { |
| 7259 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7260 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7261 | } |
| 7262 | |
| 7263 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 7264 | static void |
| 7265 | android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 |
| 7266 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7267 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7268 | const char * _exceptionType = NULL; |
| 7269 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7270 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7271 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7272 | jint _remaining; |
| 7273 | GLfloat *coords = (GLfloat *) 0; |
| 7274 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7275 | if (!coords_buf) { |
| 7276 | _exception = 1; |
| 7277 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7278 | _exceptionMessage = "coords == null"; |
| 7279 | goto exit; |
| 7280 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7281 | 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] | 7282 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7283 | _exception = 1; |
| 7284 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7285 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7286 | goto exit; |
| 7287 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7288 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7289 | char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7290 | coords = (GLfloat *) (_coordsBase + _bufferOffset); |
| 7291 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7292 | glDrawTexfvOES( |
| 7293 | (GLfloat *)coords |
| 7294 | ); |
| 7295 | |
| 7296 | exit: |
| 7297 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7298 | _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7299 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7300 | if (_exception) { |
| 7301 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7302 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7303 | } |
| 7304 | |
| 7305 | /* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */ |
| 7306 | static void |
| 7307 | android_glDrawTexiOES__IIIII |
| 7308 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7309 | glDrawTexiOES( |
| 7310 | (GLint)x, |
| 7311 | (GLint)y, |
| 7312 | (GLint)z, |
| 7313 | (GLint)width, |
| 7314 | (GLint)height |
| 7315 | ); |
| 7316 | } |
| 7317 | |
| 7318 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 7319 | static void |
| 7320 | android_glDrawTexivOES___3II |
| 7321 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7322 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7323 | const char * _exceptionType = NULL; |
| 7324 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7325 | GLint *coords_base = (GLint *) 0; |
| 7326 | jint _remaining; |
| 7327 | GLint *coords = (GLint *) 0; |
| 7328 | |
| 7329 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7330 | _exception = 1; |
| 7331 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7332 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7333 | goto exit; |
| 7334 | } |
| 7335 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7336 | _exception = 1; |
| 7337 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7338 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7339 | goto exit; |
| 7340 | } |
| 7341 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7342 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7343 | _exception = 1; |
| 7344 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7345 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7346 | goto exit; |
| 7347 | } |
| 7348 | coords_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7349 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7350 | coords = coords_base + offset; |
| 7351 | |
| 7352 | glDrawTexivOES( |
| 7353 | (GLint *)coords |
| 7354 | ); |
| 7355 | |
| 7356 | exit: |
| 7357 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7358 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7359 | JNI_ABORT); |
| 7360 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7361 | if (_exception) { |
| 7362 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7363 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7364 | } |
| 7365 | |
| 7366 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 7367 | static void |
| 7368 | android_glDrawTexivOES__Ljava_nio_IntBuffer_2 |
| 7369 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7370 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7371 | const char * _exceptionType = NULL; |
| 7372 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7373 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7374 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7375 | jint _remaining; |
| 7376 | GLint *coords = (GLint *) 0; |
| 7377 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7378 | if (!coords_buf) { |
| 7379 | _exception = 1; |
| 7380 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7381 | _exceptionMessage = "coords == null"; |
| 7382 | goto exit; |
| 7383 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7384 | 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] | 7385 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7386 | _exception = 1; |
| 7387 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7388 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7389 | goto exit; |
| 7390 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7391 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7392 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7393 | coords = (GLint *) (_coordsBase + _bufferOffset); |
| 7394 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7395 | glDrawTexivOES( |
| 7396 | (GLint *)coords |
| 7397 | ); |
| 7398 | |
| 7399 | exit: |
| 7400 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7401 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7402 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7403 | if (_exception) { |
| 7404 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7405 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7406 | } |
| 7407 | |
| 7408 | /* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */ |
| 7409 | static void |
| 7410 | android_glDrawTexsOES__SSSSS |
| 7411 | (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) { |
| 7412 | glDrawTexsOES( |
| 7413 | (GLshort)x, |
| 7414 | (GLshort)y, |
| 7415 | (GLshort)z, |
| 7416 | (GLshort)width, |
| 7417 | (GLshort)height |
| 7418 | ); |
| 7419 | } |
| 7420 | |
| 7421 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7422 | static void |
| 7423 | android_glDrawTexsvOES___3SI |
| 7424 | (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7425 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7426 | const char * _exceptionType = NULL; |
| 7427 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7428 | GLshort *coords_base = (GLshort *) 0; |
| 7429 | jint _remaining; |
| 7430 | GLshort *coords = (GLshort *) 0; |
| 7431 | |
| 7432 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7433 | _exception = 1; |
| 7434 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7435 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7436 | goto exit; |
| 7437 | } |
| 7438 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7439 | _exception = 1; |
| 7440 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7441 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7442 | goto exit; |
| 7443 | } |
| 7444 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7445 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7446 | _exception = 1; |
| 7447 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7448 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7449 | goto exit; |
| 7450 | } |
| 7451 | coords_base = (GLshort *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7452 | _env->GetShortArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7453 | coords = coords_base + offset; |
| 7454 | |
| 7455 | glDrawTexsvOES( |
| 7456 | (GLshort *)coords |
| 7457 | ); |
| 7458 | |
| 7459 | exit: |
| 7460 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7461 | _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7462 | JNI_ABORT); |
| 7463 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7464 | if (_exception) { |
| 7465 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7466 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7467 | } |
| 7468 | |
| 7469 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7470 | static void |
| 7471 | android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 |
| 7472 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7473 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7474 | const char * _exceptionType = NULL; |
| 7475 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7476 | jshortArray _array = (jshortArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7477 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7478 | jint _remaining; |
| 7479 | GLshort *coords = (GLshort *) 0; |
| 7480 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7481 | if (!coords_buf) { |
| 7482 | _exception = 1; |
| 7483 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7484 | _exceptionMessage = "coords == null"; |
| 7485 | goto exit; |
| 7486 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7487 | 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] | 7488 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7489 | _exception = 1; |
| 7490 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7491 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7492 | goto exit; |
| 7493 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7494 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7495 | char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7496 | coords = (GLshort *) (_coordsBase + _bufferOffset); |
| 7497 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7498 | glDrawTexsvOES( |
| 7499 | (GLshort *)coords |
| 7500 | ); |
| 7501 | |
| 7502 | exit: |
| 7503 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7504 | _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7505 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7506 | if (_exception) { |
| 7507 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7508 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7509 | } |
| 7510 | |
| 7511 | /* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */ |
| 7512 | static void |
| 7513 | android_glDrawTexxOES__IIIII |
| 7514 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7515 | glDrawTexxOES( |
| 7516 | (GLfixed)x, |
| 7517 | (GLfixed)y, |
| 7518 | (GLfixed)z, |
| 7519 | (GLfixed)width, |
| 7520 | (GLfixed)height |
| 7521 | ); |
| 7522 | } |
| 7523 | |
| 7524 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7525 | static void |
| 7526 | android_glDrawTexxvOES___3II |
| 7527 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7528 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7529 | const char * _exceptionType = NULL; |
| 7530 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7531 | GLfixed *coords_base = (GLfixed *) 0; |
| 7532 | jint _remaining; |
| 7533 | GLfixed *coords = (GLfixed *) 0; |
| 7534 | |
| 7535 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7536 | _exception = 1; |
| 7537 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7538 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7539 | goto exit; |
| 7540 | } |
| 7541 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7542 | _exception = 1; |
| 7543 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7544 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7545 | goto exit; |
| 7546 | } |
| 7547 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7548 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7549 | _exception = 1; |
| 7550 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7551 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7552 | goto exit; |
| 7553 | } |
| 7554 | coords_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7555 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7556 | coords = coords_base + offset; |
| 7557 | |
| 7558 | glDrawTexxvOES( |
| 7559 | (GLfixed *)coords |
| 7560 | ); |
| 7561 | |
| 7562 | exit: |
| 7563 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7564 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7565 | JNI_ABORT); |
| 7566 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7567 | if (_exception) { |
| 7568 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7569 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7570 | } |
| 7571 | |
| 7572 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7573 | static void |
| 7574 | android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 |
| 7575 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7576 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7577 | const char * _exceptionType = NULL; |
| 7578 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7579 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7580 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7581 | jint _remaining; |
| 7582 | GLfixed *coords = (GLfixed *) 0; |
| 7583 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7584 | if (!coords_buf) { |
| 7585 | _exception = 1; |
| 7586 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7587 | _exceptionMessage = "coords == null"; |
| 7588 | goto exit; |
| 7589 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7590 | 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] | 7591 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7592 | _exception = 1; |
| 7593 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7594 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7595 | goto exit; |
| 7596 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7597 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7598 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7599 | coords = (GLfixed *) (_coordsBase + _bufferOffset); |
| 7600 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7601 | glDrawTexxvOES( |
| 7602 | (GLfixed *)coords |
| 7603 | ); |
| 7604 | |
| 7605 | exit: |
| 7606 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7607 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7608 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7609 | if (_exception) { |
| 7610 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7611 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7612 | } |
| 7613 | |
| 7614 | /* void glLoadPaletteFromModelViewMatrixOES ( void ) */ |
| 7615 | static void |
| 7616 | android_glLoadPaletteFromModelViewMatrixOES__ |
| 7617 | (JNIEnv *_env, jobject _this) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7618 | glLoadPaletteFromModelViewMatrixOES(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7619 | } |
| 7620 | |
| 7621 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7622 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7623 | android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7624 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7625 | jint _exception = 0; |
| 7626 | const char * _exceptionType = NULL; |
| 7627 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7628 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7629 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7630 | jint _remaining; |
| 7631 | GLvoid *pointer = (GLvoid *) 0; |
| 7632 | |
| 7633 | if (pointer_buf) { |
| 7634 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7635 | if ( ! pointer ) { |
| 7636 | return; |
| 7637 | } |
| 7638 | } |
| 7639 | glMatrixIndexPointerOESBounds( |
| 7640 | (GLint)size, |
| 7641 | (GLenum)type, |
| 7642 | (GLsizei)stride, |
| 7643 | (GLvoid *)pointer, |
| 7644 | (GLsizei)remaining |
| 7645 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7646 | if (_exception) { |
| 7647 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7648 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7649 | } |
| 7650 | |
| 7651 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7652 | static void |
| 7653 | android_glMatrixIndexPointerOES__IIII |
| 7654 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7655 | glMatrixIndexPointerOES( |
| 7656 | (GLint)size, |
| 7657 | (GLenum)type, |
| 7658 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7659 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7660 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7661 | } |
| 7662 | |
| 7663 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7664 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7665 | android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7666 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7667 | jint _exception = 0; |
| 7668 | const char * _exceptionType = NULL; |
| 7669 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7670 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7671 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7672 | jint _remaining; |
| 7673 | GLvoid *pointer = (GLvoid *) 0; |
| 7674 | |
| 7675 | if (pointer_buf) { |
| 7676 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7677 | if ( ! pointer ) { |
| 7678 | return; |
| 7679 | } |
| 7680 | } |
| 7681 | glWeightPointerOESBounds( |
| 7682 | (GLint)size, |
| 7683 | (GLenum)type, |
| 7684 | (GLsizei)stride, |
| 7685 | (GLvoid *)pointer, |
| 7686 | (GLsizei)remaining |
| 7687 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7688 | if (_exception) { |
| 7689 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7690 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7691 | } |
| 7692 | |
| 7693 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7694 | static void |
| 7695 | android_glWeightPointerOES__IIII |
| 7696 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7697 | glWeightPointerOES( |
| 7698 | (GLint)size, |
| 7699 | (GLenum)type, |
| 7700 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7701 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7702 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7703 | } |
| 7704 | |
| 7705 | /* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */ |
| 7706 | static void |
| 7707 | android_glBindFramebufferOES__II |
| 7708 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7709 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7710 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7711 | "glBindFramebufferOES"); |
| 7712 | return; |
| 7713 | } |
| 7714 | glBindFramebufferOES( |
| 7715 | (GLint)target, |
| 7716 | (GLint)framebuffer |
| 7717 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7718 | } |
| 7719 | |
| 7720 | /* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */ |
| 7721 | static void |
| 7722 | android_glBindRenderbufferOES__II |
| 7723 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7724 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7725 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7726 | "glBindRenderbufferOES"); |
| 7727 | return; |
| 7728 | } |
| 7729 | glBindRenderbufferOES( |
| 7730 | (GLint)target, |
| 7731 | (GLint)renderbuffer |
| 7732 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7733 | } |
| 7734 | |
| 7735 | /* void glBlendEquation ( GLint mode ) */ |
| 7736 | static void |
| 7737 | android_glBlendEquation__I |
| 7738 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7739 | if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7740 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7741 | "glBlendEquation"); |
| 7742 | return; |
| 7743 | } |
| 7744 | glBlendEquation( |
| 7745 | (GLint)mode |
| 7746 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7747 | } |
| 7748 | |
| 7749 | /* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */ |
| 7750 | static void |
| 7751 | android_glBlendEquationSeparate__II |
| 7752 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7753 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7754 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7755 | "glBlendEquationSeparate"); |
| 7756 | return; |
| 7757 | } |
| 7758 | glBlendEquationSeparate( |
| 7759 | (GLint)modeRGB, |
| 7760 | (GLint)modeAlpha |
| 7761 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7762 | } |
| 7763 | |
| 7764 | /* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */ |
| 7765 | static void |
| 7766 | android_glBlendFuncSeparate__IIII |
| 7767 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7768 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7769 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7770 | "glBlendFuncSeparate"); |
| 7771 | return; |
| 7772 | } |
| 7773 | glBlendFuncSeparate( |
| 7774 | (GLint)srcRGB, |
| 7775 | (GLint)dstRGB, |
| 7776 | (GLint)srcAlpha, |
| 7777 | (GLint)dstAlpha |
| 7778 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7779 | } |
| 7780 | |
| 7781 | /* GLint glCheckFramebufferStatusOES ( GLint target ) */ |
| 7782 | static jint |
| 7783 | android_glCheckFramebufferStatusOES__I |
| 7784 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7785 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7786 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7787 | "glCheckFramebufferStatusOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7788 | return 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7789 | } |
| 7790 | GLint _returnValue = 0; |
| 7791 | _returnValue = glCheckFramebufferStatusOES( |
| 7792 | (GLint)target |
| 7793 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 7794 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7795 | } |
| 7796 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7797 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7798 | static void |
| 7799 | android_glDeleteFramebuffersOES__I_3II |
| 7800 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7801 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7802 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7803 | "glDeleteFramebuffersOES"); |
| 7804 | return; |
| 7805 | } |
| 7806 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7807 | const char * _exceptionType = NULL; |
| 7808 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7809 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7810 | jint _remaining; |
| 7811 | GLuint *framebuffers = (GLuint *) 0; |
| 7812 | |
| 7813 | if (!framebuffers_ref) { |
| 7814 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7815 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7816 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7817 | goto exit; |
| 7818 | } |
| 7819 | if (offset < 0) { |
| 7820 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7821 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7822 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7823 | goto exit; |
| 7824 | } |
| 7825 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7826 | if (_remaining < n) { |
| 7827 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7828 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7829 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7830 | goto exit; |
| 7831 | } |
| 7832 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7833 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7834 | framebuffers = framebuffers_base + offset; |
| 7835 | |
| 7836 | glDeleteFramebuffersOES( |
| 7837 | (GLint)n, |
| 7838 | (GLuint *)framebuffers |
| 7839 | ); |
| 7840 | |
| 7841 | exit: |
| 7842 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7843 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7844 | _exception ? JNI_ABORT: 0); |
| 7845 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7846 | if (_exception) { |
| 7847 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7848 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7849 | } |
| 7850 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7851 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7852 | static void |
| 7853 | android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 7854 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7855 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7856 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7857 | "glDeleteFramebuffersOES"); |
| 7858 | return; |
| 7859 | } |
| 7860 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7861 | const char * _exceptionType = NULL; |
| 7862 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7863 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7864 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7865 | jint _remaining; |
| 7866 | GLuint *framebuffers = (GLuint *) 0; |
| 7867 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7868 | if (!framebuffers_buf) { |
| 7869 | _exception = 1; |
| 7870 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7871 | _exceptionMessage = "framebuffers == null"; |
| 7872 | goto exit; |
| 7873 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7874 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7875 | if (_remaining < n) { |
| 7876 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7877 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7878 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7879 | goto exit; |
| 7880 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7881 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7882 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7883 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7884 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7885 | glDeleteFramebuffersOES( |
| 7886 | (GLint)n, |
| 7887 | (GLuint *)framebuffers |
| 7888 | ); |
| 7889 | |
| 7890 | exit: |
| 7891 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7892 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7893 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7894 | if (_exception) { |
| 7895 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7896 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7897 | } |
| 7898 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7899 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7900 | static void |
| 7901 | android_glDeleteRenderbuffersOES__I_3II |
| 7902 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7903 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7904 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7905 | "glDeleteRenderbuffersOES"); |
| 7906 | return; |
| 7907 | } |
| 7908 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7909 | const char * _exceptionType = NULL; |
| 7910 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7911 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7912 | jint _remaining; |
| 7913 | GLuint *renderbuffers = (GLuint *) 0; |
| 7914 | |
| 7915 | if (!renderbuffers_ref) { |
| 7916 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7917 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7918 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7919 | goto exit; |
| 7920 | } |
| 7921 | if (offset < 0) { |
| 7922 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7923 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7924 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7925 | goto exit; |
| 7926 | } |
| 7927 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7928 | if (_remaining < n) { |
| 7929 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7930 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7931 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7932 | goto exit; |
| 7933 | } |
| 7934 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7935 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7936 | renderbuffers = renderbuffers_base + offset; |
| 7937 | |
| 7938 | glDeleteRenderbuffersOES( |
| 7939 | (GLint)n, |
| 7940 | (GLuint *)renderbuffers |
| 7941 | ); |
| 7942 | |
| 7943 | exit: |
| 7944 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7945 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7946 | _exception ? JNI_ABORT: 0); |
| 7947 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7948 | if (_exception) { |
| 7949 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7950 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7951 | } |
| 7952 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7953 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7954 | static void |
| 7955 | android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 7956 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7957 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7958 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7959 | "glDeleteRenderbuffersOES"); |
| 7960 | return; |
| 7961 | } |
| 7962 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7963 | const char * _exceptionType = NULL; |
| 7964 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7965 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7966 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7967 | jint _remaining; |
| 7968 | GLuint *renderbuffers = (GLuint *) 0; |
| 7969 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 7970 | if (!renderbuffers_buf) { |
| 7971 | _exception = 1; |
| 7972 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7973 | _exceptionMessage = "renderbuffers == null"; |
| 7974 | goto exit; |
| 7975 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7976 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7977 | if (_remaining < n) { |
| 7978 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7979 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7980 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7981 | goto exit; |
| 7982 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7983 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7984 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7985 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7986 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7987 | glDeleteRenderbuffersOES( |
| 7988 | (GLint)n, |
| 7989 | (GLuint *)renderbuffers |
| 7990 | ); |
| 7991 | |
| 7992 | exit: |
| 7993 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7994 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7995 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7996 | if (_exception) { |
| 7997 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7998 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7999 | } |
| 8000 | |
| 8001 | /* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */ |
| 8002 | static void |
| 8003 | android_glFramebufferRenderbufferOES__IIII |
| 8004 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8005 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8006 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8007 | "glFramebufferRenderbufferOES"); |
| 8008 | return; |
| 8009 | } |
| 8010 | glFramebufferRenderbufferOES( |
| 8011 | (GLint)target, |
| 8012 | (GLint)attachment, |
| 8013 | (GLint)renderbuffertarget, |
| 8014 | (GLint)renderbuffer |
| 8015 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8016 | } |
| 8017 | |
| 8018 | /* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */ |
| 8019 | static void |
| 8020 | android_glFramebufferTexture2DOES__IIIII |
| 8021 | (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] | 8022 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8023 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8024 | "glFramebufferTexture2DOES"); |
| 8025 | return; |
| 8026 | } |
| 8027 | glFramebufferTexture2DOES( |
| 8028 | (GLint)target, |
| 8029 | (GLint)attachment, |
| 8030 | (GLint)textarget, |
| 8031 | (GLint)texture, |
| 8032 | (GLint)level |
| 8033 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8034 | } |
| 8035 | |
| 8036 | /* void glGenerateMipmapOES ( GLint target ) */ |
| 8037 | static void |
| 8038 | android_glGenerateMipmapOES__I |
| 8039 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8040 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8041 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8042 | "glGenerateMipmapOES"); |
| 8043 | return; |
| 8044 | } |
| 8045 | glGenerateMipmapOES( |
| 8046 | (GLint)target |
| 8047 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8048 | } |
| 8049 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8050 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8051 | static void |
| 8052 | android_glGenFramebuffersOES__I_3II |
| 8053 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8054 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8055 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8056 | "glGenFramebuffersOES"); |
| 8057 | return; |
| 8058 | } |
| 8059 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8060 | const char * _exceptionType = NULL; |
| 8061 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8062 | GLuint *framebuffers_base = (GLuint *) 0; |
| 8063 | jint _remaining; |
| 8064 | GLuint *framebuffers = (GLuint *) 0; |
| 8065 | |
| 8066 | if (!framebuffers_ref) { |
| 8067 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8068 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8069 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8070 | goto exit; |
| 8071 | } |
| 8072 | if (offset < 0) { |
| 8073 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8074 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8075 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8076 | goto exit; |
| 8077 | } |
| 8078 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 8079 | if (_remaining < n) { |
| 8080 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8081 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8082 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8083 | goto exit; |
| 8084 | } |
| 8085 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8086 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8087 | framebuffers = framebuffers_base + offset; |
| 8088 | |
| 8089 | glGenFramebuffersOES( |
| 8090 | (GLint)n, |
| 8091 | (GLuint *)framebuffers |
| 8092 | ); |
| 8093 | |
| 8094 | exit: |
| 8095 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8096 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8097 | _exception ? JNI_ABORT: 0); |
| 8098 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8099 | if (_exception) { |
| 8100 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8101 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8102 | } |
| 8103 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8104 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8105 | static void |
| 8106 | android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 |
| 8107 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8108 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8109 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8110 | "glGenFramebuffersOES"); |
| 8111 | return; |
| 8112 | } |
| 8113 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8114 | const char * _exceptionType = NULL; |
| 8115 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8116 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8117 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8118 | jint _remaining; |
| 8119 | GLuint *framebuffers = (GLuint *) 0; |
| 8120 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8121 | if (!framebuffers_buf) { |
| 8122 | _exception = 1; |
| 8123 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8124 | _exceptionMessage = "framebuffers == null"; |
| 8125 | goto exit; |
| 8126 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8127 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8128 | if (_remaining < n) { |
| 8129 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8130 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8131 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8132 | goto exit; |
| 8133 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8134 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8135 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8136 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 8137 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8138 | glGenFramebuffersOES( |
| 8139 | (GLint)n, |
| 8140 | (GLuint *)framebuffers |
| 8141 | ); |
| 8142 | |
| 8143 | exit: |
| 8144 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8145 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8146 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8147 | if (_exception) { |
| 8148 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8149 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8150 | } |
| 8151 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8152 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8153 | static void |
| 8154 | android_glGenRenderbuffersOES__I_3II |
| 8155 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8156 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8157 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8158 | "glGenRenderbuffersOES"); |
| 8159 | return; |
| 8160 | } |
| 8161 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8162 | const char * _exceptionType = NULL; |
| 8163 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8164 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 8165 | jint _remaining; |
| 8166 | GLuint *renderbuffers = (GLuint *) 0; |
| 8167 | |
| 8168 | if (!renderbuffers_ref) { |
| 8169 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8170 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8171 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8172 | goto exit; |
| 8173 | } |
| 8174 | if (offset < 0) { |
| 8175 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8176 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8177 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8178 | goto exit; |
| 8179 | } |
| 8180 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 8181 | if (_remaining < n) { |
| 8182 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8183 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8184 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8185 | goto exit; |
| 8186 | } |
| 8187 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8188 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8189 | renderbuffers = renderbuffers_base + offset; |
| 8190 | |
| 8191 | glGenRenderbuffersOES( |
| 8192 | (GLint)n, |
| 8193 | (GLuint *)renderbuffers |
| 8194 | ); |
| 8195 | |
| 8196 | exit: |
| 8197 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8198 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8199 | _exception ? JNI_ABORT: 0); |
| 8200 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8201 | if (_exception) { |
| 8202 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8203 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8204 | } |
| 8205 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8206 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8207 | static void |
| 8208 | android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 |
| 8209 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8210 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8211 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8212 | "glGenRenderbuffersOES"); |
| 8213 | return; |
| 8214 | } |
| 8215 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8216 | const char * _exceptionType = NULL; |
| 8217 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8218 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8219 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8220 | jint _remaining; |
| 8221 | GLuint *renderbuffers = (GLuint *) 0; |
| 8222 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8223 | if (!renderbuffers_buf) { |
| 8224 | _exception = 1; |
| 8225 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8226 | _exceptionMessage = "renderbuffers == null"; |
| 8227 | goto exit; |
| 8228 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8229 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8230 | if (_remaining < n) { |
| 8231 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8232 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8233 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8234 | goto exit; |
| 8235 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8236 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8237 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8238 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 8239 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8240 | glGenRenderbuffersOES( |
| 8241 | (GLint)n, |
| 8242 | (GLuint *)renderbuffers |
| 8243 | ); |
| 8244 | |
| 8245 | exit: |
| 8246 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8247 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8248 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8249 | if (_exception) { |
| 8250 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8251 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8252 | } |
| 8253 | |
| 8254 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 8255 | static void |
| 8256 | android_glGetFramebufferAttachmentParameterivOES__III_3II |
| 8257 | (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] | 8258 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8259 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8260 | "glGetFramebufferAttachmentParameterivOES"); |
| 8261 | return; |
| 8262 | } |
| 8263 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8264 | const char * _exceptionType = NULL; |
| 8265 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8266 | GLint *params_base = (GLint *) 0; |
| 8267 | jint _remaining; |
| 8268 | GLint *params = (GLint *) 0; |
| 8269 | |
| 8270 | if (!params_ref) { |
| 8271 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8272 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8273 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8274 | goto exit; |
| 8275 | } |
| 8276 | if (offset < 0) { |
| 8277 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8278 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8279 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8280 | goto exit; |
| 8281 | } |
| 8282 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8283 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8284 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8285 | params = params_base + offset; |
| 8286 | |
| 8287 | glGetFramebufferAttachmentParameterivOES( |
| 8288 | (GLint)target, |
| 8289 | (GLint)attachment, |
| 8290 | (GLint)pname, |
| 8291 | (GLint *)params |
| 8292 | ); |
| 8293 | |
| 8294 | exit: |
| 8295 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8296 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8297 | _exception ? JNI_ABORT: 0); |
| 8298 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8299 | if (_exception) { |
| 8300 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8301 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8302 | } |
| 8303 | |
| 8304 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 8305 | static void |
| 8306 | android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 |
| 8307 | (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] | 8308 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8309 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8310 | "glGetFramebufferAttachmentParameterivOES"); |
| 8311 | return; |
| 8312 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8313 | jint _exception = 0; |
| 8314 | const char * _exceptionType = NULL; |
| 8315 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8316 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8317 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8318 | jint _remaining; |
| 8319 | GLint *params = (GLint *) 0; |
| 8320 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8321 | if (!params_buf) { |
| 8322 | _exception = 1; |
| 8323 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8324 | _exceptionMessage = "params == null"; |
| 8325 | goto exit; |
| 8326 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8327 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8328 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8329 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8330 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8331 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8332 | glGetFramebufferAttachmentParameterivOES( |
| 8333 | (GLint)target, |
| 8334 | (GLint)attachment, |
| 8335 | (GLint)pname, |
| 8336 | (GLint *)params |
| 8337 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8338 | |
| 8339 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8340 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8341 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8342 | } |
| 8343 | if (_exception) { |
| 8344 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8345 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8346 | } |
| 8347 | |
| 8348 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 8349 | static void |
| 8350 | android_glGetRenderbufferParameterivOES__II_3II |
| 8351 | (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] | 8352 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8353 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8354 | "glGetRenderbufferParameterivOES"); |
| 8355 | return; |
| 8356 | } |
| 8357 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8358 | const char * _exceptionType = NULL; |
| 8359 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8360 | GLint *params_base = (GLint *) 0; |
| 8361 | jint _remaining; |
| 8362 | GLint *params = (GLint *) 0; |
| 8363 | |
| 8364 | if (!params_ref) { |
| 8365 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8366 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8367 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8368 | goto exit; |
| 8369 | } |
| 8370 | if (offset < 0) { |
| 8371 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8372 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8373 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8374 | goto exit; |
| 8375 | } |
| 8376 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8377 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8378 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8379 | params = params_base + offset; |
| 8380 | |
| 8381 | glGetRenderbufferParameterivOES( |
| 8382 | (GLint)target, |
| 8383 | (GLint)pname, |
| 8384 | (GLint *)params |
| 8385 | ); |
| 8386 | |
| 8387 | exit: |
| 8388 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8389 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8390 | _exception ? JNI_ABORT: 0); |
| 8391 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8392 | if (_exception) { |
| 8393 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8394 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8395 | } |
| 8396 | |
| 8397 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 8398 | static void |
| 8399 | android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 |
| 8400 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8401 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
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 | "glGetRenderbufferParameterivOES"); |
| 8404 | return; |
| 8405 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8406 | jint _exception = 0; |
| 8407 | const char * _exceptionType = NULL; |
| 8408 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8409 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8410 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8411 | jint _remaining; |
| 8412 | GLint *params = (GLint *) 0; |
| 8413 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8414 | if (!params_buf) { |
| 8415 | _exception = 1; |
| 8416 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8417 | _exceptionMessage = "params == null"; |
| 8418 | goto exit; |
| 8419 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8420 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8421 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8422 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8423 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8424 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8425 | glGetRenderbufferParameterivOES( |
| 8426 | (GLint)target, |
| 8427 | (GLint)pname, |
| 8428 | (GLint *)params |
| 8429 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8430 | |
| 8431 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8432 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8433 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8434 | } |
| 8435 | if (_exception) { |
| 8436 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8437 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8438 | } |
| 8439 | |
| 8440 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8441 | static void |
| 8442 | android_glGetTexGenfv__II_3FI |
| 8443 | (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] | 8444 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8445 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8446 | "glGetTexGenfv"); |
| 8447 | return; |
| 8448 | } |
| 8449 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8450 | const char * _exceptionType = NULL; |
| 8451 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8452 | GLfloat *params_base = (GLfloat *) 0; |
| 8453 | jint _remaining; |
| 8454 | GLfloat *params = (GLfloat *) 0; |
| 8455 | |
| 8456 | if (!params_ref) { |
| 8457 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8458 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8459 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8460 | goto exit; |
| 8461 | } |
| 8462 | if (offset < 0) { |
| 8463 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8464 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8465 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8466 | goto exit; |
| 8467 | } |
| 8468 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8469 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8470 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8471 | params = params_base + offset; |
| 8472 | |
| 8473 | glGetTexGenfv( |
| 8474 | (GLint)coord, |
| 8475 | (GLint)pname, |
| 8476 | (GLfloat *)params |
| 8477 | ); |
| 8478 | |
| 8479 | exit: |
| 8480 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8481 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8482 | _exception ? JNI_ABORT: 0); |
| 8483 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8484 | if (_exception) { |
| 8485 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8486 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8487 | } |
| 8488 | |
| 8489 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8490 | static void |
| 8491 | android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8492 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8493 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8494 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8495 | "glGetTexGenfv"); |
| 8496 | return; |
| 8497 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8498 | jint _exception = 0; |
| 8499 | const char * _exceptionType = NULL; |
| 8500 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8501 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8502 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8503 | jint _remaining; |
| 8504 | GLfloat *params = (GLfloat *) 0; |
| 8505 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8506 | if (!params_buf) { |
| 8507 | _exception = 1; |
| 8508 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8509 | _exceptionMessage = "params == null"; |
| 8510 | goto exit; |
| 8511 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8512 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8513 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8514 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8515 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8516 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8517 | glGetTexGenfv( |
| 8518 | (GLint)coord, |
| 8519 | (GLint)pname, |
| 8520 | (GLfloat *)params |
| 8521 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8522 | |
| 8523 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8524 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8525 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 8526 | } |
| 8527 | if (_exception) { |
| 8528 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8529 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8530 | } |
| 8531 | |
| 8532 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8533 | static void |
| 8534 | android_glGetTexGeniv__II_3II |
| 8535 | (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] | 8536 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8537 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8538 | "glGetTexGeniv"); |
| 8539 | return; |
| 8540 | } |
| 8541 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8542 | const char * _exceptionType = NULL; |
| 8543 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8544 | GLint *params_base = (GLint *) 0; |
| 8545 | jint _remaining; |
| 8546 | GLint *params = (GLint *) 0; |
| 8547 | |
| 8548 | if (!params_ref) { |
| 8549 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8550 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8551 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8552 | goto exit; |
| 8553 | } |
| 8554 | if (offset < 0) { |
| 8555 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8556 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8557 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8558 | goto exit; |
| 8559 | } |
| 8560 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8561 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8562 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8563 | params = params_base + offset; |
| 8564 | |
| 8565 | glGetTexGeniv( |
| 8566 | (GLint)coord, |
| 8567 | (GLint)pname, |
| 8568 | (GLint *)params |
| 8569 | ); |
| 8570 | |
| 8571 | exit: |
| 8572 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8573 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8574 | _exception ? JNI_ABORT: 0); |
| 8575 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8576 | if (_exception) { |
| 8577 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8578 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8579 | } |
| 8580 | |
| 8581 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8582 | static void |
| 8583 | android_glGetTexGeniv__IILjava_nio_IntBuffer_2 |
| 8584 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8585 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8586 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8587 | "glGetTexGeniv"); |
| 8588 | return; |
| 8589 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8590 | jint _exception = 0; |
| 8591 | const char * _exceptionType = NULL; |
| 8592 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8593 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8594 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8595 | jint _remaining; |
| 8596 | GLint *params = (GLint *) 0; |
| 8597 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8598 | if (!params_buf) { |
| 8599 | _exception = 1; |
| 8600 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8601 | _exceptionMessage = "params == null"; |
| 8602 | goto exit; |
| 8603 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8604 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8605 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8606 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8607 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8608 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8609 | glGetTexGeniv( |
| 8610 | (GLint)coord, |
| 8611 | (GLint)pname, |
| 8612 | (GLint *)params |
| 8613 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8614 | |
| 8615 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8616 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8617 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8618 | } |
| 8619 | if (_exception) { |
| 8620 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8621 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8622 | } |
| 8623 | |
| 8624 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8625 | static void |
| 8626 | android_glGetTexGenxv__II_3II |
| 8627 | (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] | 8628 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8629 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8630 | "glGetTexGenxv"); |
| 8631 | return; |
| 8632 | } |
| 8633 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8634 | const char * _exceptionType = NULL; |
| 8635 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8636 | GLint *params_base = (GLint *) 0; |
| 8637 | jint _remaining; |
| 8638 | GLint *params = (GLint *) 0; |
| 8639 | |
| 8640 | if (!params_ref) { |
| 8641 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8642 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8643 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8644 | goto exit; |
| 8645 | } |
| 8646 | if (offset < 0) { |
| 8647 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8648 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8649 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8650 | goto exit; |
| 8651 | } |
| 8652 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8653 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8654 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8655 | params = params_base + offset; |
| 8656 | |
| 8657 | glGetTexGenxv( |
| 8658 | (GLint)coord, |
| 8659 | (GLint)pname, |
| 8660 | (GLint *)params |
| 8661 | ); |
| 8662 | |
| 8663 | exit: |
| 8664 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8665 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8666 | _exception ? JNI_ABORT: 0); |
| 8667 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8668 | if (_exception) { |
| 8669 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8670 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8671 | } |
| 8672 | |
| 8673 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8674 | static void |
| 8675 | android_glGetTexGenxv__IILjava_nio_IntBuffer_2 |
| 8676 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8677 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8678 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8679 | "glGetTexGenxv"); |
| 8680 | return; |
| 8681 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8682 | jint _exception = 0; |
| 8683 | const char * _exceptionType = NULL; |
| 8684 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8685 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8686 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8687 | jint _remaining; |
| 8688 | GLint *params = (GLint *) 0; |
| 8689 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8690 | if (!params_buf) { |
| 8691 | _exception = 1; |
| 8692 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8693 | _exceptionMessage = "params == null"; |
| 8694 | goto exit; |
| 8695 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8696 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8697 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8698 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8699 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8700 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8701 | glGetTexGenxv( |
| 8702 | (GLint)coord, |
| 8703 | (GLint)pname, |
| 8704 | (GLint *)params |
| 8705 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8706 | |
| 8707 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8708 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8709 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8710 | } |
| 8711 | if (_exception) { |
| 8712 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8713 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8714 | } |
| 8715 | |
| 8716 | /* GLboolean glIsFramebufferOES ( GLint framebuffer ) */ |
| 8717 | static jboolean |
| 8718 | android_glIsFramebufferOES__I |
| 8719 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8720 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8721 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8722 | "glIsFramebufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8723 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8724 | } |
| 8725 | GLboolean _returnValue = JNI_FALSE; |
| 8726 | _returnValue = glIsFramebufferOES( |
| 8727 | (GLint)framebuffer |
| 8728 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8729 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8730 | } |
| 8731 | |
| 8732 | /* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */ |
| 8733 | static jboolean |
| 8734 | android_glIsRenderbufferOES__I |
| 8735 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8736 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8737 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8738 | "glIsRenderbufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8739 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8740 | } |
| 8741 | GLboolean _returnValue = JNI_FALSE; |
| 8742 | _returnValue = glIsRenderbufferOES( |
| 8743 | (GLint)renderbuffer |
| 8744 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8745 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8746 | } |
| 8747 | |
| 8748 | /* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */ |
| 8749 | static void |
| 8750 | android_glRenderbufferStorageOES__IIII |
| 8751 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8752 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8753 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8754 | "glRenderbufferStorageOES"); |
| 8755 | return; |
| 8756 | } |
| 8757 | glRenderbufferStorageOES( |
| 8758 | (GLint)target, |
| 8759 | (GLint)internalformat, |
| 8760 | (GLint)width, |
| 8761 | (GLint)height |
| 8762 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8763 | } |
| 8764 | |
| 8765 | /* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */ |
| 8766 | static void |
| 8767 | android_glTexGenf__IIF |
| 8768 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8769 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8770 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8771 | "glTexGenf"); |
| 8772 | return; |
| 8773 | } |
| 8774 | glTexGenf( |
| 8775 | (GLint)coord, |
| 8776 | (GLint)pname, |
| 8777 | (GLfloat)param |
| 8778 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8779 | } |
| 8780 | |
| 8781 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8782 | static void |
| 8783 | android_glTexGenfv__II_3FI |
| 8784 | (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] | 8785 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8786 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8787 | "glTexGenfv"); |
| 8788 | return; |
| 8789 | } |
| 8790 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8791 | const char * _exceptionType = NULL; |
| 8792 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8793 | GLfloat *params_base = (GLfloat *) 0; |
| 8794 | jint _remaining; |
| 8795 | GLfloat *params = (GLfloat *) 0; |
| 8796 | |
| 8797 | if (!params_ref) { |
| 8798 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8799 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8800 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8801 | goto exit; |
| 8802 | } |
| 8803 | if (offset < 0) { |
| 8804 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8805 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8806 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8807 | goto exit; |
| 8808 | } |
| 8809 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8810 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8811 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8812 | params = params_base + offset; |
| 8813 | |
| 8814 | glTexGenfv( |
| 8815 | (GLint)coord, |
| 8816 | (GLint)pname, |
| 8817 | (GLfloat *)params |
| 8818 | ); |
| 8819 | |
| 8820 | exit: |
| 8821 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8822 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8823 | _exception ? JNI_ABORT: 0); |
| 8824 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8825 | if (_exception) { |
| 8826 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8827 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8828 | } |
| 8829 | |
| 8830 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8831 | static void |
| 8832 | android_glTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8833 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8834 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8835 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8836 | "glTexGenfv"); |
| 8837 | return; |
| 8838 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8839 | jint _exception = 0; |
| 8840 | const char * _exceptionType = NULL; |
| 8841 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8842 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8843 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8844 | jint _remaining; |
| 8845 | GLfloat *params = (GLfloat *) 0; |
| 8846 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8847 | if (!params_buf) { |
| 8848 | _exception = 1; |
| 8849 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8850 | _exceptionMessage = "params == null"; |
| 8851 | goto exit; |
| 8852 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8853 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8854 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8855 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8856 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8857 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8858 | glTexGenfv( |
| 8859 | (GLint)coord, |
| 8860 | (GLint)pname, |
| 8861 | (GLfloat *)params |
| 8862 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8863 | |
| 8864 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8865 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8866 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 8867 | } |
| 8868 | if (_exception) { |
| 8869 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8870 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8871 | } |
| 8872 | |
| 8873 | /* void glTexGeni ( GLint coord, GLint pname, GLint param ) */ |
| 8874 | static void |
| 8875 | android_glTexGeni__III |
| 8876 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8877 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8878 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8879 | "glTexGeni"); |
| 8880 | return; |
| 8881 | } |
| 8882 | glTexGeni( |
| 8883 | (GLint)coord, |
| 8884 | (GLint)pname, |
| 8885 | (GLint)param |
| 8886 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8887 | } |
| 8888 | |
| 8889 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8890 | static void |
| 8891 | android_glTexGeniv__II_3II |
| 8892 | (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] | 8893 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8894 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8895 | "glTexGeniv"); |
| 8896 | return; |
| 8897 | } |
| 8898 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8899 | const char * _exceptionType = NULL; |
| 8900 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8901 | GLint *params_base = (GLint *) 0; |
| 8902 | jint _remaining; |
| 8903 | GLint *params = (GLint *) 0; |
| 8904 | |
| 8905 | if (!params_ref) { |
| 8906 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8907 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8908 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8909 | goto exit; |
| 8910 | } |
| 8911 | if (offset < 0) { |
| 8912 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8913 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8914 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8915 | goto exit; |
| 8916 | } |
| 8917 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8918 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8919 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8920 | params = params_base + offset; |
| 8921 | |
| 8922 | glTexGeniv( |
| 8923 | (GLint)coord, |
| 8924 | (GLint)pname, |
| 8925 | (GLint *)params |
| 8926 | ); |
| 8927 | |
| 8928 | exit: |
| 8929 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8930 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8931 | _exception ? JNI_ABORT: 0); |
| 8932 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8933 | if (_exception) { |
| 8934 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8935 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8936 | } |
| 8937 | |
| 8938 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8939 | static void |
| 8940 | android_glTexGeniv__IILjava_nio_IntBuffer_2 |
| 8941 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8942 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8943 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8944 | "glTexGeniv"); |
| 8945 | return; |
| 8946 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8947 | jint _exception = 0; |
| 8948 | const char * _exceptionType = NULL; |
| 8949 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8950 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8951 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8952 | jint _remaining; |
| 8953 | GLint *params = (GLint *) 0; |
| 8954 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8955 | if (!params_buf) { |
| 8956 | _exception = 1; |
| 8957 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8958 | _exceptionMessage = "params == null"; |
| 8959 | goto exit; |
| 8960 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8961 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8962 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8963 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8964 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8965 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8966 | glTexGeniv( |
| 8967 | (GLint)coord, |
| 8968 | (GLint)pname, |
| 8969 | (GLint *)params |
| 8970 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8971 | |
| 8972 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8973 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 8974 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8975 | } |
| 8976 | if (_exception) { |
| 8977 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8978 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8979 | } |
| 8980 | |
| 8981 | /* void glTexGenx ( GLint coord, GLint pname, GLint param ) */ |
| 8982 | static void |
| 8983 | android_glTexGenx__III |
| 8984 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8985 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8986 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8987 | "glTexGenx"); |
| 8988 | return; |
| 8989 | } |
| 8990 | glTexGenx( |
| 8991 | (GLint)coord, |
| 8992 | (GLint)pname, |
| 8993 | (GLint)param |
| 8994 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8995 | } |
| 8996 | |
| 8997 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8998 | static void |
| 8999 | android_glTexGenxv__II_3II |
| 9000 | (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] | 9001 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 9002 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9003 | "glTexGenxv"); |
| 9004 | return; |
| 9005 | } |
| 9006 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 9007 | const char * _exceptionType = NULL; |
| 9008 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9009 | GLint *params_base = (GLint *) 0; |
| 9010 | jint _remaining; |
| 9011 | GLint *params = (GLint *) 0; |
| 9012 | |
| 9013 | if (!params_ref) { |
| 9014 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 9015 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 9016 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9017 | goto exit; |
| 9018 | } |
| 9019 | if (offset < 0) { |
| 9020 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 9021 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 9022 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9023 | goto exit; |
| 9024 | } |
| 9025 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 9026 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9027 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9028 | params = params_base + offset; |
| 9029 | |
| 9030 | glTexGenxv( |
| 9031 | (GLint)coord, |
| 9032 | (GLint)pname, |
| 9033 | (GLint *)params |
| 9034 | ); |
| 9035 | |
| 9036 | exit: |
| 9037 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9038 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9039 | _exception ? JNI_ABORT: 0); |
| 9040 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 9041 | if (_exception) { |
| 9042 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 9043 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9044 | } |
| 9045 | |
| 9046 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 9047 | static void |
| 9048 | android_glTexGenxv__IILjava_nio_IntBuffer_2 |
| 9049 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9050 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 9051 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9052 | "glTexGenxv"); |
| 9053 | return; |
| 9054 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 9055 | jint _exception = 0; |
| 9056 | const char * _exceptionType = NULL; |
| 9057 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9058 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9059 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9060 | jint _remaining; |
| 9061 | GLint *params = (GLint *) 0; |
| 9062 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 9063 | if (!params_buf) { |
| 9064 | _exception = 1; |
| 9065 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 9066 | _exceptionMessage = "params == null"; |
| 9067 | goto exit; |
| 9068 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9069 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9070 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9071 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9072 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 9073 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9074 | glTexGenxv( |
| 9075 | (GLint)coord, |
| 9076 | (GLint)pname, |
| 9077 | (GLint *)params |
| 9078 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 9079 | |
| 9080 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9081 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame^] | 9082 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 9083 | } |
| 9084 | if (_exception) { |
| 9085 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9086 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9087 | } |
| 9088 | |
| 9089 | static const char *classPathName = "com/google/android/gles_jni/GLImpl"; |
| 9090 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 9091 | static const JNINativeMethod methods[] = { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9092 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 9093 | {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, |
| 9094 | {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF }, |
| 9095 | {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II }, |
| 9096 | {"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, |
| 9097 | {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, |
| 9098 | {"glClear", "(I)V", (void *) android_glClear__I }, |
| 9099 | {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, |
| 9100 | {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII }, |
| 9101 | {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, |
| 9102 | {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I }, |
| 9103 | {"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, |
| 9104 | {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I }, |
| 9105 | {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF }, |
| 9106 | {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII }, |
| 9107 | {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, |
| 9108 | {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9109 | {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, |
| 9110 | {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9111 | {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, |
| 9112 | {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, |
| 9113 | {"glCullFace", "(I)V", (void *) android_glCullFace__I }, |
| 9114 | {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, |
| 9115 | {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, |
| 9116 | {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, |
| 9117 | {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, |
| 9118 | {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, |
| 9119 | {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II }, |
| 9120 | {"glDisable", "(I)V", (void *) android_glDisable__I }, |
| 9121 | {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I }, |
| 9122 | {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, |
| 9123 | {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, |
| 9124 | {"glEnable", "(I)V", (void *) android_glEnable__I }, |
| 9125 | {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I }, |
| 9126 | {"glFinish", "()V", (void *) android_glFinish__ }, |
| 9127 | {"glFlush", "()V", (void *) android_glFlush__ }, |
| 9128 | {"glFogf", "(IF)V", (void *) android_glFogf__IF }, |
| 9129 | {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI }, |
| 9130 | {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 }, |
| 9131 | {"glFogx", "(II)V", (void *) android_glFogx__II }, |
| 9132 | {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II }, |
| 9133 | {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 }, |
| 9134 | {"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, |
| 9135 | {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF }, |
| 9136 | {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII }, |
| 9137 | {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, |
| 9138 | {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, |
| 9139 | {"glGetError", "()I", (void *) android_glGetError__ }, |
| 9140 | {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, |
| 9141 | {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, |
| 9142 | {"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, |
| 9143 | {"glHint", "(II)V", (void *) android_glHint__II }, |
| 9144 | {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF }, |
| 9145 | {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI }, |
| 9146 | {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 }, |
| 9147 | {"glLightModelx", "(II)V", (void *) android_glLightModelx__II }, |
| 9148 | {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II }, |
| 9149 | {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 }, |
| 9150 | {"glLightf", "(IIF)V", (void *) android_glLightf__IIF }, |
| 9151 | {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI }, |
| 9152 | {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 }, |
| 9153 | {"glLightx", "(III)V", (void *) android_glLightx__III }, |
| 9154 | {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II }, |
| 9155 | {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 }, |
| 9156 | {"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, |
| 9157 | {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I }, |
| 9158 | {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ }, |
| 9159 | {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI }, |
| 9160 | {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 9161 | {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II }, |
| 9162 | {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 }, |
| 9163 | {"glLogicOp", "(I)V", (void *) android_glLogicOp__I }, |
| 9164 | {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF }, |
| 9165 | {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI }, |
| 9166 | {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 9167 | {"glMaterialx", "(III)V", (void *) android_glMaterialx__III }, |
| 9168 | {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II }, |
| 9169 | {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 9170 | {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I }, |
| 9171 | {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI }, |
| 9172 | {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 9173 | {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II }, |
| 9174 | {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 }, |
| 9175 | {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF }, |
| 9176 | {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII }, |
| 9177 | {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF }, |
| 9178 | {"glNormal3x", "(III)V", (void *) android_glNormal3x__III }, |
| 9179 | {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I }, |
| 9180 | {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF }, |
| 9181 | {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII }, |
| 9182 | {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, |
| 9183 | {"glPointSize", "(F)V", (void *) android_glPointSize__F }, |
| 9184 | {"glPointSizex", "(I)V", (void *) android_glPointSizex__I }, |
| 9185 | {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, |
| 9186 | {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II }, |
| 9187 | {"glPopMatrix", "()V", (void *) android_glPopMatrix__ }, |
| 9188 | {"glPushMatrix", "()V", (void *) android_glPushMatrix__ }, |
| 9189 | {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, |
| 9190 | {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF }, |
| 9191 | {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII }, |
| 9192 | {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, |
| 9193 | {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ }, |
| 9194 | {"glScalef", "(FFF)V", (void *) android_glScalef__FFF }, |
| 9195 | {"glScalex", "(III)V", (void *) android_glScalex__III }, |
| 9196 | {"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, |
| 9197 | {"glShadeModel", "(I)V", (void *) android_glShadeModel__I }, |
| 9198 | {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, |
| 9199 | {"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, |
| 9200 | {"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, |
| 9201 | {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9202 | {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF }, |
| 9203 | {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI }, |
| 9204 | {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 }, |
| 9205 | {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III }, |
| 9206 | {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II }, |
| 9207 | {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 9208 | {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9209 | {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, |
| 9210 | {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III }, |
| 9211 | {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9212 | {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF }, |
| 9213 | {"glTranslatex", "(III)V", (void *) android_glTranslatex__III }, |
| 9214 | {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9215 | {"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, |
| 9216 | {"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II }, |
| 9217 | {"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 9218 | {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, |
| 9219 | {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, |
| 9220 | {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, |
| 9221 | {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, |
| 9222 | {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 9223 | {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, |
| 9224 | {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 9225 | {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, |
| 9226 | {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, |
| 9227 | {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, |
| 9228 | {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, |
| 9229 | {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, |
| 9230 | {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, |
| 9231 | {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, |
| 9232 | {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, |
| 9233 | {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, |
| 9234 | {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, |
| 9235 | {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9236 | {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, |
| 9237 | {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 9238 | {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, |
| 9239 | {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 9240 | {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, |
| 9241 | {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, |
| 9242 | {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, |
| 9243 | {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, |
| 9244 | {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, |
| 9245 | {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, |
| 9246 | {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, |
| 9247 | {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, |
| 9248 | {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, |
| 9249 | {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 9250 | {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, |
| 9251 | {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 9252 | {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, |
| 9253 | {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 9254 | {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, |
| 9255 | {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 9256 | {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, |
| 9257 | {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 9258 | {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, |
| 9259 | {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9260 | {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, |
| 9261 | {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 9262 | {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, |
| 9263 | {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, |
| 9264 | {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, |
| 9265 | {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, |
| 9266 | {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, |
| 9267 | {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, |
| 9268 | {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, |
| 9269 | {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, |
| 9270 | {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, |
| 9271 | {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9272 | {"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] | 9273 | {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, |
| 9274 | {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, |
| 9275 | {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, |
| 9276 | {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 9277 | {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, |
| 9278 | {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 9279 | {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, |
| 9280 | {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, |
| 9281 | {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9282 | {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, |
| 9283 | {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 9284 | {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, |
| 9285 | {"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I }, |
| 9286 | {"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF }, |
| 9287 | {"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI }, |
| 9288 | {"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 }, |
| 9289 | {"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII }, |
| 9290 | {"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II }, |
| 9291 | {"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 }, |
| 9292 | {"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS }, |
| 9293 | {"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI }, |
| 9294 | {"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 }, |
| 9295 | {"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII }, |
| 9296 | {"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II }, |
| 9297 | {"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 }, |
| 9298 | {"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9299 | {"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] | 9300 | {"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9301 | {"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] | 9302 | {"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII }, |
| 9303 | {"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II }, |
| 9304 | {"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II }, |
| 9305 | {"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, |
| 9306 | {"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, |
| 9307 | {"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, |
| 9308 | {"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I }, |
| 9309 | {"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II }, |
| 9310 | {"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9311 | {"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II }, |
| 9312 | {"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9313 | {"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII }, |
| 9314 | {"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII }, |
| 9315 | {"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I }, |
| 9316 | {"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II }, |
| 9317 | {"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9318 | {"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II }, |
| 9319 | {"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9320 | {"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II }, |
| 9321 | {"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 }, |
| 9322 | {"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II }, |
| 9323 | {"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 }, |
| 9324 | {"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI }, |
| 9325 | {"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 9326 | {"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II }, |
| 9327 | {"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 9328 | {"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II }, |
| 9329 | {"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 9330 | {"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I }, |
| 9331 | {"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I }, |
| 9332 | {"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII }, |
| 9333 | {"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF }, |
| 9334 | {"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI }, |
| 9335 | {"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 9336 | {"glTexGeni", "(III)V", (void *) android_glTexGeni__III }, |
| 9337 | {"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II }, |
| 9338 | {"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 9339 | {"glTexGenx", "(III)V", (void *) android_glTexGenx__III }, |
| 9340 | {"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II }, |
| 9341 | {"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 9342 | }; |
| 9343 | |
| 9344 | int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env) |
| 9345 | { |
| 9346 | int err; |
| 9347 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 9348 | return err; |
| 9349 | } |