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" |
Andreas Gampe | bfe6333 | 2014-11-12 14:12:45 -0800 | [diff] [blame] | 21 | #pragma GCC diagnostic ignored "-Wunused-function" |
| 22 | |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 23 | #include "jni.h" |
Steven Moreland | 2279b25 | 2017-07-19 09:50:45 -0700 | [diff] [blame] | 24 | #include <nativehelper/JNIHelp.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | #include <android_runtime/AndroidRuntime.h> |
| 26 | #include <utils/misc.h> |
| 27 | |
| 28 | #include <assert.h> |
| 29 | #include <GLES/gl.h> |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 30 | #include <GLES/glext.h> |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 31 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 32 | // Work around differences between the generated name and the actual name. |
| 33 | |
| 34 | #define glBlendEquation glBlendEquationOES |
| 35 | #define glBlendEquationSeparate glBlendEquationSeparateOES |
| 36 | #define glBlendFuncSeparate glBlendFuncSeparateOES |
| 37 | #define glGetTexGenfv glGetTexGenfvOES |
| 38 | #define glGetTexGeniv glGetTexGenivOES |
| 39 | #define glGetTexGenxv glGetTexGenxvOES |
| 40 | #define glTexGenf glTexGenfOES |
| 41 | #define glTexGenfv glTexGenfvOES |
| 42 | #define glTexGeni glTexGeniOES |
| 43 | #define glTexGeniv glTexGenivOES |
| 44 | #define glTexGenx glTexGenxOES |
| 45 | #define glTexGenxv glTexGenxvOES |
| 46 | |
| 47 | |
| 48 | |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 49 | /* special calls implemented in Android's GLES wrapper used to more |
| 50 | * efficiently bound-check passed arrays */ |
| 51 | extern "C" { |
| 52 | GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, |
| 53 | const GLvoid *ptr, GLsizei count); |
| 54 | GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, |
| 55 | const GLvoid *pointer, GLsizei count); |
| 56 | GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, |
| 57 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 58 | GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, |
| 59 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 60 | GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, |
| 61 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 62 | GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, |
| 63 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
| 64 | GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, |
| 65 | GLsizei stride, const GLvoid *pointer, GLsizei count); |
Mathias Agopian | 8331f72 | 2009-05-08 15:35:17 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 68 | static jclass G11ImplClass; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 69 | static jfieldID haveCheckedExtensionsID; |
| 70 | static jfieldID have_OES_blend_equation_separateID; |
| 71 | static jfieldID have_OES_blend_subtractID; |
| 72 | static jfieldID have_OES_framebuffer_objectID; |
| 73 | static jfieldID have_OES_texture_cube_mapID; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | |
| 75 | /* Cache method IDs each time the class is loaded. */ |
| 76 | |
Jack Palevich | 27f8002 | 2009-04-15 19:13:17 -0700 | [diff] [blame] | 77 | static void |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 78 | nativeClassInit(JNIEnv *_env, jclass glImplClass) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | { |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 80 | jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl"); |
| 81 | G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 82 | haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z"); |
| 83 | have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z"); |
| 84 | have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z"); |
| 85 | have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z"); |
| 86 | have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z"); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | } |
| 88 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 89 | static void * |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 90 | 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] | 91 | { |
| 92 | jint position; |
| 93 | jint limit; |
| 94 | jint elementSizeShift; |
| 95 | jlong pointer; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 97 | pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 98 | *remaining = (limit - position) << elementSizeShift; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | if (pointer != 0L) { |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 100 | *array = nullptr; |
| 101 | pointer += position << elementSizeShift; |
| 102 | return reinterpret_cast<void*>(pointer); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 103 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 104 | |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 105 | *array = jniGetNioBufferBaseArray(_env, buffer); |
| 106 | *offset = jniGetNioBufferBaseArrayOffset(_env, buffer); |
| 107 | return nullptr; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | } |
| 109 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 110 | static void |
| 111 | releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) |
| 112 | { |
| 113 | _env->ReleasePrimitiveArrayCritical(array, data, |
| 114 | commit ? 0 : JNI_ABORT); |
| 115 | } |
| 116 | |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 117 | extern "C" { |
| 118 | extern char* __progname; |
| 119 | } |
| 120 | |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 121 | static void * |
| 122 | getDirectBufferPointer(JNIEnv *_env, jobject buffer) { |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 123 | if (buffer == nullptr) { |
| 124 | return nullptr; |
Jack Palevich | 91a27ae | 2009-06-15 21:03:24 -0700 | [diff] [blame] | 125 | } |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 126 | |
| 127 | jint position; |
| 128 | jint limit; |
| 129 | jint elementSizeShift; |
| 130 | jlong pointer; |
| 131 | pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift); |
| 132 | if (pointer == 0) { |
| 133 | jniThrowException(_env, "java/lang/IllegalArgumentException", |
| 134 | "Must use a native order direct Buffer"); |
| 135 | return nullptr; |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 136 | } |
Orion Hodson | 61783592 | 2019-02-28 15:15:34 +0000 | [diff] [blame] | 137 | pointer += position << elementSizeShift; |
| 138 | return reinterpret_cast<void*>(pointer); |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 139 | } |
| 140 | |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 141 | static int |
| 142 | getNumCompressedTextureFormats() { |
| 143 | int numCompressedTextureFormats = 0; |
| 144 | glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); |
| 145 | return numCompressedTextureFormats; |
| 146 | } |
| 147 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 148 | // Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is |
| 149 | // terminated by either 0 or space, while pExtension is terminated by 0. |
| 150 | |
| 151 | static bool |
| 152 | extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 153 | while (true) { |
| 154 | char a = *pExtensions++; |
| 155 | char b = *pExtension++; |
| 156 | bool aEnd = a == '\0' || a == ' '; |
| 157 | bool bEnd = b == '\0'; |
| 158 | if ( aEnd || bEnd) { |
| 159 | return aEnd == bEnd; |
| 160 | } |
| 161 | if ( a != b ) { |
| 162 | return false; |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | static const GLubyte* |
| 168 | nextExtension(const GLubyte* pExtensions) { |
| 169 | while (true) { |
| 170 | char a = *pExtensions++; |
| 171 | if ( a == '\0') { |
| 172 | return pExtensions-1; |
| 173 | } else if ( a == ' ') { |
| 174 | return pExtensions; |
| 175 | } |
| 176 | } |
| 177 | } |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 178 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 179 | static bool |
| 180 | checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) { |
| 181 | for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) { |
| 182 | if (extensionEqual(pExtensions, pExtension)) { |
| 183 | return true; |
| 184 | } |
| 185 | } |
| 186 | return false; |
| 187 | } |
| 188 | |
| 189 | static bool |
| 190 | supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) { |
| 191 | if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) { |
| 192 | _env->SetBooleanField(impl, haveCheckedExtensionsID, true); |
| 193 | const GLubyte* sExtensions = glGetString(GL_EXTENSIONS); |
| 194 | _env->SetBooleanField(impl, have_OES_blend_equation_separateID, |
| 195 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate")); |
| 196 | _env->SetBooleanField(impl, have_OES_blend_subtractID, |
| 197 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract")); |
| 198 | _env->SetBooleanField(impl, have_OES_framebuffer_objectID, |
| 199 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object")); |
| 200 | _env->SetBooleanField(impl, have_OES_texture_cube_mapID, |
| 201 | checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map")); |
| 202 | } |
| 203 | return _env->GetBooleanField(impl, fieldId); |
| 204 | } |
| 205 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 206 | // -------------------------------------------------------------------------- |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 207 | /* void glActiveTexture ( GLenum texture ) */ |
| 208 | static void |
| 209 | android_glActiveTexture__I |
| 210 | (JNIEnv *_env, jobject _this, jint texture) { |
| 211 | glActiveTexture( |
| 212 | (GLenum)texture |
| 213 | ); |
| 214 | } |
| 215 | |
| 216 | /* void glAlphaFunc ( GLenum func, GLclampf ref ) */ |
| 217 | static void |
| 218 | android_glAlphaFunc__IF |
| 219 | (JNIEnv *_env, jobject _this, jint func, jfloat ref) { |
| 220 | glAlphaFunc( |
| 221 | (GLenum)func, |
| 222 | (GLclampf)ref |
| 223 | ); |
| 224 | } |
| 225 | |
| 226 | /* void glAlphaFuncx ( GLenum func, GLclampx ref ) */ |
| 227 | static void |
| 228 | android_glAlphaFuncx__II |
| 229 | (JNIEnv *_env, jobject _this, jint func, jint ref) { |
| 230 | glAlphaFuncx( |
| 231 | (GLenum)func, |
| 232 | (GLclampx)ref |
| 233 | ); |
| 234 | } |
| 235 | |
| 236 | /* void glBindTexture ( GLenum target, GLuint texture ) */ |
| 237 | static void |
| 238 | android_glBindTexture__II |
| 239 | (JNIEnv *_env, jobject _this, jint target, jint texture) { |
| 240 | glBindTexture( |
| 241 | (GLenum)target, |
| 242 | (GLuint)texture |
| 243 | ); |
| 244 | } |
| 245 | |
| 246 | /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ |
| 247 | static void |
| 248 | android_glBlendFunc__II |
| 249 | (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { |
| 250 | glBlendFunc( |
| 251 | (GLenum)sfactor, |
| 252 | (GLenum)dfactor |
| 253 | ); |
| 254 | } |
| 255 | |
| 256 | /* void glClear ( GLbitfield mask ) */ |
| 257 | static void |
| 258 | android_glClear__I |
| 259 | (JNIEnv *_env, jobject _this, jint mask) { |
| 260 | glClear( |
| 261 | (GLbitfield)mask |
| 262 | ); |
| 263 | } |
| 264 | |
| 265 | /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ |
| 266 | static void |
| 267 | android_glClearColor__FFFF |
| 268 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 269 | glClearColor( |
| 270 | (GLclampf)red, |
| 271 | (GLclampf)green, |
| 272 | (GLclampf)blue, |
| 273 | (GLclampf)alpha |
| 274 | ); |
| 275 | } |
| 276 | |
| 277 | /* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */ |
| 278 | static void |
| 279 | android_glClearColorx__IIII |
| 280 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 281 | glClearColorx( |
| 282 | (GLclampx)red, |
| 283 | (GLclampx)green, |
| 284 | (GLclampx)blue, |
| 285 | (GLclampx)alpha |
| 286 | ); |
| 287 | } |
| 288 | |
| 289 | /* void glClearDepthf ( GLclampf depth ) */ |
| 290 | static void |
| 291 | android_glClearDepthf__F |
| 292 | (JNIEnv *_env, jobject _this, jfloat depth) { |
| 293 | glClearDepthf( |
| 294 | (GLclampf)depth |
| 295 | ); |
| 296 | } |
| 297 | |
| 298 | /* void glClearDepthx ( GLclampx depth ) */ |
| 299 | static void |
| 300 | android_glClearDepthx__I |
| 301 | (JNIEnv *_env, jobject _this, jint depth) { |
| 302 | glClearDepthx( |
| 303 | (GLclampx)depth |
| 304 | ); |
| 305 | } |
| 306 | |
| 307 | /* void glClearStencil ( GLint s ) */ |
| 308 | static void |
| 309 | android_glClearStencil__I |
| 310 | (JNIEnv *_env, jobject _this, jint s) { |
| 311 | glClearStencil( |
| 312 | (GLint)s |
| 313 | ); |
| 314 | } |
| 315 | |
| 316 | /* void glClientActiveTexture ( GLenum texture ) */ |
| 317 | static void |
| 318 | android_glClientActiveTexture__I |
| 319 | (JNIEnv *_env, jobject _this, jint texture) { |
| 320 | glClientActiveTexture( |
| 321 | (GLenum)texture |
| 322 | ); |
| 323 | } |
| 324 | |
| 325 | /* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */ |
| 326 | static void |
| 327 | android_glColor4f__FFFF |
| 328 | (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { |
| 329 | glColor4f( |
| 330 | (GLfloat)red, |
| 331 | (GLfloat)green, |
| 332 | (GLfloat)blue, |
| 333 | (GLfloat)alpha |
| 334 | ); |
| 335 | } |
| 336 | |
| 337 | /* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */ |
| 338 | static void |
| 339 | android_glColor4x__IIII |
| 340 | (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) { |
| 341 | glColor4x( |
| 342 | (GLfixed)red, |
| 343 | (GLfixed)green, |
| 344 | (GLfixed)blue, |
| 345 | (GLfixed)alpha |
| 346 | ); |
| 347 | } |
| 348 | |
| 349 | /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ |
| 350 | static void |
| 351 | android_glColorMask__ZZZZ |
| 352 | (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { |
| 353 | glColorMask( |
| 354 | (GLboolean)red, |
| 355 | (GLboolean)green, |
| 356 | (GLboolean)blue, |
| 357 | (GLboolean)alpha |
| 358 | ); |
| 359 | } |
| 360 | |
| 361 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 362 | static void |
| 363 | android_glColorPointerBounds__IIILjava_nio_Buffer_2I |
| 364 | (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] | 365 | jint _exception = 0; |
| 366 | const char * _exceptionType = NULL; |
| 367 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 368 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 369 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 370 | jint _remaining; |
| 371 | GLvoid *pointer = (GLvoid *) 0; |
| 372 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 373 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 374 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 375 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 376 | return; |
| 377 | } |
| 378 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 379 | glColorPointerBounds( |
| 380 | (GLint)size, |
| 381 | (GLenum)type, |
| 382 | (GLsizei)stride, |
| 383 | (GLvoid *)pointer, |
| 384 | (GLsizei)remaining |
| 385 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 386 | if (_exception) { |
| 387 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 388 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ |
| 392 | static void |
| 393 | android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 |
| 394 | (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] | 395 | jint _exception = 0; |
| 396 | const char * _exceptionType = NULL; |
| 397 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 398 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 399 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 400 | jint _remaining; |
| 401 | GLvoid *data = (GLvoid *) 0; |
| 402 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 403 | if (!data_buf) { |
| 404 | _exception = 1; |
| 405 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 406 | _exceptionMessage = "data == null"; |
| 407 | goto exit; |
| 408 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 409 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 410 | if (data == NULL) { |
| 411 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 412 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 413 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 414 | glCompressedTexImage2D( |
| 415 | (GLenum)target, |
| 416 | (GLint)level, |
| 417 | (GLenum)internalformat, |
| 418 | (GLsizei)width, |
| 419 | (GLsizei)height, |
| 420 | (GLint)border, |
| 421 | (GLsizei)imageSize, |
| 422 | (GLvoid *)data |
| 423 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 424 | |
| 425 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 426 | if (_array) { |
| 427 | releasePointer(_env, _array, data, JNI_FALSE); |
| 428 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 429 | if (_exception) { |
| 430 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 431 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 432 | } |
| 433 | |
| 434 | /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ |
| 435 | static void |
| 436 | android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 437 | (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] | 438 | jint _exception = 0; |
| 439 | const char * _exceptionType = NULL; |
| 440 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 442 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 443 | jint _remaining; |
| 444 | GLvoid *data = (GLvoid *) 0; |
| 445 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 446 | if (!data_buf) { |
| 447 | _exception = 1; |
| 448 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 449 | _exceptionMessage = "data == null"; |
| 450 | goto exit; |
| 451 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 452 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 453 | if (data == NULL) { |
| 454 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 455 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 456 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 457 | glCompressedTexSubImage2D( |
| 458 | (GLenum)target, |
| 459 | (GLint)level, |
| 460 | (GLint)xoffset, |
| 461 | (GLint)yoffset, |
| 462 | (GLsizei)width, |
| 463 | (GLsizei)height, |
| 464 | (GLenum)format, |
| 465 | (GLsizei)imageSize, |
| 466 | (GLvoid *)data |
| 467 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 468 | |
| 469 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 470 | if (_array) { |
| 471 | releasePointer(_env, _array, data, JNI_FALSE); |
| 472 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 473 | if (_exception) { |
| 474 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 475 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 476 | } |
| 477 | |
| 478 | /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ |
| 479 | static void |
| 480 | android_glCopyTexImage2D__IIIIIIII |
| 481 | (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { |
| 482 | glCopyTexImage2D( |
| 483 | (GLenum)target, |
| 484 | (GLint)level, |
| 485 | (GLenum)internalformat, |
| 486 | (GLint)x, |
| 487 | (GLint)y, |
| 488 | (GLsizei)width, |
| 489 | (GLsizei)height, |
| 490 | (GLint)border |
| 491 | ); |
| 492 | } |
| 493 | |
| 494 | /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 495 | static void |
| 496 | android_glCopyTexSubImage2D__IIIIIIII |
| 497 | (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { |
| 498 | glCopyTexSubImage2D( |
| 499 | (GLenum)target, |
| 500 | (GLint)level, |
| 501 | (GLint)xoffset, |
| 502 | (GLint)yoffset, |
| 503 | (GLint)x, |
| 504 | (GLint)y, |
| 505 | (GLsizei)width, |
| 506 | (GLsizei)height |
| 507 | ); |
| 508 | } |
| 509 | |
| 510 | /* void glCullFace ( GLenum mode ) */ |
| 511 | static void |
| 512 | android_glCullFace__I |
| 513 | (JNIEnv *_env, jobject _this, jint mode) { |
| 514 | glCullFace( |
| 515 | (GLenum)mode |
| 516 | ); |
| 517 | } |
| 518 | |
| 519 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 520 | static void |
| 521 | android_glDeleteTextures__I_3II |
| 522 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 523 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 524 | const char * _exceptionType = NULL; |
| 525 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 526 | GLuint *textures_base = (GLuint *) 0; |
| 527 | jint _remaining; |
| 528 | GLuint *textures = (GLuint *) 0; |
| 529 | |
| 530 | if (!textures_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 531 | _exception = 1; |
| 532 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 533 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | goto exit; |
| 535 | } |
| 536 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 537 | _exception = 1; |
| 538 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 539 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 540 | goto exit; |
| 541 | } |
| 542 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 543 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 544 | _exception = 1; |
| 545 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 546 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 547 | goto exit; |
| 548 | } |
| 549 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 550 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | textures = textures_base + offset; |
| 552 | |
| 553 | glDeleteTextures( |
| 554 | (GLsizei)n, |
| 555 | (GLuint *)textures |
| 556 | ); |
| 557 | |
| 558 | exit: |
| 559 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 560 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 561 | JNI_ABORT); |
| 562 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 563 | if (_exception) { |
| 564 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 565 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ |
| 569 | static void |
| 570 | android_glDeleteTextures__ILjava_nio_IntBuffer_2 |
| 571 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 572 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 573 | const char * _exceptionType = NULL; |
| 574 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 575 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 576 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 577 | jint _remaining; |
| 578 | GLuint *textures = (GLuint *) 0; |
| 579 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 580 | if (!textures_buf) { |
| 581 | _exception = 1; |
| 582 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 583 | _exceptionMessage = "textures == null"; |
| 584 | goto exit; |
| 585 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 586 | 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] | 587 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 588 | _exception = 1; |
| 589 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 590 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 591 | goto exit; |
| 592 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 593 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 594 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 595 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 596 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 597 | glDeleteTextures( |
| 598 | (GLsizei)n, |
| 599 | (GLuint *)textures |
| 600 | ); |
| 601 | |
| 602 | exit: |
| 603 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 604 | _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 605 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 606 | if (_exception) { |
| 607 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 608 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 609 | } |
| 610 | |
| 611 | /* void glDepthFunc ( GLenum func ) */ |
| 612 | static void |
| 613 | android_glDepthFunc__I |
| 614 | (JNIEnv *_env, jobject _this, jint func) { |
| 615 | glDepthFunc( |
| 616 | (GLenum)func |
| 617 | ); |
| 618 | } |
| 619 | |
| 620 | /* void glDepthMask ( GLboolean flag ) */ |
| 621 | static void |
| 622 | android_glDepthMask__Z |
| 623 | (JNIEnv *_env, jobject _this, jboolean flag) { |
| 624 | glDepthMask( |
| 625 | (GLboolean)flag |
| 626 | ); |
| 627 | } |
| 628 | |
| 629 | /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ |
| 630 | static void |
| 631 | android_glDepthRangef__FF |
| 632 | (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { |
| 633 | glDepthRangef( |
| 634 | (GLclampf)zNear, |
| 635 | (GLclampf)zFar |
| 636 | ); |
| 637 | } |
| 638 | |
| 639 | /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */ |
| 640 | static void |
| 641 | android_glDepthRangex__II |
| 642 | (JNIEnv *_env, jobject _this, jint zNear, jint zFar) { |
| 643 | glDepthRangex( |
| 644 | (GLclampx)zNear, |
| 645 | (GLclampx)zFar |
| 646 | ); |
| 647 | } |
| 648 | |
| 649 | /* void glDisable ( GLenum cap ) */ |
| 650 | static void |
| 651 | android_glDisable__I |
| 652 | (JNIEnv *_env, jobject _this, jint cap) { |
| 653 | glDisable( |
| 654 | (GLenum)cap |
| 655 | ); |
| 656 | } |
| 657 | |
| 658 | /* void glDisableClientState ( GLenum array ) */ |
| 659 | static void |
| 660 | android_glDisableClientState__I |
| 661 | (JNIEnv *_env, jobject _this, jint array) { |
| 662 | glDisableClientState( |
| 663 | (GLenum)array |
| 664 | ); |
| 665 | } |
| 666 | |
| 667 | /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ |
| 668 | static void |
| 669 | android_glDrawArrays__III |
| 670 | (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { |
| 671 | glDrawArrays( |
| 672 | (GLenum)mode, |
| 673 | (GLint)first, |
| 674 | (GLsizei)count |
| 675 | ); |
| 676 | } |
| 677 | |
| 678 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ |
| 679 | static void |
| 680 | android_glDrawElements__IIILjava_nio_Buffer_2 |
| 681 | (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] | 682 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 683 | const char * _exceptionType = NULL; |
| 684 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 685 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 686 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 687 | jint _remaining; |
| 688 | GLvoid *indices = (GLvoid *) 0; |
| 689 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 690 | if (!indices_buf) { |
| 691 | _exception = 1; |
| 692 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 693 | _exceptionMessage = "indices == null"; |
| 694 | goto exit; |
| 695 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 696 | 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] | 697 | if (_remaining < count) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 698 | _exception = 1; |
| 699 | _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; |
| 700 | _exceptionMessage = "remaining() < count < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 701 | goto exit; |
| 702 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 703 | if (indices == NULL) { |
| 704 | char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 705 | indices = (GLvoid *) (_indicesBase + _bufferOffset); |
| 706 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 707 | glDrawElements( |
| 708 | (GLenum)mode, |
| 709 | (GLsizei)count, |
| 710 | (GLenum)type, |
| 711 | (GLvoid *)indices |
| 712 | ); |
| 713 | |
| 714 | exit: |
| 715 | if (_array) { |
| 716 | releasePointer(_env, _array, indices, JNI_FALSE); |
| 717 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 718 | if (_exception) { |
| 719 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 720 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | } |
| 722 | |
| 723 | /* void glEnable ( GLenum cap ) */ |
| 724 | static void |
| 725 | android_glEnable__I |
| 726 | (JNIEnv *_env, jobject _this, jint cap) { |
| 727 | glEnable( |
| 728 | (GLenum)cap |
| 729 | ); |
| 730 | } |
| 731 | |
| 732 | /* void glEnableClientState ( GLenum array ) */ |
| 733 | static void |
| 734 | android_glEnableClientState__I |
| 735 | (JNIEnv *_env, jobject _this, jint array) { |
| 736 | glEnableClientState( |
| 737 | (GLenum)array |
| 738 | ); |
| 739 | } |
| 740 | |
| 741 | /* void glFinish ( void ) */ |
| 742 | static void |
| 743 | android_glFinish__ |
| 744 | (JNIEnv *_env, jobject _this) { |
| 745 | glFinish(); |
| 746 | } |
| 747 | |
| 748 | /* void glFlush ( void ) */ |
| 749 | static void |
| 750 | android_glFlush__ |
| 751 | (JNIEnv *_env, jobject _this) { |
| 752 | glFlush(); |
| 753 | } |
| 754 | |
| 755 | /* void glFogf ( GLenum pname, GLfloat param ) */ |
| 756 | static void |
| 757 | android_glFogf__IF |
| 758 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 759 | glFogf( |
| 760 | (GLenum)pname, |
| 761 | (GLfloat)param |
| 762 | ); |
| 763 | } |
| 764 | |
| 765 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 766 | static void |
| 767 | android_glFogfv__I_3FI |
| 768 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 769 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 770 | const char * _exceptionType = NULL; |
| 771 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 772 | GLfloat *params_base = (GLfloat *) 0; |
| 773 | jint _remaining; |
| 774 | GLfloat *params = (GLfloat *) 0; |
| 775 | |
| 776 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 777 | _exception = 1; |
| 778 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 779 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | goto exit; |
| 781 | } |
| 782 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 783 | _exception = 1; |
| 784 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 785 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 786 | goto exit; |
| 787 | } |
| 788 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 789 | int _needed; |
| 790 | switch (pname) { |
| 791 | #if defined(GL_FOG_MODE) |
| 792 | case GL_FOG_MODE: |
| 793 | #endif // defined(GL_FOG_MODE) |
| 794 | #if defined(GL_FOG_DENSITY) |
| 795 | case GL_FOG_DENSITY: |
| 796 | #endif // defined(GL_FOG_DENSITY) |
| 797 | #if defined(GL_FOG_START) |
| 798 | case GL_FOG_START: |
| 799 | #endif // defined(GL_FOG_START) |
| 800 | #if defined(GL_FOG_END) |
| 801 | case GL_FOG_END: |
| 802 | #endif // defined(GL_FOG_END) |
| 803 | _needed = 1; |
| 804 | break; |
| 805 | #if defined(GL_FOG_COLOR) |
| 806 | case GL_FOG_COLOR: |
| 807 | #endif // defined(GL_FOG_COLOR) |
| 808 | _needed = 4; |
| 809 | break; |
| 810 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 811 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 812 | break; |
| 813 | } |
| 814 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 815 | _exception = 1; |
| 816 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 817 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 818 | goto exit; |
| 819 | } |
| 820 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 821 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 822 | params = params_base + offset; |
| 823 | |
| 824 | glFogfv( |
| 825 | (GLenum)pname, |
| 826 | (GLfloat *)params |
| 827 | ); |
| 828 | |
| 829 | exit: |
| 830 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 831 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 832 | JNI_ABORT); |
| 833 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 834 | if (_exception) { |
| 835 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 836 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 837 | } |
| 838 | |
| 839 | /* void glFogfv ( GLenum pname, const GLfloat *params ) */ |
| 840 | static void |
| 841 | android_glFogfv__ILjava_nio_FloatBuffer_2 |
| 842 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 843 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 844 | const char * _exceptionType = NULL; |
| 845 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 846 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 847 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 848 | jint _remaining; |
| 849 | GLfloat *params = (GLfloat *) 0; |
| 850 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 851 | if (!params_buf) { |
| 852 | _exception = 1; |
| 853 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 854 | _exceptionMessage = "params == null"; |
| 855 | goto exit; |
| 856 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 857 | 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] | 858 | int _needed; |
| 859 | switch (pname) { |
| 860 | #if defined(GL_FOG_MODE) |
| 861 | case GL_FOG_MODE: |
| 862 | #endif // defined(GL_FOG_MODE) |
| 863 | #if defined(GL_FOG_DENSITY) |
| 864 | case GL_FOG_DENSITY: |
| 865 | #endif // defined(GL_FOG_DENSITY) |
| 866 | #if defined(GL_FOG_START) |
| 867 | case GL_FOG_START: |
| 868 | #endif // defined(GL_FOG_START) |
| 869 | #if defined(GL_FOG_END) |
| 870 | case GL_FOG_END: |
| 871 | #endif // defined(GL_FOG_END) |
| 872 | _needed = 1; |
| 873 | break; |
| 874 | #if defined(GL_FOG_COLOR) |
| 875 | case GL_FOG_COLOR: |
| 876 | #endif // defined(GL_FOG_COLOR) |
| 877 | _needed = 4; |
| 878 | break; |
| 879 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 880 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 881 | break; |
| 882 | } |
| 883 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 884 | _exception = 1; |
| 885 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 886 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 887 | goto exit; |
| 888 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 889 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 890 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 891 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 892 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 893 | glFogfv( |
| 894 | (GLenum)pname, |
| 895 | (GLfloat *)params |
| 896 | ); |
| 897 | |
| 898 | exit: |
| 899 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 900 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 901 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 902 | if (_exception) { |
| 903 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 904 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 905 | } |
| 906 | |
| 907 | /* void glFogx ( GLenum pname, GLfixed param ) */ |
| 908 | static void |
| 909 | android_glFogx__II |
| 910 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 911 | glFogx( |
| 912 | (GLenum)pname, |
| 913 | (GLfixed)param |
| 914 | ); |
| 915 | } |
| 916 | |
| 917 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 918 | static void |
| 919 | android_glFogxv__I_3II |
| 920 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 921 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 922 | const char * _exceptionType = NULL; |
| 923 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 924 | GLfixed *params_base = (GLfixed *) 0; |
| 925 | jint _remaining; |
| 926 | GLfixed *params = (GLfixed *) 0; |
| 927 | |
| 928 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 929 | _exception = 1; |
| 930 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 931 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 932 | goto exit; |
| 933 | } |
| 934 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 935 | _exception = 1; |
| 936 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 937 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 938 | goto exit; |
| 939 | } |
| 940 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 941 | int _needed; |
| 942 | switch (pname) { |
| 943 | #if defined(GL_FOG_MODE) |
| 944 | case GL_FOG_MODE: |
| 945 | #endif // defined(GL_FOG_MODE) |
| 946 | #if defined(GL_FOG_DENSITY) |
| 947 | case GL_FOG_DENSITY: |
| 948 | #endif // defined(GL_FOG_DENSITY) |
| 949 | #if defined(GL_FOG_START) |
| 950 | case GL_FOG_START: |
| 951 | #endif // defined(GL_FOG_START) |
| 952 | #if defined(GL_FOG_END) |
| 953 | case GL_FOG_END: |
| 954 | #endif // defined(GL_FOG_END) |
| 955 | _needed = 1; |
| 956 | break; |
| 957 | #if defined(GL_FOG_COLOR) |
| 958 | case GL_FOG_COLOR: |
| 959 | #endif // defined(GL_FOG_COLOR) |
| 960 | _needed = 4; |
| 961 | break; |
| 962 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 963 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 964 | break; |
| 965 | } |
| 966 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 967 | _exception = 1; |
| 968 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 969 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 970 | goto exit; |
| 971 | } |
| 972 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 973 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 974 | params = params_base + offset; |
| 975 | |
| 976 | glFogxv( |
| 977 | (GLenum)pname, |
| 978 | (GLfixed *)params |
| 979 | ); |
| 980 | |
| 981 | exit: |
| 982 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 983 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 984 | JNI_ABORT); |
| 985 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 986 | if (_exception) { |
| 987 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 988 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 989 | } |
| 990 | |
| 991 | /* void glFogxv ( GLenum pname, const GLfixed *params ) */ |
| 992 | static void |
| 993 | android_glFogxv__ILjava_nio_IntBuffer_2 |
| 994 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 995 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 996 | const char * _exceptionType = NULL; |
| 997 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 998 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 999 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1000 | jint _remaining; |
| 1001 | GLfixed *params = (GLfixed *) 0; |
| 1002 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1003 | if (!params_buf) { |
| 1004 | _exception = 1; |
| 1005 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1006 | _exceptionMessage = "params == null"; |
| 1007 | goto exit; |
| 1008 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1009 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1010 | int _needed; |
| 1011 | switch (pname) { |
| 1012 | #if defined(GL_FOG_MODE) |
| 1013 | case GL_FOG_MODE: |
| 1014 | #endif // defined(GL_FOG_MODE) |
| 1015 | #if defined(GL_FOG_DENSITY) |
| 1016 | case GL_FOG_DENSITY: |
| 1017 | #endif // defined(GL_FOG_DENSITY) |
| 1018 | #if defined(GL_FOG_START) |
| 1019 | case GL_FOG_START: |
| 1020 | #endif // defined(GL_FOG_START) |
| 1021 | #if defined(GL_FOG_END) |
| 1022 | case GL_FOG_END: |
| 1023 | #endif // defined(GL_FOG_END) |
| 1024 | _needed = 1; |
| 1025 | break; |
| 1026 | #if defined(GL_FOG_COLOR) |
| 1027 | case GL_FOG_COLOR: |
| 1028 | #endif // defined(GL_FOG_COLOR) |
| 1029 | _needed = 4; |
| 1030 | break; |
| 1031 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1032 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1033 | break; |
| 1034 | } |
| 1035 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1036 | _exception = 1; |
| 1037 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1038 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1039 | goto exit; |
| 1040 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1041 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1042 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1043 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 1044 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1045 | glFogxv( |
| 1046 | (GLenum)pname, |
| 1047 | (GLfixed *)params |
| 1048 | ); |
| 1049 | |
| 1050 | exit: |
| 1051 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1052 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1053 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1054 | if (_exception) { |
| 1055 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1056 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1057 | } |
| 1058 | |
| 1059 | /* void glFrontFace ( GLenum mode ) */ |
| 1060 | static void |
| 1061 | android_glFrontFace__I |
| 1062 | (JNIEnv *_env, jobject _this, jint mode) { |
| 1063 | glFrontFace( |
| 1064 | (GLenum)mode |
| 1065 | ); |
| 1066 | } |
| 1067 | |
| 1068 | /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 1069 | static void |
| 1070 | android_glFrustumf__FFFFFF |
| 1071 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 1072 | glFrustumf( |
| 1073 | (GLfloat)left, |
| 1074 | (GLfloat)right, |
| 1075 | (GLfloat)bottom, |
| 1076 | (GLfloat)top, |
| 1077 | (GLfloat)zNear, |
| 1078 | (GLfloat)zFar |
| 1079 | ); |
| 1080 | } |
| 1081 | |
| 1082 | /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 1083 | static void |
| 1084 | android_glFrustumx__IIIIII |
| 1085 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 1086 | glFrustumx( |
| 1087 | (GLfixed)left, |
| 1088 | (GLfixed)right, |
| 1089 | (GLfixed)bottom, |
| 1090 | (GLfixed)top, |
| 1091 | (GLfixed)zNear, |
| 1092 | (GLfixed)zFar |
| 1093 | ); |
| 1094 | } |
| 1095 | |
| 1096 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1097 | static void |
| 1098 | android_glGenTextures__I_3II |
| 1099 | (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { |
| 1100 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1101 | const char * _exceptionType = NULL; |
| 1102 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1103 | GLuint *textures_base = (GLuint *) 0; |
| 1104 | jint _remaining; |
| 1105 | GLuint *textures = (GLuint *) 0; |
| 1106 | |
| 1107 | if (!textures_ref) { |
| 1108 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1109 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1110 | _exceptionMessage = "textures == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1111 | goto exit; |
| 1112 | } |
| 1113 | if (offset < 0) { |
| 1114 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1115 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1116 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1117 | goto exit; |
| 1118 | } |
| 1119 | _remaining = _env->GetArrayLength(textures_ref) - offset; |
| 1120 | if (_remaining < n) { |
| 1121 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1122 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1123 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1124 | goto exit; |
| 1125 | } |
| 1126 | textures_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1127 | _env->GetIntArrayElements(textures_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1128 | textures = textures_base + offset; |
| 1129 | |
| 1130 | glGenTextures( |
| 1131 | (GLsizei)n, |
| 1132 | (GLuint *)textures |
| 1133 | ); |
| 1134 | |
| 1135 | exit: |
| 1136 | if (textures_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1137 | _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1138 | _exception ? JNI_ABORT: 0); |
| 1139 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1140 | if (_exception) { |
| 1141 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1142 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1143 | } |
| 1144 | |
| 1145 | /* void glGenTextures ( GLsizei n, GLuint *textures ) */ |
| 1146 | static void |
| 1147 | android_glGenTextures__ILjava_nio_IntBuffer_2 |
| 1148 | (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { |
| 1149 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1150 | const char * _exceptionType = NULL; |
| 1151 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1152 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1153 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1154 | jint _remaining; |
| 1155 | GLuint *textures = (GLuint *) 0; |
| 1156 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1157 | if (!textures_buf) { |
| 1158 | _exception = 1; |
| 1159 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1160 | _exceptionMessage = "textures == null"; |
| 1161 | goto exit; |
| 1162 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1163 | 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] | 1164 | if (_remaining < n) { |
| 1165 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1166 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1167 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1168 | goto exit; |
| 1169 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1170 | if (textures == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1171 | char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1172 | textures = (GLuint *) (_texturesBase + _bufferOffset); |
| 1173 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1174 | glGenTextures( |
| 1175 | (GLsizei)n, |
| 1176 | (GLuint *)textures |
| 1177 | ); |
| 1178 | |
| 1179 | exit: |
| 1180 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1181 | _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1182 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1183 | if (_exception) { |
| 1184 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1185 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1186 | } |
| 1187 | |
| 1188 | /* GLenum glGetError ( void ) */ |
| 1189 | static jint |
| 1190 | android_glGetError__ |
| 1191 | (JNIEnv *_env, jobject _this) { |
| 1192 | GLenum _returnValue; |
| 1193 | _returnValue = glGetError(); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 1194 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1195 | } |
| 1196 | |
| 1197 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1198 | static void |
| 1199 | android_glGetIntegerv__I_3II |
| 1200 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 1201 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1202 | const char * _exceptionType = NULL; |
| 1203 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1204 | GLint *params_base = (GLint *) 0; |
| 1205 | jint _remaining; |
| 1206 | GLint *params = (GLint *) 0; |
| 1207 | |
| 1208 | if (!params_ref) { |
| 1209 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1210 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1211 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1212 | goto exit; |
| 1213 | } |
| 1214 | if (offset < 0) { |
| 1215 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1216 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1217 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1218 | goto exit; |
| 1219 | } |
| 1220 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 1221 | int _needed; |
| 1222 | switch (pname) { |
| 1223 | #if defined(GL_ALPHA_BITS) |
| 1224 | case GL_ALPHA_BITS: |
| 1225 | #endif // defined(GL_ALPHA_BITS) |
| 1226 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1227 | case GL_ALPHA_TEST_FUNC: |
| 1228 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1229 | #if defined(GL_ALPHA_TEST_REF) |
| 1230 | case GL_ALPHA_TEST_REF: |
| 1231 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1232 | #if defined(GL_BLEND_DST) |
| 1233 | case GL_BLEND_DST: |
| 1234 | #endif // defined(GL_BLEND_DST) |
| 1235 | #if defined(GL_BLUE_BITS) |
| 1236 | case GL_BLUE_BITS: |
| 1237 | #endif // defined(GL_BLUE_BITS) |
| 1238 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1239 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1240 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1241 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1242 | case GL_COLOR_ARRAY_SIZE: |
| 1243 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1244 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1245 | case GL_COLOR_ARRAY_STRIDE: |
| 1246 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1247 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1248 | case GL_COLOR_ARRAY_TYPE: |
| 1249 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1250 | #if defined(GL_CULL_FACE) |
| 1251 | case GL_CULL_FACE: |
| 1252 | #endif // defined(GL_CULL_FACE) |
| 1253 | #if defined(GL_DEPTH_BITS) |
| 1254 | case GL_DEPTH_BITS: |
| 1255 | #endif // defined(GL_DEPTH_BITS) |
| 1256 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1257 | case GL_DEPTH_CLEAR_VALUE: |
| 1258 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1259 | #if defined(GL_DEPTH_FUNC) |
| 1260 | case GL_DEPTH_FUNC: |
| 1261 | #endif // defined(GL_DEPTH_FUNC) |
| 1262 | #if defined(GL_DEPTH_WRITEMASK) |
| 1263 | case GL_DEPTH_WRITEMASK: |
| 1264 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1265 | #if defined(GL_FOG_DENSITY) |
| 1266 | case GL_FOG_DENSITY: |
| 1267 | #endif // defined(GL_FOG_DENSITY) |
| 1268 | #if defined(GL_FOG_END) |
| 1269 | case GL_FOG_END: |
| 1270 | #endif // defined(GL_FOG_END) |
| 1271 | #if defined(GL_FOG_MODE) |
| 1272 | case GL_FOG_MODE: |
| 1273 | #endif // defined(GL_FOG_MODE) |
| 1274 | #if defined(GL_FOG_START) |
| 1275 | case GL_FOG_START: |
| 1276 | #endif // defined(GL_FOG_START) |
| 1277 | #if defined(GL_FRONT_FACE) |
| 1278 | case GL_FRONT_FACE: |
| 1279 | #endif // defined(GL_FRONT_FACE) |
| 1280 | #if defined(GL_GREEN_BITS) |
| 1281 | case GL_GREEN_BITS: |
| 1282 | #endif // defined(GL_GREEN_BITS) |
| 1283 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1284 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1285 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1286 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1287 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1288 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1289 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1290 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1291 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1292 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1293 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1294 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1295 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1296 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1297 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1298 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1299 | case GL_LINE_SMOOTH_HINT: |
| 1300 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1301 | #if defined(GL_LINE_WIDTH) |
| 1302 | case GL_LINE_WIDTH: |
| 1303 | #endif // defined(GL_LINE_WIDTH) |
| 1304 | #if defined(GL_LOGIC_OP_MODE) |
| 1305 | case GL_LOGIC_OP_MODE: |
| 1306 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1307 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1308 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1309 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1310 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1311 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1312 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1313 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1314 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1315 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1316 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1317 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1318 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1319 | #if defined(GL_MATRIX_MODE) |
| 1320 | case GL_MATRIX_MODE: |
| 1321 | #endif // defined(GL_MATRIX_MODE) |
| 1322 | #if defined(GL_MAX_CLIP_PLANES) |
| 1323 | case GL_MAX_CLIP_PLANES: |
| 1324 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1325 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1326 | case GL_MAX_ELEMENTS_INDICES: |
| 1327 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1328 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1329 | case GL_MAX_ELEMENTS_VERTICES: |
| 1330 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1331 | #if defined(GL_MAX_LIGHTS) |
| 1332 | case GL_MAX_LIGHTS: |
| 1333 | #endif // defined(GL_MAX_LIGHTS) |
| 1334 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1335 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1336 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1337 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1338 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1339 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1340 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1341 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1342 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1343 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1344 | case GL_MAX_TEXTURE_SIZE: |
| 1345 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1346 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1347 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1348 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1349 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1350 | case GL_MAX_TEXTURE_UNITS: |
| 1351 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1352 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1353 | case GL_MAX_VERTEX_UNITS_OES: |
| 1354 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1355 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1356 | case GL_MODELVIEW_STACK_DEPTH: |
| 1357 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1358 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1359 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1360 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1361 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1362 | case GL_NORMAL_ARRAY_STRIDE: |
| 1363 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1364 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1365 | case GL_NORMAL_ARRAY_TYPE: |
| 1366 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1367 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1368 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1369 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1370 | #if defined(GL_PACK_ALIGNMENT) |
| 1371 | case GL_PACK_ALIGNMENT: |
| 1372 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1373 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1374 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1375 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1376 | #if defined(GL_POINT_SIZE) |
| 1377 | case GL_POINT_SIZE: |
| 1378 | #endif // defined(GL_POINT_SIZE) |
| 1379 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1380 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1381 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1382 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1383 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1384 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1385 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1386 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1387 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1388 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1389 | case GL_POINT_SMOOTH_HINT: |
| 1390 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1391 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1392 | case GL_POLYGON_OFFSET_FACTOR: |
| 1393 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1394 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1395 | case GL_POLYGON_OFFSET_UNITS: |
| 1396 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1397 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1398 | case GL_PROJECTION_STACK_DEPTH: |
| 1399 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1400 | #if defined(GL_RED_BITS) |
| 1401 | case GL_RED_BITS: |
| 1402 | #endif // defined(GL_RED_BITS) |
| 1403 | #if defined(GL_SHADE_MODEL) |
| 1404 | case GL_SHADE_MODEL: |
| 1405 | #endif // defined(GL_SHADE_MODEL) |
| 1406 | #if defined(GL_STENCIL_BITS) |
| 1407 | case GL_STENCIL_BITS: |
| 1408 | #endif // defined(GL_STENCIL_BITS) |
| 1409 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1410 | case GL_STENCIL_CLEAR_VALUE: |
| 1411 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1412 | #if defined(GL_STENCIL_FAIL) |
| 1413 | case GL_STENCIL_FAIL: |
| 1414 | #endif // defined(GL_STENCIL_FAIL) |
| 1415 | #if defined(GL_STENCIL_FUNC) |
| 1416 | case GL_STENCIL_FUNC: |
| 1417 | #endif // defined(GL_STENCIL_FUNC) |
| 1418 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1419 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1420 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1421 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1422 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1423 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1424 | #if defined(GL_STENCIL_REF) |
| 1425 | case GL_STENCIL_REF: |
| 1426 | #endif // defined(GL_STENCIL_REF) |
| 1427 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1428 | case GL_STENCIL_VALUE_MASK: |
| 1429 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1430 | #if defined(GL_STENCIL_WRITEMASK) |
| 1431 | case GL_STENCIL_WRITEMASK: |
| 1432 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1433 | #if defined(GL_SUBPIXEL_BITS) |
| 1434 | case GL_SUBPIXEL_BITS: |
| 1435 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1436 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1437 | case GL_TEXTURE_BINDING_2D: |
| 1438 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1439 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1440 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1441 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1442 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1443 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1444 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1445 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1446 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1447 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1448 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1449 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1450 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1451 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1452 | case GL_TEXTURE_STACK_DEPTH: |
| 1453 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1454 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1455 | case GL_UNPACK_ALIGNMENT: |
| 1456 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1457 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1458 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1459 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1460 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1461 | case GL_VERTEX_ARRAY_SIZE: |
| 1462 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1463 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1464 | case GL_VERTEX_ARRAY_STRIDE: |
| 1465 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1466 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1467 | case GL_VERTEX_ARRAY_TYPE: |
| 1468 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1469 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1470 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1471 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1472 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1473 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1474 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1475 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1476 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1477 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1478 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1479 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1480 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1481 | _needed = 1; |
| 1482 | break; |
| 1483 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1484 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1485 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1486 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1487 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1488 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1489 | #if defined(GL_DEPTH_RANGE) |
| 1490 | case GL_DEPTH_RANGE: |
| 1491 | #endif // defined(GL_DEPTH_RANGE) |
| 1492 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1493 | case GL_MAX_VIEWPORT_DIMS: |
| 1494 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1495 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1496 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1497 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1498 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1499 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1500 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1501 | _needed = 2; |
| 1502 | break; |
| 1503 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1504 | case GL_COLOR_CLEAR_VALUE: |
| 1505 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1506 | #if defined(GL_COLOR_WRITEMASK) |
| 1507 | case GL_COLOR_WRITEMASK: |
| 1508 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1509 | #if defined(GL_FOG_COLOR) |
| 1510 | case GL_FOG_COLOR: |
| 1511 | #endif // defined(GL_FOG_COLOR) |
| 1512 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1513 | case GL_LIGHT_MODEL_AMBIENT: |
| 1514 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1515 | #if defined(GL_SCISSOR_BOX) |
| 1516 | case GL_SCISSOR_BOX: |
| 1517 | #endif // defined(GL_SCISSOR_BOX) |
| 1518 | #if defined(GL_VIEWPORT) |
| 1519 | case GL_VIEWPORT: |
| 1520 | #endif // defined(GL_VIEWPORT) |
| 1521 | _needed = 4; |
| 1522 | break; |
| 1523 | #if defined(GL_MODELVIEW_MATRIX) |
| 1524 | case GL_MODELVIEW_MATRIX: |
| 1525 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1526 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1527 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1528 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1529 | #if defined(GL_PROJECTION_MATRIX) |
| 1530 | case GL_PROJECTION_MATRIX: |
| 1531 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1532 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1533 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1534 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1535 | #if defined(GL_TEXTURE_MATRIX) |
| 1536 | case GL_TEXTURE_MATRIX: |
| 1537 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1538 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1539 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1540 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1541 | _needed = 16; |
| 1542 | break; |
| 1543 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1544 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1545 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1546 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1547 | break; |
| 1548 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1549 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1550 | break; |
| 1551 | } |
| 1552 | if (_remaining < _needed) { |
| 1553 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1554 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1555 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1556 | goto exit; |
| 1557 | } |
| 1558 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1559 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1560 | params = params_base + offset; |
| 1561 | |
| 1562 | glGetIntegerv( |
| 1563 | (GLenum)pname, |
| 1564 | (GLint *)params |
| 1565 | ); |
| 1566 | |
| 1567 | exit: |
| 1568 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1569 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1570 | _exception ? JNI_ABORT: 0); |
| 1571 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1572 | if (_exception) { |
| 1573 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1574 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1575 | } |
| 1576 | |
| 1577 | /* void glGetIntegerv ( GLenum pname, GLint *params ) */ |
| 1578 | static void |
| 1579 | android_glGetIntegerv__ILjava_nio_IntBuffer_2 |
| 1580 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
| 1581 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1582 | const char * _exceptionType = NULL; |
| 1583 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1584 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1585 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1586 | jint _remaining; |
| 1587 | GLint *params = (GLint *) 0; |
| 1588 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 1589 | if (!params_buf) { |
| 1590 | _exception = 1; |
| 1591 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1592 | _exceptionMessage = "params == null"; |
| 1593 | goto exit; |
| 1594 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1595 | 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] | 1596 | int _needed; |
| 1597 | switch (pname) { |
| 1598 | #if defined(GL_ALPHA_BITS) |
| 1599 | case GL_ALPHA_BITS: |
| 1600 | #endif // defined(GL_ALPHA_BITS) |
| 1601 | #if defined(GL_ALPHA_TEST_FUNC) |
| 1602 | case GL_ALPHA_TEST_FUNC: |
| 1603 | #endif // defined(GL_ALPHA_TEST_FUNC) |
| 1604 | #if defined(GL_ALPHA_TEST_REF) |
| 1605 | case GL_ALPHA_TEST_REF: |
| 1606 | #endif // defined(GL_ALPHA_TEST_REF) |
| 1607 | #if defined(GL_BLEND_DST) |
| 1608 | case GL_BLEND_DST: |
| 1609 | #endif // defined(GL_BLEND_DST) |
| 1610 | #if defined(GL_BLUE_BITS) |
| 1611 | case GL_BLUE_BITS: |
| 1612 | #endif // defined(GL_BLUE_BITS) |
| 1613 | #if defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1614 | case GL_COLOR_ARRAY_BUFFER_BINDING: |
| 1615 | #endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING) |
| 1616 | #if defined(GL_COLOR_ARRAY_SIZE) |
| 1617 | case GL_COLOR_ARRAY_SIZE: |
| 1618 | #endif // defined(GL_COLOR_ARRAY_SIZE) |
| 1619 | #if defined(GL_COLOR_ARRAY_STRIDE) |
| 1620 | case GL_COLOR_ARRAY_STRIDE: |
| 1621 | #endif // defined(GL_COLOR_ARRAY_STRIDE) |
| 1622 | #if defined(GL_COLOR_ARRAY_TYPE) |
| 1623 | case GL_COLOR_ARRAY_TYPE: |
| 1624 | #endif // defined(GL_COLOR_ARRAY_TYPE) |
| 1625 | #if defined(GL_CULL_FACE) |
| 1626 | case GL_CULL_FACE: |
| 1627 | #endif // defined(GL_CULL_FACE) |
| 1628 | #if defined(GL_DEPTH_BITS) |
| 1629 | case GL_DEPTH_BITS: |
| 1630 | #endif // defined(GL_DEPTH_BITS) |
| 1631 | #if defined(GL_DEPTH_CLEAR_VALUE) |
| 1632 | case GL_DEPTH_CLEAR_VALUE: |
| 1633 | #endif // defined(GL_DEPTH_CLEAR_VALUE) |
| 1634 | #if defined(GL_DEPTH_FUNC) |
| 1635 | case GL_DEPTH_FUNC: |
| 1636 | #endif // defined(GL_DEPTH_FUNC) |
| 1637 | #if defined(GL_DEPTH_WRITEMASK) |
| 1638 | case GL_DEPTH_WRITEMASK: |
| 1639 | #endif // defined(GL_DEPTH_WRITEMASK) |
| 1640 | #if defined(GL_FOG_DENSITY) |
| 1641 | case GL_FOG_DENSITY: |
| 1642 | #endif // defined(GL_FOG_DENSITY) |
| 1643 | #if defined(GL_FOG_END) |
| 1644 | case GL_FOG_END: |
| 1645 | #endif // defined(GL_FOG_END) |
| 1646 | #if defined(GL_FOG_MODE) |
| 1647 | case GL_FOG_MODE: |
| 1648 | #endif // defined(GL_FOG_MODE) |
| 1649 | #if defined(GL_FOG_START) |
| 1650 | case GL_FOG_START: |
| 1651 | #endif // defined(GL_FOG_START) |
| 1652 | #if defined(GL_FRONT_FACE) |
| 1653 | case GL_FRONT_FACE: |
| 1654 | #endif // defined(GL_FRONT_FACE) |
| 1655 | #if defined(GL_GREEN_BITS) |
| 1656 | case GL_GREEN_BITS: |
| 1657 | #endif // defined(GL_GREEN_BITS) |
| 1658 | #if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1659 | case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: |
| 1660 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES) |
| 1661 | #if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
| 1662 | case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: |
| 1663 | #endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1664 | #if defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1665 | case GL_LIGHT_MODEL_COLOR_CONTROL: |
| 1666 | #endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL) |
| 1667 | #if defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
| 1668 | case GL_LIGHT_MODEL_LOCAL_VIEWER: |
| 1669 | #endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1670 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1671 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 1672 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 1673 | #if defined(GL_LINE_SMOOTH_HINT) |
| 1674 | case GL_LINE_SMOOTH_HINT: |
| 1675 | #endif // defined(GL_LINE_SMOOTH_HINT) |
| 1676 | #if defined(GL_LINE_WIDTH) |
| 1677 | case GL_LINE_WIDTH: |
| 1678 | #endif // defined(GL_LINE_WIDTH) |
| 1679 | #if defined(GL_LOGIC_OP_MODE) |
| 1680 | case GL_LOGIC_OP_MODE: |
| 1681 | #endif // defined(GL_LOGIC_OP_MODE) |
| 1682 | #if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1683 | case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: |
| 1684 | #endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES) |
| 1685 | #if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1686 | case GL_MATRIX_INDEX_ARRAY_SIZE_OES: |
| 1687 | #endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES) |
| 1688 | #if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1689 | case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: |
| 1690 | #endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES) |
| 1691 | #if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1692 | case GL_MATRIX_INDEX_ARRAY_TYPE_OES: |
| 1693 | #endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES) |
| 1694 | #if defined(GL_MATRIX_MODE) |
| 1695 | case GL_MATRIX_MODE: |
| 1696 | #endif // defined(GL_MATRIX_MODE) |
| 1697 | #if defined(GL_MAX_CLIP_PLANES) |
| 1698 | case GL_MAX_CLIP_PLANES: |
| 1699 | #endif // defined(GL_MAX_CLIP_PLANES) |
| 1700 | #if defined(GL_MAX_ELEMENTS_INDICES) |
| 1701 | case GL_MAX_ELEMENTS_INDICES: |
| 1702 | #endif // defined(GL_MAX_ELEMENTS_INDICES) |
| 1703 | #if defined(GL_MAX_ELEMENTS_VERTICES) |
| 1704 | case GL_MAX_ELEMENTS_VERTICES: |
| 1705 | #endif // defined(GL_MAX_ELEMENTS_VERTICES) |
| 1706 | #if defined(GL_MAX_LIGHTS) |
| 1707 | case GL_MAX_LIGHTS: |
| 1708 | #endif // defined(GL_MAX_LIGHTS) |
| 1709 | #if defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1710 | case GL_MAX_MODELVIEW_STACK_DEPTH: |
| 1711 | #endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH) |
| 1712 | #if defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1713 | case GL_MAX_PALETTE_MATRICES_OES: |
| 1714 | #endif // defined(GL_MAX_PALETTE_MATRICES_OES) |
| 1715 | #if defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1716 | case GL_MAX_PROJECTION_STACK_DEPTH: |
| 1717 | #endif // defined(GL_MAX_PROJECTION_STACK_DEPTH) |
| 1718 | #if defined(GL_MAX_TEXTURE_SIZE) |
| 1719 | case GL_MAX_TEXTURE_SIZE: |
| 1720 | #endif // defined(GL_MAX_TEXTURE_SIZE) |
| 1721 | #if defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1722 | case GL_MAX_TEXTURE_STACK_DEPTH: |
| 1723 | #endif // defined(GL_MAX_TEXTURE_STACK_DEPTH) |
| 1724 | #if defined(GL_MAX_TEXTURE_UNITS) |
| 1725 | case GL_MAX_TEXTURE_UNITS: |
| 1726 | #endif // defined(GL_MAX_TEXTURE_UNITS) |
| 1727 | #if defined(GL_MAX_VERTEX_UNITS_OES) |
| 1728 | case GL_MAX_VERTEX_UNITS_OES: |
| 1729 | #endif // defined(GL_MAX_VERTEX_UNITS_OES) |
| 1730 | #if defined(GL_MODELVIEW_STACK_DEPTH) |
| 1731 | case GL_MODELVIEW_STACK_DEPTH: |
| 1732 | #endif // defined(GL_MODELVIEW_STACK_DEPTH) |
| 1733 | #if defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1734 | case GL_NORMAL_ARRAY_BUFFER_BINDING: |
| 1735 | #endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING) |
| 1736 | #if defined(GL_NORMAL_ARRAY_STRIDE) |
| 1737 | case GL_NORMAL_ARRAY_STRIDE: |
| 1738 | #endif // defined(GL_NORMAL_ARRAY_STRIDE) |
| 1739 | #if defined(GL_NORMAL_ARRAY_TYPE) |
| 1740 | case GL_NORMAL_ARRAY_TYPE: |
| 1741 | #endif // defined(GL_NORMAL_ARRAY_TYPE) |
| 1742 | #if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1743 | case GL_NUM_COMPRESSED_TEXTURE_FORMATS: |
| 1744 | #endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS) |
| 1745 | #if defined(GL_PACK_ALIGNMENT) |
| 1746 | case GL_PACK_ALIGNMENT: |
| 1747 | #endif // defined(GL_PACK_ALIGNMENT) |
| 1748 | #if defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1749 | case GL_PERSPECTIVE_CORRECTION_HINT: |
| 1750 | #endif // defined(GL_PERSPECTIVE_CORRECTION_HINT) |
| 1751 | #if defined(GL_POINT_SIZE) |
| 1752 | case GL_POINT_SIZE: |
| 1753 | #endif // defined(GL_POINT_SIZE) |
| 1754 | #if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1755 | case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: |
| 1756 | #endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES) |
| 1757 | #if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1758 | case GL_POINT_SIZE_ARRAY_STRIDE_OES: |
| 1759 | #endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES) |
| 1760 | #if defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1761 | case GL_POINT_SIZE_ARRAY_TYPE_OES: |
| 1762 | #endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES) |
| 1763 | #if defined(GL_POINT_SMOOTH_HINT) |
| 1764 | case GL_POINT_SMOOTH_HINT: |
| 1765 | #endif // defined(GL_POINT_SMOOTH_HINT) |
| 1766 | #if defined(GL_POLYGON_OFFSET_FACTOR) |
| 1767 | case GL_POLYGON_OFFSET_FACTOR: |
| 1768 | #endif // defined(GL_POLYGON_OFFSET_FACTOR) |
| 1769 | #if defined(GL_POLYGON_OFFSET_UNITS) |
| 1770 | case GL_POLYGON_OFFSET_UNITS: |
| 1771 | #endif // defined(GL_POLYGON_OFFSET_UNITS) |
| 1772 | #if defined(GL_PROJECTION_STACK_DEPTH) |
| 1773 | case GL_PROJECTION_STACK_DEPTH: |
| 1774 | #endif // defined(GL_PROJECTION_STACK_DEPTH) |
| 1775 | #if defined(GL_RED_BITS) |
| 1776 | case GL_RED_BITS: |
| 1777 | #endif // defined(GL_RED_BITS) |
| 1778 | #if defined(GL_SHADE_MODEL) |
| 1779 | case GL_SHADE_MODEL: |
| 1780 | #endif // defined(GL_SHADE_MODEL) |
| 1781 | #if defined(GL_STENCIL_BITS) |
| 1782 | case GL_STENCIL_BITS: |
| 1783 | #endif // defined(GL_STENCIL_BITS) |
| 1784 | #if defined(GL_STENCIL_CLEAR_VALUE) |
| 1785 | case GL_STENCIL_CLEAR_VALUE: |
| 1786 | #endif // defined(GL_STENCIL_CLEAR_VALUE) |
| 1787 | #if defined(GL_STENCIL_FAIL) |
| 1788 | case GL_STENCIL_FAIL: |
| 1789 | #endif // defined(GL_STENCIL_FAIL) |
| 1790 | #if defined(GL_STENCIL_FUNC) |
| 1791 | case GL_STENCIL_FUNC: |
| 1792 | #endif // defined(GL_STENCIL_FUNC) |
| 1793 | #if defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1794 | case GL_STENCIL_PASS_DEPTH_FAIL: |
| 1795 | #endif // defined(GL_STENCIL_PASS_DEPTH_FAIL) |
| 1796 | #if defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1797 | case GL_STENCIL_PASS_DEPTH_PASS: |
| 1798 | #endif // defined(GL_STENCIL_PASS_DEPTH_PASS) |
| 1799 | #if defined(GL_STENCIL_REF) |
| 1800 | case GL_STENCIL_REF: |
| 1801 | #endif // defined(GL_STENCIL_REF) |
| 1802 | #if defined(GL_STENCIL_VALUE_MASK) |
| 1803 | case GL_STENCIL_VALUE_MASK: |
| 1804 | #endif // defined(GL_STENCIL_VALUE_MASK) |
| 1805 | #if defined(GL_STENCIL_WRITEMASK) |
| 1806 | case GL_STENCIL_WRITEMASK: |
| 1807 | #endif // defined(GL_STENCIL_WRITEMASK) |
| 1808 | #if defined(GL_SUBPIXEL_BITS) |
| 1809 | case GL_SUBPIXEL_BITS: |
| 1810 | #endif // defined(GL_SUBPIXEL_BITS) |
| 1811 | #if defined(GL_TEXTURE_BINDING_2D) |
| 1812 | case GL_TEXTURE_BINDING_2D: |
| 1813 | #endif // defined(GL_TEXTURE_BINDING_2D) |
| 1814 | #if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1815 | case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: |
| 1816 | #endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING) |
| 1817 | #if defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1818 | case GL_TEXTURE_COORD_ARRAY_SIZE: |
| 1819 | #endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE) |
| 1820 | #if defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1821 | case GL_TEXTURE_COORD_ARRAY_STRIDE: |
| 1822 | #endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE) |
| 1823 | #if defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1824 | case GL_TEXTURE_COORD_ARRAY_TYPE: |
| 1825 | #endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE) |
| 1826 | #if defined(GL_TEXTURE_STACK_DEPTH) |
| 1827 | case GL_TEXTURE_STACK_DEPTH: |
| 1828 | #endif // defined(GL_TEXTURE_STACK_DEPTH) |
| 1829 | #if defined(GL_UNPACK_ALIGNMENT) |
| 1830 | case GL_UNPACK_ALIGNMENT: |
| 1831 | #endif // defined(GL_UNPACK_ALIGNMENT) |
| 1832 | #if defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1833 | case GL_VERTEX_ARRAY_BUFFER_BINDING: |
| 1834 | #endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING) |
| 1835 | #if defined(GL_VERTEX_ARRAY_SIZE) |
| 1836 | case GL_VERTEX_ARRAY_SIZE: |
| 1837 | #endif // defined(GL_VERTEX_ARRAY_SIZE) |
| 1838 | #if defined(GL_VERTEX_ARRAY_STRIDE) |
| 1839 | case GL_VERTEX_ARRAY_STRIDE: |
| 1840 | #endif // defined(GL_VERTEX_ARRAY_STRIDE) |
| 1841 | #if defined(GL_VERTEX_ARRAY_TYPE) |
| 1842 | case GL_VERTEX_ARRAY_TYPE: |
| 1843 | #endif // defined(GL_VERTEX_ARRAY_TYPE) |
| 1844 | #if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1845 | case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: |
| 1846 | #endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES) |
| 1847 | #if defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1848 | case GL_WEIGHT_ARRAY_SIZE_OES: |
| 1849 | #endif // defined(GL_WEIGHT_ARRAY_SIZE_OES) |
| 1850 | #if defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1851 | case GL_WEIGHT_ARRAY_STRIDE_OES: |
| 1852 | #endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES) |
| 1853 | #if defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1854 | case GL_WEIGHT_ARRAY_TYPE_OES: |
| 1855 | #endif // defined(GL_WEIGHT_ARRAY_TYPE_OES) |
| 1856 | _needed = 1; |
| 1857 | break; |
| 1858 | #if defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1859 | case GL_ALIASED_POINT_SIZE_RANGE: |
| 1860 | #endif // defined(GL_ALIASED_POINT_SIZE_RANGE) |
| 1861 | #if defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1862 | case GL_ALIASED_LINE_WIDTH_RANGE: |
| 1863 | #endif // defined(GL_ALIASED_LINE_WIDTH_RANGE) |
| 1864 | #if defined(GL_DEPTH_RANGE) |
| 1865 | case GL_DEPTH_RANGE: |
| 1866 | #endif // defined(GL_DEPTH_RANGE) |
| 1867 | #if defined(GL_MAX_VIEWPORT_DIMS) |
| 1868 | case GL_MAX_VIEWPORT_DIMS: |
| 1869 | #endif // defined(GL_MAX_VIEWPORT_DIMS) |
| 1870 | #if defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1871 | case GL_SMOOTH_LINE_WIDTH_RANGE: |
| 1872 | #endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE) |
| 1873 | #if defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1874 | case GL_SMOOTH_POINT_SIZE_RANGE: |
| 1875 | #endif // defined(GL_SMOOTH_POINT_SIZE_RANGE) |
| 1876 | _needed = 2; |
| 1877 | break; |
| 1878 | #if defined(GL_COLOR_CLEAR_VALUE) |
| 1879 | case GL_COLOR_CLEAR_VALUE: |
| 1880 | #endif // defined(GL_COLOR_CLEAR_VALUE) |
| 1881 | #if defined(GL_COLOR_WRITEMASK) |
| 1882 | case GL_COLOR_WRITEMASK: |
| 1883 | #endif // defined(GL_COLOR_WRITEMASK) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1884 | #if defined(GL_FOG_COLOR) |
| 1885 | case GL_FOG_COLOR: |
| 1886 | #endif // defined(GL_FOG_COLOR) |
| 1887 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 1888 | case GL_LIGHT_MODEL_AMBIENT: |
| 1889 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1890 | #if defined(GL_SCISSOR_BOX) |
| 1891 | case GL_SCISSOR_BOX: |
| 1892 | #endif // defined(GL_SCISSOR_BOX) |
| 1893 | #if defined(GL_VIEWPORT) |
| 1894 | case GL_VIEWPORT: |
| 1895 | #endif // defined(GL_VIEWPORT) |
| 1896 | _needed = 4; |
| 1897 | break; |
| 1898 | #if defined(GL_MODELVIEW_MATRIX) |
| 1899 | case GL_MODELVIEW_MATRIX: |
| 1900 | #endif // defined(GL_MODELVIEW_MATRIX) |
| 1901 | #if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1902 | case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1903 | #endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1904 | #if defined(GL_PROJECTION_MATRIX) |
| 1905 | case GL_PROJECTION_MATRIX: |
| 1906 | #endif // defined(GL_PROJECTION_MATRIX) |
| 1907 | #if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1908 | case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1909 | #endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1910 | #if defined(GL_TEXTURE_MATRIX) |
| 1911 | case GL_TEXTURE_MATRIX: |
| 1912 | #endif // defined(GL_TEXTURE_MATRIX) |
| 1913 | #if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1914 | case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES: |
| 1915 | #endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES) |
| 1916 | _needed = 16; |
| 1917 | break; |
| 1918 | #if defined(GL_COMPRESSED_TEXTURE_FORMATS) |
| 1919 | case GL_COMPRESSED_TEXTURE_FORMATS: |
| 1920 | #endif // defined(GL_COMPRESSED_TEXTURE_FORMATS) |
Jack Palevich | be509c9 | 2009-05-07 09:52:14 -0700 | [diff] [blame] | 1921 | _needed = getNumCompressedTextureFormats(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1922 | break; |
| 1923 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1924 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1925 | break; |
| 1926 | } |
| 1927 | if (_remaining < _needed) { |
| 1928 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1929 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1930 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1931 | goto exit; |
| 1932 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1933 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1934 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 1935 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 1936 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1937 | glGetIntegerv( |
| 1938 | (GLenum)pname, |
| 1939 | (GLint *)params |
| 1940 | ); |
| 1941 | |
| 1942 | exit: |
| 1943 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 1944 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1945 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1946 | if (_exception) { |
| 1947 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 1948 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1949 | } |
| 1950 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1951 | /* const GLubyte * glGetString ( GLenum name ) */ |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 1952 | static jstring android_glGetString(JNIEnv *_env, jobject, jint name) { |
| 1953 | const char* chars = (const char*) glGetString((GLenum) name); |
| 1954 | return _env->NewStringUTF(chars); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1955 | } |
| 1956 | /* void glHint ( GLenum target, GLenum mode ) */ |
| 1957 | static void |
| 1958 | android_glHint__II |
| 1959 | (JNIEnv *_env, jobject _this, jint target, jint mode) { |
| 1960 | glHint( |
| 1961 | (GLenum)target, |
| 1962 | (GLenum)mode |
| 1963 | ); |
| 1964 | } |
| 1965 | |
| 1966 | /* void glLightModelf ( GLenum pname, GLfloat param ) */ |
| 1967 | static void |
| 1968 | android_glLightModelf__IF |
| 1969 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 1970 | glLightModelf( |
| 1971 | (GLenum)pname, |
| 1972 | (GLfloat)param |
| 1973 | ); |
| 1974 | } |
| 1975 | |
| 1976 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 1977 | static void |
| 1978 | android_glLightModelfv__I_3FI |
| 1979 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1980 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 1981 | const char * _exceptionType = NULL; |
| 1982 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1983 | GLfloat *params_base = (GLfloat *) 0; |
| 1984 | jint _remaining; |
| 1985 | GLfloat *params = (GLfloat *) 0; |
| 1986 | |
| 1987 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1988 | _exception = 1; |
| 1989 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1990 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1991 | goto exit; |
| 1992 | } |
| 1993 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 1994 | _exception = 1; |
| 1995 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 1996 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1997 | goto exit; |
| 1998 | } |
| 1999 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2000 | int _needed; |
| 2001 | switch (pname) { |
| 2002 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2003 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2004 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2005 | _needed = 1; |
| 2006 | break; |
| 2007 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2008 | case GL_LIGHT_MODEL_AMBIENT: |
| 2009 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2010 | _needed = 4; |
| 2011 | break; |
| 2012 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2013 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2014 | break; |
| 2015 | } |
| 2016 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2017 | _exception = 1; |
| 2018 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2019 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2020 | goto exit; |
| 2021 | } |
| 2022 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2023 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2024 | params = params_base + offset; |
| 2025 | |
| 2026 | glLightModelfv( |
| 2027 | (GLenum)pname, |
| 2028 | (GLfloat *)params |
| 2029 | ); |
| 2030 | |
| 2031 | exit: |
| 2032 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2033 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2034 | JNI_ABORT); |
| 2035 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2036 | if (_exception) { |
| 2037 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2038 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2039 | } |
| 2040 | |
| 2041 | /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */ |
| 2042 | static void |
| 2043 | android_glLightModelfv__ILjava_nio_FloatBuffer_2 |
| 2044 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2045 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2046 | const char * _exceptionType = NULL; |
| 2047 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2048 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2049 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2050 | jint _remaining; |
| 2051 | GLfloat *params = (GLfloat *) 0; |
| 2052 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2053 | if (!params_buf) { |
| 2054 | _exception = 1; |
| 2055 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2056 | _exceptionMessage = "params == null"; |
| 2057 | goto exit; |
| 2058 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2059 | 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] | 2060 | int _needed; |
| 2061 | switch (pname) { |
| 2062 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2063 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2064 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2065 | _needed = 1; |
| 2066 | break; |
| 2067 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2068 | case GL_LIGHT_MODEL_AMBIENT: |
| 2069 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2070 | _needed = 4; |
| 2071 | break; |
| 2072 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2073 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2074 | break; |
| 2075 | } |
| 2076 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2077 | _exception = 1; |
| 2078 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2079 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2080 | goto exit; |
| 2081 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2082 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2083 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2084 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2085 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2086 | glLightModelfv( |
| 2087 | (GLenum)pname, |
| 2088 | (GLfloat *)params |
| 2089 | ); |
| 2090 | |
| 2091 | exit: |
| 2092 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2093 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2094 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2095 | if (_exception) { |
| 2096 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2097 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2098 | } |
| 2099 | |
| 2100 | /* void glLightModelx ( GLenum pname, GLfixed param ) */ |
| 2101 | static void |
| 2102 | android_glLightModelx__II |
| 2103 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 2104 | glLightModelx( |
| 2105 | (GLenum)pname, |
| 2106 | (GLfixed)param |
| 2107 | ); |
| 2108 | } |
| 2109 | |
| 2110 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2111 | static void |
| 2112 | android_glLightModelxv__I_3II |
| 2113 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2114 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2115 | const char * _exceptionType = NULL; |
| 2116 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2117 | GLfixed *params_base = (GLfixed *) 0; |
| 2118 | jint _remaining; |
| 2119 | GLfixed *params = (GLfixed *) 0; |
| 2120 | |
| 2121 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2122 | _exception = 1; |
| 2123 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2124 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2125 | goto exit; |
| 2126 | } |
| 2127 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2128 | _exception = 1; |
| 2129 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2130 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2131 | goto exit; |
| 2132 | } |
| 2133 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2134 | int _needed; |
| 2135 | switch (pname) { |
| 2136 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2137 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2138 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2139 | _needed = 1; |
| 2140 | break; |
| 2141 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2142 | case GL_LIGHT_MODEL_AMBIENT: |
| 2143 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2144 | _needed = 4; |
| 2145 | break; |
| 2146 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2147 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2148 | break; |
| 2149 | } |
| 2150 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2151 | _exception = 1; |
| 2152 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2153 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2154 | goto exit; |
| 2155 | } |
| 2156 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2157 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2158 | params = params_base + offset; |
| 2159 | |
| 2160 | glLightModelxv( |
| 2161 | (GLenum)pname, |
| 2162 | (GLfixed *)params |
| 2163 | ); |
| 2164 | |
| 2165 | exit: |
| 2166 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2167 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2168 | JNI_ABORT); |
| 2169 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2170 | if (_exception) { |
| 2171 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2172 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2173 | } |
| 2174 | |
| 2175 | /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */ |
| 2176 | static void |
| 2177 | android_glLightModelxv__ILjava_nio_IntBuffer_2 |
| 2178 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2179 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2180 | const char * _exceptionType = NULL; |
| 2181 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2182 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2183 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2184 | jint _remaining; |
| 2185 | GLfixed *params = (GLfixed *) 0; |
| 2186 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2187 | if (!params_buf) { |
| 2188 | _exception = 1; |
| 2189 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2190 | _exceptionMessage = "params == null"; |
| 2191 | goto exit; |
| 2192 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2193 | 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] | 2194 | int _needed; |
| 2195 | switch (pname) { |
| 2196 | #if defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2197 | case GL_LIGHT_MODEL_TWO_SIDE: |
| 2198 | #endif // defined(GL_LIGHT_MODEL_TWO_SIDE) |
| 2199 | _needed = 1; |
| 2200 | break; |
| 2201 | #if defined(GL_LIGHT_MODEL_AMBIENT) |
| 2202 | case GL_LIGHT_MODEL_AMBIENT: |
| 2203 | #endif // defined(GL_LIGHT_MODEL_AMBIENT) |
| 2204 | _needed = 4; |
| 2205 | break; |
| 2206 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2207 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2208 | break; |
| 2209 | } |
| 2210 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2211 | _exception = 1; |
| 2212 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2213 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2214 | goto exit; |
| 2215 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2216 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2217 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2218 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2219 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2220 | glLightModelxv( |
| 2221 | (GLenum)pname, |
| 2222 | (GLfixed *)params |
| 2223 | ); |
| 2224 | |
| 2225 | exit: |
| 2226 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2227 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2228 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2229 | if (_exception) { |
| 2230 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2231 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2232 | } |
| 2233 | |
| 2234 | /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */ |
| 2235 | static void |
| 2236 | android_glLightf__IIF |
| 2237 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) { |
| 2238 | glLightf( |
| 2239 | (GLenum)light, |
| 2240 | (GLenum)pname, |
| 2241 | (GLfloat)param |
| 2242 | ); |
| 2243 | } |
| 2244 | |
| 2245 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2246 | static void |
| 2247 | android_glLightfv__II_3FI |
| 2248 | (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] | 2249 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2250 | const char * _exceptionType = NULL; |
| 2251 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2252 | GLfloat *params_base = (GLfloat *) 0; |
| 2253 | jint _remaining; |
| 2254 | GLfloat *params = (GLfloat *) 0; |
| 2255 | |
| 2256 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2257 | _exception = 1; |
| 2258 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2259 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2260 | goto exit; |
| 2261 | } |
| 2262 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2263 | _exception = 1; |
| 2264 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2265 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2266 | goto exit; |
| 2267 | } |
| 2268 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2269 | int _needed; |
| 2270 | switch (pname) { |
| 2271 | #if defined(GL_SPOT_EXPONENT) |
| 2272 | case GL_SPOT_EXPONENT: |
| 2273 | #endif // defined(GL_SPOT_EXPONENT) |
| 2274 | #if defined(GL_SPOT_CUTOFF) |
| 2275 | case GL_SPOT_CUTOFF: |
| 2276 | #endif // defined(GL_SPOT_CUTOFF) |
| 2277 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2278 | case GL_CONSTANT_ATTENUATION: |
| 2279 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2280 | #if defined(GL_LINEAR_ATTENUATION) |
| 2281 | case GL_LINEAR_ATTENUATION: |
| 2282 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2283 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2284 | case GL_QUADRATIC_ATTENUATION: |
| 2285 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2286 | _needed = 1; |
| 2287 | break; |
| 2288 | #if defined(GL_SPOT_DIRECTION) |
| 2289 | case GL_SPOT_DIRECTION: |
| 2290 | #endif // defined(GL_SPOT_DIRECTION) |
| 2291 | _needed = 3; |
| 2292 | break; |
| 2293 | #if defined(GL_AMBIENT) |
| 2294 | case GL_AMBIENT: |
| 2295 | #endif // defined(GL_AMBIENT) |
| 2296 | #if defined(GL_DIFFUSE) |
| 2297 | case GL_DIFFUSE: |
| 2298 | #endif // defined(GL_DIFFUSE) |
| 2299 | #if defined(GL_SPECULAR) |
| 2300 | case GL_SPECULAR: |
| 2301 | #endif // defined(GL_SPECULAR) |
| 2302 | #if defined(GL_EMISSION) |
| 2303 | case GL_EMISSION: |
| 2304 | #endif // defined(GL_EMISSION) |
| 2305 | _needed = 4; |
| 2306 | break; |
| 2307 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2308 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2309 | break; |
| 2310 | } |
| 2311 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2312 | _exception = 1; |
| 2313 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2314 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2315 | goto exit; |
| 2316 | } |
| 2317 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2318 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2319 | params = params_base + offset; |
| 2320 | |
| 2321 | glLightfv( |
| 2322 | (GLenum)light, |
| 2323 | (GLenum)pname, |
| 2324 | (GLfloat *)params |
| 2325 | ); |
| 2326 | |
| 2327 | exit: |
| 2328 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2329 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2330 | JNI_ABORT); |
| 2331 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2332 | if (_exception) { |
| 2333 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2334 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2335 | } |
| 2336 | |
| 2337 | /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */ |
| 2338 | static void |
| 2339 | android_glLightfv__IILjava_nio_FloatBuffer_2 |
| 2340 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2341 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2342 | const char * _exceptionType = NULL; |
| 2343 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2344 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2345 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2346 | jint _remaining; |
| 2347 | GLfloat *params = (GLfloat *) 0; |
| 2348 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2349 | if (!params_buf) { |
| 2350 | _exception = 1; |
| 2351 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2352 | _exceptionMessage = "params == null"; |
| 2353 | goto exit; |
| 2354 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2355 | 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] | 2356 | int _needed; |
| 2357 | switch (pname) { |
| 2358 | #if defined(GL_SPOT_EXPONENT) |
| 2359 | case GL_SPOT_EXPONENT: |
| 2360 | #endif // defined(GL_SPOT_EXPONENT) |
| 2361 | #if defined(GL_SPOT_CUTOFF) |
| 2362 | case GL_SPOT_CUTOFF: |
| 2363 | #endif // defined(GL_SPOT_CUTOFF) |
| 2364 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2365 | case GL_CONSTANT_ATTENUATION: |
| 2366 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2367 | #if defined(GL_LINEAR_ATTENUATION) |
| 2368 | case GL_LINEAR_ATTENUATION: |
| 2369 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2370 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2371 | case GL_QUADRATIC_ATTENUATION: |
| 2372 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2373 | _needed = 1; |
| 2374 | break; |
| 2375 | #if defined(GL_SPOT_DIRECTION) |
| 2376 | case GL_SPOT_DIRECTION: |
| 2377 | #endif // defined(GL_SPOT_DIRECTION) |
| 2378 | _needed = 3; |
| 2379 | break; |
| 2380 | #if defined(GL_AMBIENT) |
| 2381 | case GL_AMBIENT: |
| 2382 | #endif // defined(GL_AMBIENT) |
| 2383 | #if defined(GL_DIFFUSE) |
| 2384 | case GL_DIFFUSE: |
| 2385 | #endif // defined(GL_DIFFUSE) |
| 2386 | #if defined(GL_SPECULAR) |
| 2387 | case GL_SPECULAR: |
| 2388 | #endif // defined(GL_SPECULAR) |
| 2389 | #if defined(GL_EMISSION) |
| 2390 | case GL_EMISSION: |
| 2391 | #endif // defined(GL_EMISSION) |
| 2392 | _needed = 4; |
| 2393 | break; |
| 2394 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2395 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2396 | break; |
| 2397 | } |
| 2398 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2399 | _exception = 1; |
| 2400 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2401 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2402 | goto exit; |
| 2403 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2404 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2405 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2406 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2407 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2408 | glLightfv( |
| 2409 | (GLenum)light, |
| 2410 | (GLenum)pname, |
| 2411 | (GLfloat *)params |
| 2412 | ); |
| 2413 | |
| 2414 | exit: |
| 2415 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2416 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2417 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2418 | if (_exception) { |
| 2419 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2420 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2421 | } |
| 2422 | |
| 2423 | /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */ |
| 2424 | static void |
| 2425 | android_glLightx__III |
| 2426 | (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) { |
| 2427 | glLightx( |
| 2428 | (GLenum)light, |
| 2429 | (GLenum)pname, |
| 2430 | (GLfixed)param |
| 2431 | ); |
| 2432 | } |
| 2433 | |
| 2434 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2435 | static void |
| 2436 | android_glLightxv__II_3II |
| 2437 | (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] | 2438 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2439 | const char * _exceptionType = NULL; |
| 2440 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2441 | GLfixed *params_base = (GLfixed *) 0; |
| 2442 | jint _remaining; |
| 2443 | GLfixed *params = (GLfixed *) 0; |
| 2444 | |
| 2445 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2446 | _exception = 1; |
| 2447 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2448 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2449 | goto exit; |
| 2450 | } |
| 2451 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2452 | _exception = 1; |
| 2453 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2454 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2455 | goto exit; |
| 2456 | } |
| 2457 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2458 | int _needed; |
| 2459 | switch (pname) { |
| 2460 | #if defined(GL_SPOT_EXPONENT) |
| 2461 | case GL_SPOT_EXPONENT: |
| 2462 | #endif // defined(GL_SPOT_EXPONENT) |
| 2463 | #if defined(GL_SPOT_CUTOFF) |
| 2464 | case GL_SPOT_CUTOFF: |
| 2465 | #endif // defined(GL_SPOT_CUTOFF) |
| 2466 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2467 | case GL_CONSTANT_ATTENUATION: |
| 2468 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2469 | #if defined(GL_LINEAR_ATTENUATION) |
| 2470 | case GL_LINEAR_ATTENUATION: |
| 2471 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2472 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2473 | case GL_QUADRATIC_ATTENUATION: |
| 2474 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2475 | _needed = 1; |
| 2476 | break; |
| 2477 | #if defined(GL_SPOT_DIRECTION) |
| 2478 | case GL_SPOT_DIRECTION: |
| 2479 | #endif // defined(GL_SPOT_DIRECTION) |
| 2480 | _needed = 3; |
| 2481 | break; |
| 2482 | #if defined(GL_AMBIENT) |
| 2483 | case GL_AMBIENT: |
| 2484 | #endif // defined(GL_AMBIENT) |
| 2485 | #if defined(GL_DIFFUSE) |
| 2486 | case GL_DIFFUSE: |
| 2487 | #endif // defined(GL_DIFFUSE) |
| 2488 | #if defined(GL_SPECULAR) |
| 2489 | case GL_SPECULAR: |
| 2490 | #endif // defined(GL_SPECULAR) |
| 2491 | #if defined(GL_EMISSION) |
| 2492 | case GL_EMISSION: |
| 2493 | #endif // defined(GL_EMISSION) |
| 2494 | _needed = 4; |
| 2495 | break; |
| 2496 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2497 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2498 | break; |
| 2499 | } |
| 2500 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2501 | _exception = 1; |
| 2502 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2503 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2504 | goto exit; |
| 2505 | } |
| 2506 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2507 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2508 | params = params_base + offset; |
| 2509 | |
| 2510 | glLightxv( |
| 2511 | (GLenum)light, |
| 2512 | (GLenum)pname, |
| 2513 | (GLfixed *)params |
| 2514 | ); |
| 2515 | |
| 2516 | exit: |
| 2517 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2518 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2519 | JNI_ABORT); |
| 2520 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2521 | if (_exception) { |
| 2522 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2523 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2524 | } |
| 2525 | |
| 2526 | /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */ |
| 2527 | static void |
| 2528 | android_glLightxv__IILjava_nio_IntBuffer_2 |
| 2529 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2530 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2531 | const char * _exceptionType = NULL; |
| 2532 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2533 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2534 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2535 | jint _remaining; |
| 2536 | GLfixed *params = (GLfixed *) 0; |
| 2537 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2538 | if (!params_buf) { |
| 2539 | _exception = 1; |
| 2540 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2541 | _exceptionMessage = "params == null"; |
| 2542 | goto exit; |
| 2543 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2544 | 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] | 2545 | int _needed; |
| 2546 | switch (pname) { |
| 2547 | #if defined(GL_SPOT_EXPONENT) |
| 2548 | case GL_SPOT_EXPONENT: |
| 2549 | #endif // defined(GL_SPOT_EXPONENT) |
| 2550 | #if defined(GL_SPOT_CUTOFF) |
| 2551 | case GL_SPOT_CUTOFF: |
| 2552 | #endif // defined(GL_SPOT_CUTOFF) |
| 2553 | #if defined(GL_CONSTANT_ATTENUATION) |
| 2554 | case GL_CONSTANT_ATTENUATION: |
| 2555 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 2556 | #if defined(GL_LINEAR_ATTENUATION) |
| 2557 | case GL_LINEAR_ATTENUATION: |
| 2558 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 2559 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 2560 | case GL_QUADRATIC_ATTENUATION: |
| 2561 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 2562 | _needed = 1; |
| 2563 | break; |
| 2564 | #if defined(GL_SPOT_DIRECTION) |
| 2565 | case GL_SPOT_DIRECTION: |
| 2566 | #endif // defined(GL_SPOT_DIRECTION) |
| 2567 | _needed = 3; |
| 2568 | break; |
| 2569 | #if defined(GL_AMBIENT) |
| 2570 | case GL_AMBIENT: |
| 2571 | #endif // defined(GL_AMBIENT) |
| 2572 | #if defined(GL_DIFFUSE) |
| 2573 | case GL_DIFFUSE: |
| 2574 | #endif // defined(GL_DIFFUSE) |
| 2575 | #if defined(GL_SPECULAR) |
| 2576 | case GL_SPECULAR: |
| 2577 | #endif // defined(GL_SPECULAR) |
| 2578 | #if defined(GL_EMISSION) |
| 2579 | case GL_EMISSION: |
| 2580 | #endif // defined(GL_EMISSION) |
| 2581 | _needed = 4; |
| 2582 | break; |
| 2583 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2584 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2585 | break; |
| 2586 | } |
| 2587 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2588 | _exception = 1; |
| 2589 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2590 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2591 | goto exit; |
| 2592 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2593 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2594 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2595 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 2596 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2597 | glLightxv( |
| 2598 | (GLenum)light, |
| 2599 | (GLenum)pname, |
| 2600 | (GLfixed *)params |
| 2601 | ); |
| 2602 | |
| 2603 | exit: |
| 2604 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2605 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2606 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2607 | if (_exception) { |
| 2608 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2609 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2610 | } |
| 2611 | |
| 2612 | /* void glLineWidth ( GLfloat width ) */ |
| 2613 | static void |
| 2614 | android_glLineWidth__F |
| 2615 | (JNIEnv *_env, jobject _this, jfloat width) { |
| 2616 | glLineWidth( |
| 2617 | (GLfloat)width |
| 2618 | ); |
| 2619 | } |
| 2620 | |
| 2621 | /* void glLineWidthx ( GLfixed width ) */ |
| 2622 | static void |
| 2623 | android_glLineWidthx__I |
| 2624 | (JNIEnv *_env, jobject _this, jint width) { |
| 2625 | glLineWidthx( |
| 2626 | (GLfixed)width |
| 2627 | ); |
| 2628 | } |
| 2629 | |
| 2630 | /* void glLoadIdentity ( void ) */ |
| 2631 | static void |
| 2632 | android_glLoadIdentity__ |
| 2633 | (JNIEnv *_env, jobject _this) { |
| 2634 | glLoadIdentity(); |
| 2635 | } |
| 2636 | |
| 2637 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2638 | static void |
| 2639 | android_glLoadMatrixf___3FI |
| 2640 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2641 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2642 | const char * _exceptionType = NULL; |
| 2643 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2644 | GLfloat *m_base = (GLfloat *) 0; |
| 2645 | jint _remaining; |
| 2646 | GLfloat *m = (GLfloat *) 0; |
| 2647 | |
| 2648 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2649 | _exception = 1; |
| 2650 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2651 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2652 | goto exit; |
| 2653 | } |
| 2654 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2655 | _exception = 1; |
| 2656 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2657 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2658 | goto exit; |
| 2659 | } |
| 2660 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2661 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2662 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2663 | m = m_base + offset; |
| 2664 | |
| 2665 | glLoadMatrixf( |
| 2666 | (GLfloat *)m |
| 2667 | ); |
| 2668 | |
| 2669 | exit: |
| 2670 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2671 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2672 | JNI_ABORT); |
| 2673 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2674 | if (_exception) { |
| 2675 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2676 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2677 | } |
| 2678 | |
| 2679 | /* void glLoadMatrixf ( const GLfloat *m ) */ |
| 2680 | static void |
| 2681 | android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 |
| 2682 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2683 | jint _exception = 0; |
| 2684 | const char * _exceptionType = NULL; |
| 2685 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2686 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2687 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2688 | jint _remaining; |
| 2689 | GLfloat *m = (GLfloat *) 0; |
| 2690 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2691 | if (!m_buf) { |
| 2692 | _exception = 1; |
| 2693 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2694 | _exceptionMessage = "m == null"; |
| 2695 | goto exit; |
| 2696 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2697 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2698 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2699 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2700 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 2701 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2702 | glLoadMatrixf( |
| 2703 | (GLfloat *)m |
| 2704 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2705 | |
| 2706 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2707 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2708 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2709 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2710 | if (_exception) { |
| 2711 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2712 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2713 | } |
| 2714 | |
| 2715 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2716 | static void |
| 2717 | android_glLoadMatrixx___3II |
| 2718 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2719 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2720 | const char * _exceptionType = NULL; |
| 2721 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2722 | GLfixed *m_base = (GLfixed *) 0; |
| 2723 | jint _remaining; |
| 2724 | GLfixed *m = (GLfixed *) 0; |
| 2725 | |
| 2726 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2727 | _exception = 1; |
| 2728 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2729 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2730 | goto exit; |
| 2731 | } |
| 2732 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2733 | _exception = 1; |
| 2734 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2735 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2736 | goto exit; |
| 2737 | } |
| 2738 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 2739 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2740 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2741 | m = m_base + offset; |
| 2742 | |
| 2743 | glLoadMatrixx( |
| 2744 | (GLfixed *)m |
| 2745 | ); |
| 2746 | |
| 2747 | exit: |
| 2748 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2749 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2750 | JNI_ABORT); |
| 2751 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2752 | if (_exception) { |
| 2753 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2754 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | /* void glLoadMatrixx ( const GLfixed *m ) */ |
| 2758 | static void |
| 2759 | android_glLoadMatrixx__Ljava_nio_IntBuffer_2 |
| 2760 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2761 | jint _exception = 0; |
| 2762 | const char * _exceptionType = NULL; |
| 2763 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2764 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2765 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2766 | jint _remaining; |
| 2767 | GLfixed *m = (GLfixed *) 0; |
| 2768 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2769 | if (!m_buf) { |
| 2770 | _exception = 1; |
| 2771 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2772 | _exceptionMessage = "m == null"; |
| 2773 | goto exit; |
| 2774 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2775 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2776 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2777 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2778 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 2779 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2780 | glLoadMatrixx( |
| 2781 | (GLfixed *)m |
| 2782 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2783 | |
| 2784 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2785 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2786 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2787 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2788 | if (_exception) { |
| 2789 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2790 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2791 | } |
| 2792 | |
| 2793 | /* void glLogicOp ( GLenum opcode ) */ |
| 2794 | static void |
| 2795 | android_glLogicOp__I |
| 2796 | (JNIEnv *_env, jobject _this, jint opcode) { |
| 2797 | glLogicOp( |
| 2798 | (GLenum)opcode |
| 2799 | ); |
| 2800 | } |
| 2801 | |
| 2802 | /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */ |
| 2803 | static void |
| 2804 | android_glMaterialf__IIF |
| 2805 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) { |
| 2806 | glMaterialf( |
| 2807 | (GLenum)face, |
| 2808 | (GLenum)pname, |
| 2809 | (GLfloat)param |
| 2810 | ); |
| 2811 | } |
| 2812 | |
| 2813 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2814 | static void |
| 2815 | android_glMaterialfv__II_3FI |
| 2816 | (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] | 2817 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2818 | const char * _exceptionType = NULL; |
| 2819 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2820 | GLfloat *params_base = (GLfloat *) 0; |
| 2821 | jint _remaining; |
| 2822 | GLfloat *params = (GLfloat *) 0; |
| 2823 | |
| 2824 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2825 | _exception = 1; |
| 2826 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2827 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2828 | goto exit; |
| 2829 | } |
| 2830 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2831 | _exception = 1; |
| 2832 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2833 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2834 | goto exit; |
| 2835 | } |
| 2836 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2837 | int _needed; |
| 2838 | switch (pname) { |
| 2839 | #if defined(GL_SHININESS) |
| 2840 | case GL_SHININESS: |
| 2841 | #endif // defined(GL_SHININESS) |
| 2842 | _needed = 1; |
| 2843 | break; |
| 2844 | #if defined(GL_AMBIENT) |
| 2845 | case GL_AMBIENT: |
| 2846 | #endif // defined(GL_AMBIENT) |
| 2847 | #if defined(GL_DIFFUSE) |
| 2848 | case GL_DIFFUSE: |
| 2849 | #endif // defined(GL_DIFFUSE) |
| 2850 | #if defined(GL_SPECULAR) |
| 2851 | case GL_SPECULAR: |
| 2852 | #endif // defined(GL_SPECULAR) |
| 2853 | #if defined(GL_EMISSION) |
| 2854 | case GL_EMISSION: |
| 2855 | #endif // defined(GL_EMISSION) |
| 2856 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2857 | case GL_AMBIENT_AND_DIFFUSE: |
| 2858 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2859 | _needed = 4; |
| 2860 | break; |
| 2861 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2862 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2863 | break; |
| 2864 | } |
| 2865 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2866 | _exception = 1; |
| 2867 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2868 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2869 | goto exit; |
| 2870 | } |
| 2871 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2872 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2873 | params = params_base + offset; |
| 2874 | |
| 2875 | glMaterialfv( |
| 2876 | (GLenum)face, |
| 2877 | (GLenum)pname, |
| 2878 | (GLfloat *)params |
| 2879 | ); |
| 2880 | |
| 2881 | exit: |
| 2882 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2883 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2884 | JNI_ABORT); |
| 2885 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2886 | if (_exception) { |
| 2887 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2888 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2889 | } |
| 2890 | |
| 2891 | /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */ |
| 2892 | static void |
| 2893 | android_glMaterialfv__IILjava_nio_FloatBuffer_2 |
| 2894 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2895 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2896 | const char * _exceptionType = NULL; |
| 2897 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2898 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2899 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2900 | jint _remaining; |
| 2901 | GLfloat *params = (GLfloat *) 0; |
| 2902 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 2903 | if (!params_buf) { |
| 2904 | _exception = 1; |
| 2905 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2906 | _exceptionMessage = "params == null"; |
| 2907 | goto exit; |
| 2908 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2909 | 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] | 2910 | int _needed; |
| 2911 | switch (pname) { |
| 2912 | #if defined(GL_SHININESS) |
| 2913 | case GL_SHININESS: |
| 2914 | #endif // defined(GL_SHININESS) |
| 2915 | _needed = 1; |
| 2916 | break; |
| 2917 | #if defined(GL_AMBIENT) |
| 2918 | case GL_AMBIENT: |
| 2919 | #endif // defined(GL_AMBIENT) |
| 2920 | #if defined(GL_DIFFUSE) |
| 2921 | case GL_DIFFUSE: |
| 2922 | #endif // defined(GL_DIFFUSE) |
| 2923 | #if defined(GL_SPECULAR) |
| 2924 | case GL_SPECULAR: |
| 2925 | #endif // defined(GL_SPECULAR) |
| 2926 | #if defined(GL_EMISSION) |
| 2927 | case GL_EMISSION: |
| 2928 | #endif // defined(GL_EMISSION) |
| 2929 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 2930 | case GL_AMBIENT_AND_DIFFUSE: |
| 2931 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 2932 | _needed = 4; |
| 2933 | break; |
| 2934 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2935 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2936 | break; |
| 2937 | } |
| 2938 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2939 | _exception = 1; |
| 2940 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2941 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2942 | goto exit; |
| 2943 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2944 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2945 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 2946 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 2947 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2948 | glMaterialfv( |
| 2949 | (GLenum)face, |
| 2950 | (GLenum)pname, |
| 2951 | (GLfloat *)params |
| 2952 | ); |
| 2953 | |
| 2954 | exit: |
| 2955 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 2956 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2957 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2958 | if (_exception) { |
| 2959 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 2960 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | } |
| 2962 | |
| 2963 | /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */ |
| 2964 | static void |
| 2965 | android_glMaterialx__III |
| 2966 | (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) { |
| 2967 | glMaterialx( |
| 2968 | (GLenum)face, |
| 2969 | (GLenum)pname, |
| 2970 | (GLfixed)param |
| 2971 | ); |
| 2972 | } |
| 2973 | |
| 2974 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 2975 | static void |
| 2976 | android_glMaterialxv__II_3II |
| 2977 | (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] | 2978 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 2979 | const char * _exceptionType = NULL; |
| 2980 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2981 | GLfixed *params_base = (GLfixed *) 0; |
| 2982 | jint _remaining; |
| 2983 | GLfixed *params = (GLfixed *) 0; |
| 2984 | |
| 2985 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2986 | _exception = 1; |
| 2987 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2988 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2989 | goto exit; |
| 2990 | } |
| 2991 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 2992 | _exception = 1; |
| 2993 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 2994 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2995 | goto exit; |
| 2996 | } |
| 2997 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 2998 | int _needed; |
| 2999 | switch (pname) { |
| 3000 | #if defined(GL_SHININESS) |
| 3001 | case GL_SHININESS: |
| 3002 | #endif // defined(GL_SHININESS) |
| 3003 | _needed = 1; |
| 3004 | break; |
| 3005 | #if defined(GL_AMBIENT) |
| 3006 | case GL_AMBIENT: |
| 3007 | #endif // defined(GL_AMBIENT) |
| 3008 | #if defined(GL_DIFFUSE) |
| 3009 | case GL_DIFFUSE: |
| 3010 | #endif // defined(GL_DIFFUSE) |
| 3011 | #if defined(GL_SPECULAR) |
| 3012 | case GL_SPECULAR: |
| 3013 | #endif // defined(GL_SPECULAR) |
| 3014 | #if defined(GL_EMISSION) |
| 3015 | case GL_EMISSION: |
| 3016 | #endif // defined(GL_EMISSION) |
| 3017 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3018 | case GL_AMBIENT_AND_DIFFUSE: |
| 3019 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3020 | _needed = 4; |
| 3021 | break; |
| 3022 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3023 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3024 | break; |
| 3025 | } |
| 3026 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3027 | _exception = 1; |
| 3028 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3029 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3030 | goto exit; |
| 3031 | } |
| 3032 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3033 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3034 | params = params_base + offset; |
| 3035 | |
| 3036 | glMaterialxv( |
| 3037 | (GLenum)face, |
| 3038 | (GLenum)pname, |
| 3039 | (GLfixed *)params |
| 3040 | ); |
| 3041 | |
| 3042 | exit: |
| 3043 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3044 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3045 | JNI_ABORT); |
| 3046 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3047 | if (_exception) { |
| 3048 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3049 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3050 | } |
| 3051 | |
| 3052 | /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */ |
| 3053 | static void |
| 3054 | android_glMaterialxv__IILjava_nio_IntBuffer_2 |
| 3055 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3056 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3057 | const char * _exceptionType = NULL; |
| 3058 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3059 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3060 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3061 | jint _remaining; |
| 3062 | GLfixed *params = (GLfixed *) 0; |
| 3063 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3064 | if (!params_buf) { |
| 3065 | _exception = 1; |
| 3066 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3067 | _exceptionMessage = "params == null"; |
| 3068 | goto exit; |
| 3069 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3070 | 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] | 3071 | int _needed; |
| 3072 | switch (pname) { |
| 3073 | #if defined(GL_SHININESS) |
| 3074 | case GL_SHININESS: |
| 3075 | #endif // defined(GL_SHININESS) |
| 3076 | _needed = 1; |
| 3077 | break; |
| 3078 | #if defined(GL_AMBIENT) |
| 3079 | case GL_AMBIENT: |
| 3080 | #endif // defined(GL_AMBIENT) |
| 3081 | #if defined(GL_DIFFUSE) |
| 3082 | case GL_DIFFUSE: |
| 3083 | #endif // defined(GL_DIFFUSE) |
| 3084 | #if defined(GL_SPECULAR) |
| 3085 | case GL_SPECULAR: |
| 3086 | #endif // defined(GL_SPECULAR) |
| 3087 | #if defined(GL_EMISSION) |
| 3088 | case GL_EMISSION: |
| 3089 | #endif // defined(GL_EMISSION) |
| 3090 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 3091 | case GL_AMBIENT_AND_DIFFUSE: |
| 3092 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 3093 | _needed = 4; |
| 3094 | break; |
| 3095 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3096 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3097 | break; |
| 3098 | } |
| 3099 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3100 | _exception = 1; |
| 3101 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3102 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3103 | goto exit; |
| 3104 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3105 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3106 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3107 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3108 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3109 | glMaterialxv( |
| 3110 | (GLenum)face, |
| 3111 | (GLenum)pname, |
| 3112 | (GLfixed *)params |
| 3113 | ); |
| 3114 | |
| 3115 | exit: |
| 3116 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3117 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3118 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3119 | if (_exception) { |
| 3120 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3121 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3122 | } |
| 3123 | |
| 3124 | /* void glMatrixMode ( GLenum mode ) */ |
| 3125 | static void |
| 3126 | android_glMatrixMode__I |
| 3127 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3128 | glMatrixMode( |
| 3129 | (GLenum)mode |
| 3130 | ); |
| 3131 | } |
| 3132 | |
| 3133 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3134 | static void |
| 3135 | android_glMultMatrixf___3FI |
| 3136 | (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3137 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3138 | const char * _exceptionType = NULL; |
| 3139 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3140 | GLfloat *m_base = (GLfloat *) 0; |
| 3141 | jint _remaining; |
| 3142 | GLfloat *m = (GLfloat *) 0; |
| 3143 | |
| 3144 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3145 | _exception = 1; |
| 3146 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3147 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3148 | goto exit; |
| 3149 | } |
| 3150 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3151 | _exception = 1; |
| 3152 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3153 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3154 | goto exit; |
| 3155 | } |
| 3156 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3157 | m_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3158 | _env->GetFloatArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3159 | m = m_base + offset; |
| 3160 | |
| 3161 | glMultMatrixf( |
| 3162 | (GLfloat *)m |
| 3163 | ); |
| 3164 | |
| 3165 | exit: |
| 3166 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3167 | _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3168 | JNI_ABORT); |
| 3169 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3170 | if (_exception) { |
| 3171 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3172 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3173 | } |
| 3174 | |
| 3175 | /* void glMultMatrixf ( const GLfloat *m ) */ |
| 3176 | static void |
| 3177 | android_glMultMatrixf__Ljava_nio_FloatBuffer_2 |
| 3178 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3179 | jint _exception = 0; |
| 3180 | const char * _exceptionType = NULL; |
| 3181 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3182 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3183 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3184 | jint _remaining; |
| 3185 | GLfloat *m = (GLfloat *) 0; |
| 3186 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3187 | if (!m_buf) { |
| 3188 | _exception = 1; |
| 3189 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3190 | _exceptionMessage = "m == null"; |
| 3191 | goto exit; |
| 3192 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3193 | m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3194 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3195 | char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3196 | m = (GLfloat *) (_mBase + _bufferOffset); |
| 3197 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3198 | glMultMatrixf( |
| 3199 | (GLfloat *)m |
| 3200 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3201 | |
| 3202 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3203 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3204 | _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3205 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3206 | if (_exception) { |
| 3207 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3208 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | } |
| 3210 | |
| 3211 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3212 | static void |
| 3213 | android_glMultMatrixx___3II |
| 3214 | (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3215 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3216 | const char * _exceptionType = NULL; |
| 3217 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3218 | GLfixed *m_base = (GLfixed *) 0; |
| 3219 | jint _remaining; |
| 3220 | GLfixed *m = (GLfixed *) 0; |
| 3221 | |
| 3222 | if (!m_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3223 | _exception = 1; |
| 3224 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3225 | _exceptionMessage = "m == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3226 | goto exit; |
| 3227 | } |
| 3228 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3229 | _exception = 1; |
| 3230 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3231 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3232 | goto exit; |
| 3233 | } |
| 3234 | _remaining = _env->GetArrayLength(m_ref) - offset; |
| 3235 | m_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3236 | _env->GetIntArrayElements(m_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3237 | m = m_base + offset; |
| 3238 | |
| 3239 | glMultMatrixx( |
| 3240 | (GLfixed *)m |
| 3241 | ); |
| 3242 | |
| 3243 | exit: |
| 3244 | if (m_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3245 | _env->ReleaseIntArrayElements(m_ref, (jint*)m_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3246 | JNI_ABORT); |
| 3247 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3248 | if (_exception) { |
| 3249 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3250 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3251 | } |
| 3252 | |
| 3253 | /* void glMultMatrixx ( const GLfixed *m ) */ |
| 3254 | static void |
| 3255 | android_glMultMatrixx__Ljava_nio_IntBuffer_2 |
| 3256 | (JNIEnv *_env, jobject _this, jobject m_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3257 | jint _exception = 0; |
| 3258 | const char * _exceptionType = NULL; |
| 3259 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3260 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3261 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3262 | jint _remaining; |
| 3263 | GLfixed *m = (GLfixed *) 0; |
| 3264 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3265 | if (!m_buf) { |
| 3266 | _exception = 1; |
| 3267 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3268 | _exceptionMessage = "m == null"; |
| 3269 | goto exit; |
| 3270 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3271 | m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3272 | if (m == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3273 | char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3274 | m = (GLfixed *) (_mBase + _bufferOffset); |
| 3275 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3276 | glMultMatrixx( |
| 3277 | (GLfixed *)m |
| 3278 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3279 | |
| 3280 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3281 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3282 | _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3283 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3284 | if (_exception) { |
| 3285 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3286 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3287 | } |
| 3288 | |
| 3289 | /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */ |
| 3290 | static void |
| 3291 | android_glMultiTexCoord4f__IFFFF |
| 3292 | (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) { |
| 3293 | glMultiTexCoord4f( |
| 3294 | (GLenum)target, |
| 3295 | (GLfloat)s, |
| 3296 | (GLfloat)t, |
| 3297 | (GLfloat)r, |
| 3298 | (GLfloat)q |
| 3299 | ); |
| 3300 | } |
| 3301 | |
| 3302 | /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */ |
| 3303 | static void |
| 3304 | android_glMultiTexCoord4x__IIIII |
| 3305 | (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) { |
| 3306 | glMultiTexCoord4x( |
| 3307 | (GLenum)target, |
| 3308 | (GLfixed)s, |
| 3309 | (GLfixed)t, |
| 3310 | (GLfixed)r, |
| 3311 | (GLfixed)q |
| 3312 | ); |
| 3313 | } |
| 3314 | |
| 3315 | /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */ |
| 3316 | static void |
| 3317 | android_glNormal3f__FFF |
| 3318 | (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) { |
| 3319 | glNormal3f( |
| 3320 | (GLfloat)nx, |
| 3321 | (GLfloat)ny, |
| 3322 | (GLfloat)nz |
| 3323 | ); |
| 3324 | } |
| 3325 | |
| 3326 | /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */ |
| 3327 | static void |
| 3328 | android_glNormal3x__III |
| 3329 | (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) { |
| 3330 | glNormal3x( |
| 3331 | (GLfixed)nx, |
| 3332 | (GLfixed)ny, |
| 3333 | (GLfixed)nz |
| 3334 | ); |
| 3335 | } |
| 3336 | |
| 3337 | /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3338 | static void |
| 3339 | android_glNormalPointerBounds__IILjava_nio_Buffer_2I |
| 3340 | (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] | 3341 | jint _exception = 0; |
| 3342 | const char * _exceptionType = NULL; |
| 3343 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3344 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3345 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3346 | jint _remaining; |
| 3347 | GLvoid *pointer = (GLvoid *) 0; |
| 3348 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3349 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3350 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3351 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3352 | return; |
| 3353 | } |
| 3354 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3355 | glNormalPointerBounds( |
| 3356 | (GLenum)type, |
| 3357 | (GLsizei)stride, |
| 3358 | (GLvoid *)pointer, |
| 3359 | (GLsizei)remaining |
| 3360 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3361 | if (_exception) { |
| 3362 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3363 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3364 | } |
| 3365 | |
| 3366 | /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */ |
| 3367 | static void |
| 3368 | android_glOrthof__FFFFFF |
| 3369 | (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) { |
| 3370 | glOrthof( |
| 3371 | (GLfloat)left, |
| 3372 | (GLfloat)right, |
| 3373 | (GLfloat)bottom, |
| 3374 | (GLfloat)top, |
| 3375 | (GLfloat)zNear, |
| 3376 | (GLfloat)zFar |
| 3377 | ); |
| 3378 | } |
| 3379 | |
| 3380 | /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */ |
| 3381 | static void |
| 3382 | android_glOrthox__IIIIII |
| 3383 | (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) { |
| 3384 | glOrthox( |
| 3385 | (GLfixed)left, |
| 3386 | (GLfixed)right, |
| 3387 | (GLfixed)bottom, |
| 3388 | (GLfixed)top, |
| 3389 | (GLfixed)zNear, |
| 3390 | (GLfixed)zFar |
| 3391 | ); |
| 3392 | } |
| 3393 | |
| 3394 | /* void glPixelStorei ( GLenum pname, GLint param ) */ |
| 3395 | static void |
| 3396 | android_glPixelStorei__II |
| 3397 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 3398 | glPixelStorei( |
| 3399 | (GLenum)pname, |
| 3400 | (GLint)param |
| 3401 | ); |
| 3402 | } |
| 3403 | |
| 3404 | /* void glPointSize ( GLfloat size ) */ |
| 3405 | static void |
| 3406 | android_glPointSize__F |
| 3407 | (JNIEnv *_env, jobject _this, jfloat size) { |
| 3408 | glPointSize( |
| 3409 | (GLfloat)size |
| 3410 | ); |
| 3411 | } |
| 3412 | |
| 3413 | /* void glPointSizex ( GLfixed size ) */ |
| 3414 | static void |
| 3415 | android_glPointSizex__I |
| 3416 | (JNIEnv *_env, jobject _this, jint size) { |
| 3417 | glPointSizex( |
| 3418 | (GLfixed)size |
| 3419 | ); |
| 3420 | } |
| 3421 | |
| 3422 | /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ |
| 3423 | static void |
| 3424 | android_glPolygonOffset__FF |
| 3425 | (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { |
| 3426 | glPolygonOffset( |
| 3427 | (GLfloat)factor, |
| 3428 | (GLfloat)units |
| 3429 | ); |
| 3430 | } |
| 3431 | |
| 3432 | /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */ |
| 3433 | static void |
| 3434 | android_glPolygonOffsetx__II |
| 3435 | (JNIEnv *_env, jobject _this, jint factor, jint units) { |
| 3436 | glPolygonOffsetx( |
| 3437 | (GLfixed)factor, |
| 3438 | (GLfixed)units |
| 3439 | ); |
| 3440 | } |
| 3441 | |
| 3442 | /* void glPopMatrix ( void ) */ |
| 3443 | static void |
| 3444 | android_glPopMatrix__ |
| 3445 | (JNIEnv *_env, jobject _this) { |
| 3446 | glPopMatrix(); |
| 3447 | } |
| 3448 | |
| 3449 | /* void glPushMatrix ( void ) */ |
| 3450 | static void |
| 3451 | android_glPushMatrix__ |
| 3452 | (JNIEnv *_env, jobject _this) { |
| 3453 | glPushMatrix(); |
| 3454 | } |
| 3455 | |
| 3456 | /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ |
| 3457 | static void |
| 3458 | android_glReadPixels__IIIIIILjava_nio_Buffer_2 |
| 3459 | (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] | 3460 | jint _exception = 0; |
| 3461 | const char * _exceptionType = NULL; |
| 3462 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3463 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3464 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3465 | jint _remaining; |
| 3466 | GLvoid *pixels = (GLvoid *) 0; |
| 3467 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3468 | if (!pixels_buf) { |
| 3469 | _exception = 1; |
| 3470 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3471 | _exceptionMessage = "pixels == null"; |
| 3472 | goto exit; |
| 3473 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3474 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3475 | if (pixels == NULL) { |
| 3476 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3477 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
| 3478 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3479 | glReadPixels( |
| 3480 | (GLint)x, |
| 3481 | (GLint)y, |
| 3482 | (GLsizei)width, |
| 3483 | (GLsizei)height, |
| 3484 | (GLenum)format, |
| 3485 | (GLenum)type, |
| 3486 | (GLvoid *)pixels |
| 3487 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3488 | |
| 3489 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3490 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3491 | releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE); |
| 3492 | } |
| 3493 | if (_exception) { |
| 3494 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3495 | } |
| 3496 | } |
| 3497 | |
| 3498 | /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */ |
| 3499 | static void |
| 3500 | android_glRotatef__FFFF |
| 3501 | (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) { |
| 3502 | glRotatef( |
| 3503 | (GLfloat)angle, |
| 3504 | (GLfloat)x, |
| 3505 | (GLfloat)y, |
| 3506 | (GLfloat)z |
| 3507 | ); |
| 3508 | } |
| 3509 | |
| 3510 | /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */ |
| 3511 | static void |
| 3512 | android_glRotatex__IIII |
| 3513 | (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) { |
| 3514 | glRotatex( |
| 3515 | (GLfixed)angle, |
| 3516 | (GLfixed)x, |
| 3517 | (GLfixed)y, |
| 3518 | (GLfixed)z |
| 3519 | ); |
| 3520 | } |
| 3521 | |
| 3522 | /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ |
| 3523 | static void |
| 3524 | android_glSampleCoverage__FZ |
| 3525 | (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { |
| 3526 | glSampleCoverage( |
| 3527 | (GLclampf)value, |
| 3528 | (GLboolean)invert |
| 3529 | ); |
| 3530 | } |
| 3531 | |
| 3532 | /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */ |
| 3533 | static void |
| 3534 | android_glSampleCoveragex__IZ |
| 3535 | (JNIEnv *_env, jobject _this, jint value, jboolean invert) { |
| 3536 | glSampleCoveragex( |
| 3537 | (GLclampx)value, |
| 3538 | (GLboolean)invert |
| 3539 | ); |
| 3540 | } |
| 3541 | |
| 3542 | /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 3543 | static void |
| 3544 | android_glScalef__FFF |
| 3545 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 3546 | glScalef( |
| 3547 | (GLfloat)x, |
| 3548 | (GLfloat)y, |
| 3549 | (GLfloat)z |
| 3550 | ); |
| 3551 | } |
| 3552 | |
| 3553 | /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 3554 | static void |
| 3555 | android_glScalex__III |
| 3556 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 3557 | glScalex( |
| 3558 | (GLfixed)x, |
| 3559 | (GLfixed)y, |
| 3560 | (GLfixed)z |
| 3561 | ); |
| 3562 | } |
| 3563 | |
| 3564 | /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 3565 | static void |
| 3566 | android_glScissor__IIII |
| 3567 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 3568 | glScissor( |
| 3569 | (GLint)x, |
| 3570 | (GLint)y, |
| 3571 | (GLsizei)width, |
| 3572 | (GLsizei)height |
| 3573 | ); |
| 3574 | } |
| 3575 | |
| 3576 | /* void glShadeModel ( GLenum mode ) */ |
| 3577 | static void |
| 3578 | android_glShadeModel__I |
| 3579 | (JNIEnv *_env, jobject _this, jint mode) { |
| 3580 | glShadeModel( |
| 3581 | (GLenum)mode |
| 3582 | ); |
| 3583 | } |
| 3584 | |
| 3585 | /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ |
| 3586 | static void |
| 3587 | android_glStencilFunc__III |
| 3588 | (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { |
| 3589 | glStencilFunc( |
| 3590 | (GLenum)func, |
| 3591 | (GLint)ref, |
| 3592 | (GLuint)mask |
| 3593 | ); |
| 3594 | } |
| 3595 | |
| 3596 | /* void glStencilMask ( GLuint mask ) */ |
| 3597 | static void |
| 3598 | android_glStencilMask__I |
| 3599 | (JNIEnv *_env, jobject _this, jint mask) { |
| 3600 | glStencilMask( |
| 3601 | (GLuint)mask |
| 3602 | ); |
| 3603 | } |
| 3604 | |
| 3605 | /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ |
| 3606 | static void |
| 3607 | android_glStencilOp__III |
| 3608 | (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { |
| 3609 | glStencilOp( |
| 3610 | (GLenum)fail, |
| 3611 | (GLenum)zfail, |
| 3612 | (GLenum)zpass |
| 3613 | ); |
| 3614 | } |
| 3615 | |
| 3616 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 3617 | static void |
| 3618 | android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I |
| 3619 | (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] | 3620 | jint _exception = 0; |
| 3621 | const char * _exceptionType = NULL; |
| 3622 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3623 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3624 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3625 | jint _remaining; |
| 3626 | GLvoid *pointer = (GLvoid *) 0; |
| 3627 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3628 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 3629 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3630 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 3631 | return; |
| 3632 | } |
| 3633 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3634 | glTexCoordPointerBounds( |
| 3635 | (GLint)size, |
| 3636 | (GLenum)type, |
| 3637 | (GLsizei)stride, |
| 3638 | (GLvoid *)pointer, |
| 3639 | (GLsizei)remaining |
| 3640 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3641 | if (_exception) { |
| 3642 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3643 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3644 | } |
| 3645 | |
| 3646 | /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3647 | static void |
| 3648 | android_glTexEnvf__IIF |
| 3649 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3650 | glTexEnvf( |
| 3651 | (GLenum)target, |
| 3652 | (GLenum)pname, |
| 3653 | (GLfloat)param |
| 3654 | ); |
| 3655 | } |
| 3656 | |
| 3657 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3658 | static void |
| 3659 | android_glTexEnvfv__II_3FI |
| 3660 | (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] | 3661 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3662 | const char * _exceptionType = NULL; |
| 3663 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3664 | GLfloat *params_base = (GLfloat *) 0; |
| 3665 | jint _remaining; |
| 3666 | GLfloat *params = (GLfloat *) 0; |
| 3667 | |
| 3668 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3669 | _exception = 1; |
| 3670 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3671 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3672 | goto exit; |
| 3673 | } |
| 3674 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3675 | _exception = 1; |
| 3676 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3677 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3678 | goto exit; |
| 3679 | } |
| 3680 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3681 | int _needed; |
| 3682 | switch (pname) { |
| 3683 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3684 | case GL_TEXTURE_ENV_MODE: |
| 3685 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3686 | #if defined(GL_COMBINE_RGB) |
| 3687 | case GL_COMBINE_RGB: |
| 3688 | #endif // defined(GL_COMBINE_RGB) |
| 3689 | #if defined(GL_COMBINE_ALPHA) |
| 3690 | case GL_COMBINE_ALPHA: |
| 3691 | #endif // defined(GL_COMBINE_ALPHA) |
| 3692 | _needed = 1; |
| 3693 | break; |
| 3694 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3695 | case GL_TEXTURE_ENV_COLOR: |
| 3696 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3697 | _needed = 4; |
| 3698 | break; |
| 3699 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3700 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3701 | break; |
| 3702 | } |
| 3703 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3704 | _exception = 1; |
| 3705 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3706 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3707 | goto exit; |
| 3708 | } |
| 3709 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3710 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3711 | params = params_base + offset; |
| 3712 | |
| 3713 | glTexEnvfv( |
| 3714 | (GLenum)target, |
| 3715 | (GLenum)pname, |
| 3716 | (GLfloat *)params |
| 3717 | ); |
| 3718 | |
| 3719 | exit: |
| 3720 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3721 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3722 | JNI_ABORT); |
| 3723 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3724 | if (_exception) { |
| 3725 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3726 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3727 | } |
| 3728 | |
| 3729 | /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 3730 | static void |
| 3731 | android_glTexEnvfv__IILjava_nio_FloatBuffer_2 |
| 3732 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3733 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3734 | const char * _exceptionType = NULL; |
| 3735 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3736 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3737 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3738 | jint _remaining; |
| 3739 | GLfloat *params = (GLfloat *) 0; |
| 3740 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3741 | if (!params_buf) { |
| 3742 | _exception = 1; |
| 3743 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3744 | _exceptionMessage = "params == null"; |
| 3745 | goto exit; |
| 3746 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3747 | 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] | 3748 | int _needed; |
| 3749 | switch (pname) { |
| 3750 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3751 | case GL_TEXTURE_ENV_MODE: |
| 3752 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3753 | #if defined(GL_COMBINE_RGB) |
| 3754 | case GL_COMBINE_RGB: |
| 3755 | #endif // defined(GL_COMBINE_RGB) |
| 3756 | #if defined(GL_COMBINE_ALPHA) |
| 3757 | case GL_COMBINE_ALPHA: |
| 3758 | #endif // defined(GL_COMBINE_ALPHA) |
| 3759 | _needed = 1; |
| 3760 | break; |
| 3761 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3762 | case GL_TEXTURE_ENV_COLOR: |
| 3763 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3764 | _needed = 4; |
| 3765 | break; |
| 3766 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3767 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3768 | break; |
| 3769 | } |
| 3770 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3771 | _exception = 1; |
| 3772 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3773 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3774 | goto exit; |
| 3775 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3776 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3777 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3778 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 3779 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3780 | glTexEnvfv( |
| 3781 | (GLenum)target, |
| 3782 | (GLenum)pname, |
| 3783 | (GLfloat *)params |
| 3784 | ); |
| 3785 | |
| 3786 | exit: |
| 3787 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3788 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3789 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3790 | if (_exception) { |
| 3791 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3792 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3793 | } |
| 3794 | |
| 3795 | /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3796 | static void |
| 3797 | android_glTexEnvx__III |
| 3798 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3799 | glTexEnvx( |
| 3800 | (GLenum)target, |
| 3801 | (GLenum)pname, |
| 3802 | (GLfixed)param |
| 3803 | ); |
| 3804 | } |
| 3805 | |
| 3806 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3807 | static void |
| 3808 | android_glTexEnvxv__II_3II |
| 3809 | (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] | 3810 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3811 | const char * _exceptionType = NULL; |
| 3812 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3813 | GLfixed *params_base = (GLfixed *) 0; |
| 3814 | jint _remaining; |
| 3815 | GLfixed *params = (GLfixed *) 0; |
| 3816 | |
| 3817 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3818 | _exception = 1; |
| 3819 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3820 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3821 | goto exit; |
| 3822 | } |
| 3823 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3824 | _exception = 1; |
| 3825 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3826 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3827 | goto exit; |
| 3828 | } |
| 3829 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 3830 | int _needed; |
| 3831 | switch (pname) { |
| 3832 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3833 | case GL_TEXTURE_ENV_MODE: |
| 3834 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3835 | #if defined(GL_COMBINE_RGB) |
| 3836 | case GL_COMBINE_RGB: |
| 3837 | #endif // defined(GL_COMBINE_RGB) |
| 3838 | #if defined(GL_COMBINE_ALPHA) |
| 3839 | case GL_COMBINE_ALPHA: |
| 3840 | #endif // defined(GL_COMBINE_ALPHA) |
| 3841 | _needed = 1; |
| 3842 | break; |
| 3843 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3844 | case GL_TEXTURE_ENV_COLOR: |
| 3845 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3846 | _needed = 4; |
| 3847 | break; |
| 3848 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3849 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3850 | break; |
| 3851 | } |
| 3852 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3853 | _exception = 1; |
| 3854 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3855 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3856 | goto exit; |
| 3857 | } |
| 3858 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3859 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3860 | params = params_base + offset; |
| 3861 | |
| 3862 | glTexEnvxv( |
| 3863 | (GLenum)target, |
| 3864 | (GLenum)pname, |
| 3865 | (GLfixed *)params |
| 3866 | ); |
| 3867 | |
| 3868 | exit: |
| 3869 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3870 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3871 | JNI_ABORT); |
| 3872 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3873 | if (_exception) { |
| 3874 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3875 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3876 | } |
| 3877 | |
| 3878 | /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 3879 | static void |
| 3880 | android_glTexEnvxv__IILjava_nio_IntBuffer_2 |
| 3881 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3882 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3883 | const char * _exceptionType = NULL; |
| 3884 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3885 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3886 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3887 | jint _remaining; |
| 3888 | GLfixed *params = (GLfixed *) 0; |
| 3889 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3890 | if (!params_buf) { |
| 3891 | _exception = 1; |
| 3892 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3893 | _exceptionMessage = "params == null"; |
| 3894 | goto exit; |
| 3895 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3896 | 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] | 3897 | int _needed; |
| 3898 | switch (pname) { |
| 3899 | #if defined(GL_TEXTURE_ENV_MODE) |
| 3900 | case GL_TEXTURE_ENV_MODE: |
| 3901 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 3902 | #if defined(GL_COMBINE_RGB) |
| 3903 | case GL_COMBINE_RGB: |
| 3904 | #endif // defined(GL_COMBINE_RGB) |
| 3905 | #if defined(GL_COMBINE_ALPHA) |
| 3906 | case GL_COMBINE_ALPHA: |
| 3907 | #endif // defined(GL_COMBINE_ALPHA) |
| 3908 | _needed = 1; |
| 3909 | break; |
| 3910 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 3911 | case GL_TEXTURE_ENV_COLOR: |
| 3912 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 3913 | _needed = 4; |
| 3914 | break; |
| 3915 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 3916 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3917 | break; |
| 3918 | } |
| 3919 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3920 | _exception = 1; |
| 3921 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 3922 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3923 | goto exit; |
| 3924 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3925 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3926 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3927 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 3928 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3929 | glTexEnvxv( |
| 3930 | (GLenum)target, |
| 3931 | (GLenum)pname, |
| 3932 | (GLfixed *)params |
| 3933 | ); |
| 3934 | |
| 3935 | exit: |
| 3936 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3937 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3938 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 3939 | if (_exception) { |
| 3940 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3941 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3942 | } |
| 3943 | |
| 3944 | /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 3945 | static void |
| 3946 | android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 3947 | (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] | 3948 | jint _exception = 0; |
| 3949 | const char * _exceptionType = NULL; |
| 3950 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3951 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3952 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3953 | jint _remaining; |
| 3954 | GLvoid *pixels = (GLvoid *) 0; |
| 3955 | |
| 3956 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 3957 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3958 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 3959 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 3960 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 3961 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3962 | } |
| 3963 | glTexImage2D( |
| 3964 | (GLenum)target, |
| 3965 | (GLint)level, |
| 3966 | (GLint)internalformat, |
| 3967 | (GLsizei)width, |
| 3968 | (GLsizei)height, |
| 3969 | (GLint)border, |
| 3970 | (GLenum)format, |
| 3971 | (GLenum)type, |
| 3972 | (GLvoid *)pixels |
| 3973 | ); |
| 3974 | if (_array) { |
| 3975 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 3976 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 3977 | if (_exception) { |
| 3978 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 3979 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3980 | } |
| 3981 | |
| 3982 | /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ |
| 3983 | static void |
| 3984 | android_glTexParameterf__IIF |
| 3985 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { |
| 3986 | glTexParameterf( |
| 3987 | (GLenum)target, |
| 3988 | (GLenum)pname, |
| 3989 | (GLfloat)param |
| 3990 | ); |
| 3991 | } |
| 3992 | |
| 3993 | /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */ |
| 3994 | static void |
| 3995 | android_glTexParameterx__III |
| 3996 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 3997 | glTexParameterx( |
| 3998 | (GLenum)target, |
| 3999 | (GLenum)pname, |
| 4000 | (GLfixed)param |
| 4001 | ); |
| 4002 | } |
| 4003 | |
| 4004 | /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ |
| 4005 | static void |
| 4006 | android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 |
| 4007 | (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] | 4008 | jint _exception = 0; |
| 4009 | const char * _exceptionType = NULL; |
| 4010 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4011 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4012 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4013 | jint _remaining; |
| 4014 | GLvoid *pixels = (GLvoid *) 0; |
| 4015 | |
| 4016 | if (pixels_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4017 | pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4018 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4019 | if (pixels_buf && pixels == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4020 | char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4021 | pixels = (GLvoid *) (_pixelsBase + _bufferOffset); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4022 | } |
| 4023 | glTexSubImage2D( |
| 4024 | (GLenum)target, |
| 4025 | (GLint)level, |
| 4026 | (GLint)xoffset, |
| 4027 | (GLint)yoffset, |
| 4028 | (GLsizei)width, |
| 4029 | (GLsizei)height, |
| 4030 | (GLenum)format, |
| 4031 | (GLenum)type, |
| 4032 | (GLvoid *)pixels |
| 4033 | ); |
| 4034 | if (_array) { |
| 4035 | releasePointer(_env, _array, pixels, JNI_FALSE); |
| 4036 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4037 | if (_exception) { |
| 4038 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4039 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4040 | } |
| 4041 | |
| 4042 | /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */ |
| 4043 | static void |
| 4044 | android_glTranslatef__FFF |
| 4045 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) { |
| 4046 | glTranslatef( |
| 4047 | (GLfloat)x, |
| 4048 | (GLfloat)y, |
| 4049 | (GLfloat)z |
| 4050 | ); |
| 4051 | } |
| 4052 | |
| 4053 | /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */ |
| 4054 | static void |
| 4055 | android_glTranslatex__III |
| 4056 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z) { |
| 4057 | glTranslatex( |
| 4058 | (GLfixed)x, |
| 4059 | (GLfixed)y, |
| 4060 | (GLfixed)z |
| 4061 | ); |
| 4062 | } |
| 4063 | |
| 4064 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 4065 | static void |
| 4066 | android_glVertexPointerBounds__IIILjava_nio_Buffer_2I |
| 4067 | (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] | 4068 | jint _exception = 0; |
| 4069 | const char * _exceptionType = NULL; |
| 4070 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4071 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4072 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4073 | jint _remaining; |
| 4074 | GLvoid *pointer = (GLvoid *) 0; |
| 4075 | |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4076 | if (pointer_buf) { |
Jack Palevich | 16e7972 | 2009-05-15 18:13:34 -0700 | [diff] [blame] | 4077 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4078 | if ( ! pointer ) { |
Jack Palevich | e20ea78 | 2009-05-07 18:28:29 -0700 | [diff] [blame] | 4079 | return; |
| 4080 | } |
| 4081 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4082 | glVertexPointerBounds( |
| 4083 | (GLint)size, |
| 4084 | (GLenum)type, |
| 4085 | (GLsizei)stride, |
| 4086 | (GLvoid *)pointer, |
| 4087 | (GLsizei)remaining |
| 4088 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4089 | if (_exception) { |
| 4090 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4091 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4092 | } |
| 4093 | |
| 4094 | /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ |
| 4095 | static void |
| 4096 | android_glViewport__IIII |
| 4097 | (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { |
| 4098 | glViewport( |
| 4099 | (GLint)x, |
| 4100 | (GLint)y, |
| 4101 | (GLsizei)width, |
| 4102 | (GLsizei)height |
| 4103 | ); |
| 4104 | } |
| 4105 | |
| 4106 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4107 | static jint |
| 4108 | android_glQueryMatrixxOES___3II_3II |
| 4109 | (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) { |
| 4110 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4111 | const char * _exceptionType = NULL; |
| 4112 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4113 | GLbitfield _returnValue = -1; |
| 4114 | GLfixed *mantissa_base = (GLfixed *) 0; |
| 4115 | jint _mantissaRemaining; |
| 4116 | GLfixed *mantissa = (GLfixed *) 0; |
| 4117 | GLint *exponent_base = (GLint *) 0; |
| 4118 | jint _exponentRemaining; |
| 4119 | GLint *exponent = (GLint *) 0; |
| 4120 | |
| 4121 | if (!mantissa_ref) { |
| 4122 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4123 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4124 | _exceptionMessage = "mantissa == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4125 | goto exit; |
| 4126 | } |
| 4127 | if (mantissaOffset < 0) { |
| 4128 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4129 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4130 | _exceptionMessage = "mantissaOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4131 | goto exit; |
| 4132 | } |
| 4133 | _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset; |
| 4134 | if (_mantissaRemaining < 16) { |
| 4135 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4136 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4137 | _exceptionMessage = "length - mantissaOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4138 | goto exit; |
| 4139 | } |
| 4140 | mantissa_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4141 | _env->GetIntArrayElements(mantissa_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4142 | mantissa = mantissa_base + mantissaOffset; |
| 4143 | |
| 4144 | if (!exponent_ref) { |
| 4145 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4146 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4147 | _exceptionMessage = "exponent == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4148 | goto exit; |
| 4149 | } |
| 4150 | if (exponentOffset < 0) { |
| 4151 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4152 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4153 | _exceptionMessage = "exponentOffset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4154 | goto exit; |
| 4155 | } |
| 4156 | _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset; |
| 4157 | if (_exponentRemaining < 16) { |
| 4158 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4159 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4160 | _exceptionMessage = "length - exponentOffset < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4161 | goto exit; |
| 4162 | } |
| 4163 | exponent_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4164 | _env->GetIntArrayElements(exponent_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4165 | exponent = exponent_base + exponentOffset; |
| 4166 | |
| 4167 | _returnValue = glQueryMatrixxOES( |
| 4168 | (GLfixed *)mantissa, |
| 4169 | (GLint *)exponent |
| 4170 | ); |
| 4171 | |
| 4172 | exit: |
| 4173 | if (exponent_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4174 | _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4175 | _exception ? JNI_ABORT: 0); |
| 4176 | } |
| 4177 | if (mantissa_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4178 | _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4179 | _exception ? JNI_ABORT: 0); |
| 4180 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4181 | if (_exception) { |
| 4182 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Orion Hodson | c240f22 | 2019-02-26 18:05:03 +0000 | [diff] [blame] | 4183 | return (jint)0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4184 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4185 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4186 | } |
| 4187 | |
| 4188 | /* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */ |
| 4189 | static jint |
| 4190 | android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 |
| 4191 | (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) { |
| 4192 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4193 | const char * _exceptionType = NULL; |
| 4194 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4195 | jintArray _mantissaArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4196 | jint _mantissaBufferOffset = (jint) 0; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4197 | jintArray _exponentArray = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4198 | jint _exponentBufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4199 | GLbitfield _returnValue = -1; |
| 4200 | jint _mantissaRemaining; |
| 4201 | GLfixed *mantissa = (GLfixed *) 0; |
| 4202 | jint _exponentRemaining; |
| 4203 | GLint *exponent = (GLint *) 0; |
| 4204 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4205 | if (!mantissa_buf) { |
| 4206 | _exception = 1; |
| 4207 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4208 | _exceptionMessage = "mantissa == null"; |
| 4209 | goto exit; |
| 4210 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4211 | 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] | 4212 | if (_mantissaRemaining < 16) { |
| 4213 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4214 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4215 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4216 | goto exit; |
| 4217 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4218 | if (!exponent_buf) { |
| 4219 | _exception = 1; |
| 4220 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4221 | _exceptionMessage = "exponent == null"; |
| 4222 | goto exit; |
| 4223 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4224 | 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] | 4225 | if (_exponentRemaining < 16) { |
| 4226 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4227 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4228 | _exceptionMessage = "remaining() < 16 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4229 | goto exit; |
| 4230 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4231 | if (mantissa == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4232 | char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4233 | mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset); |
| 4234 | } |
| 4235 | if (exponent == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4236 | char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4237 | exponent = (GLint *) (_exponentBase + _exponentBufferOffset); |
| 4238 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4239 | _returnValue = glQueryMatrixxOES( |
| 4240 | (GLfixed *)mantissa, |
| 4241 | (GLint *)exponent |
| 4242 | ); |
| 4243 | |
| 4244 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4245 | if (_exponentArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4246 | _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4247 | } |
| 4248 | if (_mantissaArray) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4249 | _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4250 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4251 | if (_exception) { |
| 4252 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Orion Hodson | c240f22 | 2019-02-26 18:05:03 +0000 | [diff] [blame] | 4253 | return (jint)0; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4254 | } |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 4255 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4256 | } |
| 4257 | |
| 4258 | /* void glBindBuffer ( GLenum target, GLuint buffer ) */ |
| 4259 | static void |
| 4260 | android_glBindBuffer__II |
| 4261 | (JNIEnv *_env, jobject _this, jint target, jint buffer) { |
| 4262 | glBindBuffer( |
| 4263 | (GLenum)target, |
| 4264 | (GLuint)buffer |
| 4265 | ); |
| 4266 | } |
| 4267 | |
| 4268 | /* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ |
| 4269 | static void |
| 4270 | android_glBufferData__IILjava_nio_Buffer_2I |
| 4271 | (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] | 4272 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4273 | const char * _exceptionType = NULL; |
| 4274 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4275 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4276 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4277 | jint _remaining; |
| 4278 | GLvoid *data = (GLvoid *) 0; |
| 4279 | |
| 4280 | if (data_buf) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4281 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4282 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4283 | _exception = 1; |
| 4284 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4285 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4286 | goto exit; |
| 4287 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4288 | } |
Thomas Tafertshofer | 37c9b49 | 2012-07-23 16:56:04 -0700 | [diff] [blame] | 4289 | if (data_buf && data == NULL) { |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4290 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4291 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4292 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4293 | glBufferData( |
| 4294 | (GLenum)target, |
| 4295 | (GLsizeiptr)size, |
| 4296 | (GLvoid *)data, |
| 4297 | (GLenum)usage |
| 4298 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4299 | |
| 4300 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4301 | if (_array) { |
| 4302 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4303 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4304 | if (_exception) { |
| 4305 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4306 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4307 | } |
| 4308 | |
| 4309 | /* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ |
| 4310 | static void |
| 4311 | android_glBufferSubData__IIILjava_nio_Buffer_2 |
| 4312 | (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] | 4313 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4314 | const char * _exceptionType = NULL; |
| 4315 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4316 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4317 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4318 | jint _remaining; |
| 4319 | GLvoid *data = (GLvoid *) 0; |
| 4320 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4321 | if (!data_buf) { |
| 4322 | _exception = 1; |
| 4323 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4324 | _exceptionMessage = "data == null"; |
| 4325 | goto exit; |
| 4326 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4327 | data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4328 | if (_remaining < size) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4329 | _exception = 1; |
| 4330 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4331 | _exceptionMessage = "remaining() < size < needed"; |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4332 | goto exit; |
| 4333 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4334 | if (data == NULL) { |
| 4335 | char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); |
| 4336 | data = (GLvoid *) (_dataBase + _bufferOffset); |
| 4337 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4338 | glBufferSubData( |
| 4339 | (GLenum)target, |
| 4340 | (GLintptr)offset, |
| 4341 | (GLsizeiptr)size, |
| 4342 | (GLvoid *)data |
| 4343 | ); |
Jack Palevich | c620a52 | 2009-10-21 11:02:44 -0700 | [diff] [blame] | 4344 | |
| 4345 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4346 | if (_array) { |
| 4347 | releasePointer(_env, _array, data, JNI_FALSE); |
| 4348 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4349 | if (_exception) { |
| 4350 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4351 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4352 | } |
| 4353 | |
| 4354 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4355 | static void |
| 4356 | android_glClipPlanef__I_3FI |
| 4357 | (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4358 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4359 | const char * _exceptionType = NULL; |
| 4360 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4361 | GLfloat *equation_base = (GLfloat *) 0; |
| 4362 | jint _remaining; |
| 4363 | GLfloat *equation = (GLfloat *) 0; |
| 4364 | |
| 4365 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4366 | _exception = 1; |
| 4367 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4368 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4369 | goto exit; |
| 4370 | } |
| 4371 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4372 | _exception = 1; |
| 4373 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4374 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4375 | goto exit; |
| 4376 | } |
| 4377 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4378 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4379 | _exception = 1; |
| 4380 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4381 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4382 | goto exit; |
| 4383 | } |
| 4384 | equation_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4385 | _env->GetFloatArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4386 | equation = equation_base + offset; |
| 4387 | |
| 4388 | glClipPlanef( |
| 4389 | (GLenum)plane, |
| 4390 | (GLfloat *)equation |
| 4391 | ); |
| 4392 | |
| 4393 | exit: |
| 4394 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4395 | _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4396 | JNI_ABORT); |
| 4397 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4398 | if (_exception) { |
| 4399 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4400 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4401 | } |
| 4402 | |
| 4403 | /* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */ |
| 4404 | static void |
| 4405 | android_glClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4406 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4407 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4408 | const char * _exceptionType = NULL; |
| 4409 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4410 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4411 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4412 | jint _remaining; |
| 4413 | GLfloat *equation = (GLfloat *) 0; |
| 4414 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4415 | if (!equation_buf) { |
| 4416 | _exception = 1; |
| 4417 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4418 | _exceptionMessage = "equation == null"; |
| 4419 | goto exit; |
| 4420 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4421 | 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] | 4422 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4423 | _exception = 1; |
| 4424 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4425 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4426 | goto exit; |
| 4427 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4428 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4429 | char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4430 | equation = (GLfloat *) (_equationBase + _bufferOffset); |
| 4431 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | glClipPlanef( |
| 4433 | (GLenum)plane, |
| 4434 | (GLfloat *)equation |
| 4435 | ); |
| 4436 | |
| 4437 | exit: |
| 4438 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4439 | _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4440 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4441 | if (_exception) { |
| 4442 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4443 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4444 | } |
| 4445 | |
| 4446 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4447 | static void |
| 4448 | android_glClipPlanex__I_3II |
| 4449 | (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4450 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4451 | const char * _exceptionType = NULL; |
| 4452 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4453 | GLfixed *equation_base = (GLfixed *) 0; |
| 4454 | jint _remaining; |
| 4455 | GLfixed *equation = (GLfixed *) 0; |
| 4456 | |
| 4457 | if (!equation_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4458 | _exception = 1; |
| 4459 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4460 | _exceptionMessage = "equation == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4461 | goto exit; |
| 4462 | } |
| 4463 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4464 | _exception = 1; |
| 4465 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4466 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4467 | goto exit; |
| 4468 | } |
| 4469 | _remaining = _env->GetArrayLength(equation_ref) - offset; |
| 4470 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4471 | _exception = 1; |
| 4472 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4473 | _exceptionMessage = "length - offset < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4474 | goto exit; |
| 4475 | } |
| 4476 | equation_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4477 | _env->GetIntArrayElements(equation_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4478 | equation = equation_base + offset; |
| 4479 | |
| 4480 | glClipPlanex( |
| 4481 | (GLenum)plane, |
| 4482 | (GLfixed *)equation |
| 4483 | ); |
| 4484 | |
| 4485 | exit: |
| 4486 | if (equation_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4487 | _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4488 | JNI_ABORT); |
| 4489 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4490 | if (_exception) { |
| 4491 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4492 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4493 | } |
| 4494 | |
| 4495 | /* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */ |
| 4496 | static void |
| 4497 | android_glClipPlanex__ILjava_nio_IntBuffer_2 |
| 4498 | (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4499 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4500 | const char * _exceptionType = NULL; |
| 4501 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4502 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4503 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4504 | jint _remaining; |
| 4505 | GLfixed *equation = (GLfixed *) 0; |
| 4506 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4507 | if (!equation_buf) { |
| 4508 | _exception = 1; |
| 4509 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4510 | _exceptionMessage = "equation == null"; |
| 4511 | goto exit; |
| 4512 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4513 | 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] | 4514 | if (_remaining < 4) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4515 | _exception = 1; |
| 4516 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4517 | _exceptionMessage = "remaining() < 4 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4518 | goto exit; |
| 4519 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4520 | if (equation == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4521 | char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4522 | equation = (GLfixed *) (_equationBase + _bufferOffset); |
| 4523 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4524 | glClipPlanex( |
| 4525 | (GLenum)plane, |
| 4526 | (GLfixed *)equation |
| 4527 | ); |
| 4528 | |
| 4529 | exit: |
| 4530 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4531 | _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4532 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4533 | if (_exception) { |
| 4534 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4535 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4536 | } |
| 4537 | |
| 4538 | /* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */ |
| 4539 | static void |
| 4540 | android_glColor4ub__BBBB |
| 4541 | (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) { |
| 4542 | glColor4ub( |
| 4543 | (GLubyte)red, |
| 4544 | (GLubyte)green, |
| 4545 | (GLubyte)blue, |
| 4546 | (GLubyte)alpha |
| 4547 | ); |
| 4548 | } |
| 4549 | |
| 4550 | /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 4551 | static void |
| 4552 | android_glColorPointer__IIII |
| 4553 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 4554 | glColorPointer( |
| 4555 | (GLint)size, |
| 4556 | (GLenum)type, |
| 4557 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4558 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4559 | ); |
| 4560 | } |
| 4561 | |
| 4562 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4563 | static void |
| 4564 | android_glDeleteBuffers__I_3II |
| 4565 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4566 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4567 | const char * _exceptionType = NULL; |
| 4568 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4569 | GLuint *buffers_base = (GLuint *) 0; |
| 4570 | jint _remaining; |
| 4571 | GLuint *buffers = (GLuint *) 0; |
| 4572 | |
| 4573 | if (!buffers_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4574 | _exception = 1; |
| 4575 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4576 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4577 | goto exit; |
| 4578 | } |
| 4579 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4580 | _exception = 1; |
| 4581 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4582 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4583 | goto exit; |
| 4584 | } |
| 4585 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4586 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4587 | _exception = 1; |
| 4588 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4589 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4590 | goto exit; |
| 4591 | } |
| 4592 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4593 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4594 | buffers = buffers_base + offset; |
| 4595 | |
| 4596 | glDeleteBuffers( |
| 4597 | (GLsizei)n, |
| 4598 | (GLuint *)buffers |
| 4599 | ); |
| 4600 | |
| 4601 | exit: |
| 4602 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4603 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4604 | JNI_ABORT); |
| 4605 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4606 | if (_exception) { |
| 4607 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4608 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | } |
| 4610 | |
| 4611 | /* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ |
| 4612 | static void |
| 4613 | android_glDeleteBuffers__ILjava_nio_IntBuffer_2 |
| 4614 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4615 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4616 | const char * _exceptionType = NULL; |
| 4617 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4618 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4619 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4620 | jint _remaining; |
| 4621 | GLuint *buffers = (GLuint *) 0; |
| 4622 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4623 | if (!buffers_buf) { |
| 4624 | _exception = 1; |
| 4625 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4626 | _exceptionMessage = "buffers == null"; |
| 4627 | goto exit; |
| 4628 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4629 | 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] | 4630 | if (_remaining < n) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4631 | _exception = 1; |
| 4632 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4633 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4634 | goto exit; |
| 4635 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4636 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4637 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4638 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4639 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4640 | glDeleteBuffers( |
| 4641 | (GLsizei)n, |
| 4642 | (GLuint *)buffers |
| 4643 | ); |
| 4644 | |
| 4645 | exit: |
| 4646 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4647 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4648 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4649 | if (_exception) { |
| 4650 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4651 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4652 | } |
| 4653 | |
| 4654 | /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ |
| 4655 | static void |
| 4656 | android_glDrawElements__IIII |
| 4657 | (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4658 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4659 | const char * _exceptionType = NULL; |
| 4660 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4661 | glDrawElements( |
| 4662 | (GLenum)mode, |
| 4663 | (GLsizei)count, |
| 4664 | (GLenum)type, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 4665 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4666 | ); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4667 | if (_exception) { |
| 4668 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4669 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4670 | } |
| 4671 | |
| 4672 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4673 | static void |
| 4674 | android_glGenBuffers__I_3II |
| 4675 | (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { |
| 4676 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4677 | const char * _exceptionType = NULL; |
| 4678 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4679 | GLuint *buffers_base = (GLuint *) 0; |
| 4680 | jint _remaining; |
| 4681 | GLuint *buffers = (GLuint *) 0; |
| 4682 | |
| 4683 | if (!buffers_ref) { |
| 4684 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4685 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4686 | _exceptionMessage = "buffers == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4687 | goto exit; |
| 4688 | } |
| 4689 | if (offset < 0) { |
| 4690 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4691 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4692 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4693 | goto exit; |
| 4694 | } |
| 4695 | _remaining = _env->GetArrayLength(buffers_ref) - offset; |
| 4696 | if (_remaining < n) { |
| 4697 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4698 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4699 | _exceptionMessage = "length - offset < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4700 | goto exit; |
| 4701 | } |
| 4702 | buffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4703 | _env->GetIntArrayElements(buffers_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4704 | buffers = buffers_base + offset; |
| 4705 | |
| 4706 | glGenBuffers( |
| 4707 | (GLsizei)n, |
| 4708 | (GLuint *)buffers |
| 4709 | ); |
| 4710 | |
| 4711 | exit: |
| 4712 | if (buffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4713 | _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4714 | _exception ? JNI_ABORT: 0); |
| 4715 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4716 | if (_exception) { |
| 4717 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4718 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4719 | } |
| 4720 | |
| 4721 | /* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ |
| 4722 | static void |
| 4723 | android_glGenBuffers__ILjava_nio_IntBuffer_2 |
| 4724 | (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { |
| 4725 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4726 | const char * _exceptionType = NULL; |
| 4727 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4728 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4729 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4730 | jint _remaining; |
| 4731 | GLuint *buffers = (GLuint *) 0; |
| 4732 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4733 | if (!buffers_buf) { |
| 4734 | _exception = 1; |
| 4735 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4736 | _exceptionMessage = "buffers == null"; |
| 4737 | goto exit; |
| 4738 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4739 | 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] | 4740 | if (_remaining < n) { |
| 4741 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4742 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4743 | _exceptionMessage = "remaining() < n < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4744 | goto exit; |
| 4745 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4746 | if (buffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4747 | char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4748 | buffers = (GLuint *) (_buffersBase + _bufferOffset); |
| 4749 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4750 | glGenBuffers( |
| 4751 | (GLsizei)n, |
| 4752 | (GLuint *)buffers |
| 4753 | ); |
| 4754 | |
| 4755 | exit: |
| 4756 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4757 | _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4758 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4759 | if (_exception) { |
| 4760 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4761 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4762 | } |
| 4763 | |
| 4764 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4765 | static void |
| 4766 | android_glGetBooleanv__I_3ZI |
| 4767 | (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { |
| 4768 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4769 | const char * _exceptionType = NULL; |
| 4770 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4771 | GLboolean *params_base = (GLboolean *) 0; |
| 4772 | jint _remaining; |
| 4773 | GLboolean *params = (GLboolean *) 0; |
| 4774 | |
| 4775 | if (!params_ref) { |
| 4776 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4777 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4778 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4779 | goto exit; |
| 4780 | } |
| 4781 | if (offset < 0) { |
| 4782 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4783 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4784 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4785 | goto exit; |
| 4786 | } |
| 4787 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 4788 | params_base = (GLboolean *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4789 | _env->GetBooleanArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4790 | params = params_base + offset; |
| 4791 | |
| 4792 | glGetBooleanv( |
| 4793 | (GLenum)pname, |
| 4794 | (GLboolean *)params |
| 4795 | ); |
| 4796 | |
| 4797 | exit: |
| 4798 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4799 | _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4800 | _exception ? JNI_ABORT: 0); |
| 4801 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4802 | if (_exception) { |
| 4803 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4804 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4805 | } |
| 4806 | |
| 4807 | /* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ |
| 4808 | static void |
| 4809 | android_glGetBooleanv__ILjava_nio_IntBuffer_2 |
| 4810 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4811 | jint _exception = 0; |
| 4812 | const char * _exceptionType = NULL; |
| 4813 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4814 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4815 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4816 | jint _remaining; |
| 4817 | GLboolean *params = (GLboolean *) 0; |
| 4818 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4819 | if (!params_buf) { |
| 4820 | _exception = 1; |
| 4821 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4822 | _exceptionMessage = "params == null"; |
| 4823 | goto exit; |
| 4824 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4825 | params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4826 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4827 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4828 | params = (GLboolean *) (_paramsBase + _bufferOffset); |
| 4829 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4830 | glGetBooleanv( |
| 4831 | (GLenum)pname, |
| 4832 | (GLboolean *)params |
| 4833 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4834 | |
| 4835 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4836 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4837 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 4838 | } |
| 4839 | if (_exception) { |
| 4840 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4841 | } |
| 4842 | } |
| 4843 | |
| 4844 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4845 | static void |
| 4846 | android_glGetBufferParameteriv__II_3II |
| 4847 | (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] | 4848 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4849 | "glGetBufferParameteriv"); |
Orion Hodson | c240f22 | 2019-02-26 18:05:03 +0000 | [diff] [blame] | 4850 | return; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4851 | } |
| 4852 | |
| 4853 | /* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 4854 | static void |
| 4855 | android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 |
| 4856 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 4857 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4858 | "glGetBufferParameteriv"); |
Orion Hodson | c240f22 | 2019-02-26 18:05:03 +0000 | [diff] [blame] | 4859 | return; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4860 | } |
| 4861 | |
| 4862 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4863 | static void |
| 4864 | android_glGetClipPlanef__I_3FI |
| 4865 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) { |
| 4866 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4867 | const char * _exceptionType = NULL; |
| 4868 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4869 | GLfloat *eqn_base = (GLfloat *) 0; |
| 4870 | jint _remaining; |
| 4871 | GLfloat *eqn = (GLfloat *) 0; |
| 4872 | |
| 4873 | if (!eqn_ref) { |
| 4874 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4875 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4876 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4877 | goto exit; |
| 4878 | } |
| 4879 | if (offset < 0) { |
| 4880 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4881 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4882 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4883 | goto exit; |
| 4884 | } |
| 4885 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4886 | eqn_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4887 | _env->GetFloatArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4888 | eqn = eqn_base + offset; |
| 4889 | |
| 4890 | glGetClipPlanef( |
| 4891 | (GLenum)pname, |
| 4892 | (GLfloat *)eqn |
| 4893 | ); |
| 4894 | |
| 4895 | exit: |
| 4896 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4897 | _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4898 | _exception ? JNI_ABORT: 0); |
| 4899 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4900 | if (_exception) { |
| 4901 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4902 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4903 | } |
| 4904 | |
| 4905 | /* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */ |
| 4906 | static void |
| 4907 | android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 |
| 4908 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4909 | jint _exception = 0; |
| 4910 | const char * _exceptionType = NULL; |
| 4911 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4912 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4913 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4914 | jint _remaining; |
| 4915 | GLfloat *eqn = (GLfloat *) 0; |
| 4916 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4917 | if (!eqn_buf) { |
| 4918 | _exception = 1; |
| 4919 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4920 | _exceptionMessage = "eqn == null"; |
| 4921 | goto exit; |
| 4922 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4923 | eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4924 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4925 | char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4926 | eqn = (GLfloat *) (_eqnBase + _bufferOffset); |
| 4927 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4928 | glGetClipPlanef( |
| 4929 | (GLenum)pname, |
| 4930 | (GLfloat *)eqn |
| 4931 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4932 | |
| 4933 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4934 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4935 | _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0); |
| 4936 | } |
| 4937 | if (_exception) { |
| 4938 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4939 | } |
| 4940 | } |
| 4941 | |
| 4942 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4943 | static void |
| 4944 | android_glGetClipPlanex__I_3II |
| 4945 | (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) { |
| 4946 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 4947 | const char * _exceptionType = NULL; |
| 4948 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4949 | GLfixed *eqn_base = (GLfixed *) 0; |
| 4950 | jint _remaining; |
| 4951 | GLfixed *eqn = (GLfixed *) 0; |
| 4952 | |
| 4953 | if (!eqn_ref) { |
| 4954 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4955 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4956 | _exceptionMessage = "eqn == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4957 | goto exit; |
| 4958 | } |
| 4959 | if (offset < 0) { |
| 4960 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4961 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 4962 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4963 | goto exit; |
| 4964 | } |
| 4965 | _remaining = _env->GetArrayLength(eqn_ref) - offset; |
| 4966 | eqn_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4967 | _env->GetIntArrayElements(eqn_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4968 | eqn = eqn_base + offset; |
| 4969 | |
| 4970 | glGetClipPlanex( |
| 4971 | (GLenum)pname, |
| 4972 | (GLfixed *)eqn |
| 4973 | ); |
| 4974 | |
| 4975 | exit: |
| 4976 | if (eqn_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4977 | _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4978 | _exception ? JNI_ABORT: 0); |
| 4979 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 4980 | if (_exception) { |
| 4981 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 4982 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4983 | } |
| 4984 | |
| 4985 | /* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */ |
| 4986 | static void |
| 4987 | android_glGetClipPlanex__ILjava_nio_IntBuffer_2 |
| 4988 | (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4989 | jint _exception = 0; |
| 4990 | const char * _exceptionType = NULL; |
| 4991 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 4992 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 4993 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4994 | jint _remaining; |
| 4995 | GLfixed *eqn = (GLfixed *) 0; |
| 4996 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 4997 | if (!eqn_buf) { |
| 4998 | _exception = 1; |
| 4999 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5000 | _exceptionMessage = "eqn == null"; |
| 5001 | goto exit; |
| 5002 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5003 | eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5004 | if (eqn == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5005 | char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5006 | eqn = (GLfixed *) (_eqnBase + _bufferOffset); |
| 5007 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5008 | glGetClipPlanex( |
| 5009 | (GLenum)pname, |
| 5010 | (GLfixed *)eqn |
| 5011 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5012 | |
| 5013 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5014 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5015 | _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0); |
| 5016 | } |
| 5017 | if (_exception) { |
| 5018 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5019 | } |
| 5020 | } |
| 5021 | |
| 5022 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 5023 | static void |
| 5024 | android_glGetFixedv__I_3II |
| 5025 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
| 5026 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5027 | const char * _exceptionType = NULL; |
| 5028 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5029 | GLfixed *params_base = (GLfixed *) 0; |
| 5030 | jint _remaining; |
| 5031 | GLfixed *params = (GLfixed *) 0; |
| 5032 | |
| 5033 | if (!params_ref) { |
| 5034 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5035 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5036 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5037 | goto exit; |
| 5038 | } |
| 5039 | if (offset < 0) { |
| 5040 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5041 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5042 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5043 | goto exit; |
| 5044 | } |
| 5045 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5046 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5047 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5048 | params = params_base + offset; |
| 5049 | |
| 5050 | glGetFixedv( |
| 5051 | (GLenum)pname, |
| 5052 | (GLfixed *)params |
| 5053 | ); |
| 5054 | |
| 5055 | exit: |
| 5056 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5057 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5058 | _exception ? JNI_ABORT: 0); |
| 5059 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5060 | if (_exception) { |
| 5061 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5062 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5063 | } |
| 5064 | |
| 5065 | /* void glGetFixedv ( GLenum pname, GLfixed *params ) */ |
| 5066 | static void |
| 5067 | android_glGetFixedv__ILjava_nio_IntBuffer_2 |
| 5068 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5069 | jint _exception = 0; |
| 5070 | const char * _exceptionType = NULL; |
| 5071 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5072 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5073 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5074 | jint _remaining; |
| 5075 | GLfixed *params = (GLfixed *) 0; |
| 5076 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5077 | if (!params_buf) { |
| 5078 | _exception = 1; |
| 5079 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5080 | _exceptionMessage = "params == null"; |
| 5081 | goto exit; |
| 5082 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5083 | params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5084 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5085 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5086 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5087 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5088 | glGetFixedv( |
| 5089 | (GLenum)pname, |
| 5090 | (GLfixed *)params |
| 5091 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5092 | |
| 5093 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5094 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5095 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 5096 | } |
| 5097 | if (_exception) { |
| 5098 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5099 | } |
| 5100 | } |
| 5101 | |
| 5102 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 5103 | static void |
| 5104 | android_glGetFloatv__I_3FI |
| 5105 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
| 5106 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5107 | const char * _exceptionType = NULL; |
| 5108 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5109 | GLfloat *params_base = (GLfloat *) 0; |
| 5110 | jint _remaining; |
| 5111 | GLfloat *params = (GLfloat *) 0; |
| 5112 | |
| 5113 | if (!params_ref) { |
| 5114 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5115 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5116 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5117 | goto exit; |
| 5118 | } |
| 5119 | if (offset < 0) { |
| 5120 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5121 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5122 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5123 | goto exit; |
| 5124 | } |
| 5125 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5126 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5127 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5128 | params = params_base + offset; |
| 5129 | |
| 5130 | glGetFloatv( |
| 5131 | (GLenum)pname, |
| 5132 | (GLfloat *)params |
| 5133 | ); |
| 5134 | |
| 5135 | exit: |
| 5136 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5137 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5138 | _exception ? JNI_ABORT: 0); |
| 5139 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5140 | if (_exception) { |
| 5141 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5142 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5143 | } |
| 5144 | |
| 5145 | /* void glGetFloatv ( GLenum pname, GLfloat *params ) */ |
| 5146 | static void |
| 5147 | android_glGetFloatv__ILjava_nio_FloatBuffer_2 |
| 5148 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5149 | jint _exception = 0; |
| 5150 | const char * _exceptionType = NULL; |
| 5151 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5152 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5153 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5154 | jint _remaining; |
| 5155 | GLfloat *params = (GLfloat *) 0; |
| 5156 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5157 | if (!params_buf) { |
| 5158 | _exception = 1; |
| 5159 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5160 | _exceptionMessage = "params == null"; |
| 5161 | goto exit; |
| 5162 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5163 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5164 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5165 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5166 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5167 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5168 | glGetFloatv( |
| 5169 | (GLenum)pname, |
| 5170 | (GLfloat *)params |
| 5171 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5172 | |
| 5173 | exit: |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5174 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5175 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 5176 | } |
| 5177 | if (_exception) { |
| 5178 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5179 | } |
| 5180 | } |
| 5181 | |
| 5182 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 5183 | static void |
| 5184 | android_glGetLightfv__II_3FI |
| 5185 | (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) { |
| 5186 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5187 | const char * _exceptionType = NULL; |
| 5188 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5189 | GLfloat *params_base = (GLfloat *) 0; |
| 5190 | jint _remaining; |
| 5191 | GLfloat *params = (GLfloat *) 0; |
| 5192 | |
| 5193 | if (!params_ref) { |
| 5194 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5195 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5196 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5197 | goto exit; |
| 5198 | } |
| 5199 | if (offset < 0) { |
| 5200 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5201 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5202 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5203 | goto exit; |
| 5204 | } |
| 5205 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5206 | int _needed; |
| 5207 | switch (pname) { |
| 5208 | #if defined(GL_SPOT_EXPONENT) |
| 5209 | case GL_SPOT_EXPONENT: |
| 5210 | #endif // defined(GL_SPOT_EXPONENT) |
| 5211 | #if defined(GL_SPOT_CUTOFF) |
| 5212 | case GL_SPOT_CUTOFF: |
| 5213 | #endif // defined(GL_SPOT_CUTOFF) |
| 5214 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5215 | case GL_CONSTANT_ATTENUATION: |
| 5216 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5217 | #if defined(GL_LINEAR_ATTENUATION) |
| 5218 | case GL_LINEAR_ATTENUATION: |
| 5219 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5220 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5221 | case GL_QUADRATIC_ATTENUATION: |
| 5222 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5223 | _needed = 1; |
| 5224 | break; |
| 5225 | #if defined(GL_SPOT_DIRECTION) |
| 5226 | case GL_SPOT_DIRECTION: |
| 5227 | #endif // defined(GL_SPOT_DIRECTION) |
| 5228 | _needed = 3; |
| 5229 | break; |
| 5230 | #if defined(GL_AMBIENT) |
| 5231 | case GL_AMBIENT: |
| 5232 | #endif // defined(GL_AMBIENT) |
| 5233 | #if defined(GL_DIFFUSE) |
| 5234 | case GL_DIFFUSE: |
| 5235 | #endif // defined(GL_DIFFUSE) |
| 5236 | #if defined(GL_SPECULAR) |
| 5237 | case GL_SPECULAR: |
| 5238 | #endif // defined(GL_SPECULAR) |
| 5239 | #if defined(GL_EMISSION) |
| 5240 | case GL_EMISSION: |
| 5241 | #endif // defined(GL_EMISSION) |
| 5242 | _needed = 4; |
| 5243 | break; |
| 5244 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5245 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5246 | break; |
| 5247 | } |
| 5248 | if (_remaining < _needed) { |
| 5249 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5250 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5251 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5252 | goto exit; |
| 5253 | } |
| 5254 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5255 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5256 | params = params_base + offset; |
| 5257 | |
| 5258 | glGetLightfv( |
| 5259 | (GLenum)light, |
| 5260 | (GLenum)pname, |
| 5261 | (GLfloat *)params |
| 5262 | ); |
| 5263 | |
| 5264 | exit: |
| 5265 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5266 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5267 | _exception ? JNI_ABORT: 0); |
| 5268 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5269 | if (_exception) { |
| 5270 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5271 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5272 | } |
| 5273 | |
| 5274 | /* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */ |
| 5275 | static void |
| 5276 | android_glGetLightfv__IILjava_nio_FloatBuffer_2 |
| 5277 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5278 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5279 | const char * _exceptionType = NULL; |
| 5280 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5281 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5282 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5283 | jint _remaining; |
| 5284 | GLfloat *params = (GLfloat *) 0; |
| 5285 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5286 | if (!params_buf) { |
| 5287 | _exception = 1; |
| 5288 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5289 | _exceptionMessage = "params == null"; |
| 5290 | goto exit; |
| 5291 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5292 | 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] | 5293 | int _needed; |
| 5294 | switch (pname) { |
| 5295 | #if defined(GL_SPOT_EXPONENT) |
| 5296 | case GL_SPOT_EXPONENT: |
| 5297 | #endif // defined(GL_SPOT_EXPONENT) |
| 5298 | #if defined(GL_SPOT_CUTOFF) |
| 5299 | case GL_SPOT_CUTOFF: |
| 5300 | #endif // defined(GL_SPOT_CUTOFF) |
| 5301 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5302 | case GL_CONSTANT_ATTENUATION: |
| 5303 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5304 | #if defined(GL_LINEAR_ATTENUATION) |
| 5305 | case GL_LINEAR_ATTENUATION: |
| 5306 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5307 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5308 | case GL_QUADRATIC_ATTENUATION: |
| 5309 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5310 | _needed = 1; |
| 5311 | break; |
| 5312 | #if defined(GL_SPOT_DIRECTION) |
| 5313 | case GL_SPOT_DIRECTION: |
| 5314 | #endif // defined(GL_SPOT_DIRECTION) |
| 5315 | _needed = 3; |
| 5316 | break; |
| 5317 | #if defined(GL_AMBIENT) |
| 5318 | case GL_AMBIENT: |
| 5319 | #endif // defined(GL_AMBIENT) |
| 5320 | #if defined(GL_DIFFUSE) |
| 5321 | case GL_DIFFUSE: |
| 5322 | #endif // defined(GL_DIFFUSE) |
| 5323 | #if defined(GL_SPECULAR) |
| 5324 | case GL_SPECULAR: |
| 5325 | #endif // defined(GL_SPECULAR) |
| 5326 | #if defined(GL_EMISSION) |
| 5327 | case GL_EMISSION: |
| 5328 | #endif // defined(GL_EMISSION) |
| 5329 | _needed = 4; |
| 5330 | break; |
| 5331 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5332 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5333 | break; |
| 5334 | } |
| 5335 | if (_remaining < _needed) { |
| 5336 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5337 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5338 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5339 | goto exit; |
| 5340 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5341 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5342 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5343 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5344 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5345 | glGetLightfv( |
| 5346 | (GLenum)light, |
| 5347 | (GLenum)pname, |
| 5348 | (GLfloat *)params |
| 5349 | ); |
| 5350 | |
| 5351 | exit: |
| 5352 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5353 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5354 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5355 | if (_exception) { |
| 5356 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5357 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5358 | } |
| 5359 | |
| 5360 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5361 | static void |
| 5362 | android_glGetLightxv__II_3II |
| 5363 | (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) { |
| 5364 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5365 | const char * _exceptionType = NULL; |
| 5366 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5367 | GLfixed *params_base = (GLfixed *) 0; |
| 5368 | jint _remaining; |
| 5369 | GLfixed *params = (GLfixed *) 0; |
| 5370 | |
| 5371 | if (!params_ref) { |
| 5372 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5373 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5374 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5375 | goto exit; |
| 5376 | } |
| 5377 | if (offset < 0) { |
| 5378 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5379 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5380 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5381 | goto exit; |
| 5382 | } |
| 5383 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5384 | int _needed; |
| 5385 | switch (pname) { |
| 5386 | #if defined(GL_SPOT_EXPONENT) |
| 5387 | case GL_SPOT_EXPONENT: |
| 5388 | #endif // defined(GL_SPOT_EXPONENT) |
| 5389 | #if defined(GL_SPOT_CUTOFF) |
| 5390 | case GL_SPOT_CUTOFF: |
| 5391 | #endif // defined(GL_SPOT_CUTOFF) |
| 5392 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5393 | case GL_CONSTANT_ATTENUATION: |
| 5394 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5395 | #if defined(GL_LINEAR_ATTENUATION) |
| 5396 | case GL_LINEAR_ATTENUATION: |
| 5397 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5398 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5399 | case GL_QUADRATIC_ATTENUATION: |
| 5400 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5401 | _needed = 1; |
| 5402 | break; |
| 5403 | #if defined(GL_SPOT_DIRECTION) |
| 5404 | case GL_SPOT_DIRECTION: |
| 5405 | #endif // defined(GL_SPOT_DIRECTION) |
| 5406 | _needed = 3; |
| 5407 | break; |
| 5408 | #if defined(GL_AMBIENT) |
| 5409 | case GL_AMBIENT: |
| 5410 | #endif // defined(GL_AMBIENT) |
| 5411 | #if defined(GL_DIFFUSE) |
| 5412 | case GL_DIFFUSE: |
| 5413 | #endif // defined(GL_DIFFUSE) |
| 5414 | #if defined(GL_SPECULAR) |
| 5415 | case GL_SPECULAR: |
| 5416 | #endif // defined(GL_SPECULAR) |
| 5417 | #if defined(GL_EMISSION) |
| 5418 | case GL_EMISSION: |
| 5419 | #endif // defined(GL_EMISSION) |
| 5420 | _needed = 4; |
| 5421 | break; |
| 5422 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5423 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5424 | break; |
| 5425 | } |
| 5426 | if (_remaining < _needed) { |
| 5427 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5428 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5429 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5430 | goto exit; |
| 5431 | } |
| 5432 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5433 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5434 | params = params_base + offset; |
| 5435 | |
| 5436 | glGetLightxv( |
| 5437 | (GLenum)light, |
| 5438 | (GLenum)pname, |
| 5439 | (GLfixed *)params |
| 5440 | ); |
| 5441 | |
| 5442 | exit: |
| 5443 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5444 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5445 | _exception ? JNI_ABORT: 0); |
| 5446 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5447 | if (_exception) { |
| 5448 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5449 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5450 | } |
| 5451 | |
| 5452 | /* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */ |
| 5453 | static void |
| 5454 | android_glGetLightxv__IILjava_nio_IntBuffer_2 |
| 5455 | (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) { |
| 5456 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5457 | const char * _exceptionType = NULL; |
| 5458 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5459 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5460 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5461 | jint _remaining; |
| 5462 | GLfixed *params = (GLfixed *) 0; |
| 5463 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5464 | if (!params_buf) { |
| 5465 | _exception = 1; |
| 5466 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5467 | _exceptionMessage = "params == null"; |
| 5468 | goto exit; |
| 5469 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5470 | 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] | 5471 | int _needed; |
| 5472 | switch (pname) { |
| 5473 | #if defined(GL_SPOT_EXPONENT) |
| 5474 | case GL_SPOT_EXPONENT: |
| 5475 | #endif // defined(GL_SPOT_EXPONENT) |
| 5476 | #if defined(GL_SPOT_CUTOFF) |
| 5477 | case GL_SPOT_CUTOFF: |
| 5478 | #endif // defined(GL_SPOT_CUTOFF) |
| 5479 | #if defined(GL_CONSTANT_ATTENUATION) |
| 5480 | case GL_CONSTANT_ATTENUATION: |
| 5481 | #endif // defined(GL_CONSTANT_ATTENUATION) |
| 5482 | #if defined(GL_LINEAR_ATTENUATION) |
| 5483 | case GL_LINEAR_ATTENUATION: |
| 5484 | #endif // defined(GL_LINEAR_ATTENUATION) |
| 5485 | #if defined(GL_QUADRATIC_ATTENUATION) |
| 5486 | case GL_QUADRATIC_ATTENUATION: |
| 5487 | #endif // defined(GL_QUADRATIC_ATTENUATION) |
| 5488 | _needed = 1; |
| 5489 | break; |
| 5490 | #if defined(GL_SPOT_DIRECTION) |
| 5491 | case GL_SPOT_DIRECTION: |
| 5492 | #endif // defined(GL_SPOT_DIRECTION) |
| 5493 | _needed = 3; |
| 5494 | break; |
| 5495 | #if defined(GL_AMBIENT) |
| 5496 | case GL_AMBIENT: |
| 5497 | #endif // defined(GL_AMBIENT) |
| 5498 | #if defined(GL_DIFFUSE) |
| 5499 | case GL_DIFFUSE: |
| 5500 | #endif // defined(GL_DIFFUSE) |
| 5501 | #if defined(GL_SPECULAR) |
| 5502 | case GL_SPECULAR: |
| 5503 | #endif // defined(GL_SPECULAR) |
| 5504 | #if defined(GL_EMISSION) |
| 5505 | case GL_EMISSION: |
| 5506 | #endif // defined(GL_EMISSION) |
| 5507 | _needed = 4; |
| 5508 | break; |
| 5509 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5510 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5511 | break; |
| 5512 | } |
| 5513 | if (_remaining < _needed) { |
| 5514 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5515 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5516 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5517 | goto exit; |
| 5518 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5519 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5520 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5521 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5522 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5523 | glGetLightxv( |
| 5524 | (GLenum)light, |
| 5525 | (GLenum)pname, |
| 5526 | (GLfixed *)params |
| 5527 | ); |
| 5528 | |
| 5529 | exit: |
| 5530 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5531 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5532 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5533 | if (_exception) { |
| 5534 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5535 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5536 | } |
| 5537 | |
| 5538 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5539 | static void |
| 5540 | android_glGetMaterialfv__II_3FI |
| 5541 | (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) { |
| 5542 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5543 | const char * _exceptionType = NULL; |
| 5544 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5545 | GLfloat *params_base = (GLfloat *) 0; |
| 5546 | jint _remaining; |
| 5547 | GLfloat *params = (GLfloat *) 0; |
| 5548 | |
| 5549 | if (!params_ref) { |
| 5550 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5551 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5552 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5553 | goto exit; |
| 5554 | } |
| 5555 | if (offset < 0) { |
| 5556 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5557 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5558 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5559 | goto exit; |
| 5560 | } |
| 5561 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5562 | int _needed; |
| 5563 | switch (pname) { |
| 5564 | #if defined(GL_SHININESS) |
| 5565 | case GL_SHININESS: |
| 5566 | #endif // defined(GL_SHININESS) |
| 5567 | _needed = 1; |
| 5568 | break; |
| 5569 | #if defined(GL_AMBIENT) |
| 5570 | case GL_AMBIENT: |
| 5571 | #endif // defined(GL_AMBIENT) |
| 5572 | #if defined(GL_DIFFUSE) |
| 5573 | case GL_DIFFUSE: |
| 5574 | #endif // defined(GL_DIFFUSE) |
| 5575 | #if defined(GL_SPECULAR) |
| 5576 | case GL_SPECULAR: |
| 5577 | #endif // defined(GL_SPECULAR) |
| 5578 | #if defined(GL_EMISSION) |
| 5579 | case GL_EMISSION: |
| 5580 | #endif // defined(GL_EMISSION) |
| 5581 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5582 | case GL_AMBIENT_AND_DIFFUSE: |
| 5583 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5584 | _needed = 4; |
| 5585 | break; |
| 5586 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5587 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5588 | break; |
| 5589 | } |
| 5590 | if (_remaining < _needed) { |
| 5591 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5592 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5593 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5594 | goto exit; |
| 5595 | } |
| 5596 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5597 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5598 | params = params_base + offset; |
| 5599 | |
| 5600 | glGetMaterialfv( |
| 5601 | (GLenum)face, |
| 5602 | (GLenum)pname, |
| 5603 | (GLfloat *)params |
| 5604 | ); |
| 5605 | |
| 5606 | exit: |
| 5607 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5608 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5609 | _exception ? JNI_ABORT: 0); |
| 5610 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5611 | if (_exception) { |
| 5612 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5613 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5614 | } |
| 5615 | |
| 5616 | /* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */ |
| 5617 | static void |
| 5618 | android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 |
| 5619 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5620 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5621 | const char * _exceptionType = NULL; |
| 5622 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5623 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5624 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5625 | jint _remaining; |
| 5626 | GLfloat *params = (GLfloat *) 0; |
| 5627 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5628 | if (!params_buf) { |
| 5629 | _exception = 1; |
| 5630 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5631 | _exceptionMessage = "params == null"; |
| 5632 | goto exit; |
| 5633 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5634 | 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] | 5635 | int _needed; |
| 5636 | switch (pname) { |
| 5637 | #if defined(GL_SHININESS) |
| 5638 | case GL_SHININESS: |
| 5639 | #endif // defined(GL_SHININESS) |
| 5640 | _needed = 1; |
| 5641 | break; |
| 5642 | #if defined(GL_AMBIENT) |
| 5643 | case GL_AMBIENT: |
| 5644 | #endif // defined(GL_AMBIENT) |
| 5645 | #if defined(GL_DIFFUSE) |
| 5646 | case GL_DIFFUSE: |
| 5647 | #endif // defined(GL_DIFFUSE) |
| 5648 | #if defined(GL_SPECULAR) |
| 5649 | case GL_SPECULAR: |
| 5650 | #endif // defined(GL_SPECULAR) |
| 5651 | #if defined(GL_EMISSION) |
| 5652 | case GL_EMISSION: |
| 5653 | #endif // defined(GL_EMISSION) |
| 5654 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5655 | case GL_AMBIENT_AND_DIFFUSE: |
| 5656 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5657 | _needed = 4; |
| 5658 | break; |
| 5659 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5660 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5661 | break; |
| 5662 | } |
| 5663 | if (_remaining < _needed) { |
| 5664 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5665 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5666 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5667 | goto exit; |
| 5668 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5669 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5670 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5671 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 5672 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5673 | glGetMaterialfv( |
| 5674 | (GLenum)face, |
| 5675 | (GLenum)pname, |
| 5676 | (GLfloat *)params |
| 5677 | ); |
| 5678 | |
| 5679 | exit: |
| 5680 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5681 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5682 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5683 | if (_exception) { |
| 5684 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5685 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5686 | } |
| 5687 | |
| 5688 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5689 | static void |
| 5690 | android_glGetMaterialxv__II_3II |
| 5691 | (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) { |
| 5692 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5693 | const char * _exceptionType = NULL; |
| 5694 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5695 | GLfixed *params_base = (GLfixed *) 0; |
| 5696 | jint _remaining; |
| 5697 | GLfixed *params = (GLfixed *) 0; |
| 5698 | |
| 5699 | if (!params_ref) { |
| 5700 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5701 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5702 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5703 | goto exit; |
| 5704 | } |
| 5705 | if (offset < 0) { |
| 5706 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5707 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5708 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5709 | goto exit; |
| 5710 | } |
| 5711 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5712 | int _needed; |
| 5713 | switch (pname) { |
| 5714 | #if defined(GL_SHININESS) |
| 5715 | case GL_SHININESS: |
| 5716 | #endif // defined(GL_SHININESS) |
| 5717 | _needed = 1; |
| 5718 | break; |
| 5719 | #if defined(GL_AMBIENT) |
| 5720 | case GL_AMBIENT: |
| 5721 | #endif // defined(GL_AMBIENT) |
| 5722 | #if defined(GL_DIFFUSE) |
| 5723 | case GL_DIFFUSE: |
| 5724 | #endif // defined(GL_DIFFUSE) |
| 5725 | #if defined(GL_SPECULAR) |
| 5726 | case GL_SPECULAR: |
| 5727 | #endif // defined(GL_SPECULAR) |
| 5728 | #if defined(GL_EMISSION) |
| 5729 | case GL_EMISSION: |
| 5730 | #endif // defined(GL_EMISSION) |
| 5731 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5732 | case GL_AMBIENT_AND_DIFFUSE: |
| 5733 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5734 | _needed = 4; |
| 5735 | break; |
| 5736 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5737 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5738 | break; |
| 5739 | } |
| 5740 | if (_remaining < _needed) { |
| 5741 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5742 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5743 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5744 | goto exit; |
| 5745 | } |
| 5746 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5747 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5748 | params = params_base + offset; |
| 5749 | |
| 5750 | glGetMaterialxv( |
| 5751 | (GLenum)face, |
| 5752 | (GLenum)pname, |
| 5753 | (GLfixed *)params |
| 5754 | ); |
| 5755 | |
| 5756 | exit: |
| 5757 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5758 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5759 | _exception ? JNI_ABORT: 0); |
| 5760 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5761 | if (_exception) { |
| 5762 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5763 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5764 | } |
| 5765 | |
| 5766 | /* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */ |
| 5767 | static void |
| 5768 | android_glGetMaterialxv__IILjava_nio_IntBuffer_2 |
| 5769 | (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) { |
| 5770 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5771 | const char * _exceptionType = NULL; |
| 5772 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5773 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5774 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5775 | jint _remaining; |
| 5776 | GLfixed *params = (GLfixed *) 0; |
| 5777 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5778 | if (!params_buf) { |
| 5779 | _exception = 1; |
| 5780 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5781 | _exceptionMessage = "params == null"; |
| 5782 | goto exit; |
| 5783 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5784 | 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] | 5785 | int _needed; |
| 5786 | switch (pname) { |
| 5787 | #if defined(GL_SHININESS) |
| 5788 | case GL_SHININESS: |
| 5789 | #endif // defined(GL_SHININESS) |
| 5790 | _needed = 1; |
| 5791 | break; |
| 5792 | #if defined(GL_AMBIENT) |
| 5793 | case GL_AMBIENT: |
| 5794 | #endif // defined(GL_AMBIENT) |
| 5795 | #if defined(GL_DIFFUSE) |
| 5796 | case GL_DIFFUSE: |
| 5797 | #endif // defined(GL_DIFFUSE) |
| 5798 | #if defined(GL_SPECULAR) |
| 5799 | case GL_SPECULAR: |
| 5800 | #endif // defined(GL_SPECULAR) |
| 5801 | #if defined(GL_EMISSION) |
| 5802 | case GL_EMISSION: |
| 5803 | #endif // defined(GL_EMISSION) |
| 5804 | #if defined(GL_AMBIENT_AND_DIFFUSE) |
| 5805 | case GL_AMBIENT_AND_DIFFUSE: |
| 5806 | #endif // defined(GL_AMBIENT_AND_DIFFUSE) |
| 5807 | _needed = 4; |
| 5808 | break; |
| 5809 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5810 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5811 | break; |
| 5812 | } |
| 5813 | if (_remaining < _needed) { |
| 5814 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5815 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5816 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5817 | goto exit; |
| 5818 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5819 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5820 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5821 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 5822 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5823 | glGetMaterialxv( |
| 5824 | (GLenum)face, |
| 5825 | (GLenum)pname, |
| 5826 | (GLfixed *)params |
| 5827 | ); |
| 5828 | |
| 5829 | exit: |
| 5830 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5831 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5832 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5833 | if (_exception) { |
| 5834 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5835 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5836 | } |
| 5837 | |
| 5838 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5839 | static void |
| 5840 | android_glGetTexEnviv__II_3II |
| 5841 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5842 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5843 | const char * _exceptionType = NULL; |
| 5844 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5845 | GLint *params_base = (GLint *) 0; |
| 5846 | jint _remaining; |
| 5847 | GLint *params = (GLint *) 0; |
| 5848 | |
| 5849 | if (!params_ref) { |
| 5850 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5851 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5852 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5853 | goto exit; |
| 5854 | } |
| 5855 | if (offset < 0) { |
| 5856 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5857 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5858 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5859 | goto exit; |
| 5860 | } |
| 5861 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 5862 | int _needed; |
| 5863 | switch (pname) { |
| 5864 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5865 | case GL_TEXTURE_ENV_MODE: |
| 5866 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5867 | #if defined(GL_COMBINE_RGB) |
| 5868 | case GL_COMBINE_RGB: |
| 5869 | #endif // defined(GL_COMBINE_RGB) |
| 5870 | #if defined(GL_COMBINE_ALPHA) |
| 5871 | case GL_COMBINE_ALPHA: |
| 5872 | #endif // defined(GL_COMBINE_ALPHA) |
| 5873 | _needed = 1; |
| 5874 | break; |
| 5875 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5876 | case GL_TEXTURE_ENV_COLOR: |
| 5877 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5878 | _needed = 4; |
| 5879 | break; |
| 5880 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5881 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5882 | break; |
| 5883 | } |
| 5884 | if (_remaining < _needed) { |
| 5885 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5886 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5887 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5888 | goto exit; |
| 5889 | } |
| 5890 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5891 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5892 | params = params_base + offset; |
| 5893 | |
| 5894 | glGetTexEnviv( |
| 5895 | (GLenum)env, |
| 5896 | (GLenum)pname, |
| 5897 | (GLint *)params |
| 5898 | ); |
| 5899 | |
| 5900 | exit: |
| 5901 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5902 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5903 | _exception ? JNI_ABORT: 0); |
| 5904 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5905 | if (_exception) { |
| 5906 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5907 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5908 | } |
| 5909 | |
| 5910 | /* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */ |
| 5911 | static void |
| 5912 | android_glGetTexEnviv__IILjava_nio_IntBuffer_2 |
| 5913 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 5914 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5915 | const char * _exceptionType = NULL; |
| 5916 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5917 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5918 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5919 | jint _remaining; |
| 5920 | GLint *params = (GLint *) 0; |
| 5921 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 5922 | if (!params_buf) { |
| 5923 | _exception = 1; |
| 5924 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5925 | _exceptionMessage = "params == null"; |
| 5926 | goto exit; |
| 5927 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5928 | 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] | 5929 | int _needed; |
| 5930 | switch (pname) { |
| 5931 | #if defined(GL_TEXTURE_ENV_MODE) |
| 5932 | case GL_TEXTURE_ENV_MODE: |
| 5933 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 5934 | #if defined(GL_COMBINE_RGB) |
| 5935 | case GL_COMBINE_RGB: |
| 5936 | #endif // defined(GL_COMBINE_RGB) |
| 5937 | #if defined(GL_COMBINE_ALPHA) |
| 5938 | case GL_COMBINE_ALPHA: |
| 5939 | #endif // defined(GL_COMBINE_ALPHA) |
| 5940 | _needed = 1; |
| 5941 | break; |
| 5942 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 5943 | case GL_TEXTURE_ENV_COLOR: |
| 5944 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 5945 | _needed = 4; |
| 5946 | break; |
| 5947 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5948 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5949 | break; |
| 5950 | } |
| 5951 | if (_remaining < _needed) { |
| 5952 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5953 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5954 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5955 | goto exit; |
| 5956 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5957 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5958 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 5959 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 5960 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5961 | glGetTexEnviv( |
| 5962 | (GLenum)env, |
| 5963 | (GLenum)pname, |
| 5964 | (GLint *)params |
| 5965 | ); |
| 5966 | |
| 5967 | exit: |
| 5968 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 5969 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5970 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5971 | if (_exception) { |
| 5972 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 5973 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5974 | } |
| 5975 | |
| 5976 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 5977 | static void |
| 5978 | android_glGetTexEnvxv__II_3II |
| 5979 | (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) { |
| 5980 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 5981 | const char * _exceptionType = NULL; |
| 5982 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5983 | GLfixed *params_base = (GLfixed *) 0; |
| 5984 | jint _remaining; |
| 5985 | GLfixed *params = (GLfixed *) 0; |
| 5986 | |
| 5987 | if (!params_ref) { |
| 5988 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5989 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5990 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5991 | goto exit; |
| 5992 | } |
| 5993 | if (offset < 0) { |
| 5994 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 5995 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 5996 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5997 | goto exit; |
| 5998 | } |
| 5999 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6000 | int _needed; |
| 6001 | switch (pname) { |
| 6002 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6003 | case GL_TEXTURE_ENV_MODE: |
| 6004 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6005 | #if defined(GL_COMBINE_RGB) |
| 6006 | case GL_COMBINE_RGB: |
| 6007 | #endif // defined(GL_COMBINE_RGB) |
| 6008 | #if defined(GL_COMBINE_ALPHA) |
| 6009 | case GL_COMBINE_ALPHA: |
| 6010 | #endif // defined(GL_COMBINE_ALPHA) |
| 6011 | _needed = 1; |
| 6012 | break; |
| 6013 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6014 | case GL_TEXTURE_ENV_COLOR: |
| 6015 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6016 | _needed = 4; |
| 6017 | break; |
| 6018 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6019 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6020 | break; |
| 6021 | } |
| 6022 | if (_remaining < _needed) { |
| 6023 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6024 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6025 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6026 | goto exit; |
| 6027 | } |
| 6028 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6029 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6030 | params = params_base + offset; |
| 6031 | |
| 6032 | glGetTexEnvxv( |
| 6033 | (GLenum)env, |
| 6034 | (GLenum)pname, |
| 6035 | (GLfixed *)params |
| 6036 | ); |
| 6037 | |
| 6038 | exit: |
| 6039 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6040 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6041 | _exception ? JNI_ABORT: 0); |
| 6042 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6043 | if (_exception) { |
| 6044 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6045 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6046 | } |
| 6047 | |
| 6048 | /* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */ |
| 6049 | static void |
| 6050 | android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 |
| 6051 | (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) { |
| 6052 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6053 | const char * _exceptionType = NULL; |
| 6054 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6055 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6056 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6057 | jint _remaining; |
| 6058 | GLfixed *params = (GLfixed *) 0; |
| 6059 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6060 | if (!params_buf) { |
| 6061 | _exception = 1; |
| 6062 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6063 | _exceptionMessage = "params == null"; |
| 6064 | goto exit; |
| 6065 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6066 | 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] | 6067 | int _needed; |
| 6068 | switch (pname) { |
| 6069 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6070 | case GL_TEXTURE_ENV_MODE: |
| 6071 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6072 | #if defined(GL_COMBINE_RGB) |
| 6073 | case GL_COMBINE_RGB: |
| 6074 | #endif // defined(GL_COMBINE_RGB) |
| 6075 | #if defined(GL_COMBINE_ALPHA) |
| 6076 | case GL_COMBINE_ALPHA: |
| 6077 | #endif // defined(GL_COMBINE_ALPHA) |
| 6078 | _needed = 1; |
| 6079 | break; |
| 6080 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6081 | case GL_TEXTURE_ENV_COLOR: |
| 6082 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6083 | _needed = 4; |
| 6084 | break; |
| 6085 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6086 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6087 | break; |
| 6088 | } |
| 6089 | if (_remaining < _needed) { |
| 6090 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6091 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6092 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6093 | goto exit; |
| 6094 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6095 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6096 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6097 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6098 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6099 | glGetTexEnvxv( |
| 6100 | (GLenum)env, |
| 6101 | (GLenum)pname, |
| 6102 | (GLfixed *)params |
| 6103 | ); |
| 6104 | |
| 6105 | exit: |
| 6106 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6107 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6108 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6109 | if (_exception) { |
| 6110 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6111 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6112 | } |
| 6113 | |
| 6114 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 6115 | static void |
| 6116 | android_glGetTexParameterfv__II_3FI |
| 6117 | (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { |
| 6118 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6119 | const char * _exceptionType = NULL; |
| 6120 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6121 | GLfloat *params_base = (GLfloat *) 0; |
| 6122 | jint _remaining; |
| 6123 | GLfloat *params = (GLfloat *) 0; |
| 6124 | |
| 6125 | if (!params_ref) { |
| 6126 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6127 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6128 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6129 | goto exit; |
| 6130 | } |
| 6131 | if (offset < 0) { |
| 6132 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6133 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6134 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6135 | goto exit; |
| 6136 | } |
| 6137 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6138 | if (_remaining < 1) { |
| 6139 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6140 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6141 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6142 | goto exit; |
| 6143 | } |
| 6144 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6145 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6146 | params = params_base + offset; |
| 6147 | |
| 6148 | glGetTexParameterfv( |
| 6149 | (GLenum)target, |
| 6150 | (GLenum)pname, |
| 6151 | (GLfloat *)params |
| 6152 | ); |
| 6153 | |
| 6154 | exit: |
| 6155 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6156 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6157 | _exception ? JNI_ABORT: 0); |
| 6158 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6159 | if (_exception) { |
| 6160 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6161 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6162 | } |
| 6163 | |
| 6164 | /* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ |
| 6165 | static void |
| 6166 | android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6167 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6168 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6169 | const char * _exceptionType = NULL; |
| 6170 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6171 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6172 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6173 | jint _remaining; |
| 6174 | GLfloat *params = (GLfloat *) 0; |
| 6175 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6176 | if (!params_buf) { |
| 6177 | _exception = 1; |
| 6178 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6179 | _exceptionMessage = "params == null"; |
| 6180 | goto exit; |
| 6181 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6182 | 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] | 6183 | if (_remaining < 1) { |
| 6184 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6185 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6186 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6187 | goto exit; |
| 6188 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6189 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6190 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6191 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6192 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6193 | glGetTexParameterfv( |
| 6194 | (GLenum)target, |
| 6195 | (GLenum)pname, |
| 6196 | (GLfloat *)params |
| 6197 | ); |
| 6198 | |
| 6199 | exit: |
| 6200 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6201 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6202 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6203 | if (_exception) { |
| 6204 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6205 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6206 | } |
| 6207 | |
| 6208 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 6209 | static void |
| 6210 | android_glGetTexParameteriv__II_3II |
| 6211 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 6212 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6213 | const char * _exceptionType = NULL; |
| 6214 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6215 | GLint *params_base = (GLint *) 0; |
| 6216 | jint _remaining; |
| 6217 | GLint *params = (GLint *) 0; |
| 6218 | |
| 6219 | if (!params_ref) { |
| 6220 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6221 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6222 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6223 | goto exit; |
| 6224 | } |
| 6225 | if (offset < 0) { |
| 6226 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6227 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6228 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6229 | goto exit; |
| 6230 | } |
| 6231 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6232 | if (_remaining < 1) { |
| 6233 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6234 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6235 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6236 | goto exit; |
| 6237 | } |
| 6238 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6239 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6240 | params = params_base + offset; |
| 6241 | |
| 6242 | glGetTexParameteriv( |
| 6243 | (GLenum)target, |
| 6244 | (GLenum)pname, |
| 6245 | (GLint *)params |
| 6246 | ); |
| 6247 | |
| 6248 | exit: |
| 6249 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6250 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6251 | _exception ? JNI_ABORT: 0); |
| 6252 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6253 | if (_exception) { |
| 6254 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6255 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6256 | } |
| 6257 | |
| 6258 | /* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ |
| 6259 | static void |
| 6260 | android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 |
| 6261 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6262 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6263 | const char * _exceptionType = NULL; |
| 6264 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6265 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6266 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6267 | jint _remaining; |
| 6268 | GLint *params = (GLint *) 0; |
| 6269 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6270 | if (!params_buf) { |
| 6271 | _exception = 1; |
| 6272 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6273 | _exceptionMessage = "params == null"; |
| 6274 | goto exit; |
| 6275 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6276 | 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] | 6277 | if (_remaining < 1) { |
| 6278 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6279 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6280 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6281 | goto exit; |
| 6282 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6283 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6284 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6285 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6286 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6287 | glGetTexParameteriv( |
| 6288 | (GLenum)target, |
| 6289 | (GLenum)pname, |
| 6290 | (GLint *)params |
| 6291 | ); |
| 6292 | |
| 6293 | exit: |
| 6294 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6295 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6296 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6297 | if (_exception) { |
| 6298 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6299 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6300 | } |
| 6301 | |
| 6302 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6303 | static void |
| 6304 | android_glGetTexParameterxv__II_3II |
| 6305 | (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { |
| 6306 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6307 | const char * _exceptionType = NULL; |
| 6308 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6309 | GLfixed *params_base = (GLfixed *) 0; |
| 6310 | jint _remaining; |
| 6311 | GLfixed *params = (GLfixed *) 0; |
| 6312 | |
| 6313 | if (!params_ref) { |
| 6314 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6315 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6316 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6317 | goto exit; |
| 6318 | } |
| 6319 | if (offset < 0) { |
| 6320 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6321 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6322 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6323 | goto exit; |
| 6324 | } |
| 6325 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6326 | if (_remaining < 1) { |
| 6327 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6328 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6329 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6330 | goto exit; |
| 6331 | } |
| 6332 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6333 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6334 | params = params_base + offset; |
| 6335 | |
| 6336 | glGetTexParameterxv( |
| 6337 | (GLenum)target, |
| 6338 | (GLenum)pname, |
| 6339 | (GLfixed *)params |
| 6340 | ); |
| 6341 | |
| 6342 | exit: |
| 6343 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6344 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6345 | _exception ? JNI_ABORT: 0); |
| 6346 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6347 | if (_exception) { |
| 6348 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6349 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6350 | } |
| 6351 | |
| 6352 | /* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */ |
| 6353 | static void |
| 6354 | android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 |
| 6355 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
| 6356 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6357 | const char * _exceptionType = NULL; |
| 6358 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6359 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6360 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6361 | jint _remaining; |
| 6362 | GLfixed *params = (GLfixed *) 0; |
| 6363 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6364 | if (!params_buf) { |
| 6365 | _exception = 1; |
| 6366 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6367 | _exceptionMessage = "params == null"; |
| 6368 | goto exit; |
| 6369 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6370 | 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] | 6371 | if (_remaining < 1) { |
| 6372 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6373 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6374 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6375 | goto exit; |
| 6376 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6377 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6378 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6379 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6380 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6381 | glGetTexParameterxv( |
| 6382 | (GLenum)target, |
| 6383 | (GLenum)pname, |
| 6384 | (GLfixed *)params |
| 6385 | ); |
| 6386 | |
| 6387 | exit: |
| 6388 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6389 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6390 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6391 | if (_exception) { |
| 6392 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6393 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6394 | } |
| 6395 | |
| 6396 | /* GLboolean glIsBuffer ( GLuint buffer ) */ |
| 6397 | static jboolean |
| 6398 | android_glIsBuffer__I |
| 6399 | (JNIEnv *_env, jobject _this, jint buffer) { |
| 6400 | GLboolean _returnValue; |
| 6401 | _returnValue = glIsBuffer( |
| 6402 | (GLuint)buffer |
| 6403 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6404 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6405 | } |
| 6406 | |
| 6407 | /* GLboolean glIsEnabled ( GLenum cap ) */ |
| 6408 | static jboolean |
| 6409 | android_glIsEnabled__I |
| 6410 | (JNIEnv *_env, jobject _this, jint cap) { |
| 6411 | GLboolean _returnValue; |
| 6412 | _returnValue = glIsEnabled( |
| 6413 | (GLenum)cap |
| 6414 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6415 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6416 | } |
| 6417 | |
| 6418 | /* GLboolean glIsTexture ( GLuint texture ) */ |
| 6419 | static jboolean |
| 6420 | android_glIsTexture__I |
| 6421 | (JNIEnv *_env, jobject _this, jint texture) { |
| 6422 | GLboolean _returnValue; |
| 6423 | _returnValue = glIsTexture( |
| 6424 | (GLuint)texture |
| 6425 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 6426 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6427 | } |
| 6428 | |
| 6429 | /* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */ |
| 6430 | static void |
| 6431 | android_glNormalPointer__III |
| 6432 | (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) { |
| 6433 | glNormalPointer( |
| 6434 | (GLenum)type, |
| 6435 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6436 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6437 | ); |
| 6438 | } |
| 6439 | |
| 6440 | /* void glPointParameterf ( GLenum pname, GLfloat param ) */ |
| 6441 | static void |
| 6442 | android_glPointParameterf__IF |
| 6443 | (JNIEnv *_env, jobject _this, jint pname, jfloat param) { |
| 6444 | glPointParameterf( |
| 6445 | (GLenum)pname, |
| 6446 | (GLfloat)param |
| 6447 | ); |
| 6448 | } |
| 6449 | |
| 6450 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6451 | static void |
| 6452 | android_glPointParameterfv__I_3FI |
| 6453 | (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6454 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6455 | const char * _exceptionType = NULL; |
| 6456 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6457 | GLfloat *params_base = (GLfloat *) 0; |
| 6458 | jint _remaining; |
| 6459 | GLfloat *params = (GLfloat *) 0; |
| 6460 | |
| 6461 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6462 | _exception = 1; |
| 6463 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6464 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6465 | goto exit; |
| 6466 | } |
| 6467 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6468 | _exception = 1; |
| 6469 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6470 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6471 | goto exit; |
| 6472 | } |
| 6473 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6474 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6475 | _exception = 1; |
| 6476 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6477 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6478 | goto exit; |
| 6479 | } |
| 6480 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6481 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6482 | params = params_base + offset; |
| 6483 | |
| 6484 | glPointParameterfv( |
| 6485 | (GLenum)pname, |
| 6486 | (GLfloat *)params |
| 6487 | ); |
| 6488 | |
| 6489 | exit: |
| 6490 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6491 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6492 | JNI_ABORT); |
| 6493 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6494 | if (_exception) { |
| 6495 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6496 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6497 | } |
| 6498 | |
| 6499 | /* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */ |
| 6500 | static void |
| 6501 | android_glPointParameterfv__ILjava_nio_FloatBuffer_2 |
| 6502 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6503 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6504 | const char * _exceptionType = NULL; |
| 6505 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6506 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6507 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6508 | jint _remaining; |
| 6509 | GLfloat *params = (GLfloat *) 0; |
| 6510 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6511 | if (!params_buf) { |
| 6512 | _exception = 1; |
| 6513 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6514 | _exceptionMessage = "params == null"; |
| 6515 | goto exit; |
| 6516 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6517 | 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] | 6518 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6519 | _exception = 1; |
| 6520 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6521 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6522 | goto exit; |
| 6523 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6524 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6525 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6526 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6527 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6528 | glPointParameterfv( |
| 6529 | (GLenum)pname, |
| 6530 | (GLfloat *)params |
| 6531 | ); |
| 6532 | |
| 6533 | exit: |
| 6534 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6535 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6536 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6537 | if (_exception) { |
| 6538 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6539 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6540 | } |
| 6541 | |
| 6542 | /* void glPointParameterx ( GLenum pname, GLfixed param ) */ |
| 6543 | static void |
| 6544 | android_glPointParameterx__II |
| 6545 | (JNIEnv *_env, jobject _this, jint pname, jint param) { |
| 6546 | glPointParameterx( |
| 6547 | (GLenum)pname, |
| 6548 | (GLfixed)param |
| 6549 | ); |
| 6550 | } |
| 6551 | |
| 6552 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6553 | static void |
| 6554 | android_glPointParameterxv__I_3II |
| 6555 | (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6556 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6557 | const char * _exceptionType = NULL; |
| 6558 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6559 | GLfixed *params_base = (GLfixed *) 0; |
| 6560 | jint _remaining; |
| 6561 | GLfixed *params = (GLfixed *) 0; |
| 6562 | |
| 6563 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6564 | _exception = 1; |
| 6565 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6566 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6567 | goto exit; |
| 6568 | } |
| 6569 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6570 | _exception = 1; |
| 6571 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6572 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6573 | goto exit; |
| 6574 | } |
| 6575 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6576 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6577 | _exception = 1; |
| 6578 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6579 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6580 | goto exit; |
| 6581 | } |
| 6582 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6583 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6584 | params = params_base + offset; |
| 6585 | |
| 6586 | glPointParameterxv( |
| 6587 | (GLenum)pname, |
| 6588 | (GLfixed *)params |
| 6589 | ); |
| 6590 | |
| 6591 | exit: |
| 6592 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6593 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6594 | JNI_ABORT); |
| 6595 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6596 | if (_exception) { |
| 6597 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6598 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6599 | } |
| 6600 | |
| 6601 | /* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */ |
| 6602 | static void |
| 6603 | android_glPointParameterxv__ILjava_nio_IntBuffer_2 |
| 6604 | (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6605 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6606 | const char * _exceptionType = NULL; |
| 6607 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6608 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6609 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6610 | jint _remaining; |
| 6611 | GLfixed *params = (GLfixed *) 0; |
| 6612 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6613 | if (!params_buf) { |
| 6614 | _exception = 1; |
| 6615 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6616 | _exceptionMessage = "params == null"; |
| 6617 | goto exit; |
| 6618 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6619 | 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] | 6620 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6621 | _exception = 1; |
| 6622 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6623 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6624 | goto exit; |
| 6625 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6626 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6627 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6628 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 6629 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6630 | glPointParameterxv( |
| 6631 | (GLenum)pname, |
| 6632 | (GLfixed *)params |
| 6633 | ); |
| 6634 | |
| 6635 | exit: |
| 6636 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6637 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6638 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6639 | if (_exception) { |
| 6640 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6641 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6642 | } |
| 6643 | |
| 6644 | /* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 6645 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6646 | android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I |
| 6647 | (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] | 6648 | jint _exception = 0; |
| 6649 | const char * _exceptionType = NULL; |
| 6650 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6651 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6652 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6653 | jint _remaining; |
| 6654 | GLvoid *pointer = (GLvoid *) 0; |
| 6655 | |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6656 | if (pointer_buf) { |
| 6657 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 6658 | if ( ! pointer ) { |
| 6659 | return; |
| 6660 | } |
| 6661 | } |
| 6662 | glPointSizePointerOESBounds( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6663 | (GLenum)type, |
| 6664 | (GLsizei)stride, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 6665 | (GLvoid *)pointer, |
| 6666 | (GLsizei)remaining |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6667 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6668 | if (_exception) { |
| 6669 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6670 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6671 | } |
| 6672 | |
| 6673 | /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 6674 | static void |
| 6675 | android_glTexCoordPointer__IIII |
| 6676 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 6677 | glTexCoordPointer( |
| 6678 | (GLint)size, |
| 6679 | (GLenum)type, |
| 6680 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 6681 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6682 | ); |
| 6683 | } |
| 6684 | |
| 6685 | /* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */ |
| 6686 | static void |
| 6687 | android_glTexEnvi__III |
| 6688 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6689 | glTexEnvi( |
| 6690 | (GLenum)target, |
| 6691 | (GLenum)pname, |
| 6692 | (GLint)param |
| 6693 | ); |
| 6694 | } |
| 6695 | |
| 6696 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6697 | static void |
| 6698 | android_glTexEnviv__II_3II |
| 6699 | (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] | 6700 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6701 | const char * _exceptionType = NULL; |
| 6702 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6703 | GLint *params_base = (GLint *) 0; |
| 6704 | jint _remaining; |
| 6705 | GLint *params = (GLint *) 0; |
| 6706 | |
| 6707 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6708 | _exception = 1; |
| 6709 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6710 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6711 | goto exit; |
| 6712 | } |
| 6713 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6714 | _exception = 1; |
| 6715 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6716 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6717 | goto exit; |
| 6718 | } |
| 6719 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6720 | int _needed; |
| 6721 | switch (pname) { |
| 6722 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6723 | case GL_TEXTURE_ENV_MODE: |
| 6724 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6725 | #if defined(GL_COMBINE_RGB) |
| 6726 | case GL_COMBINE_RGB: |
| 6727 | #endif // defined(GL_COMBINE_RGB) |
| 6728 | #if defined(GL_COMBINE_ALPHA) |
| 6729 | case GL_COMBINE_ALPHA: |
| 6730 | #endif // defined(GL_COMBINE_ALPHA) |
| 6731 | _needed = 1; |
| 6732 | break; |
| 6733 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6734 | case GL_TEXTURE_ENV_COLOR: |
| 6735 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6736 | _needed = 4; |
| 6737 | break; |
| 6738 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6739 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6740 | break; |
| 6741 | } |
| 6742 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6743 | _exception = 1; |
| 6744 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6745 | _exceptionMessage = "length - offset < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6746 | goto exit; |
| 6747 | } |
| 6748 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6749 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6750 | params = params_base + offset; |
| 6751 | |
| 6752 | glTexEnviv( |
| 6753 | (GLenum)target, |
| 6754 | (GLenum)pname, |
| 6755 | (GLint *)params |
| 6756 | ); |
| 6757 | |
| 6758 | exit: |
| 6759 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6760 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6761 | JNI_ABORT); |
| 6762 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6763 | if (_exception) { |
| 6764 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6765 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6766 | } |
| 6767 | |
| 6768 | /* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6769 | static void |
| 6770 | android_glTexEnviv__IILjava_nio_IntBuffer_2 |
| 6771 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6772 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6773 | const char * _exceptionType = NULL; |
| 6774 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6775 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6776 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6777 | jint _remaining; |
| 6778 | GLint *params = (GLint *) 0; |
| 6779 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6780 | if (!params_buf) { |
| 6781 | _exception = 1; |
| 6782 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6783 | _exceptionMessage = "params == null"; |
| 6784 | goto exit; |
| 6785 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6786 | 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] | 6787 | int _needed; |
| 6788 | switch (pname) { |
| 6789 | #if defined(GL_TEXTURE_ENV_MODE) |
| 6790 | case GL_TEXTURE_ENV_MODE: |
| 6791 | #endif // defined(GL_TEXTURE_ENV_MODE) |
| 6792 | #if defined(GL_COMBINE_RGB) |
| 6793 | case GL_COMBINE_RGB: |
| 6794 | #endif // defined(GL_COMBINE_RGB) |
| 6795 | #if defined(GL_COMBINE_ALPHA) |
| 6796 | case GL_COMBINE_ALPHA: |
| 6797 | #endif // defined(GL_COMBINE_ALPHA) |
| 6798 | _needed = 1; |
| 6799 | break; |
| 6800 | #if defined(GL_TEXTURE_ENV_COLOR) |
| 6801 | case GL_TEXTURE_ENV_COLOR: |
| 6802 | #endif // defined(GL_TEXTURE_ENV_COLOR) |
| 6803 | _needed = 4; |
| 6804 | break; |
| 6805 | default: |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6806 | _needed = 1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6807 | break; |
| 6808 | } |
| 6809 | if (_remaining < _needed) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6810 | _exception = 1; |
| 6811 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6812 | _exceptionMessage = "remaining() < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6813 | goto exit; |
| 6814 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6815 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6816 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6817 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 6818 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6819 | glTexEnviv( |
| 6820 | (GLenum)target, |
| 6821 | (GLenum)pname, |
| 6822 | (GLint *)params |
| 6823 | ); |
| 6824 | |
| 6825 | exit: |
| 6826 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6827 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6828 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6829 | if (_exception) { |
| 6830 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6831 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6832 | } |
| 6833 | |
| 6834 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6835 | static void |
| 6836 | android_glTexParameterfv__II_3FI |
| 6837 | (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] | 6838 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6839 | const char * _exceptionType = NULL; |
| 6840 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6841 | GLfloat *params_base = (GLfloat *) 0; |
| 6842 | jint _remaining; |
| 6843 | GLfloat *params = (GLfloat *) 0; |
| 6844 | |
| 6845 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6846 | _exception = 1; |
| 6847 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6848 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6849 | goto exit; |
| 6850 | } |
| 6851 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6852 | _exception = 1; |
| 6853 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6854 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6855 | goto exit; |
| 6856 | } |
| 6857 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6858 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6859 | _exception = 1; |
| 6860 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6861 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6862 | goto exit; |
| 6863 | } |
| 6864 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6865 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6866 | params = params_base + offset; |
| 6867 | |
| 6868 | glTexParameterfv( |
| 6869 | (GLenum)target, |
| 6870 | (GLenum)pname, |
| 6871 | (GLfloat *)params |
| 6872 | ); |
| 6873 | |
| 6874 | exit: |
| 6875 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6876 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6877 | JNI_ABORT); |
| 6878 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6879 | if (_exception) { |
| 6880 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6881 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6882 | } |
| 6883 | |
| 6884 | /* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ |
| 6885 | static void |
| 6886 | android_glTexParameterfv__IILjava_nio_FloatBuffer_2 |
| 6887 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6888 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6889 | const char * _exceptionType = NULL; |
| 6890 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6891 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6892 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6893 | jint _remaining; |
| 6894 | GLfloat *params = (GLfloat *) 0; |
| 6895 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 6896 | if (!params_buf) { |
| 6897 | _exception = 1; |
| 6898 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6899 | _exceptionMessage = "params == null"; |
| 6900 | goto exit; |
| 6901 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6902 | 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] | 6903 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6904 | _exception = 1; |
| 6905 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6906 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6907 | goto exit; |
| 6908 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6909 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6910 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6911 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 6912 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6913 | glTexParameterfv( |
| 6914 | (GLenum)target, |
| 6915 | (GLenum)pname, |
| 6916 | (GLfloat *)params |
| 6917 | ); |
| 6918 | |
| 6919 | exit: |
| 6920 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6921 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6922 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6923 | if (_exception) { |
| 6924 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6925 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6926 | } |
| 6927 | |
| 6928 | /* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ |
| 6929 | static void |
| 6930 | android_glTexParameteri__III |
| 6931 | (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { |
| 6932 | glTexParameteri( |
| 6933 | (GLenum)target, |
| 6934 | (GLenum)pname, |
| 6935 | (GLint)param |
| 6936 | ); |
| 6937 | } |
| 6938 | |
| 6939 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6940 | static void |
| 6941 | android_glTexParameteriv__II_3II |
| 6942 | (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] | 6943 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6944 | const char * _exceptionType = NULL; |
| 6945 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6946 | GLint *params_base = (GLint *) 0; |
| 6947 | jint _remaining; |
| 6948 | GLint *params = (GLint *) 0; |
| 6949 | |
| 6950 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6951 | _exception = 1; |
| 6952 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6953 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6954 | goto exit; |
| 6955 | } |
| 6956 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6957 | _exception = 1; |
| 6958 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6959 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6960 | goto exit; |
| 6961 | } |
| 6962 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 6963 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6964 | _exception = 1; |
| 6965 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 6966 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6967 | goto exit; |
| 6968 | } |
| 6969 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6970 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6971 | params = params_base + offset; |
| 6972 | |
| 6973 | glTexParameteriv( |
| 6974 | (GLenum)target, |
| 6975 | (GLenum)pname, |
| 6976 | (GLint *)params |
| 6977 | ); |
| 6978 | |
| 6979 | exit: |
| 6980 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6981 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6982 | JNI_ABORT); |
| 6983 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6984 | if (_exception) { |
| 6985 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 6986 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6987 | } |
| 6988 | |
| 6989 | /* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ |
| 6990 | static void |
| 6991 | android_glTexParameteriv__IILjava_nio_IntBuffer_2 |
| 6992 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 6993 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 6994 | const char * _exceptionType = NULL; |
| 6995 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 6996 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 6997 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 6998 | jint _remaining; |
| 6999 | GLint *params = (GLint *) 0; |
| 7000 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7001 | if (!params_buf) { |
| 7002 | _exception = 1; |
| 7003 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7004 | _exceptionMessage = "params == null"; |
| 7005 | goto exit; |
| 7006 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7007 | 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] | 7008 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7009 | _exception = 1; |
| 7010 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7011 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7012 | goto exit; |
| 7013 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7014 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7015 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7016 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 7017 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7018 | glTexParameteriv( |
| 7019 | (GLenum)target, |
| 7020 | (GLenum)pname, |
| 7021 | (GLint *)params |
| 7022 | ); |
| 7023 | |
| 7024 | exit: |
| 7025 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7026 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7027 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7028 | if (_exception) { |
| 7029 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7030 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7031 | } |
| 7032 | |
| 7033 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 7034 | static void |
| 7035 | android_glTexParameterxv__II_3II |
| 7036 | (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] | 7037 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7038 | const char * _exceptionType = NULL; |
| 7039 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7040 | GLfixed *params_base = (GLfixed *) 0; |
| 7041 | jint _remaining; |
| 7042 | GLfixed *params = (GLfixed *) 0; |
| 7043 | |
| 7044 | if (!params_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7045 | _exception = 1; |
| 7046 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7047 | _exceptionMessage = "params == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7048 | goto exit; |
| 7049 | } |
| 7050 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7051 | _exception = 1; |
| 7052 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7053 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7054 | goto exit; |
| 7055 | } |
| 7056 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 7057 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7058 | _exception = 1; |
| 7059 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7060 | _exceptionMessage = "length - offset < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7061 | goto exit; |
| 7062 | } |
| 7063 | params_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7064 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7065 | params = params_base + offset; |
| 7066 | |
| 7067 | glTexParameterxv( |
| 7068 | (GLenum)target, |
| 7069 | (GLenum)pname, |
| 7070 | (GLfixed *)params |
| 7071 | ); |
| 7072 | |
| 7073 | exit: |
| 7074 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7075 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7076 | JNI_ABORT); |
| 7077 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7078 | if (_exception) { |
| 7079 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7080 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7081 | } |
| 7082 | |
| 7083 | /* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */ |
| 7084 | static void |
| 7085 | android_glTexParameterxv__IILjava_nio_IntBuffer_2 |
| 7086 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7087 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7088 | const char * _exceptionType = NULL; |
| 7089 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7090 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7091 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7092 | jint _remaining; |
| 7093 | GLfixed *params = (GLfixed *) 0; |
| 7094 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7095 | if (!params_buf) { |
| 7096 | _exception = 1; |
| 7097 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7098 | _exceptionMessage = "params == null"; |
| 7099 | goto exit; |
| 7100 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7101 | 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] | 7102 | if (_remaining < 1) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7103 | _exception = 1; |
| 7104 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7105 | _exceptionMessage = "remaining() < 1 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7106 | goto exit; |
| 7107 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7108 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7109 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7110 | params = (GLfixed *) (_paramsBase + _bufferOffset); |
| 7111 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7112 | glTexParameterxv( |
| 7113 | (GLenum)target, |
| 7114 | (GLenum)pname, |
| 7115 | (GLfixed *)params |
| 7116 | ); |
| 7117 | |
| 7118 | exit: |
| 7119 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7120 | _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7121 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7122 | if (_exception) { |
| 7123 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7124 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7125 | } |
| 7126 | |
| 7127 | /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7128 | static void |
| 7129 | android_glVertexPointer__IIII |
| 7130 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
| 7131 | glVertexPointer( |
| 7132 | (GLint)size, |
| 7133 | (GLenum)type, |
| 7134 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7135 | reinterpret_cast<GLvoid *>(offset) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7136 | ); |
| 7137 | } |
| 7138 | |
| 7139 | /* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */ |
| 7140 | static void |
| 7141 | android_glCurrentPaletteMatrixOES__I |
| 7142 | (JNIEnv *_env, jobject _this, jint matrixpaletteindex) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7143 | glCurrentPaletteMatrixOES( |
| 7144 | (GLuint)matrixpaletteindex |
| 7145 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7146 | } |
| 7147 | |
| 7148 | /* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */ |
| 7149 | static void |
| 7150 | android_glDrawTexfOES__FFFFF |
| 7151 | (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) { |
| 7152 | glDrawTexfOES( |
| 7153 | (GLfloat)x, |
| 7154 | (GLfloat)y, |
| 7155 | (GLfloat)z, |
| 7156 | (GLfloat)width, |
| 7157 | (GLfloat)height |
| 7158 | ); |
| 7159 | } |
| 7160 | |
| 7161 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 7162 | static void |
| 7163 | android_glDrawTexfvOES___3FI |
| 7164 | (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7165 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7166 | const char * _exceptionType = NULL; |
| 7167 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7168 | GLfloat *coords_base = (GLfloat *) 0; |
| 7169 | jint _remaining; |
| 7170 | GLfloat *coords = (GLfloat *) 0; |
| 7171 | |
| 7172 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7173 | _exception = 1; |
| 7174 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7175 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7176 | goto exit; |
| 7177 | } |
| 7178 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7179 | _exception = 1; |
| 7180 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7181 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7182 | goto exit; |
| 7183 | } |
| 7184 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7185 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7186 | _exception = 1; |
| 7187 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7188 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7189 | goto exit; |
| 7190 | } |
| 7191 | coords_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7192 | _env->GetFloatArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7193 | coords = coords_base + offset; |
| 7194 | |
| 7195 | glDrawTexfvOES( |
| 7196 | (GLfloat *)coords |
| 7197 | ); |
| 7198 | |
| 7199 | exit: |
| 7200 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7201 | _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7202 | JNI_ABORT); |
| 7203 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7204 | if (_exception) { |
| 7205 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7206 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7207 | } |
| 7208 | |
| 7209 | /* void glDrawTexfvOES ( const GLfloat *coords ) */ |
| 7210 | static void |
| 7211 | android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 |
| 7212 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7213 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7214 | const char * _exceptionType = NULL; |
| 7215 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7216 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7217 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7218 | jint _remaining; |
| 7219 | GLfloat *coords = (GLfloat *) 0; |
| 7220 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7221 | if (!coords_buf) { |
| 7222 | _exception = 1; |
| 7223 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7224 | _exceptionMessage = "coords == null"; |
| 7225 | goto exit; |
| 7226 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7227 | 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] | 7228 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7229 | _exception = 1; |
| 7230 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7231 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7232 | goto exit; |
| 7233 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7234 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7235 | char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7236 | coords = (GLfloat *) (_coordsBase + _bufferOffset); |
| 7237 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7238 | glDrawTexfvOES( |
| 7239 | (GLfloat *)coords |
| 7240 | ); |
| 7241 | |
| 7242 | exit: |
| 7243 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7244 | _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7245 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7246 | if (_exception) { |
| 7247 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7248 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7249 | } |
| 7250 | |
| 7251 | /* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */ |
| 7252 | static void |
| 7253 | android_glDrawTexiOES__IIIII |
| 7254 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7255 | glDrawTexiOES( |
| 7256 | (GLint)x, |
| 7257 | (GLint)y, |
| 7258 | (GLint)z, |
| 7259 | (GLint)width, |
| 7260 | (GLint)height |
| 7261 | ); |
| 7262 | } |
| 7263 | |
| 7264 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 7265 | static void |
| 7266 | android_glDrawTexivOES___3II |
| 7267 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7268 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7269 | const char * _exceptionType = NULL; |
| 7270 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7271 | GLint *coords_base = (GLint *) 0; |
| 7272 | jint _remaining; |
| 7273 | GLint *coords = (GLint *) 0; |
| 7274 | |
| 7275 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7276 | _exception = 1; |
| 7277 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7278 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7279 | goto exit; |
| 7280 | } |
| 7281 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7282 | _exception = 1; |
| 7283 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7284 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7285 | goto exit; |
| 7286 | } |
| 7287 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7288 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7289 | _exception = 1; |
| 7290 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7291 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7292 | goto exit; |
| 7293 | } |
| 7294 | coords_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7295 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7296 | coords = coords_base + offset; |
| 7297 | |
| 7298 | glDrawTexivOES( |
| 7299 | (GLint *)coords |
| 7300 | ); |
| 7301 | |
| 7302 | exit: |
| 7303 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7304 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7305 | JNI_ABORT); |
| 7306 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7307 | if (_exception) { |
| 7308 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7309 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7310 | } |
| 7311 | |
| 7312 | /* void glDrawTexivOES ( const GLint *coords ) */ |
| 7313 | static void |
| 7314 | android_glDrawTexivOES__Ljava_nio_IntBuffer_2 |
| 7315 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7316 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7317 | const char * _exceptionType = NULL; |
| 7318 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7319 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7320 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7321 | jint _remaining; |
| 7322 | GLint *coords = (GLint *) 0; |
| 7323 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7324 | if (!coords_buf) { |
| 7325 | _exception = 1; |
| 7326 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7327 | _exceptionMessage = "coords == null"; |
| 7328 | goto exit; |
| 7329 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7330 | 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] | 7331 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7332 | _exception = 1; |
| 7333 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7334 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7335 | goto exit; |
| 7336 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7337 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7338 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7339 | coords = (GLint *) (_coordsBase + _bufferOffset); |
| 7340 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7341 | glDrawTexivOES( |
| 7342 | (GLint *)coords |
| 7343 | ); |
| 7344 | |
| 7345 | exit: |
| 7346 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7347 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7348 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7349 | if (_exception) { |
| 7350 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7351 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7352 | } |
| 7353 | |
| 7354 | /* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */ |
| 7355 | static void |
| 7356 | android_glDrawTexsOES__SSSSS |
| 7357 | (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) { |
| 7358 | glDrawTexsOES( |
| 7359 | (GLshort)x, |
| 7360 | (GLshort)y, |
| 7361 | (GLshort)z, |
| 7362 | (GLshort)width, |
| 7363 | (GLshort)height |
| 7364 | ); |
| 7365 | } |
| 7366 | |
| 7367 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7368 | static void |
| 7369 | android_glDrawTexsvOES___3SI |
| 7370 | (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7371 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7372 | const char * _exceptionType = NULL; |
| 7373 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7374 | GLshort *coords_base = (GLshort *) 0; |
| 7375 | jint _remaining; |
| 7376 | GLshort *coords = (GLshort *) 0; |
| 7377 | |
| 7378 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7379 | _exception = 1; |
| 7380 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7381 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7382 | goto exit; |
| 7383 | } |
| 7384 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7385 | _exception = 1; |
| 7386 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7387 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7388 | goto exit; |
| 7389 | } |
| 7390 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7391 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7392 | _exception = 1; |
| 7393 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7394 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7395 | goto exit; |
| 7396 | } |
| 7397 | coords_base = (GLshort *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7398 | _env->GetShortArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7399 | coords = coords_base + offset; |
| 7400 | |
| 7401 | glDrawTexsvOES( |
| 7402 | (GLshort *)coords |
| 7403 | ); |
| 7404 | |
| 7405 | exit: |
| 7406 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7407 | _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7408 | JNI_ABORT); |
| 7409 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7410 | if (_exception) { |
| 7411 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7412 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7413 | } |
| 7414 | |
| 7415 | /* void glDrawTexsvOES ( const GLshort *coords ) */ |
| 7416 | static void |
| 7417 | android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 |
| 7418 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7419 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7420 | const char * _exceptionType = NULL; |
| 7421 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7422 | jshortArray _array = (jshortArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7423 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7424 | jint _remaining; |
| 7425 | GLshort *coords = (GLshort *) 0; |
| 7426 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7427 | if (!coords_buf) { |
| 7428 | _exception = 1; |
| 7429 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7430 | _exceptionMessage = "coords == null"; |
| 7431 | goto exit; |
| 7432 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7433 | 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] | 7434 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7435 | _exception = 1; |
| 7436 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7437 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7438 | goto exit; |
| 7439 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7440 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7441 | char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7442 | coords = (GLshort *) (_coordsBase + _bufferOffset); |
| 7443 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7444 | glDrawTexsvOES( |
| 7445 | (GLshort *)coords |
| 7446 | ); |
| 7447 | |
| 7448 | exit: |
| 7449 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7450 | _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7451 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7452 | if (_exception) { |
| 7453 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7454 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7455 | } |
| 7456 | |
| 7457 | /* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */ |
| 7458 | static void |
| 7459 | android_glDrawTexxOES__IIIII |
| 7460 | (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) { |
| 7461 | glDrawTexxOES( |
| 7462 | (GLfixed)x, |
| 7463 | (GLfixed)y, |
| 7464 | (GLfixed)z, |
| 7465 | (GLfixed)width, |
| 7466 | (GLfixed)height |
| 7467 | ); |
| 7468 | } |
| 7469 | |
| 7470 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7471 | static void |
| 7472 | android_glDrawTexxvOES___3II |
| 7473 | (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7474 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7475 | const char * _exceptionType = NULL; |
| 7476 | const char * _exceptionMessage = NULL; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7477 | GLfixed *coords_base = (GLfixed *) 0; |
| 7478 | jint _remaining; |
| 7479 | GLfixed *coords = (GLfixed *) 0; |
| 7480 | |
| 7481 | if (!coords_ref) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7482 | _exception = 1; |
| 7483 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7484 | _exceptionMessage = "coords == null"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7485 | goto exit; |
| 7486 | } |
| 7487 | if (offset < 0) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7488 | _exception = 1; |
| 7489 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7490 | _exceptionMessage = "offset < 0"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7491 | goto exit; |
| 7492 | } |
| 7493 | _remaining = _env->GetArrayLength(coords_ref) - offset; |
| 7494 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7495 | _exception = 1; |
| 7496 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7497 | _exceptionMessage = "length - offset < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7498 | goto exit; |
| 7499 | } |
| 7500 | coords_base = (GLfixed *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7501 | _env->GetIntArrayElements(coords_ref, (jboolean *)0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7502 | coords = coords_base + offset; |
| 7503 | |
| 7504 | glDrawTexxvOES( |
| 7505 | (GLfixed *)coords |
| 7506 | ); |
| 7507 | |
| 7508 | exit: |
| 7509 | if (coords_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7510 | _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7511 | JNI_ABORT); |
| 7512 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7513 | if (_exception) { |
| 7514 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7515 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7516 | } |
| 7517 | |
| 7518 | /* void glDrawTexxvOES ( const GLfixed *coords ) */ |
| 7519 | static void |
| 7520 | android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 |
| 7521 | (JNIEnv *_env, jobject _this, jobject coords_buf) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7522 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7523 | const char * _exceptionType = NULL; |
| 7524 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7525 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7526 | jint _bufferOffset = (jint) 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7527 | jint _remaining; |
| 7528 | GLfixed *coords = (GLfixed *) 0; |
| 7529 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7530 | if (!coords_buf) { |
| 7531 | _exception = 1; |
| 7532 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7533 | _exceptionMessage = "coords == null"; |
| 7534 | goto exit; |
| 7535 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7536 | 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] | 7537 | if (_remaining < 5) { |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7538 | _exception = 1; |
| 7539 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7540 | _exceptionMessage = "remaining() < 5 < needed"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7541 | goto exit; |
| 7542 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7543 | if (coords == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7544 | char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7545 | coords = (GLfixed *) (_coordsBase + _bufferOffset); |
| 7546 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7547 | glDrawTexxvOES( |
| 7548 | (GLfixed *)coords |
| 7549 | ); |
| 7550 | |
| 7551 | exit: |
| 7552 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7553 | _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7554 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7555 | if (_exception) { |
| 7556 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7557 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7558 | } |
| 7559 | |
| 7560 | /* void glLoadPaletteFromModelViewMatrixOES ( void ) */ |
| 7561 | static void |
| 7562 | android_glLoadPaletteFromModelViewMatrixOES__ |
| 7563 | (JNIEnv *_env, jobject _this) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7564 | glLoadPaletteFromModelViewMatrixOES(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7565 | } |
| 7566 | |
| 7567 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7568 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7569 | android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7570 | (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] | 7571 | jint _exception = 0; |
| 7572 | const char * _exceptionType = NULL; |
| 7573 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7574 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7575 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7576 | jint _remaining; |
| 7577 | GLvoid *pointer = (GLvoid *) 0; |
| 7578 | |
| 7579 | if (pointer_buf) { |
| 7580 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7581 | if ( ! pointer ) { |
| 7582 | return; |
| 7583 | } |
| 7584 | } |
| 7585 | glMatrixIndexPointerOESBounds( |
| 7586 | (GLint)size, |
| 7587 | (GLenum)type, |
| 7588 | (GLsizei)stride, |
| 7589 | (GLvoid *)pointer, |
| 7590 | (GLsizei)remaining |
| 7591 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7592 | if (_exception) { |
| 7593 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7594 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7595 | } |
| 7596 | |
| 7597 | /* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7598 | static void |
| 7599 | android_glMatrixIndexPointerOES__IIII |
| 7600 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7601 | glMatrixIndexPointerOES( |
| 7602 | (GLint)size, |
| 7603 | (GLenum)type, |
| 7604 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7605 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7606 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7607 | } |
| 7608 | |
| 7609 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */ |
| 7610 | static void |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7611 | android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I |
| 7612 | (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] | 7613 | jint _exception = 0; |
| 7614 | const char * _exceptionType = NULL; |
| 7615 | const char * _exceptionMessage = NULL; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7616 | jarray _array = (jarray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7617 | jint _bufferOffset = (jint) 0; |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7618 | jint _remaining; |
| 7619 | GLvoid *pointer = (GLvoid *) 0; |
| 7620 | |
| 7621 | if (pointer_buf) { |
| 7622 | pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf); |
| 7623 | if ( ! pointer ) { |
| 7624 | return; |
| 7625 | } |
| 7626 | } |
| 7627 | glWeightPointerOESBounds( |
| 7628 | (GLint)size, |
| 7629 | (GLenum)type, |
| 7630 | (GLsizei)stride, |
| 7631 | (GLvoid *)pointer, |
| 7632 | (GLsizei)remaining |
| 7633 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7634 | if (_exception) { |
| 7635 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7636 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7637 | } |
| 7638 | |
| 7639 | /* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */ |
| 7640 | static void |
| 7641 | android_glWeightPointerOES__IIII |
| 7642 | (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) { |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7643 | glWeightPointerOES( |
| 7644 | (GLint)size, |
| 7645 | (GLenum)type, |
| 7646 | (GLsizei)stride, |
Ashok Bhat | 01c26ea | 2014-02-24 09:49:07 +0000 | [diff] [blame] | 7647 | reinterpret_cast<GLvoid *>(offset) |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 7648 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7649 | } |
| 7650 | |
| 7651 | /* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */ |
| 7652 | static void |
| 7653 | android_glBindFramebufferOES__II |
| 7654 | (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7655 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7656 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7657 | "glBindFramebufferOES"); |
| 7658 | return; |
| 7659 | } |
| 7660 | glBindFramebufferOES( |
| 7661 | (GLint)target, |
| 7662 | (GLint)framebuffer |
| 7663 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7664 | } |
| 7665 | |
| 7666 | /* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */ |
| 7667 | static void |
| 7668 | android_glBindRenderbufferOES__II |
| 7669 | (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7670 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7671 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7672 | "glBindRenderbufferOES"); |
| 7673 | return; |
| 7674 | } |
| 7675 | glBindRenderbufferOES( |
| 7676 | (GLint)target, |
| 7677 | (GLint)renderbuffer |
| 7678 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7679 | } |
| 7680 | |
| 7681 | /* void glBlendEquation ( GLint mode ) */ |
| 7682 | static void |
| 7683 | android_glBlendEquation__I |
| 7684 | (JNIEnv *_env, jobject _this, jint mode) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7685 | if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7686 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7687 | "glBlendEquation"); |
| 7688 | return; |
| 7689 | } |
| 7690 | glBlendEquation( |
| 7691 | (GLint)mode |
| 7692 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7693 | } |
| 7694 | |
| 7695 | /* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */ |
| 7696 | static void |
| 7697 | android_glBlendEquationSeparate__II |
| 7698 | (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7699 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7700 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7701 | "glBlendEquationSeparate"); |
| 7702 | return; |
| 7703 | } |
| 7704 | glBlendEquationSeparate( |
| 7705 | (GLint)modeRGB, |
| 7706 | (GLint)modeAlpha |
| 7707 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7708 | } |
| 7709 | |
| 7710 | /* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */ |
| 7711 | static void |
| 7712 | android_glBlendFuncSeparate__IIII |
| 7713 | (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7714 | if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7715 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7716 | "glBlendFuncSeparate"); |
| 7717 | return; |
| 7718 | } |
| 7719 | glBlendFuncSeparate( |
| 7720 | (GLint)srcRGB, |
| 7721 | (GLint)dstRGB, |
| 7722 | (GLint)srcAlpha, |
| 7723 | (GLint)dstAlpha |
| 7724 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7725 | } |
| 7726 | |
| 7727 | /* GLint glCheckFramebufferStatusOES ( GLint target ) */ |
| 7728 | static jint |
| 7729 | android_glCheckFramebufferStatusOES__I |
| 7730 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7731 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7732 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7733 | "glCheckFramebufferStatusOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7734 | return 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7735 | } |
| 7736 | GLint _returnValue = 0; |
| 7737 | _returnValue = glCheckFramebufferStatusOES( |
| 7738 | (GLint)target |
| 7739 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 7740 | return (jint)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7741 | } |
| 7742 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7743 | /* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7744 | static void |
| 7745 | android_glDeleteFramebuffersOES__I_3II |
| 7746 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7747 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7748 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7749 | "glDeleteFramebuffersOES"); |
| 7750 | return; |
| 7751 | } |
| 7752 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7753 | const char * _exceptionType = NULL; |
| 7754 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7755 | GLuint *framebuffers_base = (GLuint *) 0; |
| 7756 | jint _remaining; |
| 7757 | GLuint *framebuffers = (GLuint *) 0; |
| 7758 | |
| 7759 | if (!framebuffers_ref) { |
| 7760 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7761 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7762 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7763 | goto exit; |
| 7764 | } |
| 7765 | if (offset < 0) { |
| 7766 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7767 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7768 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7769 | goto exit; |
| 7770 | } |
| 7771 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 7772 | if (_remaining < n) { |
| 7773 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7774 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7775 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7776 | goto exit; |
| 7777 | } |
| 7778 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7779 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7780 | framebuffers = framebuffers_base + offset; |
| 7781 | |
| 7782 | glDeleteFramebuffersOES( |
| 7783 | (GLint)n, |
| 7784 | (GLuint *)framebuffers |
| 7785 | ); |
| 7786 | |
| 7787 | exit: |
| 7788 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7789 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7790 | _exception ? JNI_ABORT: 0); |
| 7791 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7792 | if (_exception) { |
| 7793 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7794 | } |
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__ILjava_nio_IntBuffer_2 |
| 7800 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
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; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7809 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7810 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7811 | jint _remaining; |
| 7812 | GLuint *framebuffers = (GLuint *) 0; |
| 7813 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7814 | if (!framebuffers_buf) { |
| 7815 | _exception = 1; |
| 7816 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7817 | _exceptionMessage = "framebuffers == null"; |
| 7818 | goto exit; |
| 7819 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7820 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7821 | if (_remaining < n) { |
| 7822 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7823 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7824 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7825 | goto exit; |
| 7826 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7827 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7828 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7829 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 7830 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7831 | glDeleteFramebuffersOES( |
| 7832 | (GLint)n, |
| 7833 | (GLuint *)framebuffers |
| 7834 | ); |
| 7835 | |
| 7836 | exit: |
| 7837 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7838 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7839 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7840 | if (_exception) { |
| 7841 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7842 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7843 | } |
| 7844 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7845 | /* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7846 | static void |
| 7847 | android_glDeleteRenderbuffersOES__I_3II |
| 7848 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7849 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7850 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7851 | "glDeleteRenderbuffersOES"); |
| 7852 | return; |
| 7853 | } |
| 7854 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 7855 | const char * _exceptionType = NULL; |
| 7856 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7857 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 7858 | jint _remaining; |
| 7859 | GLuint *renderbuffers = (GLuint *) 0; |
| 7860 | |
| 7861 | if (!renderbuffers_ref) { |
| 7862 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7863 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7864 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7865 | goto exit; |
| 7866 | } |
| 7867 | if (offset < 0) { |
| 7868 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7869 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7870 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7871 | goto exit; |
| 7872 | } |
| 7873 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 7874 | if (_remaining < n) { |
| 7875 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7876 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7877 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7878 | goto exit; |
| 7879 | } |
| 7880 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7881 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7882 | renderbuffers = renderbuffers_base + offset; |
| 7883 | |
| 7884 | glDeleteRenderbuffersOES( |
| 7885 | (GLint)n, |
| 7886 | (GLuint *)renderbuffers |
| 7887 | ); |
| 7888 | |
| 7889 | exit: |
| 7890 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7891 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7892 | _exception ? JNI_ABORT: 0); |
| 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__ILjava_nio_IntBuffer_2 |
| 7902 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
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; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7911 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7912 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7913 | jint _remaining; |
| 7914 | GLuint *renderbuffers = (GLuint *) 0; |
| 7915 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 7916 | if (!renderbuffers_buf) { |
| 7917 | _exception = 1; |
| 7918 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7919 | _exceptionMessage = "renderbuffers == null"; |
| 7920 | goto exit; |
| 7921 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7922 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7923 | if (_remaining < n) { |
| 7924 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7925 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 7926 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7927 | goto exit; |
| 7928 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7929 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7930 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 7931 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 7932 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7933 | glDeleteRenderbuffersOES( |
| 7934 | (GLint)n, |
| 7935 | (GLuint *)renderbuffers |
| 7936 | ); |
| 7937 | |
| 7938 | exit: |
| 7939 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 7940 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7941 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 7942 | if (_exception) { |
| 7943 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 7944 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7945 | } |
| 7946 | |
| 7947 | /* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */ |
| 7948 | static void |
| 7949 | android_glFramebufferRenderbufferOES__IIII |
| 7950 | (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7951 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7952 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7953 | "glFramebufferRenderbufferOES"); |
| 7954 | return; |
| 7955 | } |
| 7956 | glFramebufferRenderbufferOES( |
| 7957 | (GLint)target, |
| 7958 | (GLint)attachment, |
| 7959 | (GLint)renderbuffertarget, |
| 7960 | (GLint)renderbuffer |
| 7961 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7962 | } |
| 7963 | |
| 7964 | /* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */ |
| 7965 | static void |
| 7966 | android_glFramebufferTexture2DOES__IIIII |
| 7967 | (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] | 7968 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7969 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7970 | "glFramebufferTexture2DOES"); |
| 7971 | return; |
| 7972 | } |
| 7973 | glFramebufferTexture2DOES( |
| 7974 | (GLint)target, |
| 7975 | (GLint)attachment, |
| 7976 | (GLint)textarget, |
| 7977 | (GLint)texture, |
| 7978 | (GLint)level |
| 7979 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7980 | } |
| 7981 | |
| 7982 | /* void glGenerateMipmapOES ( GLint target ) */ |
| 7983 | static void |
| 7984 | android_glGenerateMipmapOES__I |
| 7985 | (JNIEnv *_env, jobject _this, jint target) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7986 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 7987 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7988 | "glGenerateMipmapOES"); |
| 7989 | return; |
| 7990 | } |
| 7991 | glGenerateMipmapOES( |
| 7992 | (GLint)target |
| 7993 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7994 | } |
| 7995 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 7996 | /* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 7997 | static void |
| 7998 | android_glGenFramebuffersOES__I_3II |
| 7999 | (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8000 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8001 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8002 | "glGenFramebuffersOES"); |
| 8003 | return; |
| 8004 | } |
| 8005 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8006 | const char * _exceptionType = NULL; |
| 8007 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8008 | GLuint *framebuffers_base = (GLuint *) 0; |
| 8009 | jint _remaining; |
| 8010 | GLuint *framebuffers = (GLuint *) 0; |
| 8011 | |
| 8012 | if (!framebuffers_ref) { |
| 8013 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8014 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8015 | _exceptionMessage = "framebuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8016 | goto exit; |
| 8017 | } |
| 8018 | if (offset < 0) { |
| 8019 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8020 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8021 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8022 | goto exit; |
| 8023 | } |
| 8024 | _remaining = _env->GetArrayLength(framebuffers_ref) - offset; |
| 8025 | if (_remaining < n) { |
| 8026 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8027 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8028 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8029 | goto exit; |
| 8030 | } |
| 8031 | framebuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8032 | _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8033 | framebuffers = framebuffers_base + offset; |
| 8034 | |
| 8035 | glGenFramebuffersOES( |
| 8036 | (GLint)n, |
| 8037 | (GLuint *)framebuffers |
| 8038 | ); |
| 8039 | |
| 8040 | exit: |
| 8041 | if (framebuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8042 | _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8043 | _exception ? JNI_ABORT: 0); |
| 8044 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8045 | if (_exception) { |
| 8046 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 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__ILjava_nio_IntBuffer_2 |
| 8053 | (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { |
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; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8062 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8063 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8064 | jint _remaining; |
| 8065 | GLuint *framebuffers = (GLuint *) 0; |
| 8066 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8067 | if (!framebuffers_buf) { |
| 8068 | _exception = 1; |
| 8069 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8070 | _exceptionMessage = "framebuffers == null"; |
| 8071 | goto exit; |
| 8072 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8073 | framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8074 | if (_remaining < n) { |
| 8075 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8076 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8077 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8078 | goto exit; |
| 8079 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8080 | if (framebuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8081 | char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8082 | framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); |
| 8083 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8084 | glGenFramebuffersOES( |
| 8085 | (GLint)n, |
| 8086 | (GLuint *)framebuffers |
| 8087 | ); |
| 8088 | |
| 8089 | exit: |
| 8090 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8091 | _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8092 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8093 | if (_exception) { |
| 8094 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8095 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8096 | } |
| 8097 | |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8098 | /* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8099 | static void |
| 8100 | android_glGenRenderbuffersOES__I_3II |
| 8101 | (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8102 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8103 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8104 | "glGenRenderbuffersOES"); |
| 8105 | return; |
| 8106 | } |
| 8107 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8108 | const char * _exceptionType = NULL; |
| 8109 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8110 | GLuint *renderbuffers_base = (GLuint *) 0; |
| 8111 | jint _remaining; |
| 8112 | GLuint *renderbuffers = (GLuint *) 0; |
| 8113 | |
| 8114 | if (!renderbuffers_ref) { |
| 8115 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8116 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8117 | _exceptionMessage = "renderbuffers == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8118 | goto exit; |
| 8119 | } |
| 8120 | if (offset < 0) { |
| 8121 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8122 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8123 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8124 | goto exit; |
| 8125 | } |
| 8126 | _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; |
| 8127 | if (_remaining < n) { |
| 8128 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8129 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8130 | _exceptionMessage = "length - offset < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8131 | goto exit; |
| 8132 | } |
| 8133 | renderbuffers_base = (GLuint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8134 | _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8135 | renderbuffers = renderbuffers_base + offset; |
| 8136 | |
| 8137 | glGenRenderbuffersOES( |
| 8138 | (GLint)n, |
| 8139 | (GLuint *)renderbuffers |
| 8140 | ); |
| 8141 | |
| 8142 | exit: |
| 8143 | if (renderbuffers_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8144 | _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8145 | _exception ? JNI_ABORT: 0); |
| 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__ILjava_nio_IntBuffer_2 |
| 8155 | (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { |
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; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8164 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8165 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8166 | jint _remaining; |
| 8167 | GLuint *renderbuffers = (GLuint *) 0; |
| 8168 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8169 | if (!renderbuffers_buf) { |
| 8170 | _exception = 1; |
| 8171 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8172 | _exceptionMessage = "renderbuffers == null"; |
| 8173 | goto exit; |
| 8174 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8175 | renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8176 | if (_remaining < n) { |
| 8177 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8178 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8179 | _exceptionMessage = "remaining() < n < needed"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8180 | goto exit; |
| 8181 | } |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8182 | if (renderbuffers == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8183 | char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8184 | renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); |
| 8185 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8186 | glGenRenderbuffersOES( |
| 8187 | (GLint)n, |
| 8188 | (GLuint *)renderbuffers |
| 8189 | ); |
| 8190 | |
| 8191 | exit: |
| 8192 | if (_array) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8193 | _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8194 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8195 | if (_exception) { |
| 8196 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8197 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8198 | } |
| 8199 | |
| 8200 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 8201 | static void |
| 8202 | android_glGetFramebufferAttachmentParameterivOES__III_3II |
| 8203 | (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] | 8204 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8205 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8206 | "glGetFramebufferAttachmentParameterivOES"); |
| 8207 | return; |
| 8208 | } |
| 8209 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8210 | const char * _exceptionType = NULL; |
| 8211 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8212 | GLint *params_base = (GLint *) 0; |
| 8213 | jint _remaining; |
| 8214 | GLint *params = (GLint *) 0; |
| 8215 | |
| 8216 | if (!params_ref) { |
| 8217 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8218 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8219 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8220 | goto exit; |
| 8221 | } |
| 8222 | if (offset < 0) { |
| 8223 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8224 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8225 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8226 | goto exit; |
| 8227 | } |
| 8228 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8229 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8230 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8231 | params = params_base + offset; |
| 8232 | |
| 8233 | glGetFramebufferAttachmentParameterivOES( |
| 8234 | (GLint)target, |
| 8235 | (GLint)attachment, |
| 8236 | (GLint)pname, |
| 8237 | (GLint *)params |
| 8238 | ); |
| 8239 | |
| 8240 | exit: |
| 8241 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8242 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8243 | _exception ? JNI_ABORT: 0); |
| 8244 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8245 | if (_exception) { |
| 8246 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8247 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8248 | } |
| 8249 | |
| 8250 | /* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */ |
| 8251 | static void |
| 8252 | android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 |
| 8253 | (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] | 8254 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8255 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8256 | "glGetFramebufferAttachmentParameterivOES"); |
| 8257 | return; |
| 8258 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8259 | jint _exception = 0; |
| 8260 | const char * _exceptionType = NULL; |
| 8261 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8262 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8263 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8264 | jint _remaining; |
| 8265 | GLint *params = (GLint *) 0; |
| 8266 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8267 | if (!params_buf) { |
| 8268 | _exception = 1; |
| 8269 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8270 | _exceptionMessage = "params == null"; |
| 8271 | goto exit; |
| 8272 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8273 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8274 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8275 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8276 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8277 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8278 | glGetFramebufferAttachmentParameterivOES( |
| 8279 | (GLint)target, |
| 8280 | (GLint)attachment, |
| 8281 | (GLint)pname, |
| 8282 | (GLint *)params |
| 8283 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8284 | |
| 8285 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8286 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8287 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8288 | } |
| 8289 | if (_exception) { |
| 8290 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8291 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8292 | } |
| 8293 | |
| 8294 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 8295 | static void |
| 8296 | android_glGetRenderbufferParameterivOES__II_3II |
| 8297 | (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] | 8298 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8299 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8300 | "glGetRenderbufferParameterivOES"); |
| 8301 | return; |
| 8302 | } |
| 8303 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8304 | const char * _exceptionType = NULL; |
| 8305 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8306 | GLint *params_base = (GLint *) 0; |
| 8307 | jint _remaining; |
| 8308 | GLint *params = (GLint *) 0; |
| 8309 | |
| 8310 | if (!params_ref) { |
| 8311 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8312 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8313 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8314 | goto exit; |
| 8315 | } |
| 8316 | if (offset < 0) { |
| 8317 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8318 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8319 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8320 | goto exit; |
| 8321 | } |
| 8322 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8323 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8324 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8325 | params = params_base + offset; |
| 8326 | |
| 8327 | glGetRenderbufferParameterivOES( |
| 8328 | (GLint)target, |
| 8329 | (GLint)pname, |
| 8330 | (GLint *)params |
| 8331 | ); |
| 8332 | |
| 8333 | exit: |
| 8334 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8335 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8336 | _exception ? JNI_ABORT: 0); |
| 8337 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8338 | if (_exception) { |
| 8339 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8340 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8341 | } |
| 8342 | |
| 8343 | /* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */ |
| 8344 | static void |
| 8345 | android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 |
| 8346 | (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8347 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8348 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8349 | "glGetRenderbufferParameterivOES"); |
| 8350 | return; |
| 8351 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8352 | jint _exception = 0; |
| 8353 | const char * _exceptionType = NULL; |
| 8354 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8355 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8356 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8357 | jint _remaining; |
| 8358 | GLint *params = (GLint *) 0; |
| 8359 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8360 | if (!params_buf) { |
| 8361 | _exception = 1; |
| 8362 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8363 | _exceptionMessage = "params == null"; |
| 8364 | goto exit; |
| 8365 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8366 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8367 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8368 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8369 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8370 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8371 | glGetRenderbufferParameterivOES( |
| 8372 | (GLint)target, |
| 8373 | (GLint)pname, |
| 8374 | (GLint *)params |
| 8375 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8376 | |
| 8377 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8378 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8379 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8380 | } |
| 8381 | if (_exception) { |
| 8382 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8383 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8384 | } |
| 8385 | |
| 8386 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8387 | static void |
| 8388 | android_glGetTexGenfv__II_3FI |
| 8389 | (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] | 8390 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8391 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8392 | "glGetTexGenfv"); |
| 8393 | return; |
| 8394 | } |
| 8395 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8396 | const char * _exceptionType = NULL; |
| 8397 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8398 | GLfloat *params_base = (GLfloat *) 0; |
| 8399 | jint _remaining; |
| 8400 | GLfloat *params = (GLfloat *) 0; |
| 8401 | |
| 8402 | if (!params_ref) { |
| 8403 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8404 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8405 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8406 | goto exit; |
| 8407 | } |
| 8408 | if (offset < 0) { |
| 8409 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8410 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8411 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8412 | goto exit; |
| 8413 | } |
| 8414 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8415 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8416 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8417 | params = params_base + offset; |
| 8418 | |
| 8419 | glGetTexGenfv( |
| 8420 | (GLint)coord, |
| 8421 | (GLint)pname, |
| 8422 | (GLfloat *)params |
| 8423 | ); |
| 8424 | |
| 8425 | exit: |
| 8426 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8427 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8428 | _exception ? JNI_ABORT: 0); |
| 8429 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8430 | if (_exception) { |
| 8431 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8432 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8433 | } |
| 8434 | |
| 8435 | /* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8436 | static void |
| 8437 | android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8438 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8439 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8440 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8441 | "glGetTexGenfv"); |
| 8442 | return; |
| 8443 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8444 | jint _exception = 0; |
| 8445 | const char * _exceptionType = NULL; |
| 8446 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8447 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8448 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8449 | jint _remaining; |
| 8450 | GLfloat *params = (GLfloat *) 0; |
| 8451 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8452 | if (!params_buf) { |
| 8453 | _exception = 1; |
| 8454 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8455 | _exceptionMessage = "params == null"; |
| 8456 | goto exit; |
| 8457 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8458 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8459 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8460 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8461 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8462 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8463 | glGetTexGenfv( |
| 8464 | (GLint)coord, |
| 8465 | (GLint)pname, |
| 8466 | (GLfloat *)params |
| 8467 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8468 | |
| 8469 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8470 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8471 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 8472 | } |
| 8473 | if (_exception) { |
| 8474 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8475 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8476 | } |
| 8477 | |
| 8478 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8479 | static void |
| 8480 | android_glGetTexGeniv__II_3II |
| 8481 | (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] | 8482 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8483 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8484 | "glGetTexGeniv"); |
| 8485 | return; |
| 8486 | } |
| 8487 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8488 | const char * _exceptionType = NULL; |
| 8489 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8490 | GLint *params_base = (GLint *) 0; |
| 8491 | jint _remaining; |
| 8492 | GLint *params = (GLint *) 0; |
| 8493 | |
| 8494 | if (!params_ref) { |
| 8495 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8496 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8497 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8498 | goto exit; |
| 8499 | } |
| 8500 | if (offset < 0) { |
| 8501 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8502 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8503 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8504 | goto exit; |
| 8505 | } |
| 8506 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8507 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8508 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8509 | params = params_base + offset; |
| 8510 | |
| 8511 | glGetTexGeniv( |
| 8512 | (GLint)coord, |
| 8513 | (GLint)pname, |
| 8514 | (GLint *)params |
| 8515 | ); |
| 8516 | |
| 8517 | exit: |
| 8518 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8519 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8520 | _exception ? JNI_ABORT: 0); |
| 8521 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8522 | if (_exception) { |
| 8523 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8524 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8525 | } |
| 8526 | |
| 8527 | /* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8528 | static void |
| 8529 | android_glGetTexGeniv__IILjava_nio_IntBuffer_2 |
| 8530 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8531 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8532 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8533 | "glGetTexGeniv"); |
| 8534 | return; |
| 8535 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8536 | jint _exception = 0; |
| 8537 | const char * _exceptionType = NULL; |
| 8538 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8539 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8540 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8541 | jint _remaining; |
| 8542 | GLint *params = (GLint *) 0; |
| 8543 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8544 | if (!params_buf) { |
| 8545 | _exception = 1; |
| 8546 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8547 | _exceptionMessage = "params == null"; |
| 8548 | goto exit; |
| 8549 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8550 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8551 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8552 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8553 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8554 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8555 | glGetTexGeniv( |
| 8556 | (GLint)coord, |
| 8557 | (GLint)pname, |
| 8558 | (GLint *)params |
| 8559 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8560 | |
| 8561 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8562 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8563 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8564 | } |
| 8565 | if (_exception) { |
| 8566 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8567 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8568 | } |
| 8569 | |
| 8570 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8571 | static void |
| 8572 | android_glGetTexGenxv__II_3II |
| 8573 | (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] | 8574 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8575 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8576 | "glGetTexGenxv"); |
| 8577 | return; |
| 8578 | } |
| 8579 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8580 | const char * _exceptionType = NULL; |
| 8581 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8582 | GLint *params_base = (GLint *) 0; |
| 8583 | jint _remaining; |
| 8584 | GLint *params = (GLint *) 0; |
| 8585 | |
| 8586 | if (!params_ref) { |
| 8587 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8588 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8589 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8590 | goto exit; |
| 8591 | } |
| 8592 | if (offset < 0) { |
| 8593 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8594 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8595 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8596 | goto exit; |
| 8597 | } |
| 8598 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8599 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8600 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8601 | params = params_base + offset; |
| 8602 | |
| 8603 | glGetTexGenxv( |
| 8604 | (GLint)coord, |
| 8605 | (GLint)pname, |
| 8606 | (GLint *)params |
| 8607 | ); |
| 8608 | |
| 8609 | exit: |
| 8610 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8611 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8612 | _exception ? JNI_ABORT: 0); |
| 8613 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8614 | if (_exception) { |
| 8615 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8616 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8617 | } |
| 8618 | |
| 8619 | /* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8620 | static void |
| 8621 | android_glGetTexGenxv__IILjava_nio_IntBuffer_2 |
| 8622 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8623 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8624 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8625 | "glGetTexGenxv"); |
| 8626 | return; |
| 8627 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8628 | jint _exception = 0; |
| 8629 | const char * _exceptionType = NULL; |
| 8630 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8631 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8632 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8633 | jint _remaining; |
| 8634 | GLint *params = (GLint *) 0; |
| 8635 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8636 | if (!params_buf) { |
| 8637 | _exception = 1; |
| 8638 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8639 | _exceptionMessage = "params == null"; |
| 8640 | goto exit; |
| 8641 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8642 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8643 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8644 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8645 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8646 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8647 | glGetTexGenxv( |
| 8648 | (GLint)coord, |
| 8649 | (GLint)pname, |
| 8650 | (GLint *)params |
| 8651 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8652 | |
| 8653 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8654 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8655 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8656 | } |
| 8657 | if (_exception) { |
| 8658 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8659 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8660 | } |
| 8661 | |
| 8662 | /* GLboolean glIsFramebufferOES ( GLint framebuffer ) */ |
| 8663 | static jboolean |
| 8664 | android_glIsFramebufferOES__I |
| 8665 | (JNIEnv *_env, jobject _this, jint framebuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8666 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8667 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8668 | "glIsFramebufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8669 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8670 | } |
| 8671 | GLboolean _returnValue = JNI_FALSE; |
| 8672 | _returnValue = glIsFramebufferOES( |
| 8673 | (GLint)framebuffer |
| 8674 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8675 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8676 | } |
| 8677 | |
| 8678 | /* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */ |
| 8679 | static jboolean |
| 8680 | android_glIsRenderbufferOES__I |
| 8681 | (JNIEnv *_env, jobject _this, jint renderbuffer) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8682 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8683 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8684 | "glIsRenderbufferOES"); |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8685 | return JNI_FALSE; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8686 | } |
| 8687 | GLboolean _returnValue = JNI_FALSE; |
| 8688 | _returnValue = glIsRenderbufferOES( |
| 8689 | (GLint)renderbuffer |
| 8690 | ); |
Elliott Hughes | 428d3fc | 2013-09-24 17:15:41 -0700 | [diff] [blame] | 8691 | return (jboolean)_returnValue; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8692 | } |
| 8693 | |
| 8694 | /* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */ |
| 8695 | static void |
| 8696 | android_glRenderbufferStorageOES__IIII |
| 8697 | (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8698 | if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8699 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8700 | "glRenderbufferStorageOES"); |
| 8701 | return; |
| 8702 | } |
| 8703 | glRenderbufferStorageOES( |
| 8704 | (GLint)target, |
| 8705 | (GLint)internalformat, |
| 8706 | (GLint)width, |
| 8707 | (GLint)height |
| 8708 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8709 | } |
| 8710 | |
| 8711 | /* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */ |
| 8712 | static void |
| 8713 | android_glTexGenf__IIF |
| 8714 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8715 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8716 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8717 | "glTexGenf"); |
| 8718 | return; |
| 8719 | } |
| 8720 | glTexGenf( |
| 8721 | (GLint)coord, |
| 8722 | (GLint)pname, |
| 8723 | (GLfloat)param |
| 8724 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8725 | } |
| 8726 | |
| 8727 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8728 | static void |
| 8729 | android_glTexGenfv__II_3FI |
| 8730 | (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] | 8731 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8732 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8733 | "glTexGenfv"); |
| 8734 | return; |
| 8735 | } |
| 8736 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8737 | const char * _exceptionType = NULL; |
| 8738 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8739 | GLfloat *params_base = (GLfloat *) 0; |
| 8740 | jint _remaining; |
| 8741 | GLfloat *params = (GLfloat *) 0; |
| 8742 | |
| 8743 | if (!params_ref) { |
| 8744 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8745 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8746 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8747 | goto exit; |
| 8748 | } |
| 8749 | if (offset < 0) { |
| 8750 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8751 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8752 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8753 | goto exit; |
| 8754 | } |
| 8755 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8756 | params_base = (GLfloat *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8757 | _env->GetFloatArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8758 | params = params_base + offset; |
| 8759 | |
| 8760 | glTexGenfv( |
| 8761 | (GLint)coord, |
| 8762 | (GLint)pname, |
| 8763 | (GLfloat *)params |
| 8764 | ); |
| 8765 | |
| 8766 | exit: |
| 8767 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8768 | _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8769 | _exception ? JNI_ABORT: 0); |
| 8770 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8771 | if (_exception) { |
| 8772 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8773 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8774 | } |
| 8775 | |
| 8776 | /* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */ |
| 8777 | static void |
| 8778 | android_glTexGenfv__IILjava_nio_FloatBuffer_2 |
| 8779 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8780 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8781 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8782 | "glTexGenfv"); |
| 8783 | return; |
| 8784 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8785 | jint _exception = 0; |
| 8786 | const char * _exceptionType = NULL; |
| 8787 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8788 | jfloatArray _array = (jfloatArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8789 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8790 | jint _remaining; |
| 8791 | GLfloat *params = (GLfloat *) 0; |
| 8792 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8793 | if (!params_buf) { |
| 8794 | _exception = 1; |
| 8795 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8796 | _exceptionMessage = "params == null"; |
| 8797 | goto exit; |
| 8798 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8799 | params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8800 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8801 | char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8802 | params = (GLfloat *) (_paramsBase + _bufferOffset); |
| 8803 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8804 | glTexGenfv( |
| 8805 | (GLint)coord, |
| 8806 | (GLint)pname, |
| 8807 | (GLfloat *)params |
| 8808 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8809 | |
| 8810 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8811 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8812 | _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); |
| 8813 | } |
| 8814 | if (_exception) { |
| 8815 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8816 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8817 | } |
| 8818 | |
| 8819 | /* void glTexGeni ( GLint coord, GLint pname, GLint param ) */ |
| 8820 | static void |
| 8821 | android_glTexGeni__III |
| 8822 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8823 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8824 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8825 | "glTexGeni"); |
| 8826 | return; |
| 8827 | } |
| 8828 | glTexGeni( |
| 8829 | (GLint)coord, |
| 8830 | (GLint)pname, |
| 8831 | (GLint)param |
| 8832 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8833 | } |
| 8834 | |
| 8835 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8836 | static void |
| 8837 | android_glTexGeniv__II_3II |
| 8838 | (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] | 8839 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8840 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8841 | "glTexGeniv"); |
| 8842 | return; |
| 8843 | } |
| 8844 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8845 | const char * _exceptionType = NULL; |
| 8846 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8847 | GLint *params_base = (GLint *) 0; |
| 8848 | jint _remaining; |
| 8849 | GLint *params = (GLint *) 0; |
| 8850 | |
| 8851 | if (!params_ref) { |
| 8852 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8853 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8854 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8855 | goto exit; |
| 8856 | } |
| 8857 | if (offset < 0) { |
| 8858 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8859 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8860 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8861 | goto exit; |
| 8862 | } |
| 8863 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8864 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8865 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8866 | params = params_base + offset; |
| 8867 | |
| 8868 | glTexGeniv( |
| 8869 | (GLint)coord, |
| 8870 | (GLint)pname, |
| 8871 | (GLint *)params |
| 8872 | ); |
| 8873 | |
| 8874 | exit: |
| 8875 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8876 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8877 | _exception ? JNI_ABORT: 0); |
| 8878 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8879 | if (_exception) { |
| 8880 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8881 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8882 | } |
| 8883 | |
| 8884 | /* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */ |
| 8885 | static void |
| 8886 | android_glTexGeniv__IILjava_nio_IntBuffer_2 |
| 8887 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8888 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8889 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8890 | "glTexGeniv"); |
| 8891 | return; |
| 8892 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8893 | jint _exception = 0; |
| 8894 | const char * _exceptionType = NULL; |
| 8895 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8896 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8897 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8898 | jint _remaining; |
| 8899 | GLint *params = (GLint *) 0; |
| 8900 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8901 | if (!params_buf) { |
| 8902 | _exception = 1; |
| 8903 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8904 | _exceptionMessage = "params == null"; |
| 8905 | goto exit; |
| 8906 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8907 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8908 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8909 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 8910 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 8911 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8912 | glTexGeniv( |
| 8913 | (GLint)coord, |
| 8914 | (GLint)pname, |
| 8915 | (GLint *)params |
| 8916 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8917 | |
| 8918 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8919 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 8920 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 8921 | } |
| 8922 | if (_exception) { |
| 8923 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8924 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8925 | } |
| 8926 | |
| 8927 | /* void glTexGenx ( GLint coord, GLint pname, GLint param ) */ |
| 8928 | static void |
| 8929 | android_glTexGenx__III |
| 8930 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8931 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8932 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8933 | "glTexGenx"); |
| 8934 | return; |
| 8935 | } |
| 8936 | glTexGenx( |
| 8937 | (GLint)coord, |
| 8938 | (GLint)pname, |
| 8939 | (GLint)param |
| 8940 | ); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8941 | } |
| 8942 | |
| 8943 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8944 | static void |
| 8945 | android_glTexGenxv__II_3II |
| 8946 | (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] | 8947 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8948 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8949 | "glTexGenxv"); |
| 8950 | return; |
| 8951 | } |
| 8952 | jint _exception = 0; |
Mathias Agopian | 15284de | 2013-02-23 03:12:30 -0800 | [diff] [blame] | 8953 | const char * _exceptionType = NULL; |
| 8954 | const char * _exceptionMessage = NULL; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8955 | GLint *params_base = (GLint *) 0; |
| 8956 | jint _remaining; |
| 8957 | GLint *params = (GLint *) 0; |
| 8958 | |
| 8959 | if (!params_ref) { |
| 8960 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8961 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8962 | _exceptionMessage = "params == null"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8963 | goto exit; |
| 8964 | } |
| 8965 | if (offset < 0) { |
| 8966 | _exception = 1; |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8967 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 8968 | _exceptionMessage = "offset < 0"; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8969 | goto exit; |
| 8970 | } |
| 8971 | _remaining = _env->GetArrayLength(params_ref) - offset; |
| 8972 | params_base = (GLint *) |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8973 | _env->GetIntArrayElements(params_ref, (jboolean *)0); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8974 | params = params_base + offset; |
| 8975 | |
| 8976 | glTexGenxv( |
| 8977 | (GLint)coord, |
| 8978 | (GLint)pname, |
| 8979 | (GLint *)params |
| 8980 | ); |
| 8981 | |
| 8982 | exit: |
| 8983 | if (params_base) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 8984 | _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8985 | _exception ? JNI_ABORT: 0); |
| 8986 | } |
Thomas Tafertshofer | 2545b32 | 2012-06-27 16:33:26 -0700 | [diff] [blame] | 8987 | if (_exception) { |
| 8988 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
| 8989 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 8990 | } |
| 8991 | |
| 8992 | /* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */ |
| 8993 | static void |
| 8994 | android_glTexGenxv__IILjava_nio_IntBuffer_2 |
| 8995 | (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) { |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8996 | if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) { |
Elliott Hughes | 24ce5fb | 2011-04-08 20:01:01 -0700 | [diff] [blame] | 8997 | jniThrowException(_env, "java/lang/UnsupportedOperationException", |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 8998 | "glTexGenxv"); |
| 8999 | return; |
| 9000 | } |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 9001 | jint _exception = 0; |
| 9002 | const char * _exceptionType = NULL; |
| 9003 | const char * _exceptionMessage = NULL; |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9004 | jintArray _array = (jintArray) 0; |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9005 | jint _bufferOffset = (jint) 0; |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9006 | jint _remaining; |
| 9007 | GLint *params = (GLint *) 0; |
| 9008 | |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 9009 | if (!params_buf) { |
| 9010 | _exception = 1; |
| 9011 | _exceptionType = "java/lang/IllegalArgumentException"; |
| 9012 | _exceptionMessage = "params == null"; |
| 9013 | goto exit; |
| 9014 | } |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9015 | params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9016 | if (params == NULL) { |
Hiroshi Yamauchi | 3b1d46e | 2015-05-13 13:10:33 -0700 | [diff] [blame] | 9017 | char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); |
Thomas Tafertshofer | 17045a1 | 2012-07-12 13:55:55 -0700 | [diff] [blame] | 9018 | params = (GLint *) (_paramsBase + _bufferOffset); |
| 9019 | } |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9020 | glTexGenxv( |
| 9021 | (GLint)coord, |
| 9022 | (GLint)pname, |
| 9023 | (GLint *)params |
| 9024 | ); |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 9025 | |
| 9026 | exit: |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9027 | if (_array) { |
Romain Guy | 84cac20 | 2016-12-05 12:26:02 -0800 | [diff] [blame] | 9028 | _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); |
| 9029 | } |
| 9030 | if (_exception) { |
| 9031 | jniThrowException(_env, _exceptionType, _exceptionMessage); |
Jack Palevich | 8a4de4b | 2010-01-28 20:28:32 +0800 | [diff] [blame] | 9032 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9033 | } |
| 9034 | |
| 9035 | static const char *classPathName = "com/google/android/gles_jni/GLImpl"; |
| 9036 | |
Daniel Micay | 76f6a86 | 2015-09-19 17:31:01 -0400 | [diff] [blame] | 9037 | static const JNINativeMethod methods[] = { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 9038 | {"_nativeClassInit", "()V", (void*)nativeClassInit }, |
| 9039 | {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, |
| 9040 | {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF }, |
| 9041 | {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II }, |
| 9042 | {"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, |
| 9043 | {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, |
| 9044 | {"glClear", "(I)V", (void *) android_glClear__I }, |
| 9045 | {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, |
| 9046 | {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII }, |
| 9047 | {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, |
| 9048 | {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I }, |
| 9049 | {"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, |
| 9050 | {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I }, |
| 9051 | {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF }, |
| 9052 | {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII }, |
| 9053 | {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, |
| 9054 | {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9055 | {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, |
| 9056 | {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9057 | {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, |
| 9058 | {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, |
| 9059 | {"glCullFace", "(I)V", (void *) android_glCullFace__I }, |
| 9060 | {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, |
| 9061 | {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, |
| 9062 | {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, |
| 9063 | {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, |
| 9064 | {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, |
| 9065 | {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II }, |
| 9066 | {"glDisable", "(I)V", (void *) android_glDisable__I }, |
| 9067 | {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I }, |
| 9068 | {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, |
| 9069 | {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, |
| 9070 | {"glEnable", "(I)V", (void *) android_glEnable__I }, |
| 9071 | {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I }, |
| 9072 | {"glFinish", "()V", (void *) android_glFinish__ }, |
| 9073 | {"glFlush", "()V", (void *) android_glFlush__ }, |
| 9074 | {"glFogf", "(IF)V", (void *) android_glFogf__IF }, |
| 9075 | {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI }, |
| 9076 | {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 }, |
| 9077 | {"glFogx", "(II)V", (void *) android_glFogx__II }, |
| 9078 | {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II }, |
| 9079 | {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 }, |
| 9080 | {"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, |
| 9081 | {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF }, |
| 9082 | {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII }, |
| 9083 | {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, |
| 9084 | {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, |
| 9085 | {"glGetError", "()I", (void *) android_glGetError__ }, |
| 9086 | {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, |
| 9087 | {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, |
| 9088 | {"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, |
| 9089 | {"glHint", "(II)V", (void *) android_glHint__II }, |
| 9090 | {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF }, |
| 9091 | {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI }, |
| 9092 | {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 }, |
| 9093 | {"glLightModelx", "(II)V", (void *) android_glLightModelx__II }, |
| 9094 | {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II }, |
| 9095 | {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 }, |
| 9096 | {"glLightf", "(IIF)V", (void *) android_glLightf__IIF }, |
| 9097 | {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI }, |
| 9098 | {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 }, |
| 9099 | {"glLightx", "(III)V", (void *) android_glLightx__III }, |
| 9100 | {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II }, |
| 9101 | {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 }, |
| 9102 | {"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, |
| 9103 | {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I }, |
| 9104 | {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ }, |
| 9105 | {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI }, |
| 9106 | {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 9107 | {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II }, |
| 9108 | {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 }, |
| 9109 | {"glLogicOp", "(I)V", (void *) android_glLogicOp__I }, |
| 9110 | {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF }, |
| 9111 | {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI }, |
| 9112 | {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 9113 | {"glMaterialx", "(III)V", (void *) android_glMaterialx__III }, |
| 9114 | {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II }, |
| 9115 | {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 9116 | {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I }, |
| 9117 | {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI }, |
| 9118 | {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 }, |
| 9119 | {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II }, |
| 9120 | {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 }, |
| 9121 | {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF }, |
| 9122 | {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII }, |
| 9123 | {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF }, |
| 9124 | {"glNormal3x", "(III)V", (void *) android_glNormal3x__III }, |
| 9125 | {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I }, |
| 9126 | {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF }, |
| 9127 | {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII }, |
| 9128 | {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, |
| 9129 | {"glPointSize", "(F)V", (void *) android_glPointSize__F }, |
| 9130 | {"glPointSizex", "(I)V", (void *) android_glPointSizex__I }, |
| 9131 | {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, |
| 9132 | {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II }, |
| 9133 | {"glPopMatrix", "()V", (void *) android_glPopMatrix__ }, |
| 9134 | {"glPushMatrix", "()V", (void *) android_glPushMatrix__ }, |
| 9135 | {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, |
| 9136 | {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF }, |
| 9137 | {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII }, |
| 9138 | {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, |
| 9139 | {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ }, |
| 9140 | {"glScalef", "(FFF)V", (void *) android_glScalef__FFF }, |
| 9141 | {"glScalex", "(III)V", (void *) android_glScalex__III }, |
| 9142 | {"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, |
| 9143 | {"glShadeModel", "(I)V", (void *) android_glShadeModel__I }, |
| 9144 | {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, |
| 9145 | {"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, |
| 9146 | {"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, |
| 9147 | {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9148 | {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF }, |
| 9149 | {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI }, |
| 9150 | {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 }, |
| 9151 | {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III }, |
| 9152 | {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II }, |
| 9153 | {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 9154 | {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9155 | {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, |
| 9156 | {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III }, |
| 9157 | {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, |
| 9158 | {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF }, |
| 9159 | {"glTranslatex", "(III)V", (void *) android_glTranslatex__III }, |
| 9160 | {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I }, |
| 9161 | {"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, |
| 9162 | {"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II }, |
| 9163 | {"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, |
| 9164 | {"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, |
| 9165 | {"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, |
| 9166 | {"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, |
| 9167 | {"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI }, |
| 9168 | {"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 9169 | {"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II }, |
| 9170 | {"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 9171 | {"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB }, |
| 9172 | {"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII }, |
| 9173 | {"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, |
| 9174 | {"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, |
| 9175 | {"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, |
| 9176 | {"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, |
| 9177 | {"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, |
| 9178 | {"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, |
| 9179 | {"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, |
| 9180 | {"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, |
| 9181 | {"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9182 | {"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI }, |
| 9183 | {"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 }, |
| 9184 | {"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II }, |
| 9185 | {"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 }, |
| 9186 | {"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II }, |
| 9187 | {"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 }, |
| 9188 | {"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, |
| 9189 | {"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, |
| 9190 | {"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI }, |
| 9191 | {"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 }, |
| 9192 | {"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II }, |
| 9193 | {"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 }, |
| 9194 | {"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI }, |
| 9195 | {"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 }, |
| 9196 | {"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II }, |
| 9197 | {"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 }, |
| 9198 | {"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II }, |
| 9199 | {"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 9200 | {"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II }, |
| 9201 | {"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 }, |
| 9202 | {"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, |
| 9203 | {"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 9204 | {"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, |
| 9205 | {"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9206 | {"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II }, |
| 9207 | {"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 9208 | {"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, |
| 9209 | {"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, |
| 9210 | {"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, |
| 9211 | {"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III }, |
| 9212 | {"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF }, |
| 9213 | {"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI }, |
| 9214 | {"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 }, |
| 9215 | {"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II }, |
| 9216 | {"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II }, |
| 9217 | {"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9218 | {"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] | 9219 | {"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII }, |
| 9220 | {"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III }, |
| 9221 | {"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II }, |
| 9222 | {"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 }, |
| 9223 | {"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, |
| 9224 | {"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, |
| 9225 | {"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, |
| 9226 | {"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, |
| 9227 | {"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, |
| 9228 | {"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II }, |
| 9229 | {"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 }, |
| 9230 | {"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII }, |
| 9231 | {"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I }, |
| 9232 | {"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF }, |
| 9233 | {"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI }, |
| 9234 | {"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 }, |
| 9235 | {"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII }, |
| 9236 | {"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II }, |
| 9237 | {"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 }, |
| 9238 | {"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS }, |
| 9239 | {"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI }, |
| 9240 | {"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 }, |
| 9241 | {"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII }, |
| 9242 | {"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II }, |
| 9243 | {"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 }, |
| 9244 | {"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9245 | {"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] | 9246 | {"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII }, |
Jack Palevich | be6eac8 | 2009-12-08 15:43:51 +0800 | [diff] [blame] | 9247 | {"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] | 9248 | {"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII }, |
| 9249 | {"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II }, |
| 9250 | {"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II }, |
| 9251 | {"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, |
| 9252 | {"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, |
| 9253 | {"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, |
| 9254 | {"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I }, |
| 9255 | {"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II }, |
| 9256 | {"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9257 | {"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II }, |
| 9258 | {"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9259 | {"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII }, |
| 9260 | {"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII }, |
| 9261 | {"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I }, |
| 9262 | {"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II }, |
| 9263 | {"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9264 | {"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II }, |
| 9265 | {"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 }, |
| 9266 | {"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II }, |
| 9267 | {"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 }, |
| 9268 | {"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II }, |
| 9269 | {"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 }, |
| 9270 | {"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI }, |
| 9271 | {"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 9272 | {"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II }, |
| 9273 | {"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 9274 | {"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II }, |
| 9275 | {"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 9276 | {"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I }, |
| 9277 | {"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I }, |
| 9278 | {"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII }, |
| 9279 | {"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF }, |
| 9280 | {"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI }, |
| 9281 | {"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 }, |
| 9282 | {"glTexGeni", "(III)V", (void *) android_glTexGeni__III }, |
| 9283 | {"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II }, |
| 9284 | {"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 }, |
| 9285 | {"glTexGenx", "(III)V", (void *) android_glTexGenx__III }, |
| 9286 | {"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II }, |
| 9287 | {"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 }, |
| 9288 | }; |
| 9289 | |
| 9290 | int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env) |
| 9291 | { |
| 9292 | int err; |
| 9293 | err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); |
| 9294 | return err; |
| 9295 | } |