blob: b0c26c5157c1d2b85d55f49db65044d750abf8a6 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/* //device/libs/android_runtime/com_google_android_gles_jni_GLImpl.cpp
2**
3** Copyright 2006, The Android Open Source Project
4**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07005** 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 Project9066cfe2009-03-03 19:31:44 -08008**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009** http://www.apache.org/licenses/LICENSE-2.0
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080010**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070011** 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 Project9066cfe2009-03-03 19:31:44 -080015** limitations under the License.
16*/
17
18// This source file is automatically generated
19
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070020#include "jni.h"
21#include "JNIHelp.h"
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022#include <android_runtime/AndroidRuntime.h>
23#include <utils/misc.h>
24
25#include <assert.h>
26#include <GLES/gl.h>
Jack Palevichbe509c92009-05-07 09:52:14 -070027#include <GLES/glext.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028
Jack Palevich8a4de4b2010-01-28 20:28:32 +080029// Work around differences between the generated name and the actual name.
30
31#define glBlendEquation glBlendEquationOES
32#define glBlendEquationSeparate glBlendEquationSeparateOES
33#define glBlendFuncSeparate glBlendFuncSeparateOES
34#define glGetTexGenfv glGetTexGenfvOES
35#define glGetTexGeniv glGetTexGenivOES
36#define glGetTexGenxv glGetTexGenxvOES
37#define glTexGenf glTexGenfOES
38#define glTexGenfv glTexGenfvOES
39#define glTexGeni glTexGeniOES
40#define glTexGeniv glTexGenivOES
41#define glTexGenx glTexGenxOES
42#define glTexGenxv glTexGenxvOES
43
44
45
Mathias Agopian8331f722009-05-08 15:35:17 -070046/* special calls implemented in Android's GLES wrapper used to more
47 * efficiently bound-check passed arrays */
48extern "C" {
49GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
Jack Palevichbe6eac82009-12-08 15:43:51 +080057GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
Mathias Agopian8331f722009-05-08 15:35:17 -070063}
64
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065static int initialized = 0;
66
67static jclass nioAccessClass;
68static jclass bufferClass;
Jack Palevich91a27ae2009-06-15 21:03:24 -070069static jclass G11ImplClass;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070static jmethodID getBasePointerID;
71static jmethodID getBaseArrayID;
72static jmethodID getBaseArrayOffsetID;
Jack Palevich91a27ae2009-06-15 21:03:24 -070073static jmethodID allowIndirectBuffersID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074static jfieldID positionID;
75static jfieldID limitID;
76static jfieldID elementSizeShiftID;
Jack Palevich8a4de4b2010-01-28 20:28:32 +080077static jfieldID haveCheckedExtensionsID;
78static jfieldID have_OES_blend_equation_separateID;
79static jfieldID have_OES_blend_subtractID;
80static jfieldID have_OES_framebuffer_objectID;
81static jfieldID have_OES_texture_cube_mapID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082
83/* Cache method IDs each time the class is loaded. */
84
Jack Palevich27f80022009-04-15 19:13:17 -070085static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070086nativeClassInit(JNIEnv *_env, jclass glImplClass)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087{
88 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
89 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
90
91 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
92 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
93
Jack Palevich91a27ae2009-06-15 21:03:24 -070094 jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
95 G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
Jack Palevich8a4de4b2010-01-28 20:28:32 +080096 haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
97 have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
98 have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
99 have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
100 have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800102 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
103 "getBasePointer", "(Ljava/nio/Buffer;)J");
104 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
105 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
106 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
107 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700108 allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
109 "allowIndirectBuffers", "(Ljava/lang/String;)Z");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 positionID = _env->GetFieldID(bufferClass, "position", "I");
111 limitID = _env->GetFieldID(bufferClass, "limit", "I");
112 elementSizeShiftID =
113 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
114}
115
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700117getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118{
119 jint position;
120 jint limit;
121 jint elementSizeShift;
122 jlong pointer;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800123
124 position = _env->GetIntField(buffer, positionID);
125 limit = _env->GetIntField(buffer, limitID);
126 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
127 *remaining = (limit - position) << elementSizeShift;
128 pointer = _env->CallStaticLongMethod(nioAccessClass,
129 getBasePointerID, buffer);
130 if (pointer != 0L) {
131 *array = NULL;
132 return (void *) (jint) pointer;
133 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700134
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800135 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
136 getBaseArrayID, buffer);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700137 if (*array == NULL) {
138 return (void*) NULL;
139 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700140 *offset = _env->CallStaticIntMethod(nioAccessClass,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700142
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700143 return NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144}
145
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146static void
147releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
148{
149 _env->ReleasePrimitiveArrayCritical(array, data,
150 commit ? 0 : JNI_ABORT);
151}
152
Jack Palevich91a27ae2009-06-15 21:03:24 -0700153extern "C" {
154extern char* __progname;
155}
156
157static bool
158allowIndirectBuffers(JNIEnv *_env) {
159 static jint sIndirectBufferCompatability;
160 if (sIndirectBufferCompatability == 0) {
161 jobject appName = _env->NewStringUTF(::__progname);
162 sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
163 }
164 return sIndirectBufferCompatability == 2;
165}
166
Jack Palevich16e79722009-05-15 18:13:34 -0700167static void *
168getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700169 if (!buffer) {
170 return NULL;
171 }
172 void* buf = _env->GetDirectBufferAddress(buffer);
Jack Palevich16e79722009-05-15 18:13:34 -0700173 if (buf) {
174 jint position = _env->GetIntField(buffer, positionID);
175 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700176 buf = ((char*) buf) + (position << elementSizeShift);
Jack Palevich16e79722009-05-15 18:13:34 -0700177 } else {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700178 if (allowIndirectBuffers(_env)) {
179 jarray array = 0;
180 jint remaining;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700181 jint offset;
182 buf = getPointer(_env, buffer, &array, &remaining, &offset);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700183 if (array) {
184 releasePointer(_env, array, buf, 0);
185 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700186 buf = buf + offset;
Jack Palevich91a27ae2009-06-15 21:03:24 -0700187 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700188 jniThrowException(_env, "java/lang/IllegalArgumentException",
189 "Must use a native order direct Buffer");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700190 }
Jack Palevich16e79722009-05-15 18:13:34 -0700191 }
Jack Palevich91a27ae2009-06-15 21:03:24 -0700192 return buf;
Jack Palevich16e79722009-05-15 18:13:34 -0700193}
194
Jack Palevichbe509c92009-05-07 09:52:14 -0700195static int
196getNumCompressedTextureFormats() {
197 int numCompressedTextureFormats = 0;
198 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
199 return numCompressedTextureFormats;
200}
201
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800202// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
203// terminated by either 0 or space, while pExtension is terminated by 0.
204
205static bool
206extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
207 while (true) {
208 char a = *pExtensions++;
209 char b = *pExtension++;
210 bool aEnd = a == '\0' || a == ' ';
211 bool bEnd = b == '\0';
212 if ( aEnd || bEnd) {
213 return aEnd == bEnd;
214 }
215 if ( a != b ) {
216 return false;
217 }
218 }
219}
220
221static const GLubyte*
222nextExtension(const GLubyte* pExtensions) {
223 while (true) {
224 char a = *pExtensions++;
225 if ( a == '\0') {
226 return pExtensions-1;
227 } else if ( a == ' ') {
228 return pExtensions;
229 }
230 }
231}
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700232
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800233static bool
234checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
235 for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
236 if (extensionEqual(pExtensions, pExtension)) {
237 return true;
238 }
239 }
240 return false;
241}
242
243static bool
244supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
245 if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
246 _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
247 const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
248 _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
249 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
250 _env->SetBooleanField(impl, have_OES_blend_subtractID,
251 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
252 _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
253 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
254 _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
255 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
256 }
257 return _env->GetBooleanField(impl, fieldId);
258}
259
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800260// --------------------------------------------------------------------------
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800261/* void glActiveTexture ( GLenum texture ) */
262static void
263android_glActiveTexture__I
264 (JNIEnv *_env, jobject _this, jint texture) {
265 glActiveTexture(
266 (GLenum)texture
267 );
268}
269
270/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
271static void
272android_glAlphaFunc__IF
273 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
274 glAlphaFunc(
275 (GLenum)func,
276 (GLclampf)ref
277 );
278}
279
280/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
281static void
282android_glAlphaFuncx__II
283 (JNIEnv *_env, jobject _this, jint func, jint ref) {
284 glAlphaFuncx(
285 (GLenum)func,
286 (GLclampx)ref
287 );
288}
289
290/* void glBindTexture ( GLenum target, GLuint texture ) */
291static void
292android_glBindTexture__II
293 (JNIEnv *_env, jobject _this, jint target, jint texture) {
294 glBindTexture(
295 (GLenum)target,
296 (GLuint)texture
297 );
298}
299
300/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
301static void
302android_glBlendFunc__II
303 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
304 glBlendFunc(
305 (GLenum)sfactor,
306 (GLenum)dfactor
307 );
308}
309
310/* void glClear ( GLbitfield mask ) */
311static void
312android_glClear__I
313 (JNIEnv *_env, jobject _this, jint mask) {
314 glClear(
315 (GLbitfield)mask
316 );
317}
318
319/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
320static void
321android_glClearColor__FFFF
322 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
323 glClearColor(
324 (GLclampf)red,
325 (GLclampf)green,
326 (GLclampf)blue,
327 (GLclampf)alpha
328 );
329}
330
331/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
332static void
333android_glClearColorx__IIII
334 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
335 glClearColorx(
336 (GLclampx)red,
337 (GLclampx)green,
338 (GLclampx)blue,
339 (GLclampx)alpha
340 );
341}
342
343/* void glClearDepthf ( GLclampf depth ) */
344static void
345android_glClearDepthf__F
346 (JNIEnv *_env, jobject _this, jfloat depth) {
347 glClearDepthf(
348 (GLclampf)depth
349 );
350}
351
352/* void glClearDepthx ( GLclampx depth ) */
353static void
354android_glClearDepthx__I
355 (JNIEnv *_env, jobject _this, jint depth) {
356 glClearDepthx(
357 (GLclampx)depth
358 );
359}
360
361/* void glClearStencil ( GLint s ) */
362static void
363android_glClearStencil__I
364 (JNIEnv *_env, jobject _this, jint s) {
365 glClearStencil(
366 (GLint)s
367 );
368}
369
370/* void glClientActiveTexture ( GLenum texture ) */
371static void
372android_glClientActiveTexture__I
373 (JNIEnv *_env, jobject _this, jint texture) {
374 glClientActiveTexture(
375 (GLenum)texture
376 );
377}
378
379/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
380static void
381android_glColor4f__FFFF
382 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
383 glColor4f(
384 (GLfloat)red,
385 (GLfloat)green,
386 (GLfloat)blue,
387 (GLfloat)alpha
388 );
389}
390
391/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
392static void
393android_glColor4x__IIII
394 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
395 glColor4x(
396 (GLfixed)red,
397 (GLfixed)green,
398 (GLfixed)blue,
399 (GLfixed)alpha
400 );
401}
402
403/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
404static void
405android_glColorMask__ZZZZ
406 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
407 glColorMask(
408 (GLboolean)red,
409 (GLboolean)green,
410 (GLboolean)blue,
411 (GLboolean)alpha
412 );
413}
414
415/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
416static void
417android_glColorPointerBounds__IIILjava_nio_Buffer_2I
418 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
419 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700420 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800421 jint _remaining;
422 GLvoid *pointer = (GLvoid *) 0;
423
Jack Paleviche20ea782009-05-07 18:28:29 -0700424 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700425 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700426 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700427 return;
428 }
429 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800430 glColorPointerBounds(
431 (GLint)size,
432 (GLenum)type,
433 (GLsizei)stride,
434 (GLvoid *)pointer,
435 (GLsizei)remaining
436 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800437}
438
439/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
440static void
441android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
442 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
443 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700444 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800445 jint _remaining;
446 GLvoid *data = (GLvoid *) 0;
447
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700448 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
449 if (data == NULL) {
450 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
451 data = (GLvoid *) (_dataBase + _bufferOffset);
452 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800453 glCompressedTexImage2D(
454 (GLenum)target,
455 (GLint)level,
456 (GLenum)internalformat,
457 (GLsizei)width,
458 (GLsizei)height,
459 (GLint)border,
460 (GLsizei)imageSize,
461 (GLvoid *)data
462 );
463 if (_array) {
464 releasePointer(_env, _array, data, JNI_FALSE);
465 }
466}
467
468/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
469static void
470android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
471 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
472 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700473 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800474 jint _remaining;
475 GLvoid *data = (GLvoid *) 0;
476
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700477 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
478 if (data == NULL) {
479 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
480 data = (GLvoid *) (_dataBase + _bufferOffset);
481 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800482 glCompressedTexSubImage2D(
483 (GLenum)target,
484 (GLint)level,
485 (GLint)xoffset,
486 (GLint)yoffset,
487 (GLsizei)width,
488 (GLsizei)height,
489 (GLenum)format,
490 (GLsizei)imageSize,
491 (GLvoid *)data
492 );
493 if (_array) {
494 releasePointer(_env, _array, data, JNI_FALSE);
495 }
496}
497
498/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
499static void
500android_glCopyTexImage2D__IIIIIIII
501 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
502 glCopyTexImage2D(
503 (GLenum)target,
504 (GLint)level,
505 (GLenum)internalformat,
506 (GLint)x,
507 (GLint)y,
508 (GLsizei)width,
509 (GLsizei)height,
510 (GLint)border
511 );
512}
513
514/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
515static void
516android_glCopyTexSubImage2D__IIIIIIII
517 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
518 glCopyTexSubImage2D(
519 (GLenum)target,
520 (GLint)level,
521 (GLint)xoffset,
522 (GLint)yoffset,
523 (GLint)x,
524 (GLint)y,
525 (GLsizei)width,
526 (GLsizei)height
527 );
528}
529
530/* void glCullFace ( GLenum mode ) */
531static void
532android_glCullFace__I
533 (JNIEnv *_env, jobject _this, jint mode) {
534 glCullFace(
535 (GLenum)mode
536 );
537}
538
539/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
540static void
541android_glDeleteTextures__I_3II
542 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700543 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800544 const char * _exceptionType = NULL;
545 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 GLuint *textures_base = (GLuint *) 0;
547 jint _remaining;
548 GLuint *textures = (GLuint *) 0;
549
550 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700551 _exception = 1;
552 _exceptionType = "java/lang/IllegalArgumentException";
553 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800554 goto exit;
555 }
556 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700557 _exception = 1;
558 _exceptionType = "java/lang/IllegalArgumentException";
559 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800560 goto exit;
561 }
562 _remaining = _env->GetArrayLength(textures_ref) - offset;
563 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700564 _exception = 1;
565 _exceptionType = "java/lang/IllegalArgumentException";
566 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800567 goto exit;
568 }
569 textures_base = (GLuint *)
570 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
571 textures = textures_base + offset;
572
573 glDeleteTextures(
574 (GLsizei)n,
575 (GLuint *)textures
576 );
577
578exit:
579 if (textures_base) {
580 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
581 JNI_ABORT);
582 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700583 if (_exception) {
584 jniThrowException(_env, _exceptionType, _exceptionMessage);
585 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800586}
587
588/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
589static void
590android_glDeleteTextures__ILjava_nio_IntBuffer_2
591 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700592 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800593 const char * _exceptionType = NULL;
594 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800595 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700596 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800597 jint _remaining;
598 GLuint *textures = (GLuint *) 0;
599
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700600 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800601 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700602 _exception = 1;
603 _exceptionType = "java/lang/IllegalArgumentException";
604 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 goto exit;
606 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700607 if (textures == NULL) {
608 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
609 textures = (GLuint *) (_texturesBase + _bufferOffset);
610 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800611 glDeleteTextures(
612 (GLsizei)n,
613 (GLuint *)textures
614 );
615
616exit:
617 if (_array) {
618 releasePointer(_env, _array, textures, JNI_FALSE);
619 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700620 if (_exception) {
621 jniThrowException(_env, _exceptionType, _exceptionMessage);
622 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800623}
624
625/* void glDepthFunc ( GLenum func ) */
626static void
627android_glDepthFunc__I
628 (JNIEnv *_env, jobject _this, jint func) {
629 glDepthFunc(
630 (GLenum)func
631 );
632}
633
634/* void glDepthMask ( GLboolean flag ) */
635static void
636android_glDepthMask__Z
637 (JNIEnv *_env, jobject _this, jboolean flag) {
638 glDepthMask(
639 (GLboolean)flag
640 );
641}
642
643/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
644static void
645android_glDepthRangef__FF
646 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
647 glDepthRangef(
648 (GLclampf)zNear,
649 (GLclampf)zFar
650 );
651}
652
653/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
654static void
655android_glDepthRangex__II
656 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
657 glDepthRangex(
658 (GLclampx)zNear,
659 (GLclampx)zFar
660 );
661}
662
663/* void glDisable ( GLenum cap ) */
664static void
665android_glDisable__I
666 (JNIEnv *_env, jobject _this, jint cap) {
667 glDisable(
668 (GLenum)cap
669 );
670}
671
672/* void glDisableClientState ( GLenum array ) */
673static void
674android_glDisableClientState__I
675 (JNIEnv *_env, jobject _this, jint array) {
676 glDisableClientState(
677 (GLenum)array
678 );
679}
680
681/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
682static void
683android_glDrawArrays__III
684 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
685 glDrawArrays(
686 (GLenum)mode,
687 (GLint)first,
688 (GLsizei)count
689 );
690}
691
692/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
693static void
694android_glDrawElements__IIILjava_nio_Buffer_2
695 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700696 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800697 const char * _exceptionType = NULL;
698 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800699 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700700 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800701 jint _remaining;
702 GLvoid *indices = (GLvoid *) 0;
703
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700704 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800705 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700706 _exception = 1;
707 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
708 _exceptionMessage = "remaining() < count < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 goto exit;
710 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700711 if (indices == NULL) {
712 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
713 indices = (GLvoid *) (_indicesBase + _bufferOffset);
714 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800715 glDrawElements(
716 (GLenum)mode,
717 (GLsizei)count,
718 (GLenum)type,
719 (GLvoid *)indices
720 );
721
722exit:
723 if (_array) {
724 releasePointer(_env, _array, indices, JNI_FALSE);
725 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700726 if (_exception) {
727 jniThrowException(_env, _exceptionType, _exceptionMessage);
728 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800729}
730
731/* void glEnable ( GLenum cap ) */
732static void
733android_glEnable__I
734 (JNIEnv *_env, jobject _this, jint cap) {
735 glEnable(
736 (GLenum)cap
737 );
738}
739
740/* void glEnableClientState ( GLenum array ) */
741static void
742android_glEnableClientState__I
743 (JNIEnv *_env, jobject _this, jint array) {
744 glEnableClientState(
745 (GLenum)array
746 );
747}
748
749/* void glFinish ( void ) */
750static void
751android_glFinish__
752 (JNIEnv *_env, jobject _this) {
753 glFinish();
754}
755
756/* void glFlush ( void ) */
757static void
758android_glFlush__
759 (JNIEnv *_env, jobject _this) {
760 glFlush();
761}
762
763/* void glFogf ( GLenum pname, GLfloat param ) */
764static void
765android_glFogf__IF
766 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
767 glFogf(
768 (GLenum)pname,
769 (GLfloat)param
770 );
771}
772
773/* void glFogfv ( GLenum pname, const GLfloat *params ) */
774static void
775android_glFogfv__I_3FI
776 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700777 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800778 const char * _exceptionType = NULL;
779 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800780 GLfloat *params_base = (GLfloat *) 0;
781 jint _remaining;
782 GLfloat *params = (GLfloat *) 0;
783
784 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700785 _exception = 1;
786 _exceptionType = "java/lang/IllegalArgumentException";
787 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800788 goto exit;
789 }
790 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700791 _exception = 1;
792 _exceptionType = "java/lang/IllegalArgumentException";
793 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800794 goto exit;
795 }
796 _remaining = _env->GetArrayLength(params_ref) - offset;
797 int _needed;
798 switch (pname) {
799#if defined(GL_FOG_MODE)
800 case GL_FOG_MODE:
801#endif // defined(GL_FOG_MODE)
802#if defined(GL_FOG_DENSITY)
803 case GL_FOG_DENSITY:
804#endif // defined(GL_FOG_DENSITY)
805#if defined(GL_FOG_START)
806 case GL_FOG_START:
807#endif // defined(GL_FOG_START)
808#if defined(GL_FOG_END)
809 case GL_FOG_END:
810#endif // defined(GL_FOG_END)
811 _needed = 1;
812 break;
813#if defined(GL_FOG_COLOR)
814 case GL_FOG_COLOR:
815#endif // defined(GL_FOG_COLOR)
816 _needed = 4;
817 break;
818 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800819 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800820 break;
821 }
822 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700823 _exception = 1;
824 _exceptionType = "java/lang/IllegalArgumentException";
825 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800826 goto exit;
827 }
828 params_base = (GLfloat *)
829 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
830 params = params_base + offset;
831
832 glFogfv(
833 (GLenum)pname,
834 (GLfloat *)params
835 );
836
837exit:
838 if (params_base) {
839 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
840 JNI_ABORT);
841 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700842 if (_exception) {
843 jniThrowException(_env, _exceptionType, _exceptionMessage);
844 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800845}
846
847/* void glFogfv ( GLenum pname, const GLfloat *params ) */
848static void
849android_glFogfv__ILjava_nio_FloatBuffer_2
850 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700851 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800852 const char * _exceptionType = NULL;
853 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800854 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700855 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800856 jint _remaining;
857 GLfloat *params = (GLfloat *) 0;
858
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700859 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800860 int _needed;
861 switch (pname) {
862#if defined(GL_FOG_MODE)
863 case GL_FOG_MODE:
864#endif // defined(GL_FOG_MODE)
865#if defined(GL_FOG_DENSITY)
866 case GL_FOG_DENSITY:
867#endif // defined(GL_FOG_DENSITY)
868#if defined(GL_FOG_START)
869 case GL_FOG_START:
870#endif // defined(GL_FOG_START)
871#if defined(GL_FOG_END)
872 case GL_FOG_END:
873#endif // defined(GL_FOG_END)
874 _needed = 1;
875 break;
876#if defined(GL_FOG_COLOR)
877 case GL_FOG_COLOR:
878#endif // defined(GL_FOG_COLOR)
879 _needed = 4;
880 break;
881 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800882 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800883 break;
884 }
885 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700886 _exception = 1;
887 _exceptionType = "java/lang/IllegalArgumentException";
888 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800889 goto exit;
890 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700891 if (params == NULL) {
892 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
893 params = (GLfloat *) (_paramsBase + _bufferOffset);
894 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800895 glFogfv(
896 (GLenum)pname,
897 (GLfloat *)params
898 );
899
900exit:
901 if (_array) {
902 releasePointer(_env, _array, params, JNI_FALSE);
903 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700904 if (_exception) {
905 jniThrowException(_env, _exceptionType, _exceptionMessage);
906 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800907}
908
909/* void glFogx ( GLenum pname, GLfixed param ) */
910static void
911android_glFogx__II
912 (JNIEnv *_env, jobject _this, jint pname, jint param) {
913 glFogx(
914 (GLenum)pname,
915 (GLfixed)param
916 );
917}
918
919/* void glFogxv ( GLenum pname, const GLfixed *params ) */
920static void
921android_glFogxv__I_3II
922 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700923 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800924 const char * _exceptionType = NULL;
925 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800926 GLfixed *params_base = (GLfixed *) 0;
927 jint _remaining;
928 GLfixed *params = (GLfixed *) 0;
929
930 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700931 _exception = 1;
932 _exceptionType = "java/lang/IllegalArgumentException";
933 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800934 goto exit;
935 }
936 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700937 _exception = 1;
938 _exceptionType = "java/lang/IllegalArgumentException";
939 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800940 goto exit;
941 }
942 _remaining = _env->GetArrayLength(params_ref) - offset;
943 int _needed;
944 switch (pname) {
945#if defined(GL_FOG_MODE)
946 case GL_FOG_MODE:
947#endif // defined(GL_FOG_MODE)
948#if defined(GL_FOG_DENSITY)
949 case GL_FOG_DENSITY:
950#endif // defined(GL_FOG_DENSITY)
951#if defined(GL_FOG_START)
952 case GL_FOG_START:
953#endif // defined(GL_FOG_START)
954#if defined(GL_FOG_END)
955 case GL_FOG_END:
956#endif // defined(GL_FOG_END)
957 _needed = 1;
958 break;
959#if defined(GL_FOG_COLOR)
960 case GL_FOG_COLOR:
961#endif // defined(GL_FOG_COLOR)
962 _needed = 4;
963 break;
964 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800965 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800966 break;
967 }
968 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700969 _exception = 1;
970 _exceptionType = "java/lang/IllegalArgumentException";
971 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800972 goto exit;
973 }
974 params_base = (GLfixed *)
975 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
976 params = params_base + offset;
977
978 glFogxv(
979 (GLenum)pname,
980 (GLfixed *)params
981 );
982
983exit:
984 if (params_base) {
985 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
986 JNI_ABORT);
987 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700988 if (_exception) {
989 jniThrowException(_env, _exceptionType, _exceptionMessage);
990 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991}
992
993/* void glFogxv ( GLenum pname, const GLfixed *params ) */
994static void
995android_glFogxv__ILjava_nio_IntBuffer_2
996 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700997 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800998 const char * _exceptionType = NULL;
999 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001000 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001001 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001002 jint _remaining;
1003 GLfixed *params = (GLfixed *) 0;
1004
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001005 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001006 int _needed;
1007 switch (pname) {
1008#if defined(GL_FOG_MODE)
1009 case GL_FOG_MODE:
1010#endif // defined(GL_FOG_MODE)
1011#if defined(GL_FOG_DENSITY)
1012 case GL_FOG_DENSITY:
1013#endif // defined(GL_FOG_DENSITY)
1014#if defined(GL_FOG_START)
1015 case GL_FOG_START:
1016#endif // defined(GL_FOG_START)
1017#if defined(GL_FOG_END)
1018 case GL_FOG_END:
1019#endif // defined(GL_FOG_END)
1020 _needed = 1;
1021 break;
1022#if defined(GL_FOG_COLOR)
1023 case GL_FOG_COLOR:
1024#endif // defined(GL_FOG_COLOR)
1025 _needed = 4;
1026 break;
1027 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001028 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001029 break;
1030 }
1031 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001032 _exception = 1;
1033 _exceptionType = "java/lang/IllegalArgumentException";
1034 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001035 goto exit;
1036 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001037 if (params == NULL) {
1038 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1039 params = (GLfixed *) (_paramsBase + _bufferOffset);
1040 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001041 glFogxv(
1042 (GLenum)pname,
1043 (GLfixed *)params
1044 );
1045
1046exit:
1047 if (_array) {
1048 releasePointer(_env, _array, params, JNI_FALSE);
1049 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001050 if (_exception) {
1051 jniThrowException(_env, _exceptionType, _exceptionMessage);
1052 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001053}
1054
1055/* void glFrontFace ( GLenum mode ) */
1056static void
1057android_glFrontFace__I
1058 (JNIEnv *_env, jobject _this, jint mode) {
1059 glFrontFace(
1060 (GLenum)mode
1061 );
1062}
1063
1064/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1065static void
1066android_glFrustumf__FFFFFF
1067 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1068 glFrustumf(
1069 (GLfloat)left,
1070 (GLfloat)right,
1071 (GLfloat)bottom,
1072 (GLfloat)top,
1073 (GLfloat)zNear,
1074 (GLfloat)zFar
1075 );
1076}
1077
1078/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1079static void
1080android_glFrustumx__IIIIII
1081 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1082 glFrustumx(
1083 (GLfixed)left,
1084 (GLfixed)right,
1085 (GLfixed)bottom,
1086 (GLfixed)top,
1087 (GLfixed)zNear,
1088 (GLfixed)zFar
1089 );
1090}
1091
1092/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1093static void
1094android_glGenTextures__I_3II
1095 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1096 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001097 const char * _exceptionType = NULL;
1098 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001099 GLuint *textures_base = (GLuint *) 0;
1100 jint _remaining;
1101 GLuint *textures = (GLuint *) 0;
1102
1103 if (!textures_ref) {
1104 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001105 _exceptionType = "java/lang/IllegalArgumentException";
1106 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001107 goto exit;
1108 }
1109 if (offset < 0) {
1110 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001111 _exceptionType = "java/lang/IllegalArgumentException";
1112 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001113 goto exit;
1114 }
1115 _remaining = _env->GetArrayLength(textures_ref) - offset;
1116 if (_remaining < n) {
1117 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001118 _exceptionType = "java/lang/IllegalArgumentException";
1119 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001120 goto exit;
1121 }
1122 textures_base = (GLuint *)
1123 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
1124 textures = textures_base + offset;
1125
1126 glGenTextures(
1127 (GLsizei)n,
1128 (GLuint *)textures
1129 );
1130
1131exit:
1132 if (textures_base) {
1133 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
1134 _exception ? JNI_ABORT: 0);
1135 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001136 if (_exception) {
1137 jniThrowException(_env, _exceptionType, _exceptionMessage);
1138 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001139}
1140
1141/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1142static void
1143android_glGenTextures__ILjava_nio_IntBuffer_2
1144 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1145 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001146 const char * _exceptionType = NULL;
1147 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001148 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001149 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001150 jint _remaining;
1151 GLuint *textures = (GLuint *) 0;
1152
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001153 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001154 if (_remaining < n) {
1155 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001156 _exceptionType = "java/lang/IllegalArgumentException";
1157 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001158 goto exit;
1159 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001160 if (textures == NULL) {
1161 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1162 textures = (GLuint *) (_texturesBase + _bufferOffset);
1163 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001164 glGenTextures(
1165 (GLsizei)n,
1166 (GLuint *)textures
1167 );
1168
1169exit:
1170 if (_array) {
1171 releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE);
1172 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001173 if (_exception) {
1174 jniThrowException(_env, _exceptionType, _exceptionMessage);
1175 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001176}
1177
1178/* GLenum glGetError ( void ) */
1179static jint
1180android_glGetError__
1181 (JNIEnv *_env, jobject _this) {
1182 GLenum _returnValue;
1183 _returnValue = glGetError();
Andy McFaddencee51982013-04-25 16:08:31 -07001184 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001185}
1186
1187/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1188static void
1189android_glGetIntegerv__I_3II
1190 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1191 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001192 const char * _exceptionType = NULL;
1193 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001194 GLint *params_base = (GLint *) 0;
1195 jint _remaining;
1196 GLint *params = (GLint *) 0;
1197
1198 if (!params_ref) {
1199 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001200 _exceptionType = "java/lang/IllegalArgumentException";
1201 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001202 goto exit;
1203 }
1204 if (offset < 0) {
1205 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001206 _exceptionType = "java/lang/IllegalArgumentException";
1207 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001208 goto exit;
1209 }
1210 _remaining = _env->GetArrayLength(params_ref) - offset;
1211 int _needed;
1212 switch (pname) {
1213#if defined(GL_ALPHA_BITS)
1214 case GL_ALPHA_BITS:
1215#endif // defined(GL_ALPHA_BITS)
1216#if defined(GL_ALPHA_TEST_FUNC)
1217 case GL_ALPHA_TEST_FUNC:
1218#endif // defined(GL_ALPHA_TEST_FUNC)
1219#if defined(GL_ALPHA_TEST_REF)
1220 case GL_ALPHA_TEST_REF:
1221#endif // defined(GL_ALPHA_TEST_REF)
1222#if defined(GL_BLEND_DST)
1223 case GL_BLEND_DST:
1224#endif // defined(GL_BLEND_DST)
1225#if defined(GL_BLUE_BITS)
1226 case GL_BLUE_BITS:
1227#endif // defined(GL_BLUE_BITS)
1228#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1229 case GL_COLOR_ARRAY_BUFFER_BINDING:
1230#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1231#if defined(GL_COLOR_ARRAY_SIZE)
1232 case GL_COLOR_ARRAY_SIZE:
1233#endif // defined(GL_COLOR_ARRAY_SIZE)
1234#if defined(GL_COLOR_ARRAY_STRIDE)
1235 case GL_COLOR_ARRAY_STRIDE:
1236#endif // defined(GL_COLOR_ARRAY_STRIDE)
1237#if defined(GL_COLOR_ARRAY_TYPE)
1238 case GL_COLOR_ARRAY_TYPE:
1239#endif // defined(GL_COLOR_ARRAY_TYPE)
1240#if defined(GL_CULL_FACE)
1241 case GL_CULL_FACE:
1242#endif // defined(GL_CULL_FACE)
1243#if defined(GL_DEPTH_BITS)
1244 case GL_DEPTH_BITS:
1245#endif // defined(GL_DEPTH_BITS)
1246#if defined(GL_DEPTH_CLEAR_VALUE)
1247 case GL_DEPTH_CLEAR_VALUE:
1248#endif // defined(GL_DEPTH_CLEAR_VALUE)
1249#if defined(GL_DEPTH_FUNC)
1250 case GL_DEPTH_FUNC:
1251#endif // defined(GL_DEPTH_FUNC)
1252#if defined(GL_DEPTH_WRITEMASK)
1253 case GL_DEPTH_WRITEMASK:
1254#endif // defined(GL_DEPTH_WRITEMASK)
1255#if defined(GL_FOG_DENSITY)
1256 case GL_FOG_DENSITY:
1257#endif // defined(GL_FOG_DENSITY)
1258#if defined(GL_FOG_END)
1259 case GL_FOG_END:
1260#endif // defined(GL_FOG_END)
1261#if defined(GL_FOG_MODE)
1262 case GL_FOG_MODE:
1263#endif // defined(GL_FOG_MODE)
1264#if defined(GL_FOG_START)
1265 case GL_FOG_START:
1266#endif // defined(GL_FOG_START)
1267#if defined(GL_FRONT_FACE)
1268 case GL_FRONT_FACE:
1269#endif // defined(GL_FRONT_FACE)
1270#if defined(GL_GREEN_BITS)
1271 case GL_GREEN_BITS:
1272#endif // defined(GL_GREEN_BITS)
1273#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1274 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1275#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1276#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1277 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1278#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001279#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1280 case GL_LIGHT_MODEL_COLOR_CONTROL:
1281#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1282#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1283 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1284#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001285#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1286 case GL_LIGHT_MODEL_TWO_SIDE:
1287#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1288#if defined(GL_LINE_SMOOTH_HINT)
1289 case GL_LINE_SMOOTH_HINT:
1290#endif // defined(GL_LINE_SMOOTH_HINT)
1291#if defined(GL_LINE_WIDTH)
1292 case GL_LINE_WIDTH:
1293#endif // defined(GL_LINE_WIDTH)
1294#if defined(GL_LOGIC_OP_MODE)
1295 case GL_LOGIC_OP_MODE:
1296#endif // defined(GL_LOGIC_OP_MODE)
1297#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1298 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1299#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1300#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1301 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1302#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1303#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1304 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1305#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1306#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1307 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1308#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1309#if defined(GL_MATRIX_MODE)
1310 case GL_MATRIX_MODE:
1311#endif // defined(GL_MATRIX_MODE)
1312#if defined(GL_MAX_CLIP_PLANES)
1313 case GL_MAX_CLIP_PLANES:
1314#endif // defined(GL_MAX_CLIP_PLANES)
1315#if defined(GL_MAX_ELEMENTS_INDICES)
1316 case GL_MAX_ELEMENTS_INDICES:
1317#endif // defined(GL_MAX_ELEMENTS_INDICES)
1318#if defined(GL_MAX_ELEMENTS_VERTICES)
1319 case GL_MAX_ELEMENTS_VERTICES:
1320#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1321#if defined(GL_MAX_LIGHTS)
1322 case GL_MAX_LIGHTS:
1323#endif // defined(GL_MAX_LIGHTS)
1324#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1325 case GL_MAX_MODELVIEW_STACK_DEPTH:
1326#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1327#if defined(GL_MAX_PALETTE_MATRICES_OES)
1328 case GL_MAX_PALETTE_MATRICES_OES:
1329#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1330#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1331 case GL_MAX_PROJECTION_STACK_DEPTH:
1332#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1333#if defined(GL_MAX_TEXTURE_SIZE)
1334 case GL_MAX_TEXTURE_SIZE:
1335#endif // defined(GL_MAX_TEXTURE_SIZE)
1336#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1337 case GL_MAX_TEXTURE_STACK_DEPTH:
1338#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1339#if defined(GL_MAX_TEXTURE_UNITS)
1340 case GL_MAX_TEXTURE_UNITS:
1341#endif // defined(GL_MAX_TEXTURE_UNITS)
1342#if defined(GL_MAX_VERTEX_UNITS_OES)
1343 case GL_MAX_VERTEX_UNITS_OES:
1344#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1345#if defined(GL_MODELVIEW_STACK_DEPTH)
1346 case GL_MODELVIEW_STACK_DEPTH:
1347#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1348#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1349 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1350#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1351#if defined(GL_NORMAL_ARRAY_STRIDE)
1352 case GL_NORMAL_ARRAY_STRIDE:
1353#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1354#if defined(GL_NORMAL_ARRAY_TYPE)
1355 case GL_NORMAL_ARRAY_TYPE:
1356#endif // defined(GL_NORMAL_ARRAY_TYPE)
1357#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1358 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1359#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1360#if defined(GL_PACK_ALIGNMENT)
1361 case GL_PACK_ALIGNMENT:
1362#endif // defined(GL_PACK_ALIGNMENT)
1363#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1364 case GL_PERSPECTIVE_CORRECTION_HINT:
1365#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1366#if defined(GL_POINT_SIZE)
1367 case GL_POINT_SIZE:
1368#endif // defined(GL_POINT_SIZE)
1369#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1370 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1371#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1372#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1373 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1374#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1375#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1376 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1377#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1378#if defined(GL_POINT_SMOOTH_HINT)
1379 case GL_POINT_SMOOTH_HINT:
1380#endif // defined(GL_POINT_SMOOTH_HINT)
1381#if defined(GL_POLYGON_OFFSET_FACTOR)
1382 case GL_POLYGON_OFFSET_FACTOR:
1383#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1384#if defined(GL_POLYGON_OFFSET_UNITS)
1385 case GL_POLYGON_OFFSET_UNITS:
1386#endif // defined(GL_POLYGON_OFFSET_UNITS)
1387#if defined(GL_PROJECTION_STACK_DEPTH)
1388 case GL_PROJECTION_STACK_DEPTH:
1389#endif // defined(GL_PROJECTION_STACK_DEPTH)
1390#if defined(GL_RED_BITS)
1391 case GL_RED_BITS:
1392#endif // defined(GL_RED_BITS)
1393#if defined(GL_SHADE_MODEL)
1394 case GL_SHADE_MODEL:
1395#endif // defined(GL_SHADE_MODEL)
1396#if defined(GL_STENCIL_BITS)
1397 case GL_STENCIL_BITS:
1398#endif // defined(GL_STENCIL_BITS)
1399#if defined(GL_STENCIL_CLEAR_VALUE)
1400 case GL_STENCIL_CLEAR_VALUE:
1401#endif // defined(GL_STENCIL_CLEAR_VALUE)
1402#if defined(GL_STENCIL_FAIL)
1403 case GL_STENCIL_FAIL:
1404#endif // defined(GL_STENCIL_FAIL)
1405#if defined(GL_STENCIL_FUNC)
1406 case GL_STENCIL_FUNC:
1407#endif // defined(GL_STENCIL_FUNC)
1408#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1409 case GL_STENCIL_PASS_DEPTH_FAIL:
1410#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1411#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1412 case GL_STENCIL_PASS_DEPTH_PASS:
1413#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1414#if defined(GL_STENCIL_REF)
1415 case GL_STENCIL_REF:
1416#endif // defined(GL_STENCIL_REF)
1417#if defined(GL_STENCIL_VALUE_MASK)
1418 case GL_STENCIL_VALUE_MASK:
1419#endif // defined(GL_STENCIL_VALUE_MASK)
1420#if defined(GL_STENCIL_WRITEMASK)
1421 case GL_STENCIL_WRITEMASK:
1422#endif // defined(GL_STENCIL_WRITEMASK)
1423#if defined(GL_SUBPIXEL_BITS)
1424 case GL_SUBPIXEL_BITS:
1425#endif // defined(GL_SUBPIXEL_BITS)
1426#if defined(GL_TEXTURE_BINDING_2D)
1427 case GL_TEXTURE_BINDING_2D:
1428#endif // defined(GL_TEXTURE_BINDING_2D)
1429#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1430 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1431#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1432#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1433 case GL_TEXTURE_COORD_ARRAY_SIZE:
1434#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1435#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1436 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1437#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1438#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1439 case GL_TEXTURE_COORD_ARRAY_TYPE:
1440#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1441#if defined(GL_TEXTURE_STACK_DEPTH)
1442 case GL_TEXTURE_STACK_DEPTH:
1443#endif // defined(GL_TEXTURE_STACK_DEPTH)
1444#if defined(GL_UNPACK_ALIGNMENT)
1445 case GL_UNPACK_ALIGNMENT:
1446#endif // defined(GL_UNPACK_ALIGNMENT)
1447#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1448 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1449#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1450#if defined(GL_VERTEX_ARRAY_SIZE)
1451 case GL_VERTEX_ARRAY_SIZE:
1452#endif // defined(GL_VERTEX_ARRAY_SIZE)
1453#if defined(GL_VERTEX_ARRAY_STRIDE)
1454 case GL_VERTEX_ARRAY_STRIDE:
1455#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1456#if defined(GL_VERTEX_ARRAY_TYPE)
1457 case GL_VERTEX_ARRAY_TYPE:
1458#endif // defined(GL_VERTEX_ARRAY_TYPE)
1459#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1460 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1461#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1462#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1463 case GL_WEIGHT_ARRAY_SIZE_OES:
1464#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1465#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1466 case GL_WEIGHT_ARRAY_STRIDE_OES:
1467#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1468#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1469 case GL_WEIGHT_ARRAY_TYPE_OES:
1470#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1471 _needed = 1;
1472 break;
1473#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1474 case GL_ALIASED_POINT_SIZE_RANGE:
1475#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1476#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1477 case GL_ALIASED_LINE_WIDTH_RANGE:
1478#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1479#if defined(GL_DEPTH_RANGE)
1480 case GL_DEPTH_RANGE:
1481#endif // defined(GL_DEPTH_RANGE)
1482#if defined(GL_MAX_VIEWPORT_DIMS)
1483 case GL_MAX_VIEWPORT_DIMS:
1484#endif // defined(GL_MAX_VIEWPORT_DIMS)
1485#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1486 case GL_SMOOTH_LINE_WIDTH_RANGE:
1487#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1488#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1489 case GL_SMOOTH_POINT_SIZE_RANGE:
1490#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1491 _needed = 2;
1492 break;
1493#if defined(GL_COLOR_CLEAR_VALUE)
1494 case GL_COLOR_CLEAR_VALUE:
1495#endif // defined(GL_COLOR_CLEAR_VALUE)
1496#if defined(GL_COLOR_WRITEMASK)
1497 case GL_COLOR_WRITEMASK:
1498#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001499#if defined(GL_FOG_COLOR)
1500 case GL_FOG_COLOR:
1501#endif // defined(GL_FOG_COLOR)
1502#if defined(GL_LIGHT_MODEL_AMBIENT)
1503 case GL_LIGHT_MODEL_AMBIENT:
1504#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001505#if defined(GL_SCISSOR_BOX)
1506 case GL_SCISSOR_BOX:
1507#endif // defined(GL_SCISSOR_BOX)
1508#if defined(GL_VIEWPORT)
1509 case GL_VIEWPORT:
1510#endif // defined(GL_VIEWPORT)
1511 _needed = 4;
1512 break;
1513#if defined(GL_MODELVIEW_MATRIX)
1514 case GL_MODELVIEW_MATRIX:
1515#endif // defined(GL_MODELVIEW_MATRIX)
1516#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1517 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1518#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1519#if defined(GL_PROJECTION_MATRIX)
1520 case GL_PROJECTION_MATRIX:
1521#endif // defined(GL_PROJECTION_MATRIX)
1522#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1523 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1524#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1525#if defined(GL_TEXTURE_MATRIX)
1526 case GL_TEXTURE_MATRIX:
1527#endif // defined(GL_TEXTURE_MATRIX)
1528#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1529 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1530#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1531 _needed = 16;
1532 break;
1533#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1534 case GL_COMPRESSED_TEXTURE_FORMATS:
1535#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001536 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001537 break;
1538 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001539 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001540 break;
1541 }
1542 if (_remaining < _needed) {
1543 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001544 _exceptionType = "java/lang/IllegalArgumentException";
1545 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001546 goto exit;
1547 }
1548 params_base = (GLint *)
1549 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1550 params = params_base + offset;
1551
1552 glGetIntegerv(
1553 (GLenum)pname,
1554 (GLint *)params
1555 );
1556
1557exit:
1558 if (params_base) {
1559 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1560 _exception ? JNI_ABORT: 0);
1561 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001562 if (_exception) {
1563 jniThrowException(_env, _exceptionType, _exceptionMessage);
1564 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565}
1566
1567/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1568static void
1569android_glGetIntegerv__ILjava_nio_IntBuffer_2
1570 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1571 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001572 const char * _exceptionType = NULL;
1573 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001575 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001576 jint _remaining;
1577 GLint *params = (GLint *) 0;
1578
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001579 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 int _needed;
1581 switch (pname) {
1582#if defined(GL_ALPHA_BITS)
1583 case GL_ALPHA_BITS:
1584#endif // defined(GL_ALPHA_BITS)
1585#if defined(GL_ALPHA_TEST_FUNC)
1586 case GL_ALPHA_TEST_FUNC:
1587#endif // defined(GL_ALPHA_TEST_FUNC)
1588#if defined(GL_ALPHA_TEST_REF)
1589 case GL_ALPHA_TEST_REF:
1590#endif // defined(GL_ALPHA_TEST_REF)
1591#if defined(GL_BLEND_DST)
1592 case GL_BLEND_DST:
1593#endif // defined(GL_BLEND_DST)
1594#if defined(GL_BLUE_BITS)
1595 case GL_BLUE_BITS:
1596#endif // defined(GL_BLUE_BITS)
1597#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1598 case GL_COLOR_ARRAY_BUFFER_BINDING:
1599#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1600#if defined(GL_COLOR_ARRAY_SIZE)
1601 case GL_COLOR_ARRAY_SIZE:
1602#endif // defined(GL_COLOR_ARRAY_SIZE)
1603#if defined(GL_COLOR_ARRAY_STRIDE)
1604 case GL_COLOR_ARRAY_STRIDE:
1605#endif // defined(GL_COLOR_ARRAY_STRIDE)
1606#if defined(GL_COLOR_ARRAY_TYPE)
1607 case GL_COLOR_ARRAY_TYPE:
1608#endif // defined(GL_COLOR_ARRAY_TYPE)
1609#if defined(GL_CULL_FACE)
1610 case GL_CULL_FACE:
1611#endif // defined(GL_CULL_FACE)
1612#if defined(GL_DEPTH_BITS)
1613 case GL_DEPTH_BITS:
1614#endif // defined(GL_DEPTH_BITS)
1615#if defined(GL_DEPTH_CLEAR_VALUE)
1616 case GL_DEPTH_CLEAR_VALUE:
1617#endif // defined(GL_DEPTH_CLEAR_VALUE)
1618#if defined(GL_DEPTH_FUNC)
1619 case GL_DEPTH_FUNC:
1620#endif // defined(GL_DEPTH_FUNC)
1621#if defined(GL_DEPTH_WRITEMASK)
1622 case GL_DEPTH_WRITEMASK:
1623#endif // defined(GL_DEPTH_WRITEMASK)
1624#if defined(GL_FOG_DENSITY)
1625 case GL_FOG_DENSITY:
1626#endif // defined(GL_FOG_DENSITY)
1627#if defined(GL_FOG_END)
1628 case GL_FOG_END:
1629#endif // defined(GL_FOG_END)
1630#if defined(GL_FOG_MODE)
1631 case GL_FOG_MODE:
1632#endif // defined(GL_FOG_MODE)
1633#if defined(GL_FOG_START)
1634 case GL_FOG_START:
1635#endif // defined(GL_FOG_START)
1636#if defined(GL_FRONT_FACE)
1637 case GL_FRONT_FACE:
1638#endif // defined(GL_FRONT_FACE)
1639#if defined(GL_GREEN_BITS)
1640 case GL_GREEN_BITS:
1641#endif // defined(GL_GREEN_BITS)
1642#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1643 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1644#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1645#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1646 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1647#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001648#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1649 case GL_LIGHT_MODEL_COLOR_CONTROL:
1650#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1651#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1652 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1653#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001654#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1655 case GL_LIGHT_MODEL_TWO_SIDE:
1656#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1657#if defined(GL_LINE_SMOOTH_HINT)
1658 case GL_LINE_SMOOTH_HINT:
1659#endif // defined(GL_LINE_SMOOTH_HINT)
1660#if defined(GL_LINE_WIDTH)
1661 case GL_LINE_WIDTH:
1662#endif // defined(GL_LINE_WIDTH)
1663#if defined(GL_LOGIC_OP_MODE)
1664 case GL_LOGIC_OP_MODE:
1665#endif // defined(GL_LOGIC_OP_MODE)
1666#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1667 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1668#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1669#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1670 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1671#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1672#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1673 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1674#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1675#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1676 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1677#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1678#if defined(GL_MATRIX_MODE)
1679 case GL_MATRIX_MODE:
1680#endif // defined(GL_MATRIX_MODE)
1681#if defined(GL_MAX_CLIP_PLANES)
1682 case GL_MAX_CLIP_PLANES:
1683#endif // defined(GL_MAX_CLIP_PLANES)
1684#if defined(GL_MAX_ELEMENTS_INDICES)
1685 case GL_MAX_ELEMENTS_INDICES:
1686#endif // defined(GL_MAX_ELEMENTS_INDICES)
1687#if defined(GL_MAX_ELEMENTS_VERTICES)
1688 case GL_MAX_ELEMENTS_VERTICES:
1689#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1690#if defined(GL_MAX_LIGHTS)
1691 case GL_MAX_LIGHTS:
1692#endif // defined(GL_MAX_LIGHTS)
1693#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1694 case GL_MAX_MODELVIEW_STACK_DEPTH:
1695#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1696#if defined(GL_MAX_PALETTE_MATRICES_OES)
1697 case GL_MAX_PALETTE_MATRICES_OES:
1698#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1699#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1700 case GL_MAX_PROJECTION_STACK_DEPTH:
1701#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1702#if defined(GL_MAX_TEXTURE_SIZE)
1703 case GL_MAX_TEXTURE_SIZE:
1704#endif // defined(GL_MAX_TEXTURE_SIZE)
1705#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1706 case GL_MAX_TEXTURE_STACK_DEPTH:
1707#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1708#if defined(GL_MAX_TEXTURE_UNITS)
1709 case GL_MAX_TEXTURE_UNITS:
1710#endif // defined(GL_MAX_TEXTURE_UNITS)
1711#if defined(GL_MAX_VERTEX_UNITS_OES)
1712 case GL_MAX_VERTEX_UNITS_OES:
1713#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1714#if defined(GL_MODELVIEW_STACK_DEPTH)
1715 case GL_MODELVIEW_STACK_DEPTH:
1716#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1717#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1718 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1719#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1720#if defined(GL_NORMAL_ARRAY_STRIDE)
1721 case GL_NORMAL_ARRAY_STRIDE:
1722#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1723#if defined(GL_NORMAL_ARRAY_TYPE)
1724 case GL_NORMAL_ARRAY_TYPE:
1725#endif // defined(GL_NORMAL_ARRAY_TYPE)
1726#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1727 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1728#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1729#if defined(GL_PACK_ALIGNMENT)
1730 case GL_PACK_ALIGNMENT:
1731#endif // defined(GL_PACK_ALIGNMENT)
1732#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1733 case GL_PERSPECTIVE_CORRECTION_HINT:
1734#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1735#if defined(GL_POINT_SIZE)
1736 case GL_POINT_SIZE:
1737#endif // defined(GL_POINT_SIZE)
1738#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1739 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1740#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1741#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1742 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1743#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1744#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1745 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1746#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1747#if defined(GL_POINT_SMOOTH_HINT)
1748 case GL_POINT_SMOOTH_HINT:
1749#endif // defined(GL_POINT_SMOOTH_HINT)
1750#if defined(GL_POLYGON_OFFSET_FACTOR)
1751 case GL_POLYGON_OFFSET_FACTOR:
1752#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1753#if defined(GL_POLYGON_OFFSET_UNITS)
1754 case GL_POLYGON_OFFSET_UNITS:
1755#endif // defined(GL_POLYGON_OFFSET_UNITS)
1756#if defined(GL_PROJECTION_STACK_DEPTH)
1757 case GL_PROJECTION_STACK_DEPTH:
1758#endif // defined(GL_PROJECTION_STACK_DEPTH)
1759#if defined(GL_RED_BITS)
1760 case GL_RED_BITS:
1761#endif // defined(GL_RED_BITS)
1762#if defined(GL_SHADE_MODEL)
1763 case GL_SHADE_MODEL:
1764#endif // defined(GL_SHADE_MODEL)
1765#if defined(GL_STENCIL_BITS)
1766 case GL_STENCIL_BITS:
1767#endif // defined(GL_STENCIL_BITS)
1768#if defined(GL_STENCIL_CLEAR_VALUE)
1769 case GL_STENCIL_CLEAR_VALUE:
1770#endif // defined(GL_STENCIL_CLEAR_VALUE)
1771#if defined(GL_STENCIL_FAIL)
1772 case GL_STENCIL_FAIL:
1773#endif // defined(GL_STENCIL_FAIL)
1774#if defined(GL_STENCIL_FUNC)
1775 case GL_STENCIL_FUNC:
1776#endif // defined(GL_STENCIL_FUNC)
1777#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1778 case GL_STENCIL_PASS_DEPTH_FAIL:
1779#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1780#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1781 case GL_STENCIL_PASS_DEPTH_PASS:
1782#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1783#if defined(GL_STENCIL_REF)
1784 case GL_STENCIL_REF:
1785#endif // defined(GL_STENCIL_REF)
1786#if defined(GL_STENCIL_VALUE_MASK)
1787 case GL_STENCIL_VALUE_MASK:
1788#endif // defined(GL_STENCIL_VALUE_MASK)
1789#if defined(GL_STENCIL_WRITEMASK)
1790 case GL_STENCIL_WRITEMASK:
1791#endif // defined(GL_STENCIL_WRITEMASK)
1792#if defined(GL_SUBPIXEL_BITS)
1793 case GL_SUBPIXEL_BITS:
1794#endif // defined(GL_SUBPIXEL_BITS)
1795#if defined(GL_TEXTURE_BINDING_2D)
1796 case GL_TEXTURE_BINDING_2D:
1797#endif // defined(GL_TEXTURE_BINDING_2D)
1798#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1799 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1800#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1801#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1802 case GL_TEXTURE_COORD_ARRAY_SIZE:
1803#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1804#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1805 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1806#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1807#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1808 case GL_TEXTURE_COORD_ARRAY_TYPE:
1809#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1810#if defined(GL_TEXTURE_STACK_DEPTH)
1811 case GL_TEXTURE_STACK_DEPTH:
1812#endif // defined(GL_TEXTURE_STACK_DEPTH)
1813#if defined(GL_UNPACK_ALIGNMENT)
1814 case GL_UNPACK_ALIGNMENT:
1815#endif // defined(GL_UNPACK_ALIGNMENT)
1816#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1817 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1818#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1819#if defined(GL_VERTEX_ARRAY_SIZE)
1820 case GL_VERTEX_ARRAY_SIZE:
1821#endif // defined(GL_VERTEX_ARRAY_SIZE)
1822#if defined(GL_VERTEX_ARRAY_STRIDE)
1823 case GL_VERTEX_ARRAY_STRIDE:
1824#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1825#if defined(GL_VERTEX_ARRAY_TYPE)
1826 case GL_VERTEX_ARRAY_TYPE:
1827#endif // defined(GL_VERTEX_ARRAY_TYPE)
1828#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1829 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1830#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1831#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1832 case GL_WEIGHT_ARRAY_SIZE_OES:
1833#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1834#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1835 case GL_WEIGHT_ARRAY_STRIDE_OES:
1836#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1837#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1838 case GL_WEIGHT_ARRAY_TYPE_OES:
1839#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1840 _needed = 1;
1841 break;
1842#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1843 case GL_ALIASED_POINT_SIZE_RANGE:
1844#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1845#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1846 case GL_ALIASED_LINE_WIDTH_RANGE:
1847#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1848#if defined(GL_DEPTH_RANGE)
1849 case GL_DEPTH_RANGE:
1850#endif // defined(GL_DEPTH_RANGE)
1851#if defined(GL_MAX_VIEWPORT_DIMS)
1852 case GL_MAX_VIEWPORT_DIMS:
1853#endif // defined(GL_MAX_VIEWPORT_DIMS)
1854#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1855 case GL_SMOOTH_LINE_WIDTH_RANGE:
1856#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1857#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1858 case GL_SMOOTH_POINT_SIZE_RANGE:
1859#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1860 _needed = 2;
1861 break;
1862#if defined(GL_COLOR_CLEAR_VALUE)
1863 case GL_COLOR_CLEAR_VALUE:
1864#endif // defined(GL_COLOR_CLEAR_VALUE)
1865#if defined(GL_COLOR_WRITEMASK)
1866 case GL_COLOR_WRITEMASK:
1867#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001868#if defined(GL_FOG_COLOR)
1869 case GL_FOG_COLOR:
1870#endif // defined(GL_FOG_COLOR)
1871#if defined(GL_LIGHT_MODEL_AMBIENT)
1872 case GL_LIGHT_MODEL_AMBIENT:
1873#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001874#if defined(GL_SCISSOR_BOX)
1875 case GL_SCISSOR_BOX:
1876#endif // defined(GL_SCISSOR_BOX)
1877#if defined(GL_VIEWPORT)
1878 case GL_VIEWPORT:
1879#endif // defined(GL_VIEWPORT)
1880 _needed = 4;
1881 break;
1882#if defined(GL_MODELVIEW_MATRIX)
1883 case GL_MODELVIEW_MATRIX:
1884#endif // defined(GL_MODELVIEW_MATRIX)
1885#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1886 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1887#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1888#if defined(GL_PROJECTION_MATRIX)
1889 case GL_PROJECTION_MATRIX:
1890#endif // defined(GL_PROJECTION_MATRIX)
1891#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1892 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1893#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1894#if defined(GL_TEXTURE_MATRIX)
1895 case GL_TEXTURE_MATRIX:
1896#endif // defined(GL_TEXTURE_MATRIX)
1897#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1898 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1899#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1900 _needed = 16;
1901 break;
1902#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1903 case GL_COMPRESSED_TEXTURE_FORMATS:
1904#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001905 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001906 break;
1907 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001908 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001909 break;
1910 }
1911 if (_remaining < _needed) {
1912 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001913 _exceptionType = "java/lang/IllegalArgumentException";
1914 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001915 goto exit;
1916 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001917 if (params == NULL) {
1918 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1919 params = (GLint *) (_paramsBase + _bufferOffset);
1920 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001921 glGetIntegerv(
1922 (GLenum)pname,
1923 (GLint *)params
1924 );
1925
1926exit:
1927 if (_array) {
1928 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1929 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001930 if (_exception) {
1931 jniThrowException(_env, _exceptionType, _exceptionMessage);
1932 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001933}
1934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001935/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001936static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
1937 const char* chars = (const char*) glGetString((GLenum) name);
1938 return _env->NewStringUTF(chars);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001939}
1940/* void glHint ( GLenum target, GLenum mode ) */
1941static void
1942android_glHint__II
1943 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1944 glHint(
1945 (GLenum)target,
1946 (GLenum)mode
1947 );
1948}
1949
1950/* void glLightModelf ( GLenum pname, GLfloat param ) */
1951static void
1952android_glLightModelf__IF
1953 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1954 glLightModelf(
1955 (GLenum)pname,
1956 (GLfloat)param
1957 );
1958}
1959
1960/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1961static void
1962android_glLightModelfv__I_3FI
1963 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001964 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001965 const char * _exceptionType = NULL;
1966 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001967 GLfloat *params_base = (GLfloat *) 0;
1968 jint _remaining;
1969 GLfloat *params = (GLfloat *) 0;
1970
1971 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001972 _exception = 1;
1973 _exceptionType = "java/lang/IllegalArgumentException";
1974 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001975 goto exit;
1976 }
1977 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001978 _exception = 1;
1979 _exceptionType = "java/lang/IllegalArgumentException";
1980 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001981 goto exit;
1982 }
1983 _remaining = _env->GetArrayLength(params_ref) - offset;
1984 int _needed;
1985 switch (pname) {
1986#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1987 case GL_LIGHT_MODEL_TWO_SIDE:
1988#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1989 _needed = 1;
1990 break;
1991#if defined(GL_LIGHT_MODEL_AMBIENT)
1992 case GL_LIGHT_MODEL_AMBIENT:
1993#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1994 _needed = 4;
1995 break;
1996 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001997 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001998 break;
1999 }
2000 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002001 _exception = 1;
2002 _exceptionType = "java/lang/IllegalArgumentException";
2003 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002004 goto exit;
2005 }
2006 params_base = (GLfloat *)
2007 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2008 params = params_base + offset;
2009
2010 glLightModelfv(
2011 (GLenum)pname,
2012 (GLfloat *)params
2013 );
2014
2015exit:
2016 if (params_base) {
2017 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2018 JNI_ABORT);
2019 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002020 if (_exception) {
2021 jniThrowException(_env, _exceptionType, _exceptionMessage);
2022 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002023}
2024
2025/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2026static void
2027android_glLightModelfv__ILjava_nio_FloatBuffer_2
2028 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002029 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002030 const char * _exceptionType = NULL;
2031 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002032 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002033 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002034 jint _remaining;
2035 GLfloat *params = (GLfloat *) 0;
2036
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002037 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038 int _needed;
2039 switch (pname) {
2040#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2041 case GL_LIGHT_MODEL_TWO_SIDE:
2042#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2043 _needed = 1;
2044 break;
2045#if defined(GL_LIGHT_MODEL_AMBIENT)
2046 case GL_LIGHT_MODEL_AMBIENT:
2047#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2048 _needed = 4;
2049 break;
2050 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002051 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002052 break;
2053 }
2054 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002055 _exception = 1;
2056 _exceptionType = "java/lang/IllegalArgumentException";
2057 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002058 goto exit;
2059 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002060 if (params == NULL) {
2061 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2062 params = (GLfloat *) (_paramsBase + _bufferOffset);
2063 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002064 glLightModelfv(
2065 (GLenum)pname,
2066 (GLfloat *)params
2067 );
2068
2069exit:
2070 if (_array) {
2071 releasePointer(_env, _array, params, JNI_FALSE);
2072 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002073 if (_exception) {
2074 jniThrowException(_env, _exceptionType, _exceptionMessage);
2075 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076}
2077
2078/* void glLightModelx ( GLenum pname, GLfixed param ) */
2079static void
2080android_glLightModelx__II
2081 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2082 glLightModelx(
2083 (GLenum)pname,
2084 (GLfixed)param
2085 );
2086}
2087
2088/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2089static void
2090android_glLightModelxv__I_3II
2091 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002092 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002093 const char * _exceptionType = NULL;
2094 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002095 GLfixed *params_base = (GLfixed *) 0;
2096 jint _remaining;
2097 GLfixed *params = (GLfixed *) 0;
2098
2099 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002100 _exception = 1;
2101 _exceptionType = "java/lang/IllegalArgumentException";
2102 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002103 goto exit;
2104 }
2105 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002106 _exception = 1;
2107 _exceptionType = "java/lang/IllegalArgumentException";
2108 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002109 goto exit;
2110 }
2111 _remaining = _env->GetArrayLength(params_ref) - offset;
2112 int _needed;
2113 switch (pname) {
2114#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2115 case GL_LIGHT_MODEL_TWO_SIDE:
2116#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2117 _needed = 1;
2118 break;
2119#if defined(GL_LIGHT_MODEL_AMBIENT)
2120 case GL_LIGHT_MODEL_AMBIENT:
2121#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2122 _needed = 4;
2123 break;
2124 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002125 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002126 break;
2127 }
2128 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002129 _exception = 1;
2130 _exceptionType = "java/lang/IllegalArgumentException";
2131 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002132 goto exit;
2133 }
2134 params_base = (GLfixed *)
2135 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2136 params = params_base + offset;
2137
2138 glLightModelxv(
2139 (GLenum)pname,
2140 (GLfixed *)params
2141 );
2142
2143exit:
2144 if (params_base) {
2145 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2146 JNI_ABORT);
2147 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002148 if (_exception) {
2149 jniThrowException(_env, _exceptionType, _exceptionMessage);
2150 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002151}
2152
2153/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2154static void
2155android_glLightModelxv__ILjava_nio_IntBuffer_2
2156 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002157 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002158 const char * _exceptionType = NULL;
2159 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002160 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002161 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002162 jint _remaining;
2163 GLfixed *params = (GLfixed *) 0;
2164
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002165 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 int _needed;
2167 switch (pname) {
2168#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2169 case GL_LIGHT_MODEL_TWO_SIDE:
2170#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2171 _needed = 1;
2172 break;
2173#if defined(GL_LIGHT_MODEL_AMBIENT)
2174 case GL_LIGHT_MODEL_AMBIENT:
2175#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2176 _needed = 4;
2177 break;
2178 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002179 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002180 break;
2181 }
2182 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002183 _exception = 1;
2184 _exceptionType = "java/lang/IllegalArgumentException";
2185 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002186 goto exit;
2187 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002188 if (params == NULL) {
2189 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2190 params = (GLfixed *) (_paramsBase + _bufferOffset);
2191 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002192 glLightModelxv(
2193 (GLenum)pname,
2194 (GLfixed *)params
2195 );
2196
2197exit:
2198 if (_array) {
2199 releasePointer(_env, _array, params, JNI_FALSE);
2200 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002201 if (_exception) {
2202 jniThrowException(_env, _exceptionType, _exceptionMessage);
2203 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002204}
2205
2206/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2207static void
2208android_glLightf__IIF
2209 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2210 glLightf(
2211 (GLenum)light,
2212 (GLenum)pname,
2213 (GLfloat)param
2214 );
2215}
2216
2217/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2218static void
2219android_glLightfv__II_3FI
2220 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002221 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002222 const char * _exceptionType = NULL;
2223 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002224 GLfloat *params_base = (GLfloat *) 0;
2225 jint _remaining;
2226 GLfloat *params = (GLfloat *) 0;
2227
2228 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002229 _exception = 1;
2230 _exceptionType = "java/lang/IllegalArgumentException";
2231 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002232 goto exit;
2233 }
2234 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002235 _exception = 1;
2236 _exceptionType = "java/lang/IllegalArgumentException";
2237 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002238 goto exit;
2239 }
2240 _remaining = _env->GetArrayLength(params_ref) - offset;
2241 int _needed;
2242 switch (pname) {
2243#if defined(GL_SPOT_EXPONENT)
2244 case GL_SPOT_EXPONENT:
2245#endif // defined(GL_SPOT_EXPONENT)
2246#if defined(GL_SPOT_CUTOFF)
2247 case GL_SPOT_CUTOFF:
2248#endif // defined(GL_SPOT_CUTOFF)
2249#if defined(GL_CONSTANT_ATTENUATION)
2250 case GL_CONSTANT_ATTENUATION:
2251#endif // defined(GL_CONSTANT_ATTENUATION)
2252#if defined(GL_LINEAR_ATTENUATION)
2253 case GL_LINEAR_ATTENUATION:
2254#endif // defined(GL_LINEAR_ATTENUATION)
2255#if defined(GL_QUADRATIC_ATTENUATION)
2256 case GL_QUADRATIC_ATTENUATION:
2257#endif // defined(GL_QUADRATIC_ATTENUATION)
2258 _needed = 1;
2259 break;
2260#if defined(GL_SPOT_DIRECTION)
2261 case GL_SPOT_DIRECTION:
2262#endif // defined(GL_SPOT_DIRECTION)
2263 _needed = 3;
2264 break;
2265#if defined(GL_AMBIENT)
2266 case GL_AMBIENT:
2267#endif // defined(GL_AMBIENT)
2268#if defined(GL_DIFFUSE)
2269 case GL_DIFFUSE:
2270#endif // defined(GL_DIFFUSE)
2271#if defined(GL_SPECULAR)
2272 case GL_SPECULAR:
2273#endif // defined(GL_SPECULAR)
2274#if defined(GL_EMISSION)
2275 case GL_EMISSION:
2276#endif // defined(GL_EMISSION)
2277 _needed = 4;
2278 break;
2279 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002280 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002281 break;
2282 }
2283 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002284 _exception = 1;
2285 _exceptionType = "java/lang/IllegalArgumentException";
2286 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002287 goto exit;
2288 }
2289 params_base = (GLfloat *)
2290 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2291 params = params_base + offset;
2292
2293 glLightfv(
2294 (GLenum)light,
2295 (GLenum)pname,
2296 (GLfloat *)params
2297 );
2298
2299exit:
2300 if (params_base) {
2301 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2302 JNI_ABORT);
2303 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002304 if (_exception) {
2305 jniThrowException(_env, _exceptionType, _exceptionMessage);
2306 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002307}
2308
2309/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2310static void
2311android_glLightfv__IILjava_nio_FloatBuffer_2
2312 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002313 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002314 const char * _exceptionType = NULL;
2315 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002316 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002317 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002318 jint _remaining;
2319 GLfloat *params = (GLfloat *) 0;
2320
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002321 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002322 int _needed;
2323 switch (pname) {
2324#if defined(GL_SPOT_EXPONENT)
2325 case GL_SPOT_EXPONENT:
2326#endif // defined(GL_SPOT_EXPONENT)
2327#if defined(GL_SPOT_CUTOFF)
2328 case GL_SPOT_CUTOFF:
2329#endif // defined(GL_SPOT_CUTOFF)
2330#if defined(GL_CONSTANT_ATTENUATION)
2331 case GL_CONSTANT_ATTENUATION:
2332#endif // defined(GL_CONSTANT_ATTENUATION)
2333#if defined(GL_LINEAR_ATTENUATION)
2334 case GL_LINEAR_ATTENUATION:
2335#endif // defined(GL_LINEAR_ATTENUATION)
2336#if defined(GL_QUADRATIC_ATTENUATION)
2337 case GL_QUADRATIC_ATTENUATION:
2338#endif // defined(GL_QUADRATIC_ATTENUATION)
2339 _needed = 1;
2340 break;
2341#if defined(GL_SPOT_DIRECTION)
2342 case GL_SPOT_DIRECTION:
2343#endif // defined(GL_SPOT_DIRECTION)
2344 _needed = 3;
2345 break;
2346#if defined(GL_AMBIENT)
2347 case GL_AMBIENT:
2348#endif // defined(GL_AMBIENT)
2349#if defined(GL_DIFFUSE)
2350 case GL_DIFFUSE:
2351#endif // defined(GL_DIFFUSE)
2352#if defined(GL_SPECULAR)
2353 case GL_SPECULAR:
2354#endif // defined(GL_SPECULAR)
2355#if defined(GL_EMISSION)
2356 case GL_EMISSION:
2357#endif // defined(GL_EMISSION)
2358 _needed = 4;
2359 break;
2360 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002361 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002362 break;
2363 }
2364 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002365 _exception = 1;
2366 _exceptionType = "java/lang/IllegalArgumentException";
2367 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002368 goto exit;
2369 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002370 if (params == NULL) {
2371 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2372 params = (GLfloat *) (_paramsBase + _bufferOffset);
2373 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 glLightfv(
2375 (GLenum)light,
2376 (GLenum)pname,
2377 (GLfloat *)params
2378 );
2379
2380exit:
2381 if (_array) {
2382 releasePointer(_env, _array, params, JNI_FALSE);
2383 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002384 if (_exception) {
2385 jniThrowException(_env, _exceptionType, _exceptionMessage);
2386 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002387}
2388
2389/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2390static void
2391android_glLightx__III
2392 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2393 glLightx(
2394 (GLenum)light,
2395 (GLenum)pname,
2396 (GLfixed)param
2397 );
2398}
2399
2400/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2401static void
2402android_glLightxv__II_3II
2403 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002404 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002405 const char * _exceptionType = NULL;
2406 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002407 GLfixed *params_base = (GLfixed *) 0;
2408 jint _remaining;
2409 GLfixed *params = (GLfixed *) 0;
2410
2411 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002412 _exception = 1;
2413 _exceptionType = "java/lang/IllegalArgumentException";
2414 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415 goto exit;
2416 }
2417 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002418 _exception = 1;
2419 _exceptionType = "java/lang/IllegalArgumentException";
2420 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002421 goto exit;
2422 }
2423 _remaining = _env->GetArrayLength(params_ref) - offset;
2424 int _needed;
2425 switch (pname) {
2426#if defined(GL_SPOT_EXPONENT)
2427 case GL_SPOT_EXPONENT:
2428#endif // defined(GL_SPOT_EXPONENT)
2429#if defined(GL_SPOT_CUTOFF)
2430 case GL_SPOT_CUTOFF:
2431#endif // defined(GL_SPOT_CUTOFF)
2432#if defined(GL_CONSTANT_ATTENUATION)
2433 case GL_CONSTANT_ATTENUATION:
2434#endif // defined(GL_CONSTANT_ATTENUATION)
2435#if defined(GL_LINEAR_ATTENUATION)
2436 case GL_LINEAR_ATTENUATION:
2437#endif // defined(GL_LINEAR_ATTENUATION)
2438#if defined(GL_QUADRATIC_ATTENUATION)
2439 case GL_QUADRATIC_ATTENUATION:
2440#endif // defined(GL_QUADRATIC_ATTENUATION)
2441 _needed = 1;
2442 break;
2443#if defined(GL_SPOT_DIRECTION)
2444 case GL_SPOT_DIRECTION:
2445#endif // defined(GL_SPOT_DIRECTION)
2446 _needed = 3;
2447 break;
2448#if defined(GL_AMBIENT)
2449 case GL_AMBIENT:
2450#endif // defined(GL_AMBIENT)
2451#if defined(GL_DIFFUSE)
2452 case GL_DIFFUSE:
2453#endif // defined(GL_DIFFUSE)
2454#if defined(GL_SPECULAR)
2455 case GL_SPECULAR:
2456#endif // defined(GL_SPECULAR)
2457#if defined(GL_EMISSION)
2458 case GL_EMISSION:
2459#endif // defined(GL_EMISSION)
2460 _needed = 4;
2461 break;
2462 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002463 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002464 break;
2465 }
2466 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002467 _exception = 1;
2468 _exceptionType = "java/lang/IllegalArgumentException";
2469 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002470 goto exit;
2471 }
2472 params_base = (GLfixed *)
2473 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2474 params = params_base + offset;
2475
2476 glLightxv(
2477 (GLenum)light,
2478 (GLenum)pname,
2479 (GLfixed *)params
2480 );
2481
2482exit:
2483 if (params_base) {
2484 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2485 JNI_ABORT);
2486 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002487 if (_exception) {
2488 jniThrowException(_env, _exceptionType, _exceptionMessage);
2489 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002490}
2491
2492/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2493static void
2494android_glLightxv__IILjava_nio_IntBuffer_2
2495 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002496 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002497 const char * _exceptionType = NULL;
2498 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002499 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002500 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002501 jint _remaining;
2502 GLfixed *params = (GLfixed *) 0;
2503
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002504 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505 int _needed;
2506 switch (pname) {
2507#if defined(GL_SPOT_EXPONENT)
2508 case GL_SPOT_EXPONENT:
2509#endif // defined(GL_SPOT_EXPONENT)
2510#if defined(GL_SPOT_CUTOFF)
2511 case GL_SPOT_CUTOFF:
2512#endif // defined(GL_SPOT_CUTOFF)
2513#if defined(GL_CONSTANT_ATTENUATION)
2514 case GL_CONSTANT_ATTENUATION:
2515#endif // defined(GL_CONSTANT_ATTENUATION)
2516#if defined(GL_LINEAR_ATTENUATION)
2517 case GL_LINEAR_ATTENUATION:
2518#endif // defined(GL_LINEAR_ATTENUATION)
2519#if defined(GL_QUADRATIC_ATTENUATION)
2520 case GL_QUADRATIC_ATTENUATION:
2521#endif // defined(GL_QUADRATIC_ATTENUATION)
2522 _needed = 1;
2523 break;
2524#if defined(GL_SPOT_DIRECTION)
2525 case GL_SPOT_DIRECTION:
2526#endif // defined(GL_SPOT_DIRECTION)
2527 _needed = 3;
2528 break;
2529#if defined(GL_AMBIENT)
2530 case GL_AMBIENT:
2531#endif // defined(GL_AMBIENT)
2532#if defined(GL_DIFFUSE)
2533 case GL_DIFFUSE:
2534#endif // defined(GL_DIFFUSE)
2535#if defined(GL_SPECULAR)
2536 case GL_SPECULAR:
2537#endif // defined(GL_SPECULAR)
2538#if defined(GL_EMISSION)
2539 case GL_EMISSION:
2540#endif // defined(GL_EMISSION)
2541 _needed = 4;
2542 break;
2543 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002544 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002545 break;
2546 }
2547 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002548 _exception = 1;
2549 _exceptionType = "java/lang/IllegalArgumentException";
2550 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002551 goto exit;
2552 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002553 if (params == NULL) {
2554 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2555 params = (GLfixed *) (_paramsBase + _bufferOffset);
2556 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 glLightxv(
2558 (GLenum)light,
2559 (GLenum)pname,
2560 (GLfixed *)params
2561 );
2562
2563exit:
2564 if (_array) {
2565 releasePointer(_env, _array, params, JNI_FALSE);
2566 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002567 if (_exception) {
2568 jniThrowException(_env, _exceptionType, _exceptionMessage);
2569 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002570}
2571
2572/* void glLineWidth ( GLfloat width ) */
2573static void
2574android_glLineWidth__F
2575 (JNIEnv *_env, jobject _this, jfloat width) {
2576 glLineWidth(
2577 (GLfloat)width
2578 );
2579}
2580
2581/* void glLineWidthx ( GLfixed width ) */
2582static void
2583android_glLineWidthx__I
2584 (JNIEnv *_env, jobject _this, jint width) {
2585 glLineWidthx(
2586 (GLfixed)width
2587 );
2588}
2589
2590/* void glLoadIdentity ( void ) */
2591static void
2592android_glLoadIdentity__
2593 (JNIEnv *_env, jobject _this) {
2594 glLoadIdentity();
2595}
2596
2597/* void glLoadMatrixf ( const GLfloat *m ) */
2598static void
2599android_glLoadMatrixf___3FI
2600 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002601 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002602 const char * _exceptionType = NULL;
2603 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 GLfloat *m_base = (GLfloat *) 0;
2605 jint _remaining;
2606 GLfloat *m = (GLfloat *) 0;
2607
2608 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002609 _exception = 1;
2610 _exceptionType = "java/lang/IllegalArgumentException";
2611 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002612 goto exit;
2613 }
2614 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002615 _exception = 1;
2616 _exceptionType = "java/lang/IllegalArgumentException";
2617 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002618 goto exit;
2619 }
2620 _remaining = _env->GetArrayLength(m_ref) - offset;
2621 m_base = (GLfloat *)
2622 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2623 m = m_base + offset;
2624
2625 glLoadMatrixf(
2626 (GLfloat *)m
2627 );
2628
2629exit:
2630 if (m_base) {
2631 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2632 JNI_ABORT);
2633 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002634 if (_exception) {
2635 jniThrowException(_env, _exceptionType, _exceptionMessage);
2636 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002637}
2638
2639/* void glLoadMatrixf ( const GLfloat *m ) */
2640static void
2641android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2642 (JNIEnv *_env, jobject _this, jobject m_buf) {
2643 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002644 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002645 jint _remaining;
2646 GLfloat *m = (GLfloat *) 0;
2647
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002648 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2649 if (m == NULL) {
2650 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2651 m = (GLfloat *) (_mBase + _bufferOffset);
2652 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002653 glLoadMatrixf(
2654 (GLfloat *)m
2655 );
2656 if (_array) {
2657 releasePointer(_env, _array, m, JNI_FALSE);
2658 }
2659}
2660
2661/* void glLoadMatrixx ( const GLfixed *m ) */
2662static void
2663android_glLoadMatrixx___3II
2664 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002665 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002666 const char * _exceptionType = NULL;
2667 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002668 GLfixed *m_base = (GLfixed *) 0;
2669 jint _remaining;
2670 GLfixed *m = (GLfixed *) 0;
2671
2672 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002673 _exception = 1;
2674 _exceptionType = "java/lang/IllegalArgumentException";
2675 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002676 goto exit;
2677 }
2678 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002679 _exception = 1;
2680 _exceptionType = "java/lang/IllegalArgumentException";
2681 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002682 goto exit;
2683 }
2684 _remaining = _env->GetArrayLength(m_ref) - offset;
2685 m_base = (GLfixed *)
2686 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2687 m = m_base + offset;
2688
2689 glLoadMatrixx(
2690 (GLfixed *)m
2691 );
2692
2693exit:
2694 if (m_base) {
2695 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2696 JNI_ABORT);
2697 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002698 if (_exception) {
2699 jniThrowException(_env, _exceptionType, _exceptionMessage);
2700 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002701}
2702
2703/* void glLoadMatrixx ( const GLfixed *m ) */
2704static void
2705android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2706 (JNIEnv *_env, jobject _this, jobject m_buf) {
2707 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002708 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002709 jint _remaining;
2710 GLfixed *m = (GLfixed *) 0;
2711
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002712 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2713 if (m == NULL) {
2714 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2715 m = (GLfixed *) (_mBase + _bufferOffset);
2716 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002717 glLoadMatrixx(
2718 (GLfixed *)m
2719 );
2720 if (_array) {
2721 releasePointer(_env, _array, m, JNI_FALSE);
2722 }
2723}
2724
2725/* void glLogicOp ( GLenum opcode ) */
2726static void
2727android_glLogicOp__I
2728 (JNIEnv *_env, jobject _this, jint opcode) {
2729 glLogicOp(
2730 (GLenum)opcode
2731 );
2732}
2733
2734/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2735static void
2736android_glMaterialf__IIF
2737 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2738 glMaterialf(
2739 (GLenum)face,
2740 (GLenum)pname,
2741 (GLfloat)param
2742 );
2743}
2744
2745/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2746static void
2747android_glMaterialfv__II_3FI
2748 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002749 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002750 const char * _exceptionType = NULL;
2751 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002752 GLfloat *params_base = (GLfloat *) 0;
2753 jint _remaining;
2754 GLfloat *params = (GLfloat *) 0;
2755
2756 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002757 _exception = 1;
2758 _exceptionType = "java/lang/IllegalArgumentException";
2759 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002760 goto exit;
2761 }
2762 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002763 _exception = 1;
2764 _exceptionType = "java/lang/IllegalArgumentException";
2765 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002766 goto exit;
2767 }
2768 _remaining = _env->GetArrayLength(params_ref) - offset;
2769 int _needed;
2770 switch (pname) {
2771#if defined(GL_SHININESS)
2772 case GL_SHININESS:
2773#endif // defined(GL_SHININESS)
2774 _needed = 1;
2775 break;
2776#if defined(GL_AMBIENT)
2777 case GL_AMBIENT:
2778#endif // defined(GL_AMBIENT)
2779#if defined(GL_DIFFUSE)
2780 case GL_DIFFUSE:
2781#endif // defined(GL_DIFFUSE)
2782#if defined(GL_SPECULAR)
2783 case GL_SPECULAR:
2784#endif // defined(GL_SPECULAR)
2785#if defined(GL_EMISSION)
2786 case GL_EMISSION:
2787#endif // defined(GL_EMISSION)
2788#if defined(GL_AMBIENT_AND_DIFFUSE)
2789 case GL_AMBIENT_AND_DIFFUSE:
2790#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2791 _needed = 4;
2792 break;
2793 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002794 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002795 break;
2796 }
2797 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002798 _exception = 1;
2799 _exceptionType = "java/lang/IllegalArgumentException";
2800 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002801 goto exit;
2802 }
2803 params_base = (GLfloat *)
2804 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2805 params = params_base + offset;
2806
2807 glMaterialfv(
2808 (GLenum)face,
2809 (GLenum)pname,
2810 (GLfloat *)params
2811 );
2812
2813exit:
2814 if (params_base) {
2815 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2816 JNI_ABORT);
2817 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002818 if (_exception) {
2819 jniThrowException(_env, _exceptionType, _exceptionMessage);
2820 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002821}
2822
2823/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2824static void
2825android_glMaterialfv__IILjava_nio_FloatBuffer_2
2826 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002827 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002828 const char * _exceptionType = NULL;
2829 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002830 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002831 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002832 jint _remaining;
2833 GLfloat *params = (GLfloat *) 0;
2834
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002835 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002836 int _needed;
2837 switch (pname) {
2838#if defined(GL_SHININESS)
2839 case GL_SHININESS:
2840#endif // defined(GL_SHININESS)
2841 _needed = 1;
2842 break;
2843#if defined(GL_AMBIENT)
2844 case GL_AMBIENT:
2845#endif // defined(GL_AMBIENT)
2846#if defined(GL_DIFFUSE)
2847 case GL_DIFFUSE:
2848#endif // defined(GL_DIFFUSE)
2849#if defined(GL_SPECULAR)
2850 case GL_SPECULAR:
2851#endif // defined(GL_SPECULAR)
2852#if defined(GL_EMISSION)
2853 case GL_EMISSION:
2854#endif // defined(GL_EMISSION)
2855#if defined(GL_AMBIENT_AND_DIFFUSE)
2856 case GL_AMBIENT_AND_DIFFUSE:
2857#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2858 _needed = 4;
2859 break;
2860 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002861 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002862 break;
2863 }
2864 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002865 _exception = 1;
2866 _exceptionType = "java/lang/IllegalArgumentException";
2867 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002868 goto exit;
2869 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002870 if (params == NULL) {
2871 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2872 params = (GLfloat *) (_paramsBase + _bufferOffset);
2873 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002874 glMaterialfv(
2875 (GLenum)face,
2876 (GLenum)pname,
2877 (GLfloat *)params
2878 );
2879
2880exit:
2881 if (_array) {
2882 releasePointer(_env, _array, params, JNI_FALSE);
2883 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002884 if (_exception) {
2885 jniThrowException(_env, _exceptionType, _exceptionMessage);
2886 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887}
2888
2889/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2890static void
2891android_glMaterialx__III
2892 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2893 glMaterialx(
2894 (GLenum)face,
2895 (GLenum)pname,
2896 (GLfixed)param
2897 );
2898}
2899
2900/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2901static void
2902android_glMaterialxv__II_3II
2903 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002904 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002905 const char * _exceptionType = NULL;
2906 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002907 GLfixed *params_base = (GLfixed *) 0;
2908 jint _remaining;
2909 GLfixed *params = (GLfixed *) 0;
2910
2911 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002912 _exception = 1;
2913 _exceptionType = "java/lang/IllegalArgumentException";
2914 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002915 goto exit;
2916 }
2917 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002918 _exception = 1;
2919 _exceptionType = "java/lang/IllegalArgumentException";
2920 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 goto exit;
2922 }
2923 _remaining = _env->GetArrayLength(params_ref) - offset;
2924 int _needed;
2925 switch (pname) {
2926#if defined(GL_SHININESS)
2927 case GL_SHININESS:
2928#endif // defined(GL_SHININESS)
2929 _needed = 1;
2930 break;
2931#if defined(GL_AMBIENT)
2932 case GL_AMBIENT:
2933#endif // defined(GL_AMBIENT)
2934#if defined(GL_DIFFUSE)
2935 case GL_DIFFUSE:
2936#endif // defined(GL_DIFFUSE)
2937#if defined(GL_SPECULAR)
2938 case GL_SPECULAR:
2939#endif // defined(GL_SPECULAR)
2940#if defined(GL_EMISSION)
2941 case GL_EMISSION:
2942#endif // defined(GL_EMISSION)
2943#if defined(GL_AMBIENT_AND_DIFFUSE)
2944 case GL_AMBIENT_AND_DIFFUSE:
2945#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2946 _needed = 4;
2947 break;
2948 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002949 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002950 break;
2951 }
2952 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002953 _exception = 1;
2954 _exceptionType = "java/lang/IllegalArgumentException";
2955 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002956 goto exit;
2957 }
2958 params_base = (GLfixed *)
2959 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2960 params = params_base + offset;
2961
2962 glMaterialxv(
2963 (GLenum)face,
2964 (GLenum)pname,
2965 (GLfixed *)params
2966 );
2967
2968exit:
2969 if (params_base) {
2970 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2971 JNI_ABORT);
2972 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002973 if (_exception) {
2974 jniThrowException(_env, _exceptionType, _exceptionMessage);
2975 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002976}
2977
2978/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2979static void
2980android_glMaterialxv__IILjava_nio_IntBuffer_2
2981 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002982 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002983 const char * _exceptionType = NULL;
2984 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002985 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002986 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002987 jint _remaining;
2988 GLfixed *params = (GLfixed *) 0;
2989
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002990 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002991 int _needed;
2992 switch (pname) {
2993#if defined(GL_SHININESS)
2994 case GL_SHININESS:
2995#endif // defined(GL_SHININESS)
2996 _needed = 1;
2997 break;
2998#if defined(GL_AMBIENT)
2999 case GL_AMBIENT:
3000#endif // defined(GL_AMBIENT)
3001#if defined(GL_DIFFUSE)
3002 case GL_DIFFUSE:
3003#endif // defined(GL_DIFFUSE)
3004#if defined(GL_SPECULAR)
3005 case GL_SPECULAR:
3006#endif // defined(GL_SPECULAR)
3007#if defined(GL_EMISSION)
3008 case GL_EMISSION:
3009#endif // defined(GL_EMISSION)
3010#if defined(GL_AMBIENT_AND_DIFFUSE)
3011 case GL_AMBIENT_AND_DIFFUSE:
3012#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3013 _needed = 4;
3014 break;
3015 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003016 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003017 break;
3018 }
3019 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003020 _exception = 1;
3021 _exceptionType = "java/lang/IllegalArgumentException";
3022 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003023 goto exit;
3024 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003025 if (params == NULL) {
3026 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3027 params = (GLfixed *) (_paramsBase + _bufferOffset);
3028 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003029 glMaterialxv(
3030 (GLenum)face,
3031 (GLenum)pname,
3032 (GLfixed *)params
3033 );
3034
3035exit:
3036 if (_array) {
3037 releasePointer(_env, _array, params, JNI_FALSE);
3038 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003039 if (_exception) {
3040 jniThrowException(_env, _exceptionType, _exceptionMessage);
3041 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003042}
3043
3044/* void glMatrixMode ( GLenum mode ) */
3045static void
3046android_glMatrixMode__I
3047 (JNIEnv *_env, jobject _this, jint mode) {
3048 glMatrixMode(
3049 (GLenum)mode
3050 );
3051}
3052
3053/* void glMultMatrixf ( const GLfloat *m ) */
3054static void
3055android_glMultMatrixf___3FI
3056 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003057 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003058 const char * _exceptionType = NULL;
3059 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003060 GLfloat *m_base = (GLfloat *) 0;
3061 jint _remaining;
3062 GLfloat *m = (GLfloat *) 0;
3063
3064 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003065 _exception = 1;
3066 _exceptionType = "java/lang/IllegalArgumentException";
3067 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003068 goto exit;
3069 }
3070 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003071 _exception = 1;
3072 _exceptionType = "java/lang/IllegalArgumentException";
3073 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003074 goto exit;
3075 }
3076 _remaining = _env->GetArrayLength(m_ref) - offset;
3077 m_base = (GLfloat *)
3078 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
3079 m = m_base + offset;
3080
3081 glMultMatrixf(
3082 (GLfloat *)m
3083 );
3084
3085exit:
3086 if (m_base) {
3087 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
3088 JNI_ABORT);
3089 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003090 if (_exception) {
3091 jniThrowException(_env, _exceptionType, _exceptionMessage);
3092 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093}
3094
3095/* void glMultMatrixf ( const GLfloat *m ) */
3096static void
3097android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3098 (JNIEnv *_env, jobject _this, jobject m_buf) {
3099 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003100 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003101 jint _remaining;
3102 GLfloat *m = (GLfloat *) 0;
3103
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003104 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
3105 if (m == NULL) {
3106 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3107 m = (GLfloat *) (_mBase + _bufferOffset);
3108 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109 glMultMatrixf(
3110 (GLfloat *)m
3111 );
3112 if (_array) {
3113 releasePointer(_env, _array, m, JNI_FALSE);
3114 }
3115}
3116
3117/* void glMultMatrixx ( const GLfixed *m ) */
3118static void
3119android_glMultMatrixx___3II
3120 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003121 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003122 const char * _exceptionType = NULL;
3123 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003124 GLfixed *m_base = (GLfixed *) 0;
3125 jint _remaining;
3126 GLfixed *m = (GLfixed *) 0;
3127
3128 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003129 _exception = 1;
3130 _exceptionType = "java/lang/IllegalArgumentException";
3131 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003132 goto exit;
3133 }
3134 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003135 _exception = 1;
3136 _exceptionType = "java/lang/IllegalArgumentException";
3137 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003138 goto exit;
3139 }
3140 _remaining = _env->GetArrayLength(m_ref) - offset;
3141 m_base = (GLfixed *)
3142 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
3143 m = m_base + offset;
3144
3145 glMultMatrixx(
3146 (GLfixed *)m
3147 );
3148
3149exit:
3150 if (m_base) {
3151 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
3152 JNI_ABORT);
3153 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003154 if (_exception) {
3155 jniThrowException(_env, _exceptionType, _exceptionMessage);
3156 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003157}
3158
3159/* void glMultMatrixx ( const GLfixed *m ) */
3160static void
3161android_glMultMatrixx__Ljava_nio_IntBuffer_2
3162 (JNIEnv *_env, jobject _this, jobject m_buf) {
3163 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003164 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003165 jint _remaining;
3166 GLfixed *m = (GLfixed *) 0;
3167
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003168 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
3169 if (m == NULL) {
3170 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3171 m = (GLfixed *) (_mBase + _bufferOffset);
3172 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003173 glMultMatrixx(
3174 (GLfixed *)m
3175 );
3176 if (_array) {
3177 releasePointer(_env, _array, m, JNI_FALSE);
3178 }
3179}
3180
3181/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3182static void
3183android_glMultiTexCoord4f__IFFFF
3184 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3185 glMultiTexCoord4f(
3186 (GLenum)target,
3187 (GLfloat)s,
3188 (GLfloat)t,
3189 (GLfloat)r,
3190 (GLfloat)q
3191 );
3192}
3193
3194/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3195static void
3196android_glMultiTexCoord4x__IIIII
3197 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3198 glMultiTexCoord4x(
3199 (GLenum)target,
3200 (GLfixed)s,
3201 (GLfixed)t,
3202 (GLfixed)r,
3203 (GLfixed)q
3204 );
3205}
3206
3207/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3208static void
3209android_glNormal3f__FFF
3210 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3211 glNormal3f(
3212 (GLfloat)nx,
3213 (GLfloat)ny,
3214 (GLfloat)nz
3215 );
3216}
3217
3218/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3219static void
3220android_glNormal3x__III
3221 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3222 glNormal3x(
3223 (GLfixed)nx,
3224 (GLfixed)ny,
3225 (GLfixed)nz
3226 );
3227}
3228
3229/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3230static void
3231android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3232 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
3233 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003234 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003235 jint _remaining;
3236 GLvoid *pointer = (GLvoid *) 0;
3237
Jack Paleviche20ea782009-05-07 18:28:29 -07003238 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003239 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003240 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003241 return;
3242 }
3243 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003244 glNormalPointerBounds(
3245 (GLenum)type,
3246 (GLsizei)stride,
3247 (GLvoid *)pointer,
3248 (GLsizei)remaining
3249 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003250}
3251
3252/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3253static void
3254android_glOrthof__FFFFFF
3255 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3256 glOrthof(
3257 (GLfloat)left,
3258 (GLfloat)right,
3259 (GLfloat)bottom,
3260 (GLfloat)top,
3261 (GLfloat)zNear,
3262 (GLfloat)zFar
3263 );
3264}
3265
3266/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3267static void
3268android_glOrthox__IIIIII
3269 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3270 glOrthox(
3271 (GLfixed)left,
3272 (GLfixed)right,
3273 (GLfixed)bottom,
3274 (GLfixed)top,
3275 (GLfixed)zNear,
3276 (GLfixed)zFar
3277 );
3278}
3279
3280/* void glPixelStorei ( GLenum pname, GLint param ) */
3281static void
3282android_glPixelStorei__II
3283 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3284 glPixelStorei(
3285 (GLenum)pname,
3286 (GLint)param
3287 );
3288}
3289
3290/* void glPointSize ( GLfloat size ) */
3291static void
3292android_glPointSize__F
3293 (JNIEnv *_env, jobject _this, jfloat size) {
3294 glPointSize(
3295 (GLfloat)size
3296 );
3297}
3298
3299/* void glPointSizex ( GLfixed size ) */
3300static void
3301android_glPointSizex__I
3302 (JNIEnv *_env, jobject _this, jint size) {
3303 glPointSizex(
3304 (GLfixed)size
3305 );
3306}
3307
3308/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3309static void
3310android_glPolygonOffset__FF
3311 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3312 glPolygonOffset(
3313 (GLfloat)factor,
3314 (GLfloat)units
3315 );
3316}
3317
3318/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3319static void
3320android_glPolygonOffsetx__II
3321 (JNIEnv *_env, jobject _this, jint factor, jint units) {
3322 glPolygonOffsetx(
3323 (GLfixed)factor,
3324 (GLfixed)units
3325 );
3326}
3327
3328/* void glPopMatrix ( void ) */
3329static void
3330android_glPopMatrix__
3331 (JNIEnv *_env, jobject _this) {
3332 glPopMatrix();
3333}
3334
3335/* void glPushMatrix ( void ) */
3336static void
3337android_glPushMatrix__
3338 (JNIEnv *_env, jobject _this) {
3339 glPushMatrix();
3340}
3341
3342/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3343static void
3344android_glReadPixels__IIIIIILjava_nio_Buffer_2
3345 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003346 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003347 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003348 jint _remaining;
3349 GLvoid *pixels = (GLvoid *) 0;
3350
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003351 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
3352 if (pixels == NULL) {
3353 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3354 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3355 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003356 glReadPixels(
3357 (GLint)x,
3358 (GLint)y,
3359 (GLsizei)width,
3360 (GLsizei)height,
3361 (GLenum)format,
3362 (GLenum)type,
3363 (GLvoid *)pixels
3364 );
3365 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003366 releasePointer(_env, _array, pixels, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003367 }
3368}
3369
3370/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3371static void
3372android_glRotatef__FFFF
3373 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3374 glRotatef(
3375 (GLfloat)angle,
3376 (GLfloat)x,
3377 (GLfloat)y,
3378 (GLfloat)z
3379 );
3380}
3381
3382/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3383static void
3384android_glRotatex__IIII
3385 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3386 glRotatex(
3387 (GLfixed)angle,
3388 (GLfixed)x,
3389 (GLfixed)y,
3390 (GLfixed)z
3391 );
3392}
3393
3394/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3395static void
3396android_glSampleCoverage__FZ
3397 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3398 glSampleCoverage(
3399 (GLclampf)value,
3400 (GLboolean)invert
3401 );
3402}
3403
3404/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3405static void
3406android_glSampleCoveragex__IZ
3407 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3408 glSampleCoveragex(
3409 (GLclampx)value,
3410 (GLboolean)invert
3411 );
3412}
3413
3414/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3415static void
3416android_glScalef__FFF
3417 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3418 glScalef(
3419 (GLfloat)x,
3420 (GLfloat)y,
3421 (GLfloat)z
3422 );
3423}
3424
3425/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3426static void
3427android_glScalex__III
3428 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3429 glScalex(
3430 (GLfixed)x,
3431 (GLfixed)y,
3432 (GLfixed)z
3433 );
3434}
3435
3436/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3437static void
3438android_glScissor__IIII
3439 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3440 glScissor(
3441 (GLint)x,
3442 (GLint)y,
3443 (GLsizei)width,
3444 (GLsizei)height
3445 );
3446}
3447
3448/* void glShadeModel ( GLenum mode ) */
3449static void
3450android_glShadeModel__I
3451 (JNIEnv *_env, jobject _this, jint mode) {
3452 glShadeModel(
3453 (GLenum)mode
3454 );
3455}
3456
3457/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3458static void
3459android_glStencilFunc__III
3460 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3461 glStencilFunc(
3462 (GLenum)func,
3463 (GLint)ref,
3464 (GLuint)mask
3465 );
3466}
3467
3468/* void glStencilMask ( GLuint mask ) */
3469static void
3470android_glStencilMask__I
3471 (JNIEnv *_env, jobject _this, jint mask) {
3472 glStencilMask(
3473 (GLuint)mask
3474 );
3475}
3476
3477/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3478static void
3479android_glStencilOp__III
3480 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3481 glStencilOp(
3482 (GLenum)fail,
3483 (GLenum)zfail,
3484 (GLenum)zpass
3485 );
3486}
3487
3488/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3489static void
3490android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3491 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3492 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003493 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003494 jint _remaining;
3495 GLvoid *pointer = (GLvoid *) 0;
3496
Jack Paleviche20ea782009-05-07 18:28:29 -07003497 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003498 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003499 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003500 return;
3501 }
3502 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003503 glTexCoordPointerBounds(
3504 (GLint)size,
3505 (GLenum)type,
3506 (GLsizei)stride,
3507 (GLvoid *)pointer,
3508 (GLsizei)remaining
3509 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003510}
3511
3512/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3513static void
3514android_glTexEnvf__IIF
3515 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3516 glTexEnvf(
3517 (GLenum)target,
3518 (GLenum)pname,
3519 (GLfloat)param
3520 );
3521}
3522
3523/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3524static void
3525android_glTexEnvfv__II_3FI
3526 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003527 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003528 const char * _exceptionType = NULL;
3529 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003530 GLfloat *params_base = (GLfloat *) 0;
3531 jint _remaining;
3532 GLfloat *params = (GLfloat *) 0;
3533
3534 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003535 _exception = 1;
3536 _exceptionType = "java/lang/IllegalArgumentException";
3537 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 goto exit;
3539 }
3540 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003541 _exception = 1;
3542 _exceptionType = "java/lang/IllegalArgumentException";
3543 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003544 goto exit;
3545 }
3546 _remaining = _env->GetArrayLength(params_ref) - offset;
3547 int _needed;
3548 switch (pname) {
3549#if defined(GL_TEXTURE_ENV_MODE)
3550 case GL_TEXTURE_ENV_MODE:
3551#endif // defined(GL_TEXTURE_ENV_MODE)
3552#if defined(GL_COMBINE_RGB)
3553 case GL_COMBINE_RGB:
3554#endif // defined(GL_COMBINE_RGB)
3555#if defined(GL_COMBINE_ALPHA)
3556 case GL_COMBINE_ALPHA:
3557#endif // defined(GL_COMBINE_ALPHA)
3558 _needed = 1;
3559 break;
3560#if defined(GL_TEXTURE_ENV_COLOR)
3561 case GL_TEXTURE_ENV_COLOR:
3562#endif // defined(GL_TEXTURE_ENV_COLOR)
3563 _needed = 4;
3564 break;
3565 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003566 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003567 break;
3568 }
3569 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003570 _exception = 1;
3571 _exceptionType = "java/lang/IllegalArgumentException";
3572 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003573 goto exit;
3574 }
3575 params_base = (GLfloat *)
3576 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3577 params = params_base + offset;
3578
3579 glTexEnvfv(
3580 (GLenum)target,
3581 (GLenum)pname,
3582 (GLfloat *)params
3583 );
3584
3585exit:
3586 if (params_base) {
3587 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3588 JNI_ABORT);
3589 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003590 if (_exception) {
3591 jniThrowException(_env, _exceptionType, _exceptionMessage);
3592 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003593}
3594
3595/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3596static void
3597android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3598 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003599 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003600 const char * _exceptionType = NULL;
3601 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003602 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003603 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003604 jint _remaining;
3605 GLfloat *params = (GLfloat *) 0;
3606
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003607 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003608 int _needed;
3609 switch (pname) {
3610#if defined(GL_TEXTURE_ENV_MODE)
3611 case GL_TEXTURE_ENV_MODE:
3612#endif // defined(GL_TEXTURE_ENV_MODE)
3613#if defined(GL_COMBINE_RGB)
3614 case GL_COMBINE_RGB:
3615#endif // defined(GL_COMBINE_RGB)
3616#if defined(GL_COMBINE_ALPHA)
3617 case GL_COMBINE_ALPHA:
3618#endif // defined(GL_COMBINE_ALPHA)
3619 _needed = 1;
3620 break;
3621#if defined(GL_TEXTURE_ENV_COLOR)
3622 case GL_TEXTURE_ENV_COLOR:
3623#endif // defined(GL_TEXTURE_ENV_COLOR)
3624 _needed = 4;
3625 break;
3626 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003627 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003628 break;
3629 }
3630 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003631 _exception = 1;
3632 _exceptionType = "java/lang/IllegalArgumentException";
3633 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003634 goto exit;
3635 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003636 if (params == NULL) {
3637 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3638 params = (GLfloat *) (_paramsBase + _bufferOffset);
3639 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003640 glTexEnvfv(
3641 (GLenum)target,
3642 (GLenum)pname,
3643 (GLfloat *)params
3644 );
3645
3646exit:
3647 if (_array) {
3648 releasePointer(_env, _array, params, JNI_FALSE);
3649 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003650 if (_exception) {
3651 jniThrowException(_env, _exceptionType, _exceptionMessage);
3652 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003653}
3654
3655/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3656static void
3657android_glTexEnvx__III
3658 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3659 glTexEnvx(
3660 (GLenum)target,
3661 (GLenum)pname,
3662 (GLfixed)param
3663 );
3664}
3665
3666/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3667static void
3668android_glTexEnvxv__II_3II
3669 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003670 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003671 const char * _exceptionType = NULL;
3672 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003673 GLfixed *params_base = (GLfixed *) 0;
3674 jint _remaining;
3675 GLfixed *params = (GLfixed *) 0;
3676
3677 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003678 _exception = 1;
3679 _exceptionType = "java/lang/IllegalArgumentException";
3680 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003681 goto exit;
3682 }
3683 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003684 _exception = 1;
3685 _exceptionType = "java/lang/IllegalArgumentException";
3686 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003687 goto exit;
3688 }
3689 _remaining = _env->GetArrayLength(params_ref) - offset;
3690 int _needed;
3691 switch (pname) {
3692#if defined(GL_TEXTURE_ENV_MODE)
3693 case GL_TEXTURE_ENV_MODE:
3694#endif // defined(GL_TEXTURE_ENV_MODE)
3695#if defined(GL_COMBINE_RGB)
3696 case GL_COMBINE_RGB:
3697#endif // defined(GL_COMBINE_RGB)
3698#if defined(GL_COMBINE_ALPHA)
3699 case GL_COMBINE_ALPHA:
3700#endif // defined(GL_COMBINE_ALPHA)
3701 _needed = 1;
3702 break;
3703#if defined(GL_TEXTURE_ENV_COLOR)
3704 case GL_TEXTURE_ENV_COLOR:
3705#endif // defined(GL_TEXTURE_ENV_COLOR)
3706 _needed = 4;
3707 break;
3708 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003709 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003710 break;
3711 }
3712 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003713 _exception = 1;
3714 _exceptionType = "java/lang/IllegalArgumentException";
3715 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003716 goto exit;
3717 }
3718 params_base = (GLfixed *)
3719 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3720 params = params_base + offset;
3721
3722 glTexEnvxv(
3723 (GLenum)target,
3724 (GLenum)pname,
3725 (GLfixed *)params
3726 );
3727
3728exit:
3729 if (params_base) {
3730 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3731 JNI_ABORT);
3732 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003733 if (_exception) {
3734 jniThrowException(_env, _exceptionType, _exceptionMessage);
3735 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003736}
3737
3738/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3739static void
3740android_glTexEnvxv__IILjava_nio_IntBuffer_2
3741 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003742 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003743 const char * _exceptionType = NULL;
3744 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003745 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003746 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003747 jint _remaining;
3748 GLfixed *params = (GLfixed *) 0;
3749
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003750 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003751 int _needed;
3752 switch (pname) {
3753#if defined(GL_TEXTURE_ENV_MODE)
3754 case GL_TEXTURE_ENV_MODE:
3755#endif // defined(GL_TEXTURE_ENV_MODE)
3756#if defined(GL_COMBINE_RGB)
3757 case GL_COMBINE_RGB:
3758#endif // defined(GL_COMBINE_RGB)
3759#if defined(GL_COMBINE_ALPHA)
3760 case GL_COMBINE_ALPHA:
3761#endif // defined(GL_COMBINE_ALPHA)
3762 _needed = 1;
3763 break;
3764#if defined(GL_TEXTURE_ENV_COLOR)
3765 case GL_TEXTURE_ENV_COLOR:
3766#endif // defined(GL_TEXTURE_ENV_COLOR)
3767 _needed = 4;
3768 break;
3769 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003770 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003771 break;
3772 }
3773 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003774 _exception = 1;
3775 _exceptionType = "java/lang/IllegalArgumentException";
3776 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003777 goto exit;
3778 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003779 if (params == NULL) {
3780 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3781 params = (GLfixed *) (_paramsBase + _bufferOffset);
3782 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003783 glTexEnvxv(
3784 (GLenum)target,
3785 (GLenum)pname,
3786 (GLfixed *)params
3787 );
3788
3789exit:
3790 if (_array) {
3791 releasePointer(_env, _array, params, JNI_FALSE);
3792 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003793 if (_exception) {
3794 jniThrowException(_env, _exceptionType, _exceptionMessage);
3795 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003796}
3797
3798/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3799static void
3800android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3801 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3802 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003803 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003804 jint _remaining;
3805 GLvoid *pixels = (GLvoid *) 0;
3806
3807 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003808 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
3809 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003810 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003811 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3812 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003813 }
3814 glTexImage2D(
3815 (GLenum)target,
3816 (GLint)level,
3817 (GLint)internalformat,
3818 (GLsizei)width,
3819 (GLsizei)height,
3820 (GLint)border,
3821 (GLenum)format,
3822 (GLenum)type,
3823 (GLvoid *)pixels
3824 );
3825 if (_array) {
3826 releasePointer(_env, _array, pixels, JNI_FALSE);
3827 }
3828}
3829
3830/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3831static void
3832android_glTexParameterf__IIF
3833 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3834 glTexParameterf(
3835 (GLenum)target,
3836 (GLenum)pname,
3837 (GLfloat)param
3838 );
3839}
3840
3841/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3842static void
3843android_glTexParameterx__III
3844 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3845 glTexParameterx(
3846 (GLenum)target,
3847 (GLenum)pname,
3848 (GLfixed)param
3849 );
3850}
3851
3852/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3853static void
3854android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3855 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3856 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003857 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003858 jint _remaining;
3859 GLvoid *pixels = (GLvoid *) 0;
3860
3861 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003862 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
3863 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003864 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003865 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3866 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003867 }
3868 glTexSubImage2D(
3869 (GLenum)target,
3870 (GLint)level,
3871 (GLint)xoffset,
3872 (GLint)yoffset,
3873 (GLsizei)width,
3874 (GLsizei)height,
3875 (GLenum)format,
3876 (GLenum)type,
3877 (GLvoid *)pixels
3878 );
3879 if (_array) {
3880 releasePointer(_env, _array, pixels, JNI_FALSE);
3881 }
3882}
3883
3884/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3885static void
3886android_glTranslatef__FFF
3887 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3888 glTranslatef(
3889 (GLfloat)x,
3890 (GLfloat)y,
3891 (GLfloat)z
3892 );
3893}
3894
3895/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3896static void
3897android_glTranslatex__III
3898 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3899 glTranslatex(
3900 (GLfixed)x,
3901 (GLfixed)y,
3902 (GLfixed)z
3903 );
3904}
3905
3906/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3907static void
3908android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3909 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3910 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003911 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003912 jint _remaining;
3913 GLvoid *pointer = (GLvoid *) 0;
3914
Jack Paleviche20ea782009-05-07 18:28:29 -07003915 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003916 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003917 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003918 return;
3919 }
3920 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003921 glVertexPointerBounds(
3922 (GLint)size,
3923 (GLenum)type,
3924 (GLsizei)stride,
3925 (GLvoid *)pointer,
3926 (GLsizei)remaining
3927 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003928}
3929
3930/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3931static void
3932android_glViewport__IIII
3933 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3934 glViewport(
3935 (GLint)x,
3936 (GLint)y,
3937 (GLsizei)width,
3938 (GLsizei)height
3939 );
3940}
3941
3942/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
3943static jint
3944android_glQueryMatrixxOES___3II_3II
3945 (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
3946 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003947 const char * _exceptionType = NULL;
3948 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003949 GLbitfield _returnValue = -1;
3950 GLfixed *mantissa_base = (GLfixed *) 0;
3951 jint _mantissaRemaining;
3952 GLfixed *mantissa = (GLfixed *) 0;
3953 GLint *exponent_base = (GLint *) 0;
3954 jint _exponentRemaining;
3955 GLint *exponent = (GLint *) 0;
3956
3957 if (!mantissa_ref) {
3958 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003959 _exceptionType = "java/lang/IllegalArgumentException";
3960 _exceptionMessage = "mantissa == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003961 goto exit;
3962 }
3963 if (mantissaOffset < 0) {
3964 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003965 _exceptionType = "java/lang/IllegalArgumentException";
3966 _exceptionMessage = "mantissaOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003967 goto exit;
3968 }
3969 _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
3970 if (_mantissaRemaining < 16) {
3971 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003972 _exceptionType = "java/lang/IllegalArgumentException";
3973 _exceptionMessage = "length - mantissaOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003974 goto exit;
3975 }
3976 mantissa_base = (GLfixed *)
3977 _env->GetPrimitiveArrayCritical(mantissa_ref, (jboolean *)0);
3978 mantissa = mantissa_base + mantissaOffset;
3979
3980 if (!exponent_ref) {
3981 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003982 _exceptionType = "java/lang/IllegalArgumentException";
3983 _exceptionMessage = "exponent == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003984 goto exit;
3985 }
3986 if (exponentOffset < 0) {
3987 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003988 _exceptionType = "java/lang/IllegalArgumentException";
3989 _exceptionMessage = "exponentOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003990 goto exit;
3991 }
3992 _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
3993 if (_exponentRemaining < 16) {
3994 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003995 _exceptionType = "java/lang/IllegalArgumentException";
3996 _exceptionMessage = "length - exponentOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003997 goto exit;
3998 }
3999 exponent_base = (GLint *)
4000 _env->GetPrimitiveArrayCritical(exponent_ref, (jboolean *)0);
4001 exponent = exponent_base + exponentOffset;
4002
4003 _returnValue = glQueryMatrixxOES(
4004 (GLfixed *)mantissa,
4005 (GLint *)exponent
4006 );
4007
4008exit:
4009 if (exponent_base) {
4010 _env->ReleasePrimitiveArrayCritical(exponent_ref, exponent_base,
4011 _exception ? JNI_ABORT: 0);
4012 }
4013 if (mantissa_base) {
4014 _env->ReleasePrimitiveArrayCritical(mantissa_ref, mantissa_base,
4015 _exception ? JNI_ABORT: 0);
4016 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004017 if (_exception) {
4018 jniThrowException(_env, _exceptionType, _exceptionMessage);
4019 }
Andy McFaddencee51982013-04-25 16:08:31 -07004020 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004021}
4022
4023/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4024static jint
4025android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4026 (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4027 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004028 const char * _exceptionType = NULL;
4029 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004030 jarray _mantissaArray = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004031 jint _mantissaBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004032 jarray _exponentArray = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004033 jint _exponentBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004034 GLbitfield _returnValue = -1;
4035 jint _mantissaRemaining;
4036 GLfixed *mantissa = (GLfixed *) 0;
4037 jint _exponentRemaining;
4038 GLint *exponent = (GLint *) 0;
4039
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004040 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, &_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004041 if (_mantissaRemaining < 16) {
4042 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004043 _exceptionType = "java/lang/IllegalArgumentException";
4044 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004045 goto exit;
4046 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004047 exponent = (GLint *)getPointer(_env, exponent_buf, &_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004048 if (_exponentRemaining < 16) {
4049 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004050 _exceptionType = "java/lang/IllegalArgumentException";
4051 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004052 goto exit;
4053 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004054 if (mantissa == NULL) {
4055 char * _mantissaBase = (char *)_env->GetPrimitiveArrayCritical(_mantissaArray, (jboolean *) 0);
4056 mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4057 }
4058 if (exponent == NULL) {
4059 char * _exponentBase = (char *)_env->GetPrimitiveArrayCritical(_exponentArray, (jboolean *) 0);
4060 exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4061 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004062 _returnValue = glQueryMatrixxOES(
4063 (GLfixed *)mantissa,
4064 (GLint *)exponent
4065 );
4066
4067exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004068 if (_exponentArray) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004069 releasePointer(_env, _exponentArray, exponent, _exception ? JNI_FALSE : JNI_TRUE);
4070 }
4071 if (_mantissaArray) {
4072 releasePointer(_env, _mantissaArray, mantissa, _exception ? JNI_FALSE : JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004073 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004074 if (_exception) {
4075 jniThrowException(_env, _exceptionType, _exceptionMessage);
4076 }
Andy McFaddencee51982013-04-25 16:08:31 -07004077 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004078}
4079
4080/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4081static void
4082android_glBindBuffer__II
4083 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4084 glBindBuffer(
4085 (GLenum)target,
4086 (GLuint)buffer
4087 );
4088}
4089
4090/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4091static void
4092android_glBufferData__IILjava_nio_Buffer_2I
4093 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004094 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004095 const char * _exceptionType = NULL;
4096 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004097 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004098 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004099 jint _remaining;
4100 GLvoid *data = (GLvoid *) 0;
4101
4102 if (data_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004103 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004104 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004105 _exception = 1;
4106 _exceptionType = "java/lang/IllegalArgumentException";
4107 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004108 goto exit;
4109 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004110 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004111 if (data_buf && data == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004112 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4113 data = (GLvoid *) (_dataBase + _bufferOffset);
4114 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004115 glBufferData(
4116 (GLenum)target,
4117 (GLsizeiptr)size,
4118 (GLvoid *)data,
4119 (GLenum)usage
4120 );
Jack Palevichc620a522009-10-21 11:02:44 -07004121
4122exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004123 if (_array) {
4124 releasePointer(_env, _array, data, JNI_FALSE);
4125 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004126 if (_exception) {
4127 jniThrowException(_env, _exceptionType, _exceptionMessage);
4128 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004129}
4130
4131/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4132static void
4133android_glBufferSubData__IIILjava_nio_Buffer_2
4134 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004135 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004136 const char * _exceptionType = NULL;
4137 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004138 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004139 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004140 jint _remaining;
4141 GLvoid *data = (GLvoid *) 0;
4142
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004143 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004144 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004145 _exception = 1;
4146 _exceptionType = "java/lang/IllegalArgumentException";
4147 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004148 goto exit;
4149 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004150 if (data == NULL) {
4151 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4152 data = (GLvoid *) (_dataBase + _bufferOffset);
4153 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004154 glBufferSubData(
4155 (GLenum)target,
4156 (GLintptr)offset,
4157 (GLsizeiptr)size,
4158 (GLvoid *)data
4159 );
Jack Palevichc620a522009-10-21 11:02:44 -07004160
4161exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004162 if (_array) {
4163 releasePointer(_env, _array, data, JNI_FALSE);
4164 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004165 if (_exception) {
4166 jniThrowException(_env, _exceptionType, _exceptionMessage);
4167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004168}
4169
4170/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4171static void
4172android_glClipPlanef__I_3FI
4173 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004174 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004175 const char * _exceptionType = NULL;
4176 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004177 GLfloat *equation_base = (GLfloat *) 0;
4178 jint _remaining;
4179 GLfloat *equation = (GLfloat *) 0;
4180
4181 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004182 _exception = 1;
4183 _exceptionType = "java/lang/IllegalArgumentException";
4184 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004185 goto exit;
4186 }
4187 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004188 _exception = 1;
4189 _exceptionType = "java/lang/IllegalArgumentException";
4190 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004191 goto exit;
4192 }
4193 _remaining = _env->GetArrayLength(equation_ref) - offset;
4194 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004195 _exception = 1;
4196 _exceptionType = "java/lang/IllegalArgumentException";
4197 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004198 goto exit;
4199 }
4200 equation_base = (GLfloat *)
4201 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0);
4202 equation = equation_base + offset;
4203
4204 glClipPlanef(
4205 (GLenum)plane,
4206 (GLfloat *)equation
4207 );
4208
4209exit:
4210 if (equation_base) {
4211 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base,
4212 JNI_ABORT);
4213 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004214 if (_exception) {
4215 jniThrowException(_env, _exceptionType, _exceptionMessage);
4216 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004217}
4218
4219/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4220static void
4221android_glClipPlanef__ILjava_nio_FloatBuffer_2
4222 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004223 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004224 const char * _exceptionType = NULL;
4225 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004226 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004227 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004228 jint _remaining;
4229 GLfloat *equation = (GLfloat *) 0;
4230
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004231 equation = (GLfloat *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004232 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004233 _exception = 1;
4234 _exceptionType = "java/lang/IllegalArgumentException";
4235 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004236 goto exit;
4237 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004238 if (equation == NULL) {
4239 char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4240 equation = (GLfloat *) (_equationBase + _bufferOffset);
4241 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004242 glClipPlanef(
4243 (GLenum)plane,
4244 (GLfloat *)equation
4245 );
4246
4247exit:
4248 if (_array) {
4249 releasePointer(_env, _array, equation, JNI_FALSE);
4250 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004251 if (_exception) {
4252 jniThrowException(_env, _exceptionType, _exceptionMessage);
4253 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004254}
4255
4256/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4257static void
4258android_glClipPlanex__I_3II
4259 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004260 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004261 const char * _exceptionType = NULL;
4262 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004263 GLfixed *equation_base = (GLfixed *) 0;
4264 jint _remaining;
4265 GLfixed *equation = (GLfixed *) 0;
4266
4267 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004268 _exception = 1;
4269 _exceptionType = "java/lang/IllegalArgumentException";
4270 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004271 goto exit;
4272 }
4273 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004274 _exception = 1;
4275 _exceptionType = "java/lang/IllegalArgumentException";
4276 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004277 goto exit;
4278 }
4279 _remaining = _env->GetArrayLength(equation_ref) - offset;
4280 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004281 _exception = 1;
4282 _exceptionType = "java/lang/IllegalArgumentException";
4283 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004284 goto exit;
4285 }
4286 equation_base = (GLfixed *)
4287 _env->GetPrimitiveArrayCritical(equation_ref, (jboolean *)0);
4288 equation = equation_base + offset;
4289
4290 glClipPlanex(
4291 (GLenum)plane,
4292 (GLfixed *)equation
4293 );
4294
4295exit:
4296 if (equation_base) {
4297 _env->ReleasePrimitiveArrayCritical(equation_ref, equation_base,
4298 JNI_ABORT);
4299 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004300 if (_exception) {
4301 jniThrowException(_env, _exceptionType, _exceptionMessage);
4302 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004303}
4304
4305/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4306static void
4307android_glClipPlanex__ILjava_nio_IntBuffer_2
4308 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004309 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004310 const char * _exceptionType = NULL;
4311 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004312 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004313 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004314 jint _remaining;
4315 GLfixed *equation = (GLfixed *) 0;
4316
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004317 equation = (GLfixed *)getPointer(_env, equation_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004318 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004319 _exception = 1;
4320 _exceptionType = "java/lang/IllegalArgumentException";
4321 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004322 goto exit;
4323 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004324 if (equation == NULL) {
4325 char * _equationBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4326 equation = (GLfixed *) (_equationBase + _bufferOffset);
4327 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004328 glClipPlanex(
4329 (GLenum)plane,
4330 (GLfixed *)equation
4331 );
4332
4333exit:
4334 if (_array) {
4335 releasePointer(_env, _array, equation, JNI_FALSE);
4336 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004337 if (_exception) {
4338 jniThrowException(_env, _exceptionType, _exceptionMessage);
4339 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004340}
4341
4342/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4343static void
4344android_glColor4ub__BBBB
4345 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4346 glColor4ub(
4347 (GLubyte)red,
4348 (GLubyte)green,
4349 (GLubyte)blue,
4350 (GLubyte)alpha
4351 );
4352}
4353
4354/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4355static void
4356android_glColorPointer__IIII
4357 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4358 glColorPointer(
4359 (GLint)size,
4360 (GLenum)type,
4361 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07004362 (GLvoid *)offset
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004363 );
4364}
4365
4366/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4367static void
4368android_glDeleteBuffers__I_3II
4369 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004370 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004371 const char * _exceptionType = NULL;
4372 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004373 GLuint *buffers_base = (GLuint *) 0;
4374 jint _remaining;
4375 GLuint *buffers = (GLuint *) 0;
4376
4377 if (!buffers_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004378 _exception = 1;
4379 _exceptionType = "java/lang/IllegalArgumentException";
4380 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004381 goto exit;
4382 }
4383 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004384 _exception = 1;
4385 _exceptionType = "java/lang/IllegalArgumentException";
4386 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004387 goto exit;
4388 }
4389 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4390 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004391 _exception = 1;
4392 _exceptionType = "java/lang/IllegalArgumentException";
4393 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004394 goto exit;
4395 }
4396 buffers_base = (GLuint *)
4397 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
4398 buffers = buffers_base + offset;
4399
4400 glDeleteBuffers(
4401 (GLsizei)n,
4402 (GLuint *)buffers
4403 );
4404
4405exit:
4406 if (buffers_base) {
4407 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
4408 JNI_ABORT);
4409 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004410 if (_exception) {
4411 jniThrowException(_env, _exceptionType, _exceptionMessage);
4412 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004413}
4414
4415/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4416static void
4417android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4418 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004419 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004420 const char * _exceptionType = NULL;
4421 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004422 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004423 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004424 jint _remaining;
4425 GLuint *buffers = (GLuint *) 0;
4426
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004427 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004428 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004429 _exception = 1;
4430 _exceptionType = "java/lang/IllegalArgumentException";
4431 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 goto exit;
4433 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004434 if (buffers == NULL) {
4435 char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4436 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4437 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004438 glDeleteBuffers(
4439 (GLsizei)n,
4440 (GLuint *)buffers
4441 );
4442
4443exit:
4444 if (_array) {
4445 releasePointer(_env, _array, buffers, JNI_FALSE);
4446 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004447 if (_exception) {
4448 jniThrowException(_env, _exceptionType, _exceptionMessage);
4449 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004450}
4451
4452/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4453static void
4454android_glDrawElements__IIII
4455 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004456 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004457 const char * _exceptionType = NULL;
4458 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004459 glDrawElements(
4460 (GLenum)mode,
4461 (GLsizei)count,
4462 (GLenum)type,
Andy McFaddencee51982013-04-25 16:08:31 -07004463 (GLvoid *)offset
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004464 );
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004465 if (_exception) {
4466 jniThrowException(_env, _exceptionType, _exceptionMessage);
4467 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004468}
4469
4470/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4471static void
4472android_glGenBuffers__I_3II
4473 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4474 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004475 const char * _exceptionType = NULL;
4476 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004477 GLuint *buffers_base = (GLuint *) 0;
4478 jint _remaining;
4479 GLuint *buffers = (GLuint *) 0;
4480
4481 if (!buffers_ref) {
4482 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004483 _exceptionType = "java/lang/IllegalArgumentException";
4484 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004485 goto exit;
4486 }
4487 if (offset < 0) {
4488 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004489 _exceptionType = "java/lang/IllegalArgumentException";
4490 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004491 goto exit;
4492 }
4493 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4494 if (_remaining < n) {
4495 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004496 _exceptionType = "java/lang/IllegalArgumentException";
4497 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004498 goto exit;
4499 }
4500 buffers_base = (GLuint *)
4501 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
4502 buffers = buffers_base + offset;
4503
4504 glGenBuffers(
4505 (GLsizei)n,
4506 (GLuint *)buffers
4507 );
4508
4509exit:
4510 if (buffers_base) {
4511 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
4512 _exception ? JNI_ABORT: 0);
4513 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004514 if (_exception) {
4515 jniThrowException(_env, _exceptionType, _exceptionMessage);
4516 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004517}
4518
4519/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4520static void
4521android_glGenBuffers__ILjava_nio_IntBuffer_2
4522 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4523 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004524 const char * _exceptionType = NULL;
4525 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004526 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004527 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004528 jint _remaining;
4529 GLuint *buffers = (GLuint *) 0;
4530
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004531 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004532 if (_remaining < n) {
4533 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004534 _exceptionType = "java/lang/IllegalArgumentException";
4535 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536 goto exit;
4537 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004538 if (buffers == NULL) {
4539 char * _buffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4540 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4541 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004542 glGenBuffers(
4543 (GLsizei)n,
4544 (GLuint *)buffers
4545 );
4546
4547exit:
4548 if (_array) {
4549 releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE);
4550 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004551 if (_exception) {
4552 jniThrowException(_env, _exceptionType, _exceptionMessage);
4553 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004554}
4555
4556/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4557static void
4558android_glGetBooleanv__I_3ZI
4559 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4560 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004561 const char * _exceptionType = NULL;
4562 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004563 GLboolean *params_base = (GLboolean *) 0;
4564 jint _remaining;
4565 GLboolean *params = (GLboolean *) 0;
4566
4567 if (!params_ref) {
4568 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004569 _exceptionType = "java/lang/IllegalArgumentException";
4570 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004571 goto exit;
4572 }
4573 if (offset < 0) {
4574 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004575 _exceptionType = "java/lang/IllegalArgumentException";
4576 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004577 goto exit;
4578 }
4579 _remaining = _env->GetArrayLength(params_ref) - offset;
4580 params_base = (GLboolean *)
4581 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
4582 params = params_base + offset;
4583
4584 glGetBooleanv(
4585 (GLenum)pname,
4586 (GLboolean *)params
4587 );
4588
4589exit:
4590 if (params_base) {
4591 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
4592 _exception ? JNI_ABORT: 0);
4593 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004594 if (_exception) {
4595 jniThrowException(_env, _exceptionType, _exceptionMessage);
4596 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004597}
4598
4599/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4600static void
4601android_glGetBooleanv__ILjava_nio_IntBuffer_2
4602 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004603 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004604 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004605 jint _remaining;
4606 GLboolean *params = (GLboolean *) 0;
4607
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004608 params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
4609 if (params == NULL) {
4610 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4611 params = (GLboolean *) (_paramsBase + _bufferOffset);
4612 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004613 glGetBooleanv(
4614 (GLenum)pname,
4615 (GLboolean *)params
4616 );
4617 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004618 releasePointer(_env, _array, params, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004619 }
4620}
4621
4622/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4623static void
4624android_glGetBufferParameteriv__II_3II
4625 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004626 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004627 "glGetBufferParameteriv");
4628}
4629
4630/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4631static void
4632android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4633 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004634 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004635 "glGetBufferParameteriv");
4636}
4637
4638/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4639static void
4640android_glGetClipPlanef__I_3FI
4641 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4642 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004643 const char * _exceptionType = NULL;
4644 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004645 GLfloat *eqn_base = (GLfloat *) 0;
4646 jint _remaining;
4647 GLfloat *eqn = (GLfloat *) 0;
4648
4649 if (!eqn_ref) {
4650 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004651 _exceptionType = "java/lang/IllegalArgumentException";
4652 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004653 goto exit;
4654 }
4655 if (offset < 0) {
4656 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004657 _exceptionType = "java/lang/IllegalArgumentException";
4658 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004659 goto exit;
4660 }
4661 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4662 eqn_base = (GLfloat *)
4663 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
4664 eqn = eqn_base + offset;
4665
4666 glGetClipPlanef(
4667 (GLenum)pname,
4668 (GLfloat *)eqn
4669 );
4670
4671exit:
4672 if (eqn_base) {
4673 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base,
4674 _exception ? JNI_ABORT: 0);
4675 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004676 if (_exception) {
4677 jniThrowException(_env, _exceptionType, _exceptionMessage);
4678 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004679}
4680
4681/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4682static void
4683android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4684 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004685 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004686 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004687 jint _remaining;
4688 GLfloat *eqn = (GLfloat *) 0;
4689
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004690 eqn = (GLfloat *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
4691 if (eqn == NULL) {
4692 char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4693 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4694 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004695 glGetClipPlanef(
4696 (GLenum)pname,
4697 (GLfloat *)eqn
4698 );
4699 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004700 releasePointer(_env, _array, eqn, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004701 }
4702}
4703
4704/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4705static void
4706android_glGetClipPlanex__I_3II
4707 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
4708 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004709 const char * _exceptionType = NULL;
4710 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004711 GLfixed *eqn_base = (GLfixed *) 0;
4712 jint _remaining;
4713 GLfixed *eqn = (GLfixed *) 0;
4714
4715 if (!eqn_ref) {
4716 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004717 _exceptionType = "java/lang/IllegalArgumentException";
4718 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004719 goto exit;
4720 }
4721 if (offset < 0) {
4722 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004723 _exceptionType = "java/lang/IllegalArgumentException";
4724 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004725 goto exit;
4726 }
4727 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4728 eqn_base = (GLfixed *)
4729 _env->GetPrimitiveArrayCritical(eqn_ref, (jboolean *)0);
4730 eqn = eqn_base + offset;
4731
4732 glGetClipPlanex(
4733 (GLenum)pname,
4734 (GLfixed *)eqn
4735 );
4736
4737exit:
4738 if (eqn_base) {
4739 _env->ReleasePrimitiveArrayCritical(eqn_ref, eqn_base,
4740 _exception ? JNI_ABORT: 0);
4741 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004742 if (_exception) {
4743 jniThrowException(_env, _exceptionType, _exceptionMessage);
4744 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004745}
4746
4747/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4748static void
4749android_glGetClipPlanex__ILjava_nio_IntBuffer_2
4750 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004751 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004752 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004753 jint _remaining;
4754 GLfixed *eqn = (GLfixed *) 0;
4755
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004756 eqn = (GLfixed *)getPointer(_env, eqn_buf, &_array, &_remaining, &_bufferOffset);
4757 if (eqn == NULL) {
4758 char * _eqnBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4759 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
4760 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004761 glGetClipPlanex(
4762 (GLenum)pname,
4763 (GLfixed *)eqn
4764 );
4765 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004766 releasePointer(_env, _array, eqn, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004767 }
4768}
4769
4770/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
4771static void
4772android_glGetFixedv__I_3II
4773 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
4774 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004775 const char * _exceptionType = NULL;
4776 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004777 GLfixed *params_base = (GLfixed *) 0;
4778 jint _remaining;
4779 GLfixed *params = (GLfixed *) 0;
4780
4781 if (!params_ref) {
4782 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004783 _exceptionType = "java/lang/IllegalArgumentException";
4784 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004785 goto exit;
4786 }
4787 if (offset < 0) {
4788 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004789 _exceptionType = "java/lang/IllegalArgumentException";
4790 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004791 goto exit;
4792 }
4793 _remaining = _env->GetArrayLength(params_ref) - offset;
4794 params_base = (GLfixed *)
4795 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
4796 params = params_base + offset;
4797
4798 glGetFixedv(
4799 (GLenum)pname,
4800 (GLfixed *)params
4801 );
4802
4803exit:
4804 if (params_base) {
4805 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
4806 _exception ? JNI_ABORT: 0);
4807 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004808 if (_exception) {
4809 jniThrowException(_env, _exceptionType, _exceptionMessage);
4810 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004811}
4812
4813/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
4814static void
4815android_glGetFixedv__ILjava_nio_IntBuffer_2
4816 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004817 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004818 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004819 jint _remaining;
4820 GLfixed *params = (GLfixed *) 0;
4821
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004822 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
4823 if (params == NULL) {
4824 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4825 params = (GLfixed *) (_paramsBase + _bufferOffset);
4826 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004827 glGetFixedv(
4828 (GLenum)pname,
4829 (GLfixed *)params
4830 );
4831 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004832 releasePointer(_env, _array, params, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004833 }
4834}
4835
4836/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
4837static void
4838android_glGetFloatv__I_3FI
4839 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
4840 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004841 const char * _exceptionType = NULL;
4842 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004843 GLfloat *params_base = (GLfloat *) 0;
4844 jint _remaining;
4845 GLfloat *params = (GLfloat *) 0;
4846
4847 if (!params_ref) {
4848 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004849 _exceptionType = "java/lang/IllegalArgumentException";
4850 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004851 goto exit;
4852 }
4853 if (offset < 0) {
4854 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004855 _exceptionType = "java/lang/IllegalArgumentException";
4856 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004857 goto exit;
4858 }
4859 _remaining = _env->GetArrayLength(params_ref) - offset;
4860 params_base = (GLfloat *)
4861 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
4862 params = params_base + offset;
4863
4864 glGetFloatv(
4865 (GLenum)pname,
4866 (GLfloat *)params
4867 );
4868
4869exit:
4870 if (params_base) {
4871 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
4872 _exception ? JNI_ABORT: 0);
4873 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004874 if (_exception) {
4875 jniThrowException(_env, _exceptionType, _exceptionMessage);
4876 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004877}
4878
4879/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
4880static void
4881android_glGetFloatv__ILjava_nio_FloatBuffer_2
4882 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004883 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004884 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004885 jint _remaining;
4886 GLfloat *params = (GLfloat *) 0;
4887
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004888 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
4889 if (params == NULL) {
4890 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4891 params = (GLfloat *) (_paramsBase + _bufferOffset);
4892 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004893 glGetFloatv(
4894 (GLenum)pname,
4895 (GLfloat *)params
4896 );
4897 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004898 releasePointer(_env, _array, params, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004899 }
4900}
4901
4902/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
4903static void
4904android_glGetLightfv__II_3FI
4905 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
4906 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004907 const char * _exceptionType = NULL;
4908 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004909 GLfloat *params_base = (GLfloat *) 0;
4910 jint _remaining;
4911 GLfloat *params = (GLfloat *) 0;
4912
4913 if (!params_ref) {
4914 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004915 _exceptionType = "java/lang/IllegalArgumentException";
4916 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004917 goto exit;
4918 }
4919 if (offset < 0) {
4920 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004921 _exceptionType = "java/lang/IllegalArgumentException";
4922 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004923 goto exit;
4924 }
4925 _remaining = _env->GetArrayLength(params_ref) - offset;
4926 int _needed;
4927 switch (pname) {
4928#if defined(GL_SPOT_EXPONENT)
4929 case GL_SPOT_EXPONENT:
4930#endif // defined(GL_SPOT_EXPONENT)
4931#if defined(GL_SPOT_CUTOFF)
4932 case GL_SPOT_CUTOFF:
4933#endif // defined(GL_SPOT_CUTOFF)
4934#if defined(GL_CONSTANT_ATTENUATION)
4935 case GL_CONSTANT_ATTENUATION:
4936#endif // defined(GL_CONSTANT_ATTENUATION)
4937#if defined(GL_LINEAR_ATTENUATION)
4938 case GL_LINEAR_ATTENUATION:
4939#endif // defined(GL_LINEAR_ATTENUATION)
4940#if defined(GL_QUADRATIC_ATTENUATION)
4941 case GL_QUADRATIC_ATTENUATION:
4942#endif // defined(GL_QUADRATIC_ATTENUATION)
4943 _needed = 1;
4944 break;
4945#if defined(GL_SPOT_DIRECTION)
4946 case GL_SPOT_DIRECTION:
4947#endif // defined(GL_SPOT_DIRECTION)
4948 _needed = 3;
4949 break;
4950#if defined(GL_AMBIENT)
4951 case GL_AMBIENT:
4952#endif // defined(GL_AMBIENT)
4953#if defined(GL_DIFFUSE)
4954 case GL_DIFFUSE:
4955#endif // defined(GL_DIFFUSE)
4956#if defined(GL_SPECULAR)
4957 case GL_SPECULAR:
4958#endif // defined(GL_SPECULAR)
4959#if defined(GL_EMISSION)
4960 case GL_EMISSION:
4961#endif // defined(GL_EMISSION)
4962 _needed = 4;
4963 break;
4964 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08004965 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004966 break;
4967 }
4968 if (_remaining < _needed) {
4969 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004970 _exceptionType = "java/lang/IllegalArgumentException";
4971 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004972 goto exit;
4973 }
4974 params_base = (GLfloat *)
4975 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
4976 params = params_base + offset;
4977
4978 glGetLightfv(
4979 (GLenum)light,
4980 (GLenum)pname,
4981 (GLfloat *)params
4982 );
4983
4984exit:
4985 if (params_base) {
4986 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
4987 _exception ? JNI_ABORT: 0);
4988 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004989 if (_exception) {
4990 jniThrowException(_env, _exceptionType, _exceptionMessage);
4991 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004992}
4993
4994/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
4995static void
4996android_glGetLightfv__IILjava_nio_FloatBuffer_2
4997 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
4998 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08004999 const char * _exceptionType = NULL;
5000 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005001 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005002 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005003 jint _remaining;
5004 GLfloat *params = (GLfloat *) 0;
5005
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005006 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005007 int _needed;
5008 switch (pname) {
5009#if defined(GL_SPOT_EXPONENT)
5010 case GL_SPOT_EXPONENT:
5011#endif // defined(GL_SPOT_EXPONENT)
5012#if defined(GL_SPOT_CUTOFF)
5013 case GL_SPOT_CUTOFF:
5014#endif // defined(GL_SPOT_CUTOFF)
5015#if defined(GL_CONSTANT_ATTENUATION)
5016 case GL_CONSTANT_ATTENUATION:
5017#endif // defined(GL_CONSTANT_ATTENUATION)
5018#if defined(GL_LINEAR_ATTENUATION)
5019 case GL_LINEAR_ATTENUATION:
5020#endif // defined(GL_LINEAR_ATTENUATION)
5021#if defined(GL_QUADRATIC_ATTENUATION)
5022 case GL_QUADRATIC_ATTENUATION:
5023#endif // defined(GL_QUADRATIC_ATTENUATION)
5024 _needed = 1;
5025 break;
5026#if defined(GL_SPOT_DIRECTION)
5027 case GL_SPOT_DIRECTION:
5028#endif // defined(GL_SPOT_DIRECTION)
5029 _needed = 3;
5030 break;
5031#if defined(GL_AMBIENT)
5032 case GL_AMBIENT:
5033#endif // defined(GL_AMBIENT)
5034#if defined(GL_DIFFUSE)
5035 case GL_DIFFUSE:
5036#endif // defined(GL_DIFFUSE)
5037#if defined(GL_SPECULAR)
5038 case GL_SPECULAR:
5039#endif // defined(GL_SPECULAR)
5040#if defined(GL_EMISSION)
5041 case GL_EMISSION:
5042#endif // defined(GL_EMISSION)
5043 _needed = 4;
5044 break;
5045 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005046 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005047 break;
5048 }
5049 if (_remaining < _needed) {
5050 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005051 _exceptionType = "java/lang/IllegalArgumentException";
5052 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005053 goto exit;
5054 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005055 if (params == NULL) {
5056 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5057 params = (GLfloat *) (_paramsBase + _bufferOffset);
5058 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005059 glGetLightfv(
5060 (GLenum)light,
5061 (GLenum)pname,
5062 (GLfloat *)params
5063 );
5064
5065exit:
5066 if (_array) {
5067 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5068 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005069 if (_exception) {
5070 jniThrowException(_env, _exceptionType, _exceptionMessage);
5071 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005072}
5073
5074/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5075static void
5076android_glGetLightxv__II_3II
5077 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5078 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005079 const char * _exceptionType = NULL;
5080 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005081 GLfixed *params_base = (GLfixed *) 0;
5082 jint _remaining;
5083 GLfixed *params = (GLfixed *) 0;
5084
5085 if (!params_ref) {
5086 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005087 _exceptionType = "java/lang/IllegalArgumentException";
5088 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005089 goto exit;
5090 }
5091 if (offset < 0) {
5092 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005093 _exceptionType = "java/lang/IllegalArgumentException";
5094 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005095 goto exit;
5096 }
5097 _remaining = _env->GetArrayLength(params_ref) - offset;
5098 int _needed;
5099 switch (pname) {
5100#if defined(GL_SPOT_EXPONENT)
5101 case GL_SPOT_EXPONENT:
5102#endif // defined(GL_SPOT_EXPONENT)
5103#if defined(GL_SPOT_CUTOFF)
5104 case GL_SPOT_CUTOFF:
5105#endif // defined(GL_SPOT_CUTOFF)
5106#if defined(GL_CONSTANT_ATTENUATION)
5107 case GL_CONSTANT_ATTENUATION:
5108#endif // defined(GL_CONSTANT_ATTENUATION)
5109#if defined(GL_LINEAR_ATTENUATION)
5110 case GL_LINEAR_ATTENUATION:
5111#endif // defined(GL_LINEAR_ATTENUATION)
5112#if defined(GL_QUADRATIC_ATTENUATION)
5113 case GL_QUADRATIC_ATTENUATION:
5114#endif // defined(GL_QUADRATIC_ATTENUATION)
5115 _needed = 1;
5116 break;
5117#if defined(GL_SPOT_DIRECTION)
5118 case GL_SPOT_DIRECTION:
5119#endif // defined(GL_SPOT_DIRECTION)
5120 _needed = 3;
5121 break;
5122#if defined(GL_AMBIENT)
5123 case GL_AMBIENT:
5124#endif // defined(GL_AMBIENT)
5125#if defined(GL_DIFFUSE)
5126 case GL_DIFFUSE:
5127#endif // defined(GL_DIFFUSE)
5128#if defined(GL_SPECULAR)
5129 case GL_SPECULAR:
5130#endif // defined(GL_SPECULAR)
5131#if defined(GL_EMISSION)
5132 case GL_EMISSION:
5133#endif // defined(GL_EMISSION)
5134 _needed = 4;
5135 break;
5136 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005137 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005138 break;
5139 }
5140 if (_remaining < _needed) {
5141 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005142 _exceptionType = "java/lang/IllegalArgumentException";
5143 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005144 goto exit;
5145 }
5146 params_base = (GLfixed *)
5147 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5148 params = params_base + offset;
5149
5150 glGetLightxv(
5151 (GLenum)light,
5152 (GLenum)pname,
5153 (GLfixed *)params
5154 );
5155
5156exit:
5157 if (params_base) {
5158 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5159 _exception ? JNI_ABORT: 0);
5160 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005161 if (_exception) {
5162 jniThrowException(_env, _exceptionType, _exceptionMessage);
5163 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005164}
5165
5166/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5167static void
5168android_glGetLightxv__IILjava_nio_IntBuffer_2
5169 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5170 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005171 const char * _exceptionType = NULL;
5172 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005173 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005174 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005175 jint _remaining;
5176 GLfixed *params = (GLfixed *) 0;
5177
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005178 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005179 int _needed;
5180 switch (pname) {
5181#if defined(GL_SPOT_EXPONENT)
5182 case GL_SPOT_EXPONENT:
5183#endif // defined(GL_SPOT_EXPONENT)
5184#if defined(GL_SPOT_CUTOFF)
5185 case GL_SPOT_CUTOFF:
5186#endif // defined(GL_SPOT_CUTOFF)
5187#if defined(GL_CONSTANT_ATTENUATION)
5188 case GL_CONSTANT_ATTENUATION:
5189#endif // defined(GL_CONSTANT_ATTENUATION)
5190#if defined(GL_LINEAR_ATTENUATION)
5191 case GL_LINEAR_ATTENUATION:
5192#endif // defined(GL_LINEAR_ATTENUATION)
5193#if defined(GL_QUADRATIC_ATTENUATION)
5194 case GL_QUADRATIC_ATTENUATION:
5195#endif // defined(GL_QUADRATIC_ATTENUATION)
5196 _needed = 1;
5197 break;
5198#if defined(GL_SPOT_DIRECTION)
5199 case GL_SPOT_DIRECTION:
5200#endif // defined(GL_SPOT_DIRECTION)
5201 _needed = 3;
5202 break;
5203#if defined(GL_AMBIENT)
5204 case GL_AMBIENT:
5205#endif // defined(GL_AMBIENT)
5206#if defined(GL_DIFFUSE)
5207 case GL_DIFFUSE:
5208#endif // defined(GL_DIFFUSE)
5209#if defined(GL_SPECULAR)
5210 case GL_SPECULAR:
5211#endif // defined(GL_SPECULAR)
5212#if defined(GL_EMISSION)
5213 case GL_EMISSION:
5214#endif // defined(GL_EMISSION)
5215 _needed = 4;
5216 break;
5217 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005218 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005219 break;
5220 }
5221 if (_remaining < _needed) {
5222 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005223 _exceptionType = "java/lang/IllegalArgumentException";
5224 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005225 goto exit;
5226 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005227 if (params == NULL) {
5228 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5229 params = (GLfixed *) (_paramsBase + _bufferOffset);
5230 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005231 glGetLightxv(
5232 (GLenum)light,
5233 (GLenum)pname,
5234 (GLfixed *)params
5235 );
5236
5237exit:
5238 if (_array) {
5239 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5240 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005241 if (_exception) {
5242 jniThrowException(_env, _exceptionType, _exceptionMessage);
5243 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005244}
5245
5246/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5247static void
5248android_glGetMaterialfv__II_3FI
5249 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5250 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005251 const char * _exceptionType = NULL;
5252 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005253 GLfloat *params_base = (GLfloat *) 0;
5254 jint _remaining;
5255 GLfloat *params = (GLfloat *) 0;
5256
5257 if (!params_ref) {
5258 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005259 _exceptionType = "java/lang/IllegalArgumentException";
5260 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005261 goto exit;
5262 }
5263 if (offset < 0) {
5264 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005265 _exceptionType = "java/lang/IllegalArgumentException";
5266 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005267 goto exit;
5268 }
5269 _remaining = _env->GetArrayLength(params_ref) - offset;
5270 int _needed;
5271 switch (pname) {
5272#if defined(GL_SHININESS)
5273 case GL_SHININESS:
5274#endif // defined(GL_SHININESS)
5275 _needed = 1;
5276 break;
5277#if defined(GL_AMBIENT)
5278 case GL_AMBIENT:
5279#endif // defined(GL_AMBIENT)
5280#if defined(GL_DIFFUSE)
5281 case GL_DIFFUSE:
5282#endif // defined(GL_DIFFUSE)
5283#if defined(GL_SPECULAR)
5284 case GL_SPECULAR:
5285#endif // defined(GL_SPECULAR)
5286#if defined(GL_EMISSION)
5287 case GL_EMISSION:
5288#endif // defined(GL_EMISSION)
5289#if defined(GL_AMBIENT_AND_DIFFUSE)
5290 case GL_AMBIENT_AND_DIFFUSE:
5291#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5292 _needed = 4;
5293 break;
5294 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005295 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005296 break;
5297 }
5298 if (_remaining < _needed) {
5299 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005300 _exceptionType = "java/lang/IllegalArgumentException";
5301 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005302 goto exit;
5303 }
5304 params_base = (GLfloat *)
5305 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5306 params = params_base + offset;
5307
5308 glGetMaterialfv(
5309 (GLenum)face,
5310 (GLenum)pname,
5311 (GLfloat *)params
5312 );
5313
5314exit:
5315 if (params_base) {
5316 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5317 _exception ? JNI_ABORT: 0);
5318 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005319 if (_exception) {
5320 jniThrowException(_env, _exceptionType, _exceptionMessage);
5321 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005322}
5323
5324/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5325static void
5326android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5327 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5328 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005329 const char * _exceptionType = NULL;
5330 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005331 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005332 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005333 jint _remaining;
5334 GLfloat *params = (GLfloat *) 0;
5335
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005336 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005337 int _needed;
5338 switch (pname) {
5339#if defined(GL_SHININESS)
5340 case GL_SHININESS:
5341#endif // defined(GL_SHININESS)
5342 _needed = 1;
5343 break;
5344#if defined(GL_AMBIENT)
5345 case GL_AMBIENT:
5346#endif // defined(GL_AMBIENT)
5347#if defined(GL_DIFFUSE)
5348 case GL_DIFFUSE:
5349#endif // defined(GL_DIFFUSE)
5350#if defined(GL_SPECULAR)
5351 case GL_SPECULAR:
5352#endif // defined(GL_SPECULAR)
5353#if defined(GL_EMISSION)
5354 case GL_EMISSION:
5355#endif // defined(GL_EMISSION)
5356#if defined(GL_AMBIENT_AND_DIFFUSE)
5357 case GL_AMBIENT_AND_DIFFUSE:
5358#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5359 _needed = 4;
5360 break;
5361 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005362 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005363 break;
5364 }
5365 if (_remaining < _needed) {
5366 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005367 _exceptionType = "java/lang/IllegalArgumentException";
5368 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005369 goto exit;
5370 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005371 if (params == NULL) {
5372 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5373 params = (GLfloat *) (_paramsBase + _bufferOffset);
5374 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005375 glGetMaterialfv(
5376 (GLenum)face,
5377 (GLenum)pname,
5378 (GLfloat *)params
5379 );
5380
5381exit:
5382 if (_array) {
5383 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5384 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005385 if (_exception) {
5386 jniThrowException(_env, _exceptionType, _exceptionMessage);
5387 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005388}
5389
5390/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5391static void
5392android_glGetMaterialxv__II_3II
5393 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5394 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005395 const char * _exceptionType = NULL;
5396 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005397 GLfixed *params_base = (GLfixed *) 0;
5398 jint _remaining;
5399 GLfixed *params = (GLfixed *) 0;
5400
5401 if (!params_ref) {
5402 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005403 _exceptionType = "java/lang/IllegalArgumentException";
5404 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005405 goto exit;
5406 }
5407 if (offset < 0) {
5408 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005409 _exceptionType = "java/lang/IllegalArgumentException";
5410 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005411 goto exit;
5412 }
5413 _remaining = _env->GetArrayLength(params_ref) - offset;
5414 int _needed;
5415 switch (pname) {
5416#if defined(GL_SHININESS)
5417 case GL_SHININESS:
5418#endif // defined(GL_SHININESS)
5419 _needed = 1;
5420 break;
5421#if defined(GL_AMBIENT)
5422 case GL_AMBIENT:
5423#endif // defined(GL_AMBIENT)
5424#if defined(GL_DIFFUSE)
5425 case GL_DIFFUSE:
5426#endif // defined(GL_DIFFUSE)
5427#if defined(GL_SPECULAR)
5428 case GL_SPECULAR:
5429#endif // defined(GL_SPECULAR)
5430#if defined(GL_EMISSION)
5431 case GL_EMISSION:
5432#endif // defined(GL_EMISSION)
5433#if defined(GL_AMBIENT_AND_DIFFUSE)
5434 case GL_AMBIENT_AND_DIFFUSE:
5435#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5436 _needed = 4;
5437 break;
5438 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005439 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005440 break;
5441 }
5442 if (_remaining < _needed) {
5443 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005444 _exceptionType = "java/lang/IllegalArgumentException";
5445 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005446 goto exit;
5447 }
5448 params_base = (GLfixed *)
5449 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5450 params = params_base + offset;
5451
5452 glGetMaterialxv(
5453 (GLenum)face,
5454 (GLenum)pname,
5455 (GLfixed *)params
5456 );
5457
5458exit:
5459 if (params_base) {
5460 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5461 _exception ? JNI_ABORT: 0);
5462 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005463 if (_exception) {
5464 jniThrowException(_env, _exceptionType, _exceptionMessage);
5465 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005466}
5467
5468/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5469static void
5470android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5471 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5472 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005473 const char * _exceptionType = NULL;
5474 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005475 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005476 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005477 jint _remaining;
5478 GLfixed *params = (GLfixed *) 0;
5479
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005480 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005481 int _needed;
5482 switch (pname) {
5483#if defined(GL_SHININESS)
5484 case GL_SHININESS:
5485#endif // defined(GL_SHININESS)
5486 _needed = 1;
5487 break;
5488#if defined(GL_AMBIENT)
5489 case GL_AMBIENT:
5490#endif // defined(GL_AMBIENT)
5491#if defined(GL_DIFFUSE)
5492 case GL_DIFFUSE:
5493#endif // defined(GL_DIFFUSE)
5494#if defined(GL_SPECULAR)
5495 case GL_SPECULAR:
5496#endif // defined(GL_SPECULAR)
5497#if defined(GL_EMISSION)
5498 case GL_EMISSION:
5499#endif // defined(GL_EMISSION)
5500#if defined(GL_AMBIENT_AND_DIFFUSE)
5501 case GL_AMBIENT_AND_DIFFUSE:
5502#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5503 _needed = 4;
5504 break;
5505 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005506 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005507 break;
5508 }
5509 if (_remaining < _needed) {
5510 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005511 _exceptionType = "java/lang/IllegalArgumentException";
5512 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005513 goto exit;
5514 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005515 if (params == NULL) {
5516 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5517 params = (GLfixed *) (_paramsBase + _bufferOffset);
5518 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005519 glGetMaterialxv(
5520 (GLenum)face,
5521 (GLenum)pname,
5522 (GLfixed *)params
5523 );
5524
5525exit:
5526 if (_array) {
5527 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5528 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005529 if (_exception) {
5530 jniThrowException(_env, _exceptionType, _exceptionMessage);
5531 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005532}
5533
5534/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5535static void
5536android_glGetTexEnviv__II_3II
5537 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5538 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005539 const char * _exceptionType = NULL;
5540 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005541 GLint *params_base = (GLint *) 0;
5542 jint _remaining;
5543 GLint *params = (GLint *) 0;
5544
5545 if (!params_ref) {
5546 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005547 _exceptionType = "java/lang/IllegalArgumentException";
5548 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005549 goto exit;
5550 }
5551 if (offset < 0) {
5552 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005553 _exceptionType = "java/lang/IllegalArgumentException";
5554 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005555 goto exit;
5556 }
5557 _remaining = _env->GetArrayLength(params_ref) - offset;
5558 int _needed;
5559 switch (pname) {
5560#if defined(GL_TEXTURE_ENV_MODE)
5561 case GL_TEXTURE_ENV_MODE:
5562#endif // defined(GL_TEXTURE_ENV_MODE)
5563#if defined(GL_COMBINE_RGB)
5564 case GL_COMBINE_RGB:
5565#endif // defined(GL_COMBINE_RGB)
5566#if defined(GL_COMBINE_ALPHA)
5567 case GL_COMBINE_ALPHA:
5568#endif // defined(GL_COMBINE_ALPHA)
5569 _needed = 1;
5570 break;
5571#if defined(GL_TEXTURE_ENV_COLOR)
5572 case GL_TEXTURE_ENV_COLOR:
5573#endif // defined(GL_TEXTURE_ENV_COLOR)
5574 _needed = 4;
5575 break;
5576 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005577 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005578 break;
5579 }
5580 if (_remaining < _needed) {
5581 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005582 _exceptionType = "java/lang/IllegalArgumentException";
5583 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005584 goto exit;
5585 }
5586 params_base = (GLint *)
5587 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5588 params = params_base + offset;
5589
5590 glGetTexEnviv(
5591 (GLenum)env,
5592 (GLenum)pname,
5593 (GLint *)params
5594 );
5595
5596exit:
5597 if (params_base) {
5598 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5599 _exception ? JNI_ABORT: 0);
5600 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005601 if (_exception) {
5602 jniThrowException(_env, _exceptionType, _exceptionMessage);
5603 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005604}
5605
5606/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5607static void
5608android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5609 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5610 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005611 const char * _exceptionType = NULL;
5612 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005613 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005614 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005615 jint _remaining;
5616 GLint *params = (GLint *) 0;
5617
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005618 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005619 int _needed;
5620 switch (pname) {
5621#if defined(GL_TEXTURE_ENV_MODE)
5622 case GL_TEXTURE_ENV_MODE:
5623#endif // defined(GL_TEXTURE_ENV_MODE)
5624#if defined(GL_COMBINE_RGB)
5625 case GL_COMBINE_RGB:
5626#endif // defined(GL_COMBINE_RGB)
5627#if defined(GL_COMBINE_ALPHA)
5628 case GL_COMBINE_ALPHA:
5629#endif // defined(GL_COMBINE_ALPHA)
5630 _needed = 1;
5631 break;
5632#if defined(GL_TEXTURE_ENV_COLOR)
5633 case GL_TEXTURE_ENV_COLOR:
5634#endif // defined(GL_TEXTURE_ENV_COLOR)
5635 _needed = 4;
5636 break;
5637 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005638 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005639 break;
5640 }
5641 if (_remaining < _needed) {
5642 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005643 _exceptionType = "java/lang/IllegalArgumentException";
5644 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005645 goto exit;
5646 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005647 if (params == NULL) {
5648 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5649 params = (GLint *) (_paramsBase + _bufferOffset);
5650 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005651 glGetTexEnviv(
5652 (GLenum)env,
5653 (GLenum)pname,
5654 (GLint *)params
5655 );
5656
5657exit:
5658 if (_array) {
5659 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5660 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005661 if (_exception) {
5662 jniThrowException(_env, _exceptionType, _exceptionMessage);
5663 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005664}
5665
5666/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
5667static void
5668android_glGetTexEnvxv__II_3II
5669 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5670 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005671 const char * _exceptionType = NULL;
5672 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005673 GLfixed *params_base = (GLfixed *) 0;
5674 jint _remaining;
5675 GLfixed *params = (GLfixed *) 0;
5676
5677 if (!params_ref) {
5678 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005679 _exceptionType = "java/lang/IllegalArgumentException";
5680 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005681 goto exit;
5682 }
5683 if (offset < 0) {
5684 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005685 _exceptionType = "java/lang/IllegalArgumentException";
5686 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005687 goto exit;
5688 }
5689 _remaining = _env->GetArrayLength(params_ref) - offset;
5690 int _needed;
5691 switch (pname) {
5692#if defined(GL_TEXTURE_ENV_MODE)
5693 case GL_TEXTURE_ENV_MODE:
5694#endif // defined(GL_TEXTURE_ENV_MODE)
5695#if defined(GL_COMBINE_RGB)
5696 case GL_COMBINE_RGB:
5697#endif // defined(GL_COMBINE_RGB)
5698#if defined(GL_COMBINE_ALPHA)
5699 case GL_COMBINE_ALPHA:
5700#endif // defined(GL_COMBINE_ALPHA)
5701 _needed = 1;
5702 break;
5703#if defined(GL_TEXTURE_ENV_COLOR)
5704 case GL_TEXTURE_ENV_COLOR:
5705#endif // defined(GL_TEXTURE_ENV_COLOR)
5706 _needed = 4;
5707 break;
5708 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005709 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005710 break;
5711 }
5712 if (_remaining < _needed) {
5713 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005714 _exceptionType = "java/lang/IllegalArgumentException";
5715 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005716 goto exit;
5717 }
5718 params_base = (GLfixed *)
5719 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5720 params = params_base + offset;
5721
5722 glGetTexEnvxv(
5723 (GLenum)env,
5724 (GLenum)pname,
5725 (GLfixed *)params
5726 );
5727
5728exit:
5729 if (params_base) {
5730 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5731 _exception ? JNI_ABORT: 0);
5732 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005733 if (_exception) {
5734 jniThrowException(_env, _exceptionType, _exceptionMessage);
5735 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005736}
5737
5738/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
5739static void
5740android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
5741 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5742 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005743 const char * _exceptionType = NULL;
5744 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005745 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005746 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005747 jint _remaining;
5748 GLfixed *params = (GLfixed *) 0;
5749
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005750 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005751 int _needed;
5752 switch (pname) {
5753#if defined(GL_TEXTURE_ENV_MODE)
5754 case GL_TEXTURE_ENV_MODE:
5755#endif // defined(GL_TEXTURE_ENV_MODE)
5756#if defined(GL_COMBINE_RGB)
5757 case GL_COMBINE_RGB:
5758#endif // defined(GL_COMBINE_RGB)
5759#if defined(GL_COMBINE_ALPHA)
5760 case GL_COMBINE_ALPHA:
5761#endif // defined(GL_COMBINE_ALPHA)
5762 _needed = 1;
5763 break;
5764#if defined(GL_TEXTURE_ENV_COLOR)
5765 case GL_TEXTURE_ENV_COLOR:
5766#endif // defined(GL_TEXTURE_ENV_COLOR)
5767 _needed = 4;
5768 break;
5769 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08005770 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005771 break;
5772 }
5773 if (_remaining < _needed) {
5774 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005775 _exceptionType = "java/lang/IllegalArgumentException";
5776 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005777 goto exit;
5778 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005779 if (params == NULL) {
5780 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5781 params = (GLfixed *) (_paramsBase + _bufferOffset);
5782 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005783 glGetTexEnvxv(
5784 (GLenum)env,
5785 (GLenum)pname,
5786 (GLfixed *)params
5787 );
5788
5789exit:
5790 if (_array) {
5791 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5792 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005793 if (_exception) {
5794 jniThrowException(_env, _exceptionType, _exceptionMessage);
5795 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005796}
5797
5798/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
5799static void
5800android_glGetTexParameterfv__II_3FI
5801 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
5802 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005803 const char * _exceptionType = NULL;
5804 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005805 GLfloat *params_base = (GLfloat *) 0;
5806 jint _remaining;
5807 GLfloat *params = (GLfloat *) 0;
5808
5809 if (!params_ref) {
5810 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005811 _exceptionType = "java/lang/IllegalArgumentException";
5812 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005813 goto exit;
5814 }
5815 if (offset < 0) {
5816 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005817 _exceptionType = "java/lang/IllegalArgumentException";
5818 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005819 goto exit;
5820 }
5821 _remaining = _env->GetArrayLength(params_ref) - offset;
5822 if (_remaining < 1) {
5823 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005824 _exceptionType = "java/lang/IllegalArgumentException";
5825 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005826 goto exit;
5827 }
5828 params_base = (GLfloat *)
5829 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5830 params = params_base + offset;
5831
5832 glGetTexParameterfv(
5833 (GLenum)target,
5834 (GLenum)pname,
5835 (GLfloat *)params
5836 );
5837
5838exit:
5839 if (params_base) {
5840 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5841 _exception ? JNI_ABORT: 0);
5842 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005843 if (_exception) {
5844 jniThrowException(_env, _exceptionType, _exceptionMessage);
5845 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005846}
5847
5848/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
5849static void
5850android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
5851 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
5852 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005853 const char * _exceptionType = NULL;
5854 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005855 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005856 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005857 jint _remaining;
5858 GLfloat *params = (GLfloat *) 0;
5859
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005860 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005861 if (_remaining < 1) {
5862 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005863 _exceptionType = "java/lang/IllegalArgumentException";
5864 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005865 goto exit;
5866 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005867 if (params == NULL) {
5868 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5869 params = (GLfloat *) (_paramsBase + _bufferOffset);
5870 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005871 glGetTexParameterfv(
5872 (GLenum)target,
5873 (GLenum)pname,
5874 (GLfloat *)params
5875 );
5876
5877exit:
5878 if (_array) {
5879 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5880 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005881 if (_exception) {
5882 jniThrowException(_env, _exceptionType, _exceptionMessage);
5883 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005884}
5885
5886/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
5887static void
5888android_glGetTexParameteriv__II_3II
5889 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
5890 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005891 const char * _exceptionType = NULL;
5892 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005893 GLint *params_base = (GLint *) 0;
5894 jint _remaining;
5895 GLint *params = (GLint *) 0;
5896
5897 if (!params_ref) {
5898 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005899 _exceptionType = "java/lang/IllegalArgumentException";
5900 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005901 goto exit;
5902 }
5903 if (offset < 0) {
5904 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005905 _exceptionType = "java/lang/IllegalArgumentException";
5906 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005907 goto exit;
5908 }
5909 _remaining = _env->GetArrayLength(params_ref) - offset;
5910 if (_remaining < 1) {
5911 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005912 _exceptionType = "java/lang/IllegalArgumentException";
5913 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005914 goto exit;
5915 }
5916 params_base = (GLint *)
5917 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
5918 params = params_base + offset;
5919
5920 glGetTexParameteriv(
5921 (GLenum)target,
5922 (GLenum)pname,
5923 (GLint *)params
5924 );
5925
5926exit:
5927 if (params_base) {
5928 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
5929 _exception ? JNI_ABORT: 0);
5930 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005931 if (_exception) {
5932 jniThrowException(_env, _exceptionType, _exceptionMessage);
5933 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005934}
5935
5936/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
5937static void
5938android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
5939 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
5940 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005941 const char * _exceptionType = NULL;
5942 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005943 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005944 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005945 jint _remaining;
5946 GLint *params = (GLint *) 0;
5947
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005948 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005949 if (_remaining < 1) {
5950 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005951 _exceptionType = "java/lang/IllegalArgumentException";
5952 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005953 goto exit;
5954 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005955 if (params == NULL) {
5956 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
5957 params = (GLint *) (_paramsBase + _bufferOffset);
5958 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005959 glGetTexParameteriv(
5960 (GLenum)target,
5961 (GLenum)pname,
5962 (GLint *)params
5963 );
5964
5965exit:
5966 if (_array) {
5967 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
5968 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005969 if (_exception) {
5970 jniThrowException(_env, _exceptionType, _exceptionMessage);
5971 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005972}
5973
5974/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
5975static void
5976android_glGetTexParameterxv__II_3II
5977 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
5978 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08005979 const char * _exceptionType = NULL;
5980 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005981 GLfixed *params_base = (GLfixed *) 0;
5982 jint _remaining;
5983 GLfixed *params = (GLfixed *) 0;
5984
5985 if (!params_ref) {
5986 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005987 _exceptionType = "java/lang/IllegalArgumentException";
5988 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005989 goto exit;
5990 }
5991 if (offset < 0) {
5992 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005993 _exceptionType = "java/lang/IllegalArgumentException";
5994 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005995 goto exit;
5996 }
5997 _remaining = _env->GetArrayLength(params_ref) - offset;
5998 if (_remaining < 1) {
5999 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006000 _exceptionType = "java/lang/IllegalArgumentException";
6001 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006002 goto exit;
6003 }
6004 params_base = (GLfixed *)
6005 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6006 params = params_base + offset;
6007
6008 glGetTexParameterxv(
6009 (GLenum)target,
6010 (GLenum)pname,
6011 (GLfixed *)params
6012 );
6013
6014exit:
6015 if (params_base) {
6016 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6017 _exception ? JNI_ABORT: 0);
6018 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006019 if (_exception) {
6020 jniThrowException(_env, _exceptionType, _exceptionMessage);
6021 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006022}
6023
6024/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6025static void
6026android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6027 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6028 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006029 const char * _exceptionType = NULL;
6030 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006031 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006032 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006033 jint _remaining;
6034 GLfixed *params = (GLfixed *) 0;
6035
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006036 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006037 if (_remaining < 1) {
6038 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006039 _exceptionType = "java/lang/IllegalArgumentException";
6040 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006041 goto exit;
6042 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006043 if (params == NULL) {
6044 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6045 params = (GLfixed *) (_paramsBase + _bufferOffset);
6046 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006047 glGetTexParameterxv(
6048 (GLenum)target,
6049 (GLenum)pname,
6050 (GLfixed *)params
6051 );
6052
6053exit:
6054 if (_array) {
6055 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
6056 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006057 if (_exception) {
6058 jniThrowException(_env, _exceptionType, _exceptionMessage);
6059 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006060}
6061
6062/* GLboolean glIsBuffer ( GLuint buffer ) */
6063static jboolean
6064android_glIsBuffer__I
6065 (JNIEnv *_env, jobject _this, jint buffer) {
6066 GLboolean _returnValue;
6067 _returnValue = glIsBuffer(
6068 (GLuint)buffer
6069 );
Andy McFaddencee51982013-04-25 16:08:31 -07006070 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006071}
6072
6073/* GLboolean glIsEnabled ( GLenum cap ) */
6074static jboolean
6075android_glIsEnabled__I
6076 (JNIEnv *_env, jobject _this, jint cap) {
6077 GLboolean _returnValue;
6078 _returnValue = glIsEnabled(
6079 (GLenum)cap
6080 );
Andy McFaddencee51982013-04-25 16:08:31 -07006081 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006082}
6083
6084/* GLboolean glIsTexture ( GLuint texture ) */
6085static jboolean
6086android_glIsTexture__I
6087 (JNIEnv *_env, jobject _this, jint texture) {
6088 GLboolean _returnValue;
6089 _returnValue = glIsTexture(
6090 (GLuint)texture
6091 );
Andy McFaddencee51982013-04-25 16:08:31 -07006092 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006093}
6094
6095/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6096static void
6097android_glNormalPointer__III
6098 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6099 glNormalPointer(
6100 (GLenum)type,
6101 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07006102 (GLvoid *)offset
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006103 );
6104}
6105
6106/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6107static void
6108android_glPointParameterf__IF
6109 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6110 glPointParameterf(
6111 (GLenum)pname,
6112 (GLfloat)param
6113 );
6114}
6115
6116/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6117static void
6118android_glPointParameterfv__I_3FI
6119 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006120 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006121 const char * _exceptionType = NULL;
6122 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006123 GLfloat *params_base = (GLfloat *) 0;
6124 jint _remaining;
6125 GLfloat *params = (GLfloat *) 0;
6126
6127 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006128 _exception = 1;
6129 _exceptionType = "java/lang/IllegalArgumentException";
6130 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006131 goto exit;
6132 }
6133 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006134 _exception = 1;
6135 _exceptionType = "java/lang/IllegalArgumentException";
6136 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006137 goto exit;
6138 }
6139 _remaining = _env->GetArrayLength(params_ref) - offset;
6140 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006141 _exception = 1;
6142 _exceptionType = "java/lang/IllegalArgumentException";
6143 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006144 goto exit;
6145 }
6146 params_base = (GLfloat *)
6147 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6148 params = params_base + offset;
6149
6150 glPointParameterfv(
6151 (GLenum)pname,
6152 (GLfloat *)params
6153 );
6154
6155exit:
6156 if (params_base) {
6157 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6158 JNI_ABORT);
6159 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006160 if (_exception) {
6161 jniThrowException(_env, _exceptionType, _exceptionMessage);
6162 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006163}
6164
6165/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6166static void
6167android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6168 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006169 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006170 const char * _exceptionType = NULL;
6171 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006172 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006173 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006174 jint _remaining;
6175 GLfloat *params = (GLfloat *) 0;
6176
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006177 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006178 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006179 _exception = 1;
6180 _exceptionType = "java/lang/IllegalArgumentException";
6181 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006182 goto exit;
6183 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006184 if (params == NULL) {
6185 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6186 params = (GLfloat *) (_paramsBase + _bufferOffset);
6187 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006188 glPointParameterfv(
6189 (GLenum)pname,
6190 (GLfloat *)params
6191 );
6192
6193exit:
6194 if (_array) {
6195 releasePointer(_env, _array, params, JNI_FALSE);
6196 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006197 if (_exception) {
6198 jniThrowException(_env, _exceptionType, _exceptionMessage);
6199 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006200}
6201
6202/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6203static void
6204android_glPointParameterx__II
6205 (JNIEnv *_env, jobject _this, jint pname, jint param) {
6206 glPointParameterx(
6207 (GLenum)pname,
6208 (GLfixed)param
6209 );
6210}
6211
6212/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6213static void
6214android_glPointParameterxv__I_3II
6215 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006216 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006217 const char * _exceptionType = NULL;
6218 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006219 GLfixed *params_base = (GLfixed *) 0;
6220 jint _remaining;
6221 GLfixed *params = (GLfixed *) 0;
6222
6223 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006224 _exception = 1;
6225 _exceptionType = "java/lang/IllegalArgumentException";
6226 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006227 goto exit;
6228 }
6229 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006230 _exception = 1;
6231 _exceptionType = "java/lang/IllegalArgumentException";
6232 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006233 goto exit;
6234 }
6235 _remaining = _env->GetArrayLength(params_ref) - offset;
6236 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006237 _exception = 1;
6238 _exceptionType = "java/lang/IllegalArgumentException";
6239 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006240 goto exit;
6241 }
6242 params_base = (GLfixed *)
6243 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6244 params = params_base + offset;
6245
6246 glPointParameterxv(
6247 (GLenum)pname,
6248 (GLfixed *)params
6249 );
6250
6251exit:
6252 if (params_base) {
6253 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6254 JNI_ABORT);
6255 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006256 if (_exception) {
6257 jniThrowException(_env, _exceptionType, _exceptionMessage);
6258 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006259}
6260
6261/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6262static void
6263android_glPointParameterxv__ILjava_nio_IntBuffer_2
6264 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006265 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006266 const char * _exceptionType = NULL;
6267 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006268 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006269 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006270 jint _remaining;
6271 GLfixed *params = (GLfixed *) 0;
6272
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006273 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006274 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006275 _exception = 1;
6276 _exceptionType = "java/lang/IllegalArgumentException";
6277 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006278 goto exit;
6279 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006280 if (params == NULL) {
6281 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6282 params = (GLfixed *) (_paramsBase + _bufferOffset);
6283 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006284 glPointParameterxv(
6285 (GLenum)pname,
6286 (GLfixed *)params
6287 );
6288
6289exit:
6290 if (_array) {
6291 releasePointer(_env, _array, params, JNI_FALSE);
6292 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006293 if (_exception) {
6294 jniThrowException(_env, _exceptionType, _exceptionMessage);
6295 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006296}
6297
6298/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6299static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08006300android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6301 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006302 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006303 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006304 jint _remaining;
6305 GLvoid *pointer = (GLvoid *) 0;
6306
Jack Palevichbe6eac82009-12-08 15:43:51 +08006307 if (pointer_buf) {
6308 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6309 if ( ! pointer ) {
6310 return;
6311 }
6312 }
6313 glPointSizePointerOESBounds(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006314 (GLenum)type,
6315 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08006316 (GLvoid *)pointer,
6317 (GLsizei)remaining
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006318 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006319}
6320
6321/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6322static void
6323android_glTexCoordPointer__IIII
6324 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6325 glTexCoordPointer(
6326 (GLint)size,
6327 (GLenum)type,
6328 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07006329 (GLvoid *)offset
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006330 );
6331}
6332
6333/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6334static void
6335android_glTexEnvi__III
6336 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6337 glTexEnvi(
6338 (GLenum)target,
6339 (GLenum)pname,
6340 (GLint)param
6341 );
6342}
6343
6344/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6345static void
6346android_glTexEnviv__II_3II
6347 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006348 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006349 const char * _exceptionType = NULL;
6350 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006351 GLint *params_base = (GLint *) 0;
6352 jint _remaining;
6353 GLint *params = (GLint *) 0;
6354
6355 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006356 _exception = 1;
6357 _exceptionType = "java/lang/IllegalArgumentException";
6358 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006359 goto exit;
6360 }
6361 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006362 _exception = 1;
6363 _exceptionType = "java/lang/IllegalArgumentException";
6364 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006365 goto exit;
6366 }
6367 _remaining = _env->GetArrayLength(params_ref) - offset;
6368 int _needed;
6369 switch (pname) {
6370#if defined(GL_TEXTURE_ENV_MODE)
6371 case GL_TEXTURE_ENV_MODE:
6372#endif // defined(GL_TEXTURE_ENV_MODE)
6373#if defined(GL_COMBINE_RGB)
6374 case GL_COMBINE_RGB:
6375#endif // defined(GL_COMBINE_RGB)
6376#if defined(GL_COMBINE_ALPHA)
6377 case GL_COMBINE_ALPHA:
6378#endif // defined(GL_COMBINE_ALPHA)
6379 _needed = 1;
6380 break;
6381#if defined(GL_TEXTURE_ENV_COLOR)
6382 case GL_TEXTURE_ENV_COLOR:
6383#endif // defined(GL_TEXTURE_ENV_COLOR)
6384 _needed = 4;
6385 break;
6386 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08006387 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006388 break;
6389 }
6390 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006391 _exception = 1;
6392 _exceptionType = "java/lang/IllegalArgumentException";
6393 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006394 goto exit;
6395 }
6396 params_base = (GLint *)
6397 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6398 params = params_base + offset;
6399
6400 glTexEnviv(
6401 (GLenum)target,
6402 (GLenum)pname,
6403 (GLint *)params
6404 );
6405
6406exit:
6407 if (params_base) {
6408 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6409 JNI_ABORT);
6410 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006411 if (_exception) {
6412 jniThrowException(_env, _exceptionType, _exceptionMessage);
6413 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006414}
6415
6416/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6417static void
6418android_glTexEnviv__IILjava_nio_IntBuffer_2
6419 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006420 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006421 const char * _exceptionType = NULL;
6422 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006423 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006424 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006425 jint _remaining;
6426 GLint *params = (GLint *) 0;
6427
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006428 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006429 int _needed;
6430 switch (pname) {
6431#if defined(GL_TEXTURE_ENV_MODE)
6432 case GL_TEXTURE_ENV_MODE:
6433#endif // defined(GL_TEXTURE_ENV_MODE)
6434#if defined(GL_COMBINE_RGB)
6435 case GL_COMBINE_RGB:
6436#endif // defined(GL_COMBINE_RGB)
6437#if defined(GL_COMBINE_ALPHA)
6438 case GL_COMBINE_ALPHA:
6439#endif // defined(GL_COMBINE_ALPHA)
6440 _needed = 1;
6441 break;
6442#if defined(GL_TEXTURE_ENV_COLOR)
6443 case GL_TEXTURE_ENV_COLOR:
6444#endif // defined(GL_TEXTURE_ENV_COLOR)
6445 _needed = 4;
6446 break;
6447 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08006448 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006449 break;
6450 }
6451 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006452 _exception = 1;
6453 _exceptionType = "java/lang/IllegalArgumentException";
6454 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006455 goto exit;
6456 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006457 if (params == NULL) {
6458 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6459 params = (GLint *) (_paramsBase + _bufferOffset);
6460 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006461 glTexEnviv(
6462 (GLenum)target,
6463 (GLenum)pname,
6464 (GLint *)params
6465 );
6466
6467exit:
6468 if (_array) {
6469 releasePointer(_env, _array, params, JNI_FALSE);
6470 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006471 if (_exception) {
6472 jniThrowException(_env, _exceptionType, _exceptionMessage);
6473 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006474}
6475
6476/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6477static void
6478android_glTexParameterfv__II_3FI
6479 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006480 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006481 const char * _exceptionType = NULL;
6482 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006483 GLfloat *params_base = (GLfloat *) 0;
6484 jint _remaining;
6485 GLfloat *params = (GLfloat *) 0;
6486
6487 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006488 _exception = 1;
6489 _exceptionType = "java/lang/IllegalArgumentException";
6490 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006491 goto exit;
6492 }
6493 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006494 _exception = 1;
6495 _exceptionType = "java/lang/IllegalArgumentException";
6496 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006497 goto exit;
6498 }
6499 _remaining = _env->GetArrayLength(params_ref) - offset;
6500 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006501 _exception = 1;
6502 _exceptionType = "java/lang/IllegalArgumentException";
6503 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006504 goto exit;
6505 }
6506 params_base = (GLfloat *)
6507 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6508 params = params_base + offset;
6509
6510 glTexParameterfv(
6511 (GLenum)target,
6512 (GLenum)pname,
6513 (GLfloat *)params
6514 );
6515
6516exit:
6517 if (params_base) {
6518 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6519 JNI_ABORT);
6520 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006521 if (_exception) {
6522 jniThrowException(_env, _exceptionType, _exceptionMessage);
6523 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006524}
6525
6526/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6527static void
6528android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6529 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006530 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006531 const char * _exceptionType = NULL;
6532 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006533 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006534 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006535 jint _remaining;
6536 GLfloat *params = (GLfloat *) 0;
6537
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006538 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006539 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006540 _exception = 1;
6541 _exceptionType = "java/lang/IllegalArgumentException";
6542 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006543 goto exit;
6544 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006545 if (params == NULL) {
6546 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6547 params = (GLfloat *) (_paramsBase + _bufferOffset);
6548 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006549 glTexParameterfv(
6550 (GLenum)target,
6551 (GLenum)pname,
6552 (GLfloat *)params
6553 );
6554
6555exit:
6556 if (_array) {
6557 releasePointer(_env, _array, params, JNI_FALSE);
6558 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006559 if (_exception) {
6560 jniThrowException(_env, _exceptionType, _exceptionMessage);
6561 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006562}
6563
6564/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6565static void
6566android_glTexParameteri__III
6567 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6568 glTexParameteri(
6569 (GLenum)target,
6570 (GLenum)pname,
6571 (GLint)param
6572 );
6573}
6574
6575/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6576static void
6577android_glTexParameteriv__II_3II
6578 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006579 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006580 const char * _exceptionType = NULL;
6581 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006582 GLint *params_base = (GLint *) 0;
6583 jint _remaining;
6584 GLint *params = (GLint *) 0;
6585
6586 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006587 _exception = 1;
6588 _exceptionType = "java/lang/IllegalArgumentException";
6589 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006590 goto exit;
6591 }
6592 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006593 _exception = 1;
6594 _exceptionType = "java/lang/IllegalArgumentException";
6595 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006596 goto exit;
6597 }
6598 _remaining = _env->GetArrayLength(params_ref) - offset;
6599 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006600 _exception = 1;
6601 _exceptionType = "java/lang/IllegalArgumentException";
6602 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006603 goto exit;
6604 }
6605 params_base = (GLint *)
6606 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6607 params = params_base + offset;
6608
6609 glTexParameteriv(
6610 (GLenum)target,
6611 (GLenum)pname,
6612 (GLint *)params
6613 );
6614
6615exit:
6616 if (params_base) {
6617 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6618 JNI_ABORT);
6619 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006620 if (_exception) {
6621 jniThrowException(_env, _exceptionType, _exceptionMessage);
6622 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006623}
6624
6625/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6626static void
6627android_glTexParameteriv__IILjava_nio_IntBuffer_2
6628 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006629 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006630 const char * _exceptionType = NULL;
6631 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006632 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006633 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006634 jint _remaining;
6635 GLint *params = (GLint *) 0;
6636
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006637 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006638 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006639 _exception = 1;
6640 _exceptionType = "java/lang/IllegalArgumentException";
6641 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006642 goto exit;
6643 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006644 if (params == NULL) {
6645 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6646 params = (GLint *) (_paramsBase + _bufferOffset);
6647 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006648 glTexParameteriv(
6649 (GLenum)target,
6650 (GLenum)pname,
6651 (GLint *)params
6652 );
6653
6654exit:
6655 if (_array) {
6656 releasePointer(_env, _array, params, JNI_FALSE);
6657 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006658 if (_exception) {
6659 jniThrowException(_env, _exceptionType, _exceptionMessage);
6660 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006661}
6662
6663/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
6664static void
6665android_glTexParameterxv__II_3II
6666 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006667 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006668 const char * _exceptionType = NULL;
6669 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006670 GLfixed *params_base = (GLfixed *) 0;
6671 jint _remaining;
6672 GLfixed *params = (GLfixed *) 0;
6673
6674 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006675 _exception = 1;
6676 _exceptionType = "java/lang/IllegalArgumentException";
6677 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006678 goto exit;
6679 }
6680 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006681 _exception = 1;
6682 _exceptionType = "java/lang/IllegalArgumentException";
6683 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006684 goto exit;
6685 }
6686 _remaining = _env->GetArrayLength(params_ref) - offset;
6687 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006688 _exception = 1;
6689 _exceptionType = "java/lang/IllegalArgumentException";
6690 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006691 goto exit;
6692 }
6693 params_base = (GLfixed *)
6694 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
6695 params = params_base + offset;
6696
6697 glTexParameterxv(
6698 (GLenum)target,
6699 (GLenum)pname,
6700 (GLfixed *)params
6701 );
6702
6703exit:
6704 if (params_base) {
6705 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
6706 JNI_ABORT);
6707 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006708 if (_exception) {
6709 jniThrowException(_env, _exceptionType, _exceptionMessage);
6710 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006711}
6712
6713/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
6714static void
6715android_glTexParameterxv__IILjava_nio_IntBuffer_2
6716 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006717 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006718 const char * _exceptionType = NULL;
6719 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006720 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006721 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006722 jint _remaining;
6723 GLfixed *params = (GLfixed *) 0;
6724
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006725 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006726 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006727 _exception = 1;
6728 _exceptionType = "java/lang/IllegalArgumentException";
6729 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006730 goto exit;
6731 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006732 if (params == NULL) {
6733 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6734 params = (GLfixed *) (_paramsBase + _bufferOffset);
6735 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006736 glTexParameterxv(
6737 (GLenum)target,
6738 (GLenum)pname,
6739 (GLfixed *)params
6740 );
6741
6742exit:
6743 if (_array) {
6744 releasePointer(_env, _array, params, JNI_FALSE);
6745 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006746 if (_exception) {
6747 jniThrowException(_env, _exceptionType, _exceptionMessage);
6748 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006749}
6750
6751/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6752static void
6753android_glVertexPointer__IIII
6754 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6755 glVertexPointer(
6756 (GLint)size,
6757 (GLenum)type,
6758 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07006759 (GLvoid *)offset
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006760 );
6761}
6762
6763/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
6764static void
6765android_glCurrentPaletteMatrixOES__I
6766 (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08006767 glCurrentPaletteMatrixOES(
6768 (GLuint)matrixpaletteindex
6769 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006770}
6771
6772/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
6773static void
6774android_glDrawTexfOES__FFFFF
6775 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
6776 glDrawTexfOES(
6777 (GLfloat)x,
6778 (GLfloat)y,
6779 (GLfloat)z,
6780 (GLfloat)width,
6781 (GLfloat)height
6782 );
6783}
6784
6785/* void glDrawTexfvOES ( const GLfloat *coords ) */
6786static void
6787android_glDrawTexfvOES___3FI
6788 (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006789 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006790 const char * _exceptionType = NULL;
6791 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006792 GLfloat *coords_base = (GLfloat *) 0;
6793 jint _remaining;
6794 GLfloat *coords = (GLfloat *) 0;
6795
6796 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006797 _exception = 1;
6798 _exceptionType = "java/lang/IllegalArgumentException";
6799 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006800 goto exit;
6801 }
6802 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006803 _exception = 1;
6804 _exceptionType = "java/lang/IllegalArgumentException";
6805 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006806 goto exit;
6807 }
6808 _remaining = _env->GetArrayLength(coords_ref) - offset;
6809 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006810 _exception = 1;
6811 _exceptionType = "java/lang/IllegalArgumentException";
6812 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006813 goto exit;
6814 }
6815 coords_base = (GLfloat *)
6816 _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0);
6817 coords = coords_base + offset;
6818
6819 glDrawTexfvOES(
6820 (GLfloat *)coords
6821 );
6822
6823exit:
6824 if (coords_base) {
6825 _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base,
6826 JNI_ABORT);
6827 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006828 if (_exception) {
6829 jniThrowException(_env, _exceptionType, _exceptionMessage);
6830 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006831}
6832
6833/* void glDrawTexfvOES ( const GLfloat *coords ) */
6834static void
6835android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
6836 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006837 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006838 const char * _exceptionType = NULL;
6839 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006840 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006841 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006842 jint _remaining;
6843 GLfloat *coords = (GLfloat *) 0;
6844
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006845 coords = (GLfloat *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006846 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006847 _exception = 1;
6848 _exceptionType = "java/lang/IllegalArgumentException";
6849 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006850 goto exit;
6851 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006852 if (coords == NULL) {
6853 char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6854 coords = (GLfloat *) (_coordsBase + _bufferOffset);
6855 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006856 glDrawTexfvOES(
6857 (GLfloat *)coords
6858 );
6859
6860exit:
6861 if (_array) {
6862 releasePointer(_env, _array, coords, JNI_FALSE);
6863 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006864 if (_exception) {
6865 jniThrowException(_env, _exceptionType, _exceptionMessage);
6866 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006867}
6868
6869/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
6870static void
6871android_glDrawTexiOES__IIIII
6872 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
6873 glDrawTexiOES(
6874 (GLint)x,
6875 (GLint)y,
6876 (GLint)z,
6877 (GLint)width,
6878 (GLint)height
6879 );
6880}
6881
6882/* void glDrawTexivOES ( const GLint *coords ) */
6883static void
6884android_glDrawTexivOES___3II
6885 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006886 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006887 const char * _exceptionType = NULL;
6888 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006889 GLint *coords_base = (GLint *) 0;
6890 jint _remaining;
6891 GLint *coords = (GLint *) 0;
6892
6893 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006894 _exception = 1;
6895 _exceptionType = "java/lang/IllegalArgumentException";
6896 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006897 goto exit;
6898 }
6899 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006900 _exception = 1;
6901 _exceptionType = "java/lang/IllegalArgumentException";
6902 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006903 goto exit;
6904 }
6905 _remaining = _env->GetArrayLength(coords_ref) - offset;
6906 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006907 _exception = 1;
6908 _exceptionType = "java/lang/IllegalArgumentException";
6909 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006910 goto exit;
6911 }
6912 coords_base = (GLint *)
6913 _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0);
6914 coords = coords_base + offset;
6915
6916 glDrawTexivOES(
6917 (GLint *)coords
6918 );
6919
6920exit:
6921 if (coords_base) {
6922 _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base,
6923 JNI_ABORT);
6924 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006925 if (_exception) {
6926 jniThrowException(_env, _exceptionType, _exceptionMessage);
6927 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006928}
6929
6930/* void glDrawTexivOES ( const GLint *coords ) */
6931static void
6932android_glDrawTexivOES__Ljava_nio_IntBuffer_2
6933 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006934 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006935 const char * _exceptionType = NULL;
6936 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006937 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006938 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006939 jint _remaining;
6940 GLint *coords = (GLint *) 0;
6941
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006942 coords = (GLint *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006943 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006944 _exception = 1;
6945 _exceptionType = "java/lang/IllegalArgumentException";
6946 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006947 goto exit;
6948 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006949 if (coords == NULL) {
6950 char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
6951 coords = (GLint *) (_coordsBase + _bufferOffset);
6952 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006953 glDrawTexivOES(
6954 (GLint *)coords
6955 );
6956
6957exit:
6958 if (_array) {
6959 releasePointer(_env, _array, coords, JNI_FALSE);
6960 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006961 if (_exception) {
6962 jniThrowException(_env, _exceptionType, _exceptionMessage);
6963 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006964}
6965
6966/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
6967static void
6968android_glDrawTexsOES__SSSSS
6969 (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
6970 glDrawTexsOES(
6971 (GLshort)x,
6972 (GLshort)y,
6973 (GLshort)z,
6974 (GLshort)width,
6975 (GLshort)height
6976 );
6977}
6978
6979/* void glDrawTexsvOES ( const GLshort *coords ) */
6980static void
6981android_glDrawTexsvOES___3SI
6982 (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006983 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08006984 const char * _exceptionType = NULL;
6985 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006986 GLshort *coords_base = (GLshort *) 0;
6987 jint _remaining;
6988 GLshort *coords = (GLshort *) 0;
6989
6990 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006991 _exception = 1;
6992 _exceptionType = "java/lang/IllegalArgumentException";
6993 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006994 goto exit;
6995 }
6996 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006997 _exception = 1;
6998 _exceptionType = "java/lang/IllegalArgumentException";
6999 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007000 goto exit;
7001 }
7002 _remaining = _env->GetArrayLength(coords_ref) - offset;
7003 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007004 _exception = 1;
7005 _exceptionType = "java/lang/IllegalArgumentException";
7006 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007007 goto exit;
7008 }
7009 coords_base = (GLshort *)
7010 _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0);
7011 coords = coords_base + offset;
7012
7013 glDrawTexsvOES(
7014 (GLshort *)coords
7015 );
7016
7017exit:
7018 if (coords_base) {
7019 _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base,
7020 JNI_ABORT);
7021 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007022 if (_exception) {
7023 jniThrowException(_env, _exceptionType, _exceptionMessage);
7024 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007025}
7026
7027/* void glDrawTexsvOES ( const GLshort *coords ) */
7028static void
7029android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7030 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007031 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007032 const char * _exceptionType = NULL;
7033 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007034 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007035 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007036 jint _remaining;
7037 GLshort *coords = (GLshort *) 0;
7038
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007039 coords = (GLshort *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007040 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007041 _exception = 1;
7042 _exceptionType = "java/lang/IllegalArgumentException";
7043 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007044 goto exit;
7045 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007046 if (coords == NULL) {
7047 char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7048 coords = (GLshort *) (_coordsBase + _bufferOffset);
7049 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007050 glDrawTexsvOES(
7051 (GLshort *)coords
7052 );
7053
7054exit:
7055 if (_array) {
7056 releasePointer(_env, _array, coords, JNI_FALSE);
7057 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007058 if (_exception) {
7059 jniThrowException(_env, _exceptionType, _exceptionMessage);
7060 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007061}
7062
7063/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7064static void
7065android_glDrawTexxOES__IIIII
7066 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7067 glDrawTexxOES(
7068 (GLfixed)x,
7069 (GLfixed)y,
7070 (GLfixed)z,
7071 (GLfixed)width,
7072 (GLfixed)height
7073 );
7074}
7075
7076/* void glDrawTexxvOES ( const GLfixed *coords ) */
7077static void
7078android_glDrawTexxvOES___3II
7079 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007080 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007081 const char * _exceptionType = NULL;
7082 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007083 GLfixed *coords_base = (GLfixed *) 0;
7084 jint _remaining;
7085 GLfixed *coords = (GLfixed *) 0;
7086
7087 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007088 _exception = 1;
7089 _exceptionType = "java/lang/IllegalArgumentException";
7090 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007091 goto exit;
7092 }
7093 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007094 _exception = 1;
7095 _exceptionType = "java/lang/IllegalArgumentException";
7096 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007097 goto exit;
7098 }
7099 _remaining = _env->GetArrayLength(coords_ref) - offset;
7100 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007101 _exception = 1;
7102 _exceptionType = "java/lang/IllegalArgumentException";
7103 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007104 goto exit;
7105 }
7106 coords_base = (GLfixed *)
7107 _env->GetPrimitiveArrayCritical(coords_ref, (jboolean *)0);
7108 coords = coords_base + offset;
7109
7110 glDrawTexxvOES(
7111 (GLfixed *)coords
7112 );
7113
7114exit:
7115 if (coords_base) {
7116 _env->ReleasePrimitiveArrayCritical(coords_ref, coords_base,
7117 JNI_ABORT);
7118 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007119 if (_exception) {
7120 jniThrowException(_env, _exceptionType, _exceptionMessage);
7121 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007122}
7123
7124/* void glDrawTexxvOES ( const GLfixed *coords ) */
7125static void
7126android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7127 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007128 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007129 const char * _exceptionType = NULL;
7130 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007131 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007132 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007133 jint _remaining;
7134 GLfixed *coords = (GLfixed *) 0;
7135
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007136 coords = (GLfixed *)getPointer(_env, coords_buf, &_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007137 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007138 _exception = 1;
7139 _exceptionType = "java/lang/IllegalArgumentException";
7140 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007141 goto exit;
7142 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007143 if (coords == NULL) {
7144 char * _coordsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7145 coords = (GLfixed *) (_coordsBase + _bufferOffset);
7146 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007147 glDrawTexxvOES(
7148 (GLfixed *)coords
7149 );
7150
7151exit:
7152 if (_array) {
7153 releasePointer(_env, _array, coords, JNI_FALSE);
7154 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007155 if (_exception) {
7156 jniThrowException(_env, _exceptionType, _exceptionMessage);
7157 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007158}
7159
7160/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7161static void
7162android_glLoadPaletteFromModelViewMatrixOES__
7163 (JNIEnv *_env, jobject _this) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007164 glLoadPaletteFromModelViewMatrixOES();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007165}
7166
7167/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7168static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007169android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7170 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7171 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007172 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007173 jint _remaining;
7174 GLvoid *pointer = (GLvoid *) 0;
7175
7176 if (pointer_buf) {
7177 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7178 if ( ! pointer ) {
7179 return;
7180 }
7181 }
7182 glMatrixIndexPointerOESBounds(
7183 (GLint)size,
7184 (GLenum)type,
7185 (GLsizei)stride,
7186 (GLvoid *)pointer,
7187 (GLsizei)remaining
7188 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007189}
7190
7191/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7192static void
7193android_glMatrixIndexPointerOES__IIII
7194 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007195 glMatrixIndexPointerOES(
7196 (GLint)size,
7197 (GLenum)type,
7198 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07007199 (GLvoid *)offset
Jack Palevichbe6eac82009-12-08 15:43:51 +08007200 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007201}
7202
7203/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7204static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007205android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7206 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7207 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007208 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007209 jint _remaining;
7210 GLvoid *pointer = (GLvoid *) 0;
7211
7212 if (pointer_buf) {
7213 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7214 if ( ! pointer ) {
7215 return;
7216 }
7217 }
7218 glWeightPointerOESBounds(
7219 (GLint)size,
7220 (GLenum)type,
7221 (GLsizei)stride,
7222 (GLvoid *)pointer,
7223 (GLsizei)remaining
7224 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007225}
7226
7227/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7228static void
7229android_glWeightPointerOES__IIII
7230 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007231 glWeightPointerOES(
7232 (GLint)size,
7233 (GLenum)type,
7234 (GLsizei)stride,
Andy McFaddencee51982013-04-25 16:08:31 -07007235 (GLvoid *)offset
Jack Palevichbe6eac82009-12-08 15:43:51 +08007236 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007237}
7238
7239/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7240static void
7241android_glBindFramebufferOES__II
7242 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007243 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007244 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007245 "glBindFramebufferOES");
7246 return;
7247 }
7248 glBindFramebufferOES(
7249 (GLint)target,
7250 (GLint)framebuffer
7251 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007252}
7253
7254/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7255static void
7256android_glBindRenderbufferOES__II
7257 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007258 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007259 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007260 "glBindRenderbufferOES");
7261 return;
7262 }
7263 glBindRenderbufferOES(
7264 (GLint)target,
7265 (GLint)renderbuffer
7266 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007267}
7268
7269/* void glBlendEquation ( GLint mode ) */
7270static void
7271android_glBlendEquation__I
7272 (JNIEnv *_env, jobject _this, jint mode) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007273 if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007274 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007275 "glBlendEquation");
7276 return;
7277 }
7278 glBlendEquation(
7279 (GLint)mode
7280 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007281}
7282
7283/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7284static void
7285android_glBlendEquationSeparate__II
7286 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007287 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007288 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007289 "glBlendEquationSeparate");
7290 return;
7291 }
7292 glBlendEquationSeparate(
7293 (GLint)modeRGB,
7294 (GLint)modeAlpha
7295 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007296}
7297
7298/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7299static void
7300android_glBlendFuncSeparate__IIII
7301 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007302 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007303 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007304 "glBlendFuncSeparate");
7305 return;
7306 }
7307 glBlendFuncSeparate(
7308 (GLint)srcRGB,
7309 (GLint)dstRGB,
7310 (GLint)srcAlpha,
7311 (GLint)dstAlpha
7312 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007313}
7314
7315/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7316static jint
7317android_glCheckFramebufferStatusOES__I
7318 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007319 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007320 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007321 "glCheckFramebufferStatusOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007322 return 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007323 }
7324 GLint _returnValue = 0;
7325 _returnValue = glCheckFramebufferStatusOES(
7326 (GLint)target
7327 );
Andy McFaddencee51982013-04-25 16:08:31 -07007328 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007329}
7330
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007331/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007332static void
7333android_glDeleteFramebuffersOES__I_3II
7334 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007335 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007336 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007337 "glDeleteFramebuffersOES");
7338 return;
7339 }
7340 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007341 const char * _exceptionType = NULL;
7342 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007343 GLuint *framebuffers_base = (GLuint *) 0;
7344 jint _remaining;
7345 GLuint *framebuffers = (GLuint *) 0;
7346
7347 if (!framebuffers_ref) {
7348 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007349 _exceptionType = "java/lang/IllegalArgumentException";
7350 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007351 goto exit;
7352 }
7353 if (offset < 0) {
7354 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007355 _exceptionType = "java/lang/IllegalArgumentException";
7356 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007357 goto exit;
7358 }
7359 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7360 if (_remaining < n) {
7361 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007362 _exceptionType = "java/lang/IllegalArgumentException";
7363 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007364 goto exit;
7365 }
7366 framebuffers_base = (GLuint *)
7367 _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
7368 framebuffers = framebuffers_base + offset;
7369
7370 glDeleteFramebuffersOES(
7371 (GLint)n,
7372 (GLuint *)framebuffers
7373 );
7374
7375exit:
7376 if (framebuffers_base) {
7377 _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base,
7378 _exception ? JNI_ABORT: 0);
7379 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007380 if (_exception) {
7381 jniThrowException(_env, _exceptionType, _exceptionMessage);
7382 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007383}
7384
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007385/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007386static void
7387android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7388 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007389 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007390 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007391 "glDeleteFramebuffersOES");
7392 return;
7393 }
7394 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007395 const char * _exceptionType = NULL;
7396 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007397 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007398 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007399 jint _remaining;
7400 GLuint *framebuffers = (GLuint *) 0;
7401
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007402 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007403 if (_remaining < n) {
7404 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007405 _exceptionType = "java/lang/IllegalArgumentException";
7406 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007407 goto exit;
7408 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007409 if (framebuffers == NULL) {
7410 char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7411 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7412 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007413 glDeleteFramebuffersOES(
7414 (GLint)n,
7415 (GLuint *)framebuffers
7416 );
7417
7418exit:
7419 if (_array) {
7420 releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE);
7421 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007422 if (_exception) {
7423 jniThrowException(_env, _exceptionType, _exceptionMessage);
7424 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007425}
7426
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007427/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007428static void
7429android_glDeleteRenderbuffersOES__I_3II
7430 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007431 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007432 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007433 "glDeleteRenderbuffersOES");
7434 return;
7435 }
7436 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007437 const char * _exceptionType = NULL;
7438 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007439 GLuint *renderbuffers_base = (GLuint *) 0;
7440 jint _remaining;
7441 GLuint *renderbuffers = (GLuint *) 0;
7442
7443 if (!renderbuffers_ref) {
7444 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007445 _exceptionType = "java/lang/IllegalArgumentException";
7446 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007447 goto exit;
7448 }
7449 if (offset < 0) {
7450 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007451 _exceptionType = "java/lang/IllegalArgumentException";
7452 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007453 goto exit;
7454 }
7455 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7456 if (_remaining < n) {
7457 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007458 _exceptionType = "java/lang/IllegalArgumentException";
7459 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007460 goto exit;
7461 }
7462 renderbuffers_base = (GLuint *)
7463 _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
7464 renderbuffers = renderbuffers_base + offset;
7465
7466 glDeleteRenderbuffersOES(
7467 (GLint)n,
7468 (GLuint *)renderbuffers
7469 );
7470
7471exit:
7472 if (renderbuffers_base) {
7473 _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base,
7474 _exception ? JNI_ABORT: 0);
7475 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007476 if (_exception) {
7477 jniThrowException(_env, _exceptionType, _exceptionMessage);
7478 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007479}
7480
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007481/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007482static void
7483android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7484 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007485 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007486 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007487 "glDeleteRenderbuffersOES");
7488 return;
7489 }
7490 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007491 const char * _exceptionType = NULL;
7492 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007493 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007494 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007495 jint _remaining;
7496 GLuint *renderbuffers = (GLuint *) 0;
7497
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007498 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007499 if (_remaining < n) {
7500 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007501 _exceptionType = "java/lang/IllegalArgumentException";
7502 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007503 goto exit;
7504 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007505 if (renderbuffers == NULL) {
7506 char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7507 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7508 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007509 glDeleteRenderbuffersOES(
7510 (GLint)n,
7511 (GLuint *)renderbuffers
7512 );
7513
7514exit:
7515 if (_array) {
7516 releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE);
7517 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007518 if (_exception) {
7519 jniThrowException(_env, _exceptionType, _exceptionMessage);
7520 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007521}
7522
7523/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
7524static void
7525android_glFramebufferRenderbufferOES__IIII
7526 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007527 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007528 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007529 "glFramebufferRenderbufferOES");
7530 return;
7531 }
7532 glFramebufferRenderbufferOES(
7533 (GLint)target,
7534 (GLint)attachment,
7535 (GLint)renderbuffertarget,
7536 (GLint)renderbuffer
7537 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007538}
7539
7540/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
7541static void
7542android_glFramebufferTexture2DOES__IIIII
7543 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007544 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007545 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007546 "glFramebufferTexture2DOES");
7547 return;
7548 }
7549 glFramebufferTexture2DOES(
7550 (GLint)target,
7551 (GLint)attachment,
7552 (GLint)textarget,
7553 (GLint)texture,
7554 (GLint)level
7555 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007556}
7557
7558/* void glGenerateMipmapOES ( GLint target ) */
7559static void
7560android_glGenerateMipmapOES__I
7561 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007562 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007563 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007564 "glGenerateMipmapOES");
7565 return;
7566 }
7567 glGenerateMipmapOES(
7568 (GLint)target
7569 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007570}
7571
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007572/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007573static void
7574android_glGenFramebuffersOES__I_3II
7575 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007576 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007577 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007578 "glGenFramebuffersOES");
7579 return;
7580 }
7581 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007582 const char * _exceptionType = NULL;
7583 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007584 GLuint *framebuffers_base = (GLuint *) 0;
7585 jint _remaining;
7586 GLuint *framebuffers = (GLuint *) 0;
7587
7588 if (!framebuffers_ref) {
7589 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007590 _exceptionType = "java/lang/IllegalArgumentException";
7591 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007592 goto exit;
7593 }
7594 if (offset < 0) {
7595 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007596 _exceptionType = "java/lang/IllegalArgumentException";
7597 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007598 goto exit;
7599 }
7600 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7601 if (_remaining < n) {
7602 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007603 _exceptionType = "java/lang/IllegalArgumentException";
7604 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007605 goto exit;
7606 }
7607 framebuffers_base = (GLuint *)
7608 _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
7609 framebuffers = framebuffers_base + offset;
7610
7611 glGenFramebuffersOES(
7612 (GLint)n,
7613 (GLuint *)framebuffers
7614 );
7615
7616exit:
7617 if (framebuffers_base) {
7618 _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base,
7619 _exception ? JNI_ABORT: 0);
7620 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007621 if (_exception) {
7622 jniThrowException(_env, _exceptionType, _exceptionMessage);
7623 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007624}
7625
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007626/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007627static void
7628android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
7629 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007630 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007631 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007632 "glGenFramebuffersOES");
7633 return;
7634 }
7635 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007636 const char * _exceptionType = NULL;
7637 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007638 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007639 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007640 jint _remaining;
7641 GLuint *framebuffers = (GLuint *) 0;
7642
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007643 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007644 if (_remaining < n) {
7645 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007646 _exceptionType = "java/lang/IllegalArgumentException";
7647 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007648 goto exit;
7649 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007650 if (framebuffers == NULL) {
7651 char * _framebuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7652 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7653 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007654 glGenFramebuffersOES(
7655 (GLint)n,
7656 (GLuint *)framebuffers
7657 );
7658
7659exit:
7660 if (_array) {
7661 releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE);
7662 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007663 if (_exception) {
7664 jniThrowException(_env, _exceptionType, _exceptionMessage);
7665 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007666}
7667
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007668/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007669static void
7670android_glGenRenderbuffersOES__I_3II
7671 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007672 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007673 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007674 "glGenRenderbuffersOES");
7675 return;
7676 }
7677 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007678 const char * _exceptionType = NULL;
7679 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007680 GLuint *renderbuffers_base = (GLuint *) 0;
7681 jint _remaining;
7682 GLuint *renderbuffers = (GLuint *) 0;
7683
7684 if (!renderbuffers_ref) {
7685 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007686 _exceptionType = "java/lang/IllegalArgumentException";
7687 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007688 goto exit;
7689 }
7690 if (offset < 0) {
7691 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007692 _exceptionType = "java/lang/IllegalArgumentException";
7693 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007694 goto exit;
7695 }
7696 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7697 if (_remaining < n) {
7698 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007699 _exceptionType = "java/lang/IllegalArgumentException";
7700 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007701 goto exit;
7702 }
7703 renderbuffers_base = (GLuint *)
7704 _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
7705 renderbuffers = renderbuffers_base + offset;
7706
7707 glGenRenderbuffersOES(
7708 (GLint)n,
7709 (GLuint *)renderbuffers
7710 );
7711
7712exit:
7713 if (renderbuffers_base) {
7714 _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base,
7715 _exception ? JNI_ABORT: 0);
7716 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007717 if (_exception) {
7718 jniThrowException(_env, _exceptionType, _exceptionMessage);
7719 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007720}
7721
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007722/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007723static void
7724android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
7725 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007726 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007727 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007728 "glGenRenderbuffersOES");
7729 return;
7730 }
7731 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007732 const char * _exceptionType = NULL;
7733 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007734 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007735 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007736 jint _remaining;
7737 GLuint *renderbuffers = (GLuint *) 0;
7738
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007739 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007740 if (_remaining < n) {
7741 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007742 _exceptionType = "java/lang/IllegalArgumentException";
7743 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007744 goto exit;
7745 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007746 if (renderbuffers == NULL) {
7747 char * _renderbuffersBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7748 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7749 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007750 glGenRenderbuffersOES(
7751 (GLint)n,
7752 (GLuint *)renderbuffers
7753 );
7754
7755exit:
7756 if (_array) {
7757 releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE);
7758 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007759 if (_exception) {
7760 jniThrowException(_env, _exceptionType, _exceptionMessage);
7761 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007762}
7763
7764/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
7765static void
7766android_glGetFramebufferAttachmentParameterivOES__III_3II
7767 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007768 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007769 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007770 "glGetFramebufferAttachmentParameterivOES");
7771 return;
7772 }
7773 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007774 const char * _exceptionType = NULL;
7775 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007776 GLint *params_base = (GLint *) 0;
7777 jint _remaining;
7778 GLint *params = (GLint *) 0;
7779
7780 if (!params_ref) {
7781 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007782 _exceptionType = "java/lang/IllegalArgumentException";
7783 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007784 goto exit;
7785 }
7786 if (offset < 0) {
7787 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007788 _exceptionType = "java/lang/IllegalArgumentException";
7789 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007790 goto exit;
7791 }
7792 _remaining = _env->GetArrayLength(params_ref) - offset;
7793 params_base = (GLint *)
7794 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
7795 params = params_base + offset;
7796
7797 glGetFramebufferAttachmentParameterivOES(
7798 (GLint)target,
7799 (GLint)attachment,
7800 (GLint)pname,
7801 (GLint *)params
7802 );
7803
7804exit:
7805 if (params_base) {
7806 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
7807 _exception ? JNI_ABORT: 0);
7808 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007809 if (_exception) {
7810 jniThrowException(_env, _exceptionType, _exceptionMessage);
7811 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007812}
7813
7814/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
7815static void
7816android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
7817 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007818 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007819 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007820 "glGetFramebufferAttachmentParameterivOES");
7821 return;
7822 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007823 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007824 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007825 jint _remaining;
7826 GLint *params = (GLint *) 0;
7827
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007828 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
7829 if (params == NULL) {
7830 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7831 params = (GLint *) (_paramsBase + _bufferOffset);
7832 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007833 glGetFramebufferAttachmentParameterivOES(
7834 (GLint)target,
7835 (GLint)attachment,
7836 (GLint)pname,
7837 (GLint *)params
7838 );
7839 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007840 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007841 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007842}
7843
7844/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
7845static void
7846android_glGetRenderbufferParameterivOES__II_3II
7847 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007848 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007849 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007850 "glGetRenderbufferParameterivOES");
7851 return;
7852 }
7853 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007854 const char * _exceptionType = NULL;
7855 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007856 GLint *params_base = (GLint *) 0;
7857 jint _remaining;
7858 GLint *params = (GLint *) 0;
7859
7860 if (!params_ref) {
7861 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007862 _exceptionType = "java/lang/IllegalArgumentException";
7863 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007864 goto exit;
7865 }
7866 if (offset < 0) {
7867 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007868 _exceptionType = "java/lang/IllegalArgumentException";
7869 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007870 goto exit;
7871 }
7872 _remaining = _env->GetArrayLength(params_ref) - offset;
7873 params_base = (GLint *)
7874 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
7875 params = params_base + offset;
7876
7877 glGetRenderbufferParameterivOES(
7878 (GLint)target,
7879 (GLint)pname,
7880 (GLint *)params
7881 );
7882
7883exit:
7884 if (params_base) {
7885 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
7886 _exception ? JNI_ABORT: 0);
7887 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007888 if (_exception) {
7889 jniThrowException(_env, _exceptionType, _exceptionMessage);
7890 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007891}
7892
7893/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
7894static void
7895android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
7896 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007897 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007898 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007899 "glGetRenderbufferParameterivOES");
7900 return;
7901 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007902 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007903 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007904 jint _remaining;
7905 GLint *params = (GLint *) 0;
7906
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007907 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
7908 if (params == NULL) {
7909 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7910 params = (GLint *) (_paramsBase + _bufferOffset);
7911 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007912 glGetRenderbufferParameterivOES(
7913 (GLint)target,
7914 (GLint)pname,
7915 (GLint *)params
7916 );
7917 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007918 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007919 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007920}
7921
7922/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
7923static void
7924android_glGetTexGenfv__II_3FI
7925 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007926 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007927 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007928 "glGetTexGenfv");
7929 return;
7930 }
7931 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08007932 const char * _exceptionType = NULL;
7933 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007934 GLfloat *params_base = (GLfloat *) 0;
7935 jint _remaining;
7936 GLfloat *params = (GLfloat *) 0;
7937
7938 if (!params_ref) {
7939 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007940 _exceptionType = "java/lang/IllegalArgumentException";
7941 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007942 goto exit;
7943 }
7944 if (offset < 0) {
7945 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007946 _exceptionType = "java/lang/IllegalArgumentException";
7947 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007948 goto exit;
7949 }
7950 _remaining = _env->GetArrayLength(params_ref) - offset;
7951 params_base = (GLfloat *)
7952 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
7953 params = params_base + offset;
7954
7955 glGetTexGenfv(
7956 (GLint)coord,
7957 (GLint)pname,
7958 (GLfloat *)params
7959 );
7960
7961exit:
7962 if (params_base) {
7963 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
7964 _exception ? JNI_ABORT: 0);
7965 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007966 if (_exception) {
7967 jniThrowException(_env, _exceptionType, _exceptionMessage);
7968 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007969}
7970
7971/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
7972static void
7973android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
7974 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007975 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007976 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007977 "glGetTexGenfv");
7978 return;
7979 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007980 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007981 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007982 jint _remaining;
7983 GLfloat *params = (GLfloat *) 0;
7984
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007985 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
7986 if (params == NULL) {
7987 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
7988 params = (GLfloat *) (_paramsBase + _bufferOffset);
7989 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007990 glGetTexGenfv(
7991 (GLint)coord,
7992 (GLint)pname,
7993 (GLfloat *)params
7994 );
7995 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007996 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007997 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007998}
7999
8000/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8001static void
8002android_glGetTexGeniv__II_3II
8003 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008004 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008005 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008006 "glGetTexGeniv");
8007 return;
8008 }
8009 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08008010 const char * _exceptionType = NULL;
8011 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008012 GLint *params_base = (GLint *) 0;
8013 jint _remaining;
8014 GLint *params = (GLint *) 0;
8015
8016 if (!params_ref) {
8017 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008018 _exceptionType = "java/lang/IllegalArgumentException";
8019 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008020 goto exit;
8021 }
8022 if (offset < 0) {
8023 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008024 _exceptionType = "java/lang/IllegalArgumentException";
8025 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008026 goto exit;
8027 }
8028 _remaining = _env->GetArrayLength(params_ref) - offset;
8029 params_base = (GLint *)
8030 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
8031 params = params_base + offset;
8032
8033 glGetTexGeniv(
8034 (GLint)coord,
8035 (GLint)pname,
8036 (GLint *)params
8037 );
8038
8039exit:
8040 if (params_base) {
8041 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
8042 _exception ? JNI_ABORT: 0);
8043 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008044 if (_exception) {
8045 jniThrowException(_env, _exceptionType, _exceptionMessage);
8046 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008047}
8048
8049/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8050static void
8051android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8052 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008053 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008054 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008055 "glGetTexGeniv");
8056 return;
8057 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008058 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008059 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008060 jint _remaining;
8061 GLint *params = (GLint *) 0;
8062
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008063 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
8064 if (params == NULL) {
8065 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
8066 params = (GLint *) (_paramsBase + _bufferOffset);
8067 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008068 glGetTexGeniv(
8069 (GLint)coord,
8070 (GLint)pname,
8071 (GLint *)params
8072 );
8073 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008074 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008075 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008076}
8077
8078/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8079static void
8080android_glGetTexGenxv__II_3II
8081 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008082 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008083 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008084 "glGetTexGenxv");
8085 return;
8086 }
8087 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08008088 const char * _exceptionType = NULL;
8089 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008090 GLint *params_base = (GLint *) 0;
8091 jint _remaining;
8092 GLint *params = (GLint *) 0;
8093
8094 if (!params_ref) {
8095 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008096 _exceptionType = "java/lang/IllegalArgumentException";
8097 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008098 goto exit;
8099 }
8100 if (offset < 0) {
8101 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008102 _exceptionType = "java/lang/IllegalArgumentException";
8103 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008104 goto exit;
8105 }
8106 _remaining = _env->GetArrayLength(params_ref) - offset;
8107 params_base = (GLint *)
8108 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
8109 params = params_base + offset;
8110
8111 glGetTexGenxv(
8112 (GLint)coord,
8113 (GLint)pname,
8114 (GLint *)params
8115 );
8116
8117exit:
8118 if (params_base) {
8119 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
8120 _exception ? JNI_ABORT: 0);
8121 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008122 if (_exception) {
8123 jniThrowException(_env, _exceptionType, _exceptionMessage);
8124 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008125}
8126
8127/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8128static void
8129android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8130 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008131 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008132 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008133 "glGetTexGenxv");
8134 return;
8135 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008136 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008137 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008138 jint _remaining;
8139 GLint *params = (GLint *) 0;
8140
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008141 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
8142 if (params == NULL) {
8143 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
8144 params = (GLint *) (_paramsBase + _bufferOffset);
8145 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008146 glGetTexGenxv(
8147 (GLint)coord,
8148 (GLint)pname,
8149 (GLint *)params
8150 );
8151 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008152 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008153 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008154}
8155
8156/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8157static jboolean
8158android_glIsFramebufferOES__I
8159 (JNIEnv *_env, jobject _this, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008160 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008161 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008162 "glIsFramebufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008163 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008164 }
8165 GLboolean _returnValue = JNI_FALSE;
8166 _returnValue = glIsFramebufferOES(
8167 (GLint)framebuffer
8168 );
Andy McFaddencee51982013-04-25 16:08:31 -07008169 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008170}
8171
8172/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8173static jboolean
8174android_glIsRenderbufferOES__I
8175 (JNIEnv *_env, jobject _this, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008176 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008177 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008178 "glIsRenderbufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008179 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008180 }
8181 GLboolean _returnValue = JNI_FALSE;
8182 _returnValue = glIsRenderbufferOES(
8183 (GLint)renderbuffer
8184 );
Andy McFaddencee51982013-04-25 16:08:31 -07008185 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008186}
8187
8188/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8189static void
8190android_glRenderbufferStorageOES__IIII
8191 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008192 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008193 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008194 "glRenderbufferStorageOES");
8195 return;
8196 }
8197 glRenderbufferStorageOES(
8198 (GLint)target,
8199 (GLint)internalformat,
8200 (GLint)width,
8201 (GLint)height
8202 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008203}
8204
8205/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8206static void
8207android_glTexGenf__IIF
8208 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008209 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008210 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008211 "glTexGenf");
8212 return;
8213 }
8214 glTexGenf(
8215 (GLint)coord,
8216 (GLint)pname,
8217 (GLfloat)param
8218 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008219}
8220
8221/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8222static void
8223android_glTexGenfv__II_3FI
8224 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008225 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008226 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008227 "glTexGenfv");
8228 return;
8229 }
8230 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08008231 const char * _exceptionType = NULL;
8232 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008233 GLfloat *params_base = (GLfloat *) 0;
8234 jint _remaining;
8235 GLfloat *params = (GLfloat *) 0;
8236
8237 if (!params_ref) {
8238 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008239 _exceptionType = "java/lang/IllegalArgumentException";
8240 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008241 goto exit;
8242 }
8243 if (offset < 0) {
8244 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008245 _exceptionType = "java/lang/IllegalArgumentException";
8246 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008247 goto exit;
8248 }
8249 _remaining = _env->GetArrayLength(params_ref) - offset;
8250 params_base = (GLfloat *)
8251 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
8252 params = params_base + offset;
8253
8254 glTexGenfv(
8255 (GLint)coord,
8256 (GLint)pname,
8257 (GLfloat *)params
8258 );
8259
8260exit:
8261 if (params_base) {
8262 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
8263 _exception ? JNI_ABORT: 0);
8264 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008265 if (_exception) {
8266 jniThrowException(_env, _exceptionType, _exceptionMessage);
8267 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008268}
8269
8270/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8271static void
8272android_glTexGenfv__IILjava_nio_FloatBuffer_2
8273 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008274 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008275 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008276 "glTexGenfv");
8277 return;
8278 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008279 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008280 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008281 jint _remaining;
8282 GLfloat *params = (GLfloat *) 0;
8283
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008284 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
8285 if (params == NULL) {
8286 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
8287 params = (GLfloat *) (_paramsBase + _bufferOffset);
8288 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008289 glTexGenfv(
8290 (GLint)coord,
8291 (GLint)pname,
8292 (GLfloat *)params
8293 );
8294 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008295 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008296 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008297}
8298
8299/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8300static void
8301android_glTexGeni__III
8302 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008303 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008304 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008305 "glTexGeni");
8306 return;
8307 }
8308 glTexGeni(
8309 (GLint)coord,
8310 (GLint)pname,
8311 (GLint)param
8312 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008313}
8314
8315/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8316static void
8317android_glTexGeniv__II_3II
8318 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008319 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008320 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008321 "glTexGeniv");
8322 return;
8323 }
8324 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08008325 const char * _exceptionType = NULL;
8326 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008327 GLint *params_base = (GLint *) 0;
8328 jint _remaining;
8329 GLint *params = (GLint *) 0;
8330
8331 if (!params_ref) {
8332 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008333 _exceptionType = "java/lang/IllegalArgumentException";
8334 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008335 goto exit;
8336 }
8337 if (offset < 0) {
8338 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008339 _exceptionType = "java/lang/IllegalArgumentException";
8340 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008341 goto exit;
8342 }
8343 _remaining = _env->GetArrayLength(params_ref) - offset;
8344 params_base = (GLint *)
8345 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
8346 params = params_base + offset;
8347
8348 glTexGeniv(
8349 (GLint)coord,
8350 (GLint)pname,
8351 (GLint *)params
8352 );
8353
8354exit:
8355 if (params_base) {
8356 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
8357 _exception ? JNI_ABORT: 0);
8358 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008359 if (_exception) {
8360 jniThrowException(_env, _exceptionType, _exceptionMessage);
8361 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008362}
8363
8364/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8365static void
8366android_glTexGeniv__IILjava_nio_IntBuffer_2
8367 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008368 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008369 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008370 "glTexGeniv");
8371 return;
8372 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008373 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008374 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008375 jint _remaining;
8376 GLint *params = (GLint *) 0;
8377
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008378 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
8379 if (params == NULL) {
8380 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
8381 params = (GLint *) (_paramsBase + _bufferOffset);
8382 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008383 glTexGeniv(
8384 (GLint)coord,
8385 (GLint)pname,
8386 (GLint *)params
8387 );
8388 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008389 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008390 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008391}
8392
8393/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8394static void
8395android_glTexGenx__III
8396 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008397 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008398 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008399 "glTexGenx");
8400 return;
8401 }
8402 glTexGenx(
8403 (GLint)coord,
8404 (GLint)pname,
8405 (GLint)param
8406 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008407}
8408
8409/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8410static void
8411android_glTexGenxv__II_3II
8412 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008413 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008414 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008415 "glTexGenxv");
8416 return;
8417 }
8418 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08008419 const char * _exceptionType = NULL;
8420 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008421 GLint *params_base = (GLint *) 0;
8422 jint _remaining;
8423 GLint *params = (GLint *) 0;
8424
8425 if (!params_ref) {
8426 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008427 _exceptionType = "java/lang/IllegalArgumentException";
8428 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008429 goto exit;
8430 }
8431 if (offset < 0) {
8432 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008433 _exceptionType = "java/lang/IllegalArgumentException";
8434 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008435 goto exit;
8436 }
8437 _remaining = _env->GetArrayLength(params_ref) - offset;
8438 params_base = (GLint *)
8439 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
8440 params = params_base + offset;
8441
8442 glTexGenxv(
8443 (GLint)coord,
8444 (GLint)pname,
8445 (GLint *)params
8446 );
8447
8448exit:
8449 if (params_base) {
8450 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
8451 _exception ? JNI_ABORT: 0);
8452 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008453 if (_exception) {
8454 jniThrowException(_env, _exceptionType, _exceptionMessage);
8455 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008456}
8457
8458/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8459static void
8460android_glTexGenxv__IILjava_nio_IntBuffer_2
8461 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008462 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008463 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008464 "glTexGenxv");
8465 return;
8466 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008467 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008468 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008469 jint _remaining;
8470 GLint *params = (GLint *) 0;
8471
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008472 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
8473 if (params == NULL) {
8474 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
8475 params = (GLint *) (_paramsBase + _bufferOffset);
8476 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008477 glTexGenxv(
8478 (GLint)coord,
8479 (GLint)pname,
8480 (GLint *)params
8481 );
8482 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008483 releasePointer(_env, _array, params, JNI_TRUE);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008484 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008485}
8486
8487static const char *classPathName = "com/google/android/gles_jni/GLImpl";
8488
8489static JNINativeMethod methods[] = {
8490{"_nativeClassInit", "()V", (void*)nativeClassInit },
8491{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
8492{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
8493{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
8494{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
8495{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
8496{"glClear", "(I)V", (void *) android_glClear__I },
8497{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
8498{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
8499{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
8500{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
8501{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
8502{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
8503{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
8504{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
8505{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
8506{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
8507{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
8508{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
8509{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
8510{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
8511{"glCullFace", "(I)V", (void *) android_glCullFace__I },
8512{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
8513{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
8514{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
8515{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
8516{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
8517{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
8518{"glDisable", "(I)V", (void *) android_glDisable__I },
8519{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
8520{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
8521{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
8522{"glEnable", "(I)V", (void *) android_glEnable__I },
8523{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
8524{"glFinish", "()V", (void *) android_glFinish__ },
8525{"glFlush", "()V", (void *) android_glFlush__ },
8526{"glFogf", "(IF)V", (void *) android_glFogf__IF },
8527{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
8528{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
8529{"glFogx", "(II)V", (void *) android_glFogx__II },
8530{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
8531{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
8532{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
8533{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
8534{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
8535{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
8536{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
8537{"glGetError", "()I", (void *) android_glGetError__ },
8538{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
8539{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
8540{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
8541{"glHint", "(II)V", (void *) android_glHint__II },
8542{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
8543{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
8544{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
8545{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
8546{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
8547{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
8548{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
8549{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
8550{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
8551{"glLightx", "(III)V", (void *) android_glLightx__III },
8552{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
8553{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
8554{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
8555{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
8556{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
8557{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
8558{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
8559{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
8560{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
8561{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
8562{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
8563{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
8564{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
8565{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
8566{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
8567{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
8568{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
8569{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
8570{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
8571{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
8572{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
8573{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
8574{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
8575{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
8576{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
8577{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
8578{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
8579{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
8580{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
8581{"glPointSize", "(F)V", (void *) android_glPointSize__F },
8582{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
8583{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
8584{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
8585{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
8586{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
8587{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
8588{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
8589{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
8590{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
8591{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
8592{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
8593{"glScalex", "(III)V", (void *) android_glScalex__III },
8594{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
8595{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
8596{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
8597{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
8598{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
8599{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
8600{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
8601{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
8602{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
8603{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
8604{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
8605{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
8606{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
8607{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
8608{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
8609{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
8610{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
8611{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
8612{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
8613{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
8614{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
8615{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
8616{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
8617{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
8618{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
8619{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
8620{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
8621{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
8622{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
8623{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
8624{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
8625{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
8626{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
8627{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
8628{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
8629{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
8630{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
8631{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
8632{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
8633{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
8634{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
8635{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
8636{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
8637{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
8638{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
8639{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
8640{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
8641{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
8642{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
8643{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
8644{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
8645{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
8646{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
8647{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
8648{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
8649{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
8650{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
8651{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
8652{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
8653{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
8654{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
8655{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
8656{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
8657{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
8658{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
8659{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
8660{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
8661{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
8662{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
8663{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
8664{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
8665{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
8666{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
8667{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
8668{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
8669{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008670{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008671{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
8672{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
8673{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
8674{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
8675{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
8676{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
8677{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
8678{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
8679{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
8680{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
8681{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
8682{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
8683{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
8684{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
8685{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
8686{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
8687{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
8688{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
8689{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
8690{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
8691{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
8692{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
8693{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
8694{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
8695{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
8696{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008697{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008698{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008699{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008700{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
8701{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
8702{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
8703{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
8704{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
8705{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
8706{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
8707{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
8708{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
8709{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
8710{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
8711{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
8712{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
8713{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
8714{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
8715{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
8716{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
8717{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
8718{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
8719{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
8720{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
8721{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
8722{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
8723{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
8724{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
8725{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
8726{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
8727{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
8728{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
8729{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
8730{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
8731{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
8732{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
8733{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
8734{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
8735{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
8736{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
8737{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
8738{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
8739{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
8740};
8741
8742int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
8743{
8744 int err;
8745 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
8746 return err;
8747}