blob: ad7d744cb693e23a0ee84a640e603ff4591a8625 [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
Andreas Gampebfe63332014-11-12 14:12:45 -080020#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22#pragma GCC diagnostic ignored "-Wunused-function"
23
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070024#include "jni.h"
25#include "JNIHelp.h"
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026#include <android_runtime/AndroidRuntime.h>
27#include <utils/misc.h>
28
29#include <assert.h>
30#include <GLES/gl.h>
Jack Palevichbe509c92009-05-07 09:52:14 -070031#include <GLES/glext.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032
Jack Palevich8a4de4b2010-01-28 20:28:32 +080033// Work around differences between the generated name and the actual name.
34
35#define glBlendEquation glBlendEquationOES
36#define glBlendEquationSeparate glBlendEquationSeparateOES
37#define glBlendFuncSeparate glBlendFuncSeparateOES
38#define glGetTexGenfv glGetTexGenfvOES
39#define glGetTexGeniv glGetTexGenivOES
40#define glGetTexGenxv glGetTexGenxvOES
41#define glTexGenf glTexGenfOES
42#define glTexGenfv glTexGenfvOES
43#define glTexGeni glTexGeniOES
44#define glTexGeniv glTexGenivOES
45#define glTexGenx glTexGenxOES
46#define glTexGenxv glTexGenxvOES
47
48
49
Mathias Agopian8331f722009-05-08 15:35:17 -070050/* special calls implemented in Android's GLES wrapper used to more
51 * efficiently bound-check passed arrays */
52extern "C" {
53GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
54 const GLvoid *ptr, GLsizei count);
55GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
56 const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
Jack Palevichbe6eac82009-12-08 15:43:51 +080061GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
63GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
64 GLsizei stride, const GLvoid *pointer, GLsizei count);
65GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
66 GLsizei stride, const GLvoid *pointer, GLsizei count);
Mathias Agopian8331f722009-05-08 15:35:17 -070067}
68
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069static int initialized = 0;
70
71static jclass nioAccessClass;
72static jclass bufferClass;
Jack Palevich91a27ae2009-06-15 21:03:24 -070073static jclass G11ImplClass;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074static jmethodID getBasePointerID;
75static jmethodID getBaseArrayID;
76static jmethodID getBaseArrayOffsetID;
Jack Palevich91a27ae2009-06-15 21:03:24 -070077static jmethodID allowIndirectBuffersID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078static jfieldID positionID;
79static jfieldID limitID;
80static jfieldID elementSizeShiftID;
Jack Palevich8a4de4b2010-01-28 20:28:32 +080081static jfieldID haveCheckedExtensionsID;
82static jfieldID have_OES_blend_equation_separateID;
83static jfieldID have_OES_blend_subtractID;
84static jfieldID have_OES_framebuffer_objectID;
85static jfieldID have_OES_texture_cube_mapID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086
87/* Cache method IDs each time the class is loaded. */
88
Jack Palevich27f80022009-04-15 19:13:17 -070089static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070090nativeClassInit(JNIEnv *_env, jclass glImplClass)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091{
92 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
93 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
94
95 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
96 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
97
Jack Palevich91a27ae2009-06-15 21:03:24 -070098 jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
99 G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800100 haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
101 have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
102 have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
103 have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
104 have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700105
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800106 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
107 "getBasePointer", "(Ljava/nio/Buffer;)J");
108 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
109 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
110 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
111 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700112 allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
113 "allowIndirectBuffers", "(Ljava/lang/String;)Z");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114 positionID = _env->GetFieldID(bufferClass, "position", "I");
115 limitID = _env->GetFieldID(bufferClass, "limit", "I");
116 elementSizeShiftID =
117 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
118}
119
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800120static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700121getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800122{
123 jint position;
124 jint limit;
125 jint elementSizeShift;
126 jlong pointer;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127
128 position = _env->GetIntField(buffer, positionID);
129 limit = _env->GetIntField(buffer, limitID);
130 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
131 *remaining = (limit - position) << elementSizeShift;
132 pointer = _env->CallStaticLongMethod(nioAccessClass,
133 getBasePointerID, buffer);
134 if (pointer != 0L) {
135 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000136 return reinterpret_cast<void *>(pointer);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700138
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
140 getBaseArrayID, buffer);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700141 if (*array == NULL) {
142 return (void*) NULL;
143 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700144 *offset = _env->CallStaticIntMethod(nioAccessClass,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700146
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700147 return NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800148}
149
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800150static void
151releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
152{
153 _env->ReleasePrimitiveArrayCritical(array, data,
154 commit ? 0 : JNI_ABORT);
155}
156
Jack Palevich91a27ae2009-06-15 21:03:24 -0700157extern "C" {
158extern char* __progname;
159}
160
161static bool
162allowIndirectBuffers(JNIEnv *_env) {
163 static jint sIndirectBufferCompatability;
164 if (sIndirectBufferCompatability == 0) {
165 jobject appName = _env->NewStringUTF(::__progname);
166 sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
167 }
168 return sIndirectBufferCompatability == 2;
169}
170
Jack Palevich16e79722009-05-15 18:13:34 -0700171static void *
172getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700173 if (!buffer) {
174 return NULL;
175 }
176 void* buf = _env->GetDirectBufferAddress(buffer);
Jack Palevich16e79722009-05-15 18:13:34 -0700177 if (buf) {
178 jint position = _env->GetIntField(buffer, positionID);
179 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700180 buf = ((char*) buf) + (position << elementSizeShift);
Jack Palevich16e79722009-05-15 18:13:34 -0700181 } else {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700182 if (allowIndirectBuffers(_env)) {
183 jarray array = 0;
184 jint remaining;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700185 jint offset;
186 buf = getPointer(_env, buffer, &array, &remaining, &offset);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700187 if (array) {
188 releasePointer(_env, array, buf, 0);
189 }
synergydev01994c72013-10-14 12:20:16 -0700190 buf = (char*)buf + offset;
Jack Palevich91a27ae2009-06-15 21:03:24 -0700191 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700192 jniThrowException(_env, "java/lang/IllegalArgumentException",
193 "Must use a native order direct Buffer");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700194 }
Jack Palevich16e79722009-05-15 18:13:34 -0700195 }
Jack Palevich91a27ae2009-06-15 21:03:24 -0700196 return buf;
Jack Palevich16e79722009-05-15 18:13:34 -0700197}
198
Jack Palevichbe509c92009-05-07 09:52:14 -0700199static int
200getNumCompressedTextureFormats() {
201 int numCompressedTextureFormats = 0;
202 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
203 return numCompressedTextureFormats;
204}
205
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800206// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
207// terminated by either 0 or space, while pExtension is terminated by 0.
208
209static bool
210extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
211 while (true) {
212 char a = *pExtensions++;
213 char b = *pExtension++;
214 bool aEnd = a == '\0' || a == ' ';
215 bool bEnd = b == '\0';
216 if ( aEnd || bEnd) {
217 return aEnd == bEnd;
218 }
219 if ( a != b ) {
220 return false;
221 }
222 }
223}
224
225static const GLubyte*
226nextExtension(const GLubyte* pExtensions) {
227 while (true) {
228 char a = *pExtensions++;
229 if ( a == '\0') {
230 return pExtensions-1;
231 } else if ( a == ' ') {
232 return pExtensions;
233 }
234 }
235}
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700236
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800237static bool
238checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
239 for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
240 if (extensionEqual(pExtensions, pExtension)) {
241 return true;
242 }
243 }
244 return false;
245}
246
247static bool
248supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
249 if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
250 _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
251 const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
252 _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
253 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
254 _env->SetBooleanField(impl, have_OES_blend_subtractID,
255 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
256 _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
257 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
258 _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
259 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
260 }
261 return _env->GetBooleanField(impl, fieldId);
262}
263
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800264// --------------------------------------------------------------------------
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265/* void glActiveTexture ( GLenum texture ) */
266static void
267android_glActiveTexture__I
268 (JNIEnv *_env, jobject _this, jint texture) {
269 glActiveTexture(
270 (GLenum)texture
271 );
272}
273
274/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
275static void
276android_glAlphaFunc__IF
277 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
278 glAlphaFunc(
279 (GLenum)func,
280 (GLclampf)ref
281 );
282}
283
284/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
285static void
286android_glAlphaFuncx__II
287 (JNIEnv *_env, jobject _this, jint func, jint ref) {
288 glAlphaFuncx(
289 (GLenum)func,
290 (GLclampx)ref
291 );
292}
293
294/* void glBindTexture ( GLenum target, GLuint texture ) */
295static void
296android_glBindTexture__II
297 (JNIEnv *_env, jobject _this, jint target, jint texture) {
298 glBindTexture(
299 (GLenum)target,
300 (GLuint)texture
301 );
302}
303
304/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
305static void
306android_glBlendFunc__II
307 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
308 glBlendFunc(
309 (GLenum)sfactor,
310 (GLenum)dfactor
311 );
312}
313
314/* void glClear ( GLbitfield mask ) */
315static void
316android_glClear__I
317 (JNIEnv *_env, jobject _this, jint mask) {
318 glClear(
319 (GLbitfield)mask
320 );
321}
322
323/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
324static void
325android_glClearColor__FFFF
326 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
327 glClearColor(
328 (GLclampf)red,
329 (GLclampf)green,
330 (GLclampf)blue,
331 (GLclampf)alpha
332 );
333}
334
335/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
336static void
337android_glClearColorx__IIII
338 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
339 glClearColorx(
340 (GLclampx)red,
341 (GLclampx)green,
342 (GLclampx)blue,
343 (GLclampx)alpha
344 );
345}
346
347/* void glClearDepthf ( GLclampf depth ) */
348static void
349android_glClearDepthf__F
350 (JNIEnv *_env, jobject _this, jfloat depth) {
351 glClearDepthf(
352 (GLclampf)depth
353 );
354}
355
356/* void glClearDepthx ( GLclampx depth ) */
357static void
358android_glClearDepthx__I
359 (JNIEnv *_env, jobject _this, jint depth) {
360 glClearDepthx(
361 (GLclampx)depth
362 );
363}
364
365/* void glClearStencil ( GLint s ) */
366static void
367android_glClearStencil__I
368 (JNIEnv *_env, jobject _this, jint s) {
369 glClearStencil(
370 (GLint)s
371 );
372}
373
374/* void glClientActiveTexture ( GLenum texture ) */
375static void
376android_glClientActiveTexture__I
377 (JNIEnv *_env, jobject _this, jint texture) {
378 glClientActiveTexture(
379 (GLenum)texture
380 );
381}
382
383/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
384static void
385android_glColor4f__FFFF
386 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
387 glColor4f(
388 (GLfloat)red,
389 (GLfloat)green,
390 (GLfloat)blue,
391 (GLfloat)alpha
392 );
393}
394
395/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
396static void
397android_glColor4x__IIII
398 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
399 glColor4x(
400 (GLfixed)red,
401 (GLfixed)green,
402 (GLfixed)blue,
403 (GLfixed)alpha
404 );
405}
406
407/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
408static void
409android_glColorMask__ZZZZ
410 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
411 glColorMask(
412 (GLboolean)red,
413 (GLboolean)green,
414 (GLboolean)blue,
415 (GLboolean)alpha
416 );
417}
418
419/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
420static void
421android_glColorPointerBounds__IIILjava_nio_Buffer_2I
422 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
423 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700424 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800425 jint _remaining;
426 GLvoid *pointer = (GLvoid *) 0;
427
Jack Paleviche20ea782009-05-07 18:28:29 -0700428 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700429 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700430 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700431 return;
432 }
433 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800434 glColorPointerBounds(
435 (GLint)size,
436 (GLenum)type,
437 (GLsizei)stride,
438 (GLvoid *)pointer,
439 (GLsizei)remaining
440 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800441}
442
443/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
444static void
445android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
446 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
447 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700448 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800449 jint _remaining;
450 GLvoid *data = (GLvoid *) 0;
451
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700452 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700453 if (data == NULL) {
454 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
455 data = (GLvoid *) (_dataBase + _bufferOffset);
456 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 glCompressedTexImage2D(
458 (GLenum)target,
459 (GLint)level,
460 (GLenum)internalformat,
461 (GLsizei)width,
462 (GLsizei)height,
463 (GLint)border,
464 (GLsizei)imageSize,
465 (GLvoid *)data
466 );
467 if (_array) {
468 releasePointer(_env, _array, data, JNI_FALSE);
469 }
470}
471
472/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
473static void
474android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
475 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
476 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700477 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 jint _remaining;
479 GLvoid *data = (GLvoid *) 0;
480
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700481 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700482 if (data == NULL) {
483 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
484 data = (GLvoid *) (_dataBase + _bufferOffset);
485 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800486 glCompressedTexSubImage2D(
487 (GLenum)target,
488 (GLint)level,
489 (GLint)xoffset,
490 (GLint)yoffset,
491 (GLsizei)width,
492 (GLsizei)height,
493 (GLenum)format,
494 (GLsizei)imageSize,
495 (GLvoid *)data
496 );
497 if (_array) {
498 releasePointer(_env, _array, data, JNI_FALSE);
499 }
500}
501
502/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
503static void
504android_glCopyTexImage2D__IIIIIIII
505 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
506 glCopyTexImage2D(
507 (GLenum)target,
508 (GLint)level,
509 (GLenum)internalformat,
510 (GLint)x,
511 (GLint)y,
512 (GLsizei)width,
513 (GLsizei)height,
514 (GLint)border
515 );
516}
517
518/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
519static void
520android_glCopyTexSubImage2D__IIIIIIII
521 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
522 glCopyTexSubImage2D(
523 (GLenum)target,
524 (GLint)level,
525 (GLint)xoffset,
526 (GLint)yoffset,
527 (GLint)x,
528 (GLint)y,
529 (GLsizei)width,
530 (GLsizei)height
531 );
532}
533
534/* void glCullFace ( GLenum mode ) */
535static void
536android_glCullFace__I
537 (JNIEnv *_env, jobject _this, jint mode) {
538 glCullFace(
539 (GLenum)mode
540 );
541}
542
543/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
544static void
545android_glDeleteTextures__I_3II
546 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700547 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800548 const char * _exceptionType = NULL;
549 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800550 GLuint *textures_base = (GLuint *) 0;
551 jint _remaining;
552 GLuint *textures = (GLuint *) 0;
553
554 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700555 _exception = 1;
556 _exceptionType = "java/lang/IllegalArgumentException";
557 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800558 goto exit;
559 }
560 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700561 _exception = 1;
562 _exceptionType = "java/lang/IllegalArgumentException";
563 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800564 goto exit;
565 }
566 _remaining = _env->GetArrayLength(textures_ref) - offset;
567 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700568 _exception = 1;
569 _exceptionType = "java/lang/IllegalArgumentException";
570 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800571 goto exit;
572 }
573 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700574 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800575 textures = textures_base + offset;
576
577 glDeleteTextures(
578 (GLsizei)n,
579 (GLuint *)textures
580 );
581
582exit:
583 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700584 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 JNI_ABORT);
586 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700587 if (_exception) {
588 jniThrowException(_env, _exceptionType, _exceptionMessage);
589 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800590}
591
592/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
593static void
594android_glDeleteTextures__ILjava_nio_IntBuffer_2
595 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700596 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800597 const char * _exceptionType = NULL;
598 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700599 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700600 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800601 jint _remaining;
602 GLuint *textures = (GLuint *) 0;
603
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700604 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700606 _exception = 1;
607 _exceptionType = "java/lang/IllegalArgumentException";
608 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800609 goto exit;
610 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700611 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700612 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700613 textures = (GLuint *) (_texturesBase + _bufferOffset);
614 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800615 glDeleteTextures(
616 (GLsizei)n,
617 (GLuint *)textures
618 );
619
620exit:
621 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700622 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800623 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700624 if (_exception) {
625 jniThrowException(_env, _exceptionType, _exceptionMessage);
626 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800627}
628
629/* void glDepthFunc ( GLenum func ) */
630static void
631android_glDepthFunc__I
632 (JNIEnv *_env, jobject _this, jint func) {
633 glDepthFunc(
634 (GLenum)func
635 );
636}
637
638/* void glDepthMask ( GLboolean flag ) */
639static void
640android_glDepthMask__Z
641 (JNIEnv *_env, jobject _this, jboolean flag) {
642 glDepthMask(
643 (GLboolean)flag
644 );
645}
646
647/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
648static void
649android_glDepthRangef__FF
650 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
651 glDepthRangef(
652 (GLclampf)zNear,
653 (GLclampf)zFar
654 );
655}
656
657/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
658static void
659android_glDepthRangex__II
660 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
661 glDepthRangex(
662 (GLclampx)zNear,
663 (GLclampx)zFar
664 );
665}
666
667/* void glDisable ( GLenum cap ) */
668static void
669android_glDisable__I
670 (JNIEnv *_env, jobject _this, jint cap) {
671 glDisable(
672 (GLenum)cap
673 );
674}
675
676/* void glDisableClientState ( GLenum array ) */
677static void
678android_glDisableClientState__I
679 (JNIEnv *_env, jobject _this, jint array) {
680 glDisableClientState(
681 (GLenum)array
682 );
683}
684
685/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
686static void
687android_glDrawArrays__III
688 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
689 glDrawArrays(
690 (GLenum)mode,
691 (GLint)first,
692 (GLsizei)count
693 );
694}
695
696/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
697static void
698android_glDrawElements__IIILjava_nio_Buffer_2
699 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700700 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800701 const char * _exceptionType = NULL;
702 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800703 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700704 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800705 jint _remaining;
706 GLvoid *indices = (GLvoid *) 0;
707
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700708 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700710 _exception = 1;
711 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
712 _exceptionMessage = "remaining() < count < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800713 goto exit;
714 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700715 if (indices == NULL) {
716 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
717 indices = (GLvoid *) (_indicesBase + _bufferOffset);
718 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800719 glDrawElements(
720 (GLenum)mode,
721 (GLsizei)count,
722 (GLenum)type,
723 (GLvoid *)indices
724 );
725
726exit:
727 if (_array) {
728 releasePointer(_env, _array, indices, JNI_FALSE);
729 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700730 if (_exception) {
731 jniThrowException(_env, _exceptionType, _exceptionMessage);
732 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800733}
734
735/* void glEnable ( GLenum cap ) */
736static void
737android_glEnable__I
738 (JNIEnv *_env, jobject _this, jint cap) {
739 glEnable(
740 (GLenum)cap
741 );
742}
743
744/* void glEnableClientState ( GLenum array ) */
745static void
746android_glEnableClientState__I
747 (JNIEnv *_env, jobject _this, jint array) {
748 glEnableClientState(
749 (GLenum)array
750 );
751}
752
753/* void glFinish ( void ) */
754static void
755android_glFinish__
756 (JNIEnv *_env, jobject _this) {
757 glFinish();
758}
759
760/* void glFlush ( void ) */
761static void
762android_glFlush__
763 (JNIEnv *_env, jobject _this) {
764 glFlush();
765}
766
767/* void glFogf ( GLenum pname, GLfloat param ) */
768static void
769android_glFogf__IF
770 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
771 glFogf(
772 (GLenum)pname,
773 (GLfloat)param
774 );
775}
776
777/* void glFogfv ( GLenum pname, const GLfloat *params ) */
778static void
779android_glFogfv__I_3FI
780 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700781 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800782 const char * _exceptionType = NULL;
783 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800784 GLfloat *params_base = (GLfloat *) 0;
785 jint _remaining;
786 GLfloat *params = (GLfloat *) 0;
787
788 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700789 _exception = 1;
790 _exceptionType = "java/lang/IllegalArgumentException";
791 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800792 goto exit;
793 }
794 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700795 _exception = 1;
796 _exceptionType = "java/lang/IllegalArgumentException";
797 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800798 goto exit;
799 }
800 _remaining = _env->GetArrayLength(params_ref) - offset;
801 int _needed;
802 switch (pname) {
803#if defined(GL_FOG_MODE)
804 case GL_FOG_MODE:
805#endif // defined(GL_FOG_MODE)
806#if defined(GL_FOG_DENSITY)
807 case GL_FOG_DENSITY:
808#endif // defined(GL_FOG_DENSITY)
809#if defined(GL_FOG_START)
810 case GL_FOG_START:
811#endif // defined(GL_FOG_START)
812#if defined(GL_FOG_END)
813 case GL_FOG_END:
814#endif // defined(GL_FOG_END)
815 _needed = 1;
816 break;
817#if defined(GL_FOG_COLOR)
818 case GL_FOG_COLOR:
819#endif // defined(GL_FOG_COLOR)
820 _needed = 4;
821 break;
822 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800823 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800824 break;
825 }
826 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700827 _exception = 1;
828 _exceptionType = "java/lang/IllegalArgumentException";
829 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800830 goto exit;
831 }
832 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700833 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800834 params = params_base + offset;
835
836 glFogfv(
837 (GLenum)pname,
838 (GLfloat *)params
839 );
840
841exit:
842 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700843 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800844 JNI_ABORT);
845 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700846 if (_exception) {
847 jniThrowException(_env, _exceptionType, _exceptionMessage);
848 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800849}
850
851/* void glFogfv ( GLenum pname, const GLfloat *params ) */
852static void
853android_glFogfv__ILjava_nio_FloatBuffer_2
854 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700855 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800856 const char * _exceptionType = NULL;
857 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700858 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700859 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800860 jint _remaining;
861 GLfloat *params = (GLfloat *) 0;
862
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700863 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800864 int _needed;
865 switch (pname) {
866#if defined(GL_FOG_MODE)
867 case GL_FOG_MODE:
868#endif // defined(GL_FOG_MODE)
869#if defined(GL_FOG_DENSITY)
870 case GL_FOG_DENSITY:
871#endif // defined(GL_FOG_DENSITY)
872#if defined(GL_FOG_START)
873 case GL_FOG_START:
874#endif // defined(GL_FOG_START)
875#if defined(GL_FOG_END)
876 case GL_FOG_END:
877#endif // defined(GL_FOG_END)
878 _needed = 1;
879 break;
880#if defined(GL_FOG_COLOR)
881 case GL_FOG_COLOR:
882#endif // defined(GL_FOG_COLOR)
883 _needed = 4;
884 break;
885 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800886 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800887 break;
888 }
889 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700890 _exception = 1;
891 _exceptionType = "java/lang/IllegalArgumentException";
892 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800893 goto exit;
894 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700895 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700896 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700897 params = (GLfloat *) (_paramsBase + _bufferOffset);
898 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800899 glFogfv(
900 (GLenum)pname,
901 (GLfloat *)params
902 );
903
904exit:
905 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700906 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800907 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700908 if (_exception) {
909 jniThrowException(_env, _exceptionType, _exceptionMessage);
910 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800911}
912
913/* void glFogx ( GLenum pname, GLfixed param ) */
914static void
915android_glFogx__II
916 (JNIEnv *_env, jobject _this, jint pname, jint param) {
917 glFogx(
918 (GLenum)pname,
919 (GLfixed)param
920 );
921}
922
923/* void glFogxv ( GLenum pname, const GLfixed *params ) */
924static void
925android_glFogxv__I_3II
926 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700927 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800928 const char * _exceptionType = NULL;
929 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800930 GLfixed *params_base = (GLfixed *) 0;
931 jint _remaining;
932 GLfixed *params = (GLfixed *) 0;
933
934 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700935 _exception = 1;
936 _exceptionType = "java/lang/IllegalArgumentException";
937 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800938 goto exit;
939 }
940 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700941 _exception = 1;
942 _exceptionType = "java/lang/IllegalArgumentException";
943 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800944 goto exit;
945 }
946 _remaining = _env->GetArrayLength(params_ref) - offset;
947 int _needed;
948 switch (pname) {
949#if defined(GL_FOG_MODE)
950 case GL_FOG_MODE:
951#endif // defined(GL_FOG_MODE)
952#if defined(GL_FOG_DENSITY)
953 case GL_FOG_DENSITY:
954#endif // defined(GL_FOG_DENSITY)
955#if defined(GL_FOG_START)
956 case GL_FOG_START:
957#endif // defined(GL_FOG_START)
958#if defined(GL_FOG_END)
959 case GL_FOG_END:
960#endif // defined(GL_FOG_END)
961 _needed = 1;
962 break;
963#if defined(GL_FOG_COLOR)
964 case GL_FOG_COLOR:
965#endif // defined(GL_FOG_COLOR)
966 _needed = 4;
967 break;
968 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800969 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800970 break;
971 }
972 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700973 _exception = 1;
974 _exceptionType = "java/lang/IllegalArgumentException";
975 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800976 goto exit;
977 }
978 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700979 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800980 params = params_base + offset;
981
982 glFogxv(
983 (GLenum)pname,
984 (GLfixed *)params
985 );
986
987exit:
988 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700989 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800990 JNI_ABORT);
991 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700992 if (_exception) {
993 jniThrowException(_env, _exceptionType, _exceptionMessage);
994 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800995}
996
997/* void glFogxv ( GLenum pname, const GLfixed *params ) */
998static void
999android_glFogxv__ILjava_nio_IntBuffer_2
1000 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001001 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001002 const char * _exceptionType = NULL;
1003 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001004 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001005 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001006 jint _remaining;
1007 GLfixed *params = (GLfixed *) 0;
1008
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001009 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001010 int _needed;
1011 switch (pname) {
1012#if defined(GL_FOG_MODE)
1013 case GL_FOG_MODE:
1014#endif // defined(GL_FOG_MODE)
1015#if defined(GL_FOG_DENSITY)
1016 case GL_FOG_DENSITY:
1017#endif // defined(GL_FOG_DENSITY)
1018#if defined(GL_FOG_START)
1019 case GL_FOG_START:
1020#endif // defined(GL_FOG_START)
1021#if defined(GL_FOG_END)
1022 case GL_FOG_END:
1023#endif // defined(GL_FOG_END)
1024 _needed = 1;
1025 break;
1026#if defined(GL_FOG_COLOR)
1027 case GL_FOG_COLOR:
1028#endif // defined(GL_FOG_COLOR)
1029 _needed = 4;
1030 break;
1031 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001032 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001033 break;
1034 }
1035 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001036 _exception = 1;
1037 _exceptionType = "java/lang/IllegalArgumentException";
1038 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 goto exit;
1040 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001041 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001042 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001043 params = (GLfixed *) (_paramsBase + _bufferOffset);
1044 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001045 glFogxv(
1046 (GLenum)pname,
1047 (GLfixed *)params
1048 );
1049
1050exit:
1051 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001052 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001053 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001054 if (_exception) {
1055 jniThrowException(_env, _exceptionType, _exceptionMessage);
1056 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001057}
1058
1059/* void glFrontFace ( GLenum mode ) */
1060static void
1061android_glFrontFace__I
1062 (JNIEnv *_env, jobject _this, jint mode) {
1063 glFrontFace(
1064 (GLenum)mode
1065 );
1066}
1067
1068/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1069static void
1070android_glFrustumf__FFFFFF
1071 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1072 glFrustumf(
1073 (GLfloat)left,
1074 (GLfloat)right,
1075 (GLfloat)bottom,
1076 (GLfloat)top,
1077 (GLfloat)zNear,
1078 (GLfloat)zFar
1079 );
1080}
1081
1082/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1083static void
1084android_glFrustumx__IIIIII
1085 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1086 glFrustumx(
1087 (GLfixed)left,
1088 (GLfixed)right,
1089 (GLfixed)bottom,
1090 (GLfixed)top,
1091 (GLfixed)zNear,
1092 (GLfixed)zFar
1093 );
1094}
1095
1096/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1097static void
1098android_glGenTextures__I_3II
1099 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1100 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001101 const char * _exceptionType = NULL;
1102 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 GLuint *textures_base = (GLuint *) 0;
1104 jint _remaining;
1105 GLuint *textures = (GLuint *) 0;
1106
1107 if (!textures_ref) {
1108 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001109 _exceptionType = "java/lang/IllegalArgumentException";
1110 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001111 goto exit;
1112 }
1113 if (offset < 0) {
1114 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001115 _exceptionType = "java/lang/IllegalArgumentException";
1116 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001117 goto exit;
1118 }
1119 _remaining = _env->GetArrayLength(textures_ref) - offset;
1120 if (_remaining < n) {
1121 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001122 _exceptionType = "java/lang/IllegalArgumentException";
1123 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001124 goto exit;
1125 }
1126 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001127 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001128 textures = textures_base + offset;
1129
1130 glGenTextures(
1131 (GLsizei)n,
1132 (GLuint *)textures
1133 );
1134
1135exit:
1136 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001137 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001138 _exception ? JNI_ABORT: 0);
1139 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001140 if (_exception) {
1141 jniThrowException(_env, _exceptionType, _exceptionMessage);
1142 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001143}
1144
1145/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1146static void
1147android_glGenTextures__ILjava_nio_IntBuffer_2
1148 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1149 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001150 const char * _exceptionType = NULL;
1151 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001152 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001153 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001154 jint _remaining;
1155 GLuint *textures = (GLuint *) 0;
1156
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001157 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001158 if (_remaining < n) {
1159 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001160 _exceptionType = "java/lang/IllegalArgumentException";
1161 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001162 goto exit;
1163 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001164 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001165 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001166 textures = (GLuint *) (_texturesBase + _bufferOffset);
1167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001168 glGenTextures(
1169 (GLsizei)n,
1170 (GLuint *)textures
1171 );
1172
1173exit:
1174 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001175 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001176 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001177 if (_exception) {
1178 jniThrowException(_env, _exceptionType, _exceptionMessage);
1179 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180}
1181
1182/* GLenum glGetError ( void ) */
1183static jint
1184android_glGetError__
1185 (JNIEnv *_env, jobject _this) {
1186 GLenum _returnValue;
1187 _returnValue = glGetError();
Elliott Hughes428d3fc2013-09-24 17:15:41 -07001188 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001189}
1190
1191/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1192static void
1193android_glGetIntegerv__I_3II
1194 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1195 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001196 const char * _exceptionType = NULL;
1197 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001198 GLint *params_base = (GLint *) 0;
1199 jint _remaining;
1200 GLint *params = (GLint *) 0;
1201
1202 if (!params_ref) {
1203 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001204 _exceptionType = "java/lang/IllegalArgumentException";
1205 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001206 goto exit;
1207 }
1208 if (offset < 0) {
1209 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001210 _exceptionType = "java/lang/IllegalArgumentException";
1211 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001212 goto exit;
1213 }
1214 _remaining = _env->GetArrayLength(params_ref) - offset;
1215 int _needed;
1216 switch (pname) {
1217#if defined(GL_ALPHA_BITS)
1218 case GL_ALPHA_BITS:
1219#endif // defined(GL_ALPHA_BITS)
1220#if defined(GL_ALPHA_TEST_FUNC)
1221 case GL_ALPHA_TEST_FUNC:
1222#endif // defined(GL_ALPHA_TEST_FUNC)
1223#if defined(GL_ALPHA_TEST_REF)
1224 case GL_ALPHA_TEST_REF:
1225#endif // defined(GL_ALPHA_TEST_REF)
1226#if defined(GL_BLEND_DST)
1227 case GL_BLEND_DST:
1228#endif // defined(GL_BLEND_DST)
1229#if defined(GL_BLUE_BITS)
1230 case GL_BLUE_BITS:
1231#endif // defined(GL_BLUE_BITS)
1232#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1233 case GL_COLOR_ARRAY_BUFFER_BINDING:
1234#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1235#if defined(GL_COLOR_ARRAY_SIZE)
1236 case GL_COLOR_ARRAY_SIZE:
1237#endif // defined(GL_COLOR_ARRAY_SIZE)
1238#if defined(GL_COLOR_ARRAY_STRIDE)
1239 case GL_COLOR_ARRAY_STRIDE:
1240#endif // defined(GL_COLOR_ARRAY_STRIDE)
1241#if defined(GL_COLOR_ARRAY_TYPE)
1242 case GL_COLOR_ARRAY_TYPE:
1243#endif // defined(GL_COLOR_ARRAY_TYPE)
1244#if defined(GL_CULL_FACE)
1245 case GL_CULL_FACE:
1246#endif // defined(GL_CULL_FACE)
1247#if defined(GL_DEPTH_BITS)
1248 case GL_DEPTH_BITS:
1249#endif // defined(GL_DEPTH_BITS)
1250#if defined(GL_DEPTH_CLEAR_VALUE)
1251 case GL_DEPTH_CLEAR_VALUE:
1252#endif // defined(GL_DEPTH_CLEAR_VALUE)
1253#if defined(GL_DEPTH_FUNC)
1254 case GL_DEPTH_FUNC:
1255#endif // defined(GL_DEPTH_FUNC)
1256#if defined(GL_DEPTH_WRITEMASK)
1257 case GL_DEPTH_WRITEMASK:
1258#endif // defined(GL_DEPTH_WRITEMASK)
1259#if defined(GL_FOG_DENSITY)
1260 case GL_FOG_DENSITY:
1261#endif // defined(GL_FOG_DENSITY)
1262#if defined(GL_FOG_END)
1263 case GL_FOG_END:
1264#endif // defined(GL_FOG_END)
1265#if defined(GL_FOG_MODE)
1266 case GL_FOG_MODE:
1267#endif // defined(GL_FOG_MODE)
1268#if defined(GL_FOG_START)
1269 case GL_FOG_START:
1270#endif // defined(GL_FOG_START)
1271#if defined(GL_FRONT_FACE)
1272 case GL_FRONT_FACE:
1273#endif // defined(GL_FRONT_FACE)
1274#if defined(GL_GREEN_BITS)
1275 case GL_GREEN_BITS:
1276#endif // defined(GL_GREEN_BITS)
1277#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1278 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1279#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1280#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1281 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1282#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001283#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1284 case GL_LIGHT_MODEL_COLOR_CONTROL:
1285#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1286#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1287 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1288#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1290 case GL_LIGHT_MODEL_TWO_SIDE:
1291#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1292#if defined(GL_LINE_SMOOTH_HINT)
1293 case GL_LINE_SMOOTH_HINT:
1294#endif // defined(GL_LINE_SMOOTH_HINT)
1295#if defined(GL_LINE_WIDTH)
1296 case GL_LINE_WIDTH:
1297#endif // defined(GL_LINE_WIDTH)
1298#if defined(GL_LOGIC_OP_MODE)
1299 case GL_LOGIC_OP_MODE:
1300#endif // defined(GL_LOGIC_OP_MODE)
1301#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1302 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1303#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1304#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1305 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1306#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1307#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1308 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1309#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1310#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1311 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1312#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1313#if defined(GL_MATRIX_MODE)
1314 case GL_MATRIX_MODE:
1315#endif // defined(GL_MATRIX_MODE)
1316#if defined(GL_MAX_CLIP_PLANES)
1317 case GL_MAX_CLIP_PLANES:
1318#endif // defined(GL_MAX_CLIP_PLANES)
1319#if defined(GL_MAX_ELEMENTS_INDICES)
1320 case GL_MAX_ELEMENTS_INDICES:
1321#endif // defined(GL_MAX_ELEMENTS_INDICES)
1322#if defined(GL_MAX_ELEMENTS_VERTICES)
1323 case GL_MAX_ELEMENTS_VERTICES:
1324#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1325#if defined(GL_MAX_LIGHTS)
1326 case GL_MAX_LIGHTS:
1327#endif // defined(GL_MAX_LIGHTS)
1328#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1329 case GL_MAX_MODELVIEW_STACK_DEPTH:
1330#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1331#if defined(GL_MAX_PALETTE_MATRICES_OES)
1332 case GL_MAX_PALETTE_MATRICES_OES:
1333#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1334#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1335 case GL_MAX_PROJECTION_STACK_DEPTH:
1336#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1337#if defined(GL_MAX_TEXTURE_SIZE)
1338 case GL_MAX_TEXTURE_SIZE:
1339#endif // defined(GL_MAX_TEXTURE_SIZE)
1340#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1341 case GL_MAX_TEXTURE_STACK_DEPTH:
1342#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1343#if defined(GL_MAX_TEXTURE_UNITS)
1344 case GL_MAX_TEXTURE_UNITS:
1345#endif // defined(GL_MAX_TEXTURE_UNITS)
1346#if defined(GL_MAX_VERTEX_UNITS_OES)
1347 case GL_MAX_VERTEX_UNITS_OES:
1348#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1349#if defined(GL_MODELVIEW_STACK_DEPTH)
1350 case GL_MODELVIEW_STACK_DEPTH:
1351#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1352#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1353 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1354#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1355#if defined(GL_NORMAL_ARRAY_STRIDE)
1356 case GL_NORMAL_ARRAY_STRIDE:
1357#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1358#if defined(GL_NORMAL_ARRAY_TYPE)
1359 case GL_NORMAL_ARRAY_TYPE:
1360#endif // defined(GL_NORMAL_ARRAY_TYPE)
1361#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1362 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1363#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1364#if defined(GL_PACK_ALIGNMENT)
1365 case GL_PACK_ALIGNMENT:
1366#endif // defined(GL_PACK_ALIGNMENT)
1367#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1368 case GL_PERSPECTIVE_CORRECTION_HINT:
1369#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1370#if defined(GL_POINT_SIZE)
1371 case GL_POINT_SIZE:
1372#endif // defined(GL_POINT_SIZE)
1373#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1374 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1375#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1376#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1377 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1378#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1379#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1380 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1381#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1382#if defined(GL_POINT_SMOOTH_HINT)
1383 case GL_POINT_SMOOTH_HINT:
1384#endif // defined(GL_POINT_SMOOTH_HINT)
1385#if defined(GL_POLYGON_OFFSET_FACTOR)
1386 case GL_POLYGON_OFFSET_FACTOR:
1387#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1388#if defined(GL_POLYGON_OFFSET_UNITS)
1389 case GL_POLYGON_OFFSET_UNITS:
1390#endif // defined(GL_POLYGON_OFFSET_UNITS)
1391#if defined(GL_PROJECTION_STACK_DEPTH)
1392 case GL_PROJECTION_STACK_DEPTH:
1393#endif // defined(GL_PROJECTION_STACK_DEPTH)
1394#if defined(GL_RED_BITS)
1395 case GL_RED_BITS:
1396#endif // defined(GL_RED_BITS)
1397#if defined(GL_SHADE_MODEL)
1398 case GL_SHADE_MODEL:
1399#endif // defined(GL_SHADE_MODEL)
1400#if defined(GL_STENCIL_BITS)
1401 case GL_STENCIL_BITS:
1402#endif // defined(GL_STENCIL_BITS)
1403#if defined(GL_STENCIL_CLEAR_VALUE)
1404 case GL_STENCIL_CLEAR_VALUE:
1405#endif // defined(GL_STENCIL_CLEAR_VALUE)
1406#if defined(GL_STENCIL_FAIL)
1407 case GL_STENCIL_FAIL:
1408#endif // defined(GL_STENCIL_FAIL)
1409#if defined(GL_STENCIL_FUNC)
1410 case GL_STENCIL_FUNC:
1411#endif // defined(GL_STENCIL_FUNC)
1412#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1413 case GL_STENCIL_PASS_DEPTH_FAIL:
1414#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1415#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1416 case GL_STENCIL_PASS_DEPTH_PASS:
1417#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1418#if defined(GL_STENCIL_REF)
1419 case GL_STENCIL_REF:
1420#endif // defined(GL_STENCIL_REF)
1421#if defined(GL_STENCIL_VALUE_MASK)
1422 case GL_STENCIL_VALUE_MASK:
1423#endif // defined(GL_STENCIL_VALUE_MASK)
1424#if defined(GL_STENCIL_WRITEMASK)
1425 case GL_STENCIL_WRITEMASK:
1426#endif // defined(GL_STENCIL_WRITEMASK)
1427#if defined(GL_SUBPIXEL_BITS)
1428 case GL_SUBPIXEL_BITS:
1429#endif // defined(GL_SUBPIXEL_BITS)
1430#if defined(GL_TEXTURE_BINDING_2D)
1431 case GL_TEXTURE_BINDING_2D:
1432#endif // defined(GL_TEXTURE_BINDING_2D)
1433#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1434 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1435#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1436#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1437 case GL_TEXTURE_COORD_ARRAY_SIZE:
1438#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1439#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1440 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1441#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1442#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1443 case GL_TEXTURE_COORD_ARRAY_TYPE:
1444#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1445#if defined(GL_TEXTURE_STACK_DEPTH)
1446 case GL_TEXTURE_STACK_DEPTH:
1447#endif // defined(GL_TEXTURE_STACK_DEPTH)
1448#if defined(GL_UNPACK_ALIGNMENT)
1449 case GL_UNPACK_ALIGNMENT:
1450#endif // defined(GL_UNPACK_ALIGNMENT)
1451#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1452 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1453#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1454#if defined(GL_VERTEX_ARRAY_SIZE)
1455 case GL_VERTEX_ARRAY_SIZE:
1456#endif // defined(GL_VERTEX_ARRAY_SIZE)
1457#if defined(GL_VERTEX_ARRAY_STRIDE)
1458 case GL_VERTEX_ARRAY_STRIDE:
1459#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1460#if defined(GL_VERTEX_ARRAY_TYPE)
1461 case GL_VERTEX_ARRAY_TYPE:
1462#endif // defined(GL_VERTEX_ARRAY_TYPE)
1463#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1464 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1465#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1466#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1467 case GL_WEIGHT_ARRAY_SIZE_OES:
1468#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1469#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1470 case GL_WEIGHT_ARRAY_STRIDE_OES:
1471#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1472#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1473 case GL_WEIGHT_ARRAY_TYPE_OES:
1474#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1475 _needed = 1;
1476 break;
1477#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1478 case GL_ALIASED_POINT_SIZE_RANGE:
1479#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1480#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1481 case GL_ALIASED_LINE_WIDTH_RANGE:
1482#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1483#if defined(GL_DEPTH_RANGE)
1484 case GL_DEPTH_RANGE:
1485#endif // defined(GL_DEPTH_RANGE)
1486#if defined(GL_MAX_VIEWPORT_DIMS)
1487 case GL_MAX_VIEWPORT_DIMS:
1488#endif // defined(GL_MAX_VIEWPORT_DIMS)
1489#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1490 case GL_SMOOTH_LINE_WIDTH_RANGE:
1491#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1492#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1493 case GL_SMOOTH_POINT_SIZE_RANGE:
1494#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1495 _needed = 2;
1496 break;
1497#if defined(GL_COLOR_CLEAR_VALUE)
1498 case GL_COLOR_CLEAR_VALUE:
1499#endif // defined(GL_COLOR_CLEAR_VALUE)
1500#if defined(GL_COLOR_WRITEMASK)
1501 case GL_COLOR_WRITEMASK:
1502#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001503#if defined(GL_FOG_COLOR)
1504 case GL_FOG_COLOR:
1505#endif // defined(GL_FOG_COLOR)
1506#if defined(GL_LIGHT_MODEL_AMBIENT)
1507 case GL_LIGHT_MODEL_AMBIENT:
1508#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001509#if defined(GL_SCISSOR_BOX)
1510 case GL_SCISSOR_BOX:
1511#endif // defined(GL_SCISSOR_BOX)
1512#if defined(GL_VIEWPORT)
1513 case GL_VIEWPORT:
1514#endif // defined(GL_VIEWPORT)
1515 _needed = 4;
1516 break;
1517#if defined(GL_MODELVIEW_MATRIX)
1518 case GL_MODELVIEW_MATRIX:
1519#endif // defined(GL_MODELVIEW_MATRIX)
1520#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1521 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1522#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1523#if defined(GL_PROJECTION_MATRIX)
1524 case GL_PROJECTION_MATRIX:
1525#endif // defined(GL_PROJECTION_MATRIX)
1526#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1527 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1528#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1529#if defined(GL_TEXTURE_MATRIX)
1530 case GL_TEXTURE_MATRIX:
1531#endif // defined(GL_TEXTURE_MATRIX)
1532#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1533 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1534#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1535 _needed = 16;
1536 break;
1537#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1538 case GL_COMPRESSED_TEXTURE_FORMATS:
1539#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001540 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001541 break;
1542 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001543 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001544 break;
1545 }
1546 if (_remaining < _needed) {
1547 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001548 _exceptionType = "java/lang/IllegalArgumentException";
1549 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001550 goto exit;
1551 }
1552 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001553 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001554 params = params_base + offset;
1555
1556 glGetIntegerv(
1557 (GLenum)pname,
1558 (GLint *)params
1559 );
1560
1561exit:
1562 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001563 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001564 _exception ? JNI_ABORT: 0);
1565 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001566 if (_exception) {
1567 jniThrowException(_env, _exceptionType, _exceptionMessage);
1568 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001569}
1570
1571/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1572static void
1573android_glGetIntegerv__ILjava_nio_IntBuffer_2
1574 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1575 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001576 const char * _exceptionType = NULL;
1577 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001578 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001579 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 jint _remaining;
1581 GLint *params = (GLint *) 0;
1582
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001583 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001584 int _needed;
1585 switch (pname) {
1586#if defined(GL_ALPHA_BITS)
1587 case GL_ALPHA_BITS:
1588#endif // defined(GL_ALPHA_BITS)
1589#if defined(GL_ALPHA_TEST_FUNC)
1590 case GL_ALPHA_TEST_FUNC:
1591#endif // defined(GL_ALPHA_TEST_FUNC)
1592#if defined(GL_ALPHA_TEST_REF)
1593 case GL_ALPHA_TEST_REF:
1594#endif // defined(GL_ALPHA_TEST_REF)
1595#if defined(GL_BLEND_DST)
1596 case GL_BLEND_DST:
1597#endif // defined(GL_BLEND_DST)
1598#if defined(GL_BLUE_BITS)
1599 case GL_BLUE_BITS:
1600#endif // defined(GL_BLUE_BITS)
1601#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1602 case GL_COLOR_ARRAY_BUFFER_BINDING:
1603#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1604#if defined(GL_COLOR_ARRAY_SIZE)
1605 case GL_COLOR_ARRAY_SIZE:
1606#endif // defined(GL_COLOR_ARRAY_SIZE)
1607#if defined(GL_COLOR_ARRAY_STRIDE)
1608 case GL_COLOR_ARRAY_STRIDE:
1609#endif // defined(GL_COLOR_ARRAY_STRIDE)
1610#if defined(GL_COLOR_ARRAY_TYPE)
1611 case GL_COLOR_ARRAY_TYPE:
1612#endif // defined(GL_COLOR_ARRAY_TYPE)
1613#if defined(GL_CULL_FACE)
1614 case GL_CULL_FACE:
1615#endif // defined(GL_CULL_FACE)
1616#if defined(GL_DEPTH_BITS)
1617 case GL_DEPTH_BITS:
1618#endif // defined(GL_DEPTH_BITS)
1619#if defined(GL_DEPTH_CLEAR_VALUE)
1620 case GL_DEPTH_CLEAR_VALUE:
1621#endif // defined(GL_DEPTH_CLEAR_VALUE)
1622#if defined(GL_DEPTH_FUNC)
1623 case GL_DEPTH_FUNC:
1624#endif // defined(GL_DEPTH_FUNC)
1625#if defined(GL_DEPTH_WRITEMASK)
1626 case GL_DEPTH_WRITEMASK:
1627#endif // defined(GL_DEPTH_WRITEMASK)
1628#if defined(GL_FOG_DENSITY)
1629 case GL_FOG_DENSITY:
1630#endif // defined(GL_FOG_DENSITY)
1631#if defined(GL_FOG_END)
1632 case GL_FOG_END:
1633#endif // defined(GL_FOG_END)
1634#if defined(GL_FOG_MODE)
1635 case GL_FOG_MODE:
1636#endif // defined(GL_FOG_MODE)
1637#if defined(GL_FOG_START)
1638 case GL_FOG_START:
1639#endif // defined(GL_FOG_START)
1640#if defined(GL_FRONT_FACE)
1641 case GL_FRONT_FACE:
1642#endif // defined(GL_FRONT_FACE)
1643#if defined(GL_GREEN_BITS)
1644 case GL_GREEN_BITS:
1645#endif // defined(GL_GREEN_BITS)
1646#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1647 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1648#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1649#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1650 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1651#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001652#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1653 case GL_LIGHT_MODEL_COLOR_CONTROL:
1654#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1655#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1656 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1657#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001658#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1659 case GL_LIGHT_MODEL_TWO_SIDE:
1660#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1661#if defined(GL_LINE_SMOOTH_HINT)
1662 case GL_LINE_SMOOTH_HINT:
1663#endif // defined(GL_LINE_SMOOTH_HINT)
1664#if defined(GL_LINE_WIDTH)
1665 case GL_LINE_WIDTH:
1666#endif // defined(GL_LINE_WIDTH)
1667#if defined(GL_LOGIC_OP_MODE)
1668 case GL_LOGIC_OP_MODE:
1669#endif // defined(GL_LOGIC_OP_MODE)
1670#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1671 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1672#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1673#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1674 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1675#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1676#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1677 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1678#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1679#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1680 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1681#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1682#if defined(GL_MATRIX_MODE)
1683 case GL_MATRIX_MODE:
1684#endif // defined(GL_MATRIX_MODE)
1685#if defined(GL_MAX_CLIP_PLANES)
1686 case GL_MAX_CLIP_PLANES:
1687#endif // defined(GL_MAX_CLIP_PLANES)
1688#if defined(GL_MAX_ELEMENTS_INDICES)
1689 case GL_MAX_ELEMENTS_INDICES:
1690#endif // defined(GL_MAX_ELEMENTS_INDICES)
1691#if defined(GL_MAX_ELEMENTS_VERTICES)
1692 case GL_MAX_ELEMENTS_VERTICES:
1693#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1694#if defined(GL_MAX_LIGHTS)
1695 case GL_MAX_LIGHTS:
1696#endif // defined(GL_MAX_LIGHTS)
1697#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1698 case GL_MAX_MODELVIEW_STACK_DEPTH:
1699#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1700#if defined(GL_MAX_PALETTE_MATRICES_OES)
1701 case GL_MAX_PALETTE_MATRICES_OES:
1702#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1703#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1704 case GL_MAX_PROJECTION_STACK_DEPTH:
1705#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1706#if defined(GL_MAX_TEXTURE_SIZE)
1707 case GL_MAX_TEXTURE_SIZE:
1708#endif // defined(GL_MAX_TEXTURE_SIZE)
1709#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1710 case GL_MAX_TEXTURE_STACK_DEPTH:
1711#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1712#if defined(GL_MAX_TEXTURE_UNITS)
1713 case GL_MAX_TEXTURE_UNITS:
1714#endif // defined(GL_MAX_TEXTURE_UNITS)
1715#if defined(GL_MAX_VERTEX_UNITS_OES)
1716 case GL_MAX_VERTEX_UNITS_OES:
1717#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1718#if defined(GL_MODELVIEW_STACK_DEPTH)
1719 case GL_MODELVIEW_STACK_DEPTH:
1720#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1721#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1722 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1723#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1724#if defined(GL_NORMAL_ARRAY_STRIDE)
1725 case GL_NORMAL_ARRAY_STRIDE:
1726#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1727#if defined(GL_NORMAL_ARRAY_TYPE)
1728 case GL_NORMAL_ARRAY_TYPE:
1729#endif // defined(GL_NORMAL_ARRAY_TYPE)
1730#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1731 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1732#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1733#if defined(GL_PACK_ALIGNMENT)
1734 case GL_PACK_ALIGNMENT:
1735#endif // defined(GL_PACK_ALIGNMENT)
1736#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1737 case GL_PERSPECTIVE_CORRECTION_HINT:
1738#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1739#if defined(GL_POINT_SIZE)
1740 case GL_POINT_SIZE:
1741#endif // defined(GL_POINT_SIZE)
1742#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1743 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1744#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1745#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1746 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1747#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1748#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1749 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1750#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1751#if defined(GL_POINT_SMOOTH_HINT)
1752 case GL_POINT_SMOOTH_HINT:
1753#endif // defined(GL_POINT_SMOOTH_HINT)
1754#if defined(GL_POLYGON_OFFSET_FACTOR)
1755 case GL_POLYGON_OFFSET_FACTOR:
1756#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1757#if defined(GL_POLYGON_OFFSET_UNITS)
1758 case GL_POLYGON_OFFSET_UNITS:
1759#endif // defined(GL_POLYGON_OFFSET_UNITS)
1760#if defined(GL_PROJECTION_STACK_DEPTH)
1761 case GL_PROJECTION_STACK_DEPTH:
1762#endif // defined(GL_PROJECTION_STACK_DEPTH)
1763#if defined(GL_RED_BITS)
1764 case GL_RED_BITS:
1765#endif // defined(GL_RED_BITS)
1766#if defined(GL_SHADE_MODEL)
1767 case GL_SHADE_MODEL:
1768#endif // defined(GL_SHADE_MODEL)
1769#if defined(GL_STENCIL_BITS)
1770 case GL_STENCIL_BITS:
1771#endif // defined(GL_STENCIL_BITS)
1772#if defined(GL_STENCIL_CLEAR_VALUE)
1773 case GL_STENCIL_CLEAR_VALUE:
1774#endif // defined(GL_STENCIL_CLEAR_VALUE)
1775#if defined(GL_STENCIL_FAIL)
1776 case GL_STENCIL_FAIL:
1777#endif // defined(GL_STENCIL_FAIL)
1778#if defined(GL_STENCIL_FUNC)
1779 case GL_STENCIL_FUNC:
1780#endif // defined(GL_STENCIL_FUNC)
1781#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1782 case GL_STENCIL_PASS_DEPTH_FAIL:
1783#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1784#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1785 case GL_STENCIL_PASS_DEPTH_PASS:
1786#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1787#if defined(GL_STENCIL_REF)
1788 case GL_STENCIL_REF:
1789#endif // defined(GL_STENCIL_REF)
1790#if defined(GL_STENCIL_VALUE_MASK)
1791 case GL_STENCIL_VALUE_MASK:
1792#endif // defined(GL_STENCIL_VALUE_MASK)
1793#if defined(GL_STENCIL_WRITEMASK)
1794 case GL_STENCIL_WRITEMASK:
1795#endif // defined(GL_STENCIL_WRITEMASK)
1796#if defined(GL_SUBPIXEL_BITS)
1797 case GL_SUBPIXEL_BITS:
1798#endif // defined(GL_SUBPIXEL_BITS)
1799#if defined(GL_TEXTURE_BINDING_2D)
1800 case GL_TEXTURE_BINDING_2D:
1801#endif // defined(GL_TEXTURE_BINDING_2D)
1802#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1803 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1804#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1805#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1806 case GL_TEXTURE_COORD_ARRAY_SIZE:
1807#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1808#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1809 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1810#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1811#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1812 case GL_TEXTURE_COORD_ARRAY_TYPE:
1813#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1814#if defined(GL_TEXTURE_STACK_DEPTH)
1815 case GL_TEXTURE_STACK_DEPTH:
1816#endif // defined(GL_TEXTURE_STACK_DEPTH)
1817#if defined(GL_UNPACK_ALIGNMENT)
1818 case GL_UNPACK_ALIGNMENT:
1819#endif // defined(GL_UNPACK_ALIGNMENT)
1820#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1821 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1822#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1823#if defined(GL_VERTEX_ARRAY_SIZE)
1824 case GL_VERTEX_ARRAY_SIZE:
1825#endif // defined(GL_VERTEX_ARRAY_SIZE)
1826#if defined(GL_VERTEX_ARRAY_STRIDE)
1827 case GL_VERTEX_ARRAY_STRIDE:
1828#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1829#if defined(GL_VERTEX_ARRAY_TYPE)
1830 case GL_VERTEX_ARRAY_TYPE:
1831#endif // defined(GL_VERTEX_ARRAY_TYPE)
1832#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1833 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1834#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1835#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1836 case GL_WEIGHT_ARRAY_SIZE_OES:
1837#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1838#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1839 case GL_WEIGHT_ARRAY_STRIDE_OES:
1840#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1841#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1842 case GL_WEIGHT_ARRAY_TYPE_OES:
1843#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1844 _needed = 1;
1845 break;
1846#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1847 case GL_ALIASED_POINT_SIZE_RANGE:
1848#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1849#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1850 case GL_ALIASED_LINE_WIDTH_RANGE:
1851#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1852#if defined(GL_DEPTH_RANGE)
1853 case GL_DEPTH_RANGE:
1854#endif // defined(GL_DEPTH_RANGE)
1855#if defined(GL_MAX_VIEWPORT_DIMS)
1856 case GL_MAX_VIEWPORT_DIMS:
1857#endif // defined(GL_MAX_VIEWPORT_DIMS)
1858#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1859 case GL_SMOOTH_LINE_WIDTH_RANGE:
1860#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1861#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1862 case GL_SMOOTH_POINT_SIZE_RANGE:
1863#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1864 _needed = 2;
1865 break;
1866#if defined(GL_COLOR_CLEAR_VALUE)
1867 case GL_COLOR_CLEAR_VALUE:
1868#endif // defined(GL_COLOR_CLEAR_VALUE)
1869#if defined(GL_COLOR_WRITEMASK)
1870 case GL_COLOR_WRITEMASK:
1871#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001872#if defined(GL_FOG_COLOR)
1873 case GL_FOG_COLOR:
1874#endif // defined(GL_FOG_COLOR)
1875#if defined(GL_LIGHT_MODEL_AMBIENT)
1876 case GL_LIGHT_MODEL_AMBIENT:
1877#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001878#if defined(GL_SCISSOR_BOX)
1879 case GL_SCISSOR_BOX:
1880#endif // defined(GL_SCISSOR_BOX)
1881#if defined(GL_VIEWPORT)
1882 case GL_VIEWPORT:
1883#endif // defined(GL_VIEWPORT)
1884 _needed = 4;
1885 break;
1886#if defined(GL_MODELVIEW_MATRIX)
1887 case GL_MODELVIEW_MATRIX:
1888#endif // defined(GL_MODELVIEW_MATRIX)
1889#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1890 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1891#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1892#if defined(GL_PROJECTION_MATRIX)
1893 case GL_PROJECTION_MATRIX:
1894#endif // defined(GL_PROJECTION_MATRIX)
1895#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1896 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1897#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1898#if defined(GL_TEXTURE_MATRIX)
1899 case GL_TEXTURE_MATRIX:
1900#endif // defined(GL_TEXTURE_MATRIX)
1901#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1902 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1903#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1904 _needed = 16;
1905 break;
1906#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1907 case GL_COMPRESSED_TEXTURE_FORMATS:
1908#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001909 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001910 break;
1911 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001912 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001913 break;
1914 }
1915 if (_remaining < _needed) {
1916 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001917 _exceptionType = "java/lang/IllegalArgumentException";
1918 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001919 goto exit;
1920 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001921 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001922 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001923 params = (GLint *) (_paramsBase + _bufferOffset);
1924 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001925 glGetIntegerv(
1926 (GLenum)pname,
1927 (GLint *)params
1928 );
1929
1930exit:
1931 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001932 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001933 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001934 if (_exception) {
1935 jniThrowException(_env, _exceptionType, _exceptionMessage);
1936 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001937}
1938
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001939/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001940static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
1941 const char* chars = (const char*) glGetString((GLenum) name);
1942 return _env->NewStringUTF(chars);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001943}
1944/* void glHint ( GLenum target, GLenum mode ) */
1945static void
1946android_glHint__II
1947 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1948 glHint(
1949 (GLenum)target,
1950 (GLenum)mode
1951 );
1952}
1953
1954/* void glLightModelf ( GLenum pname, GLfloat param ) */
1955static void
1956android_glLightModelf__IF
1957 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1958 glLightModelf(
1959 (GLenum)pname,
1960 (GLfloat)param
1961 );
1962}
1963
1964/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1965static void
1966android_glLightModelfv__I_3FI
1967 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001968 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001969 const char * _exceptionType = NULL;
1970 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001971 GLfloat *params_base = (GLfloat *) 0;
1972 jint _remaining;
1973 GLfloat *params = (GLfloat *) 0;
1974
1975 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001976 _exception = 1;
1977 _exceptionType = "java/lang/IllegalArgumentException";
1978 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001979 goto exit;
1980 }
1981 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001982 _exception = 1;
1983 _exceptionType = "java/lang/IllegalArgumentException";
1984 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001985 goto exit;
1986 }
1987 _remaining = _env->GetArrayLength(params_ref) - offset;
1988 int _needed;
1989 switch (pname) {
1990#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1991 case GL_LIGHT_MODEL_TWO_SIDE:
1992#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1993 _needed = 1;
1994 break;
1995#if defined(GL_LIGHT_MODEL_AMBIENT)
1996 case GL_LIGHT_MODEL_AMBIENT:
1997#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1998 _needed = 4;
1999 break;
2000 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002001 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002002 break;
2003 }
2004 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002005 _exception = 1;
2006 _exceptionType = "java/lang/IllegalArgumentException";
2007 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002008 goto exit;
2009 }
2010 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002011 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002012 params = params_base + offset;
2013
2014 glLightModelfv(
2015 (GLenum)pname,
2016 (GLfloat *)params
2017 );
2018
2019exit:
2020 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002021 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002022 JNI_ABORT);
2023 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002024 if (_exception) {
2025 jniThrowException(_env, _exceptionType, _exceptionMessage);
2026 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002027}
2028
2029/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2030static void
2031android_glLightModelfv__ILjava_nio_FloatBuffer_2
2032 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002033 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002034 const char * _exceptionType = NULL;
2035 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002036 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002037 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002038 jint _remaining;
2039 GLfloat *params = (GLfloat *) 0;
2040
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002041 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002042 int _needed;
2043 switch (pname) {
2044#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2045 case GL_LIGHT_MODEL_TWO_SIDE:
2046#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2047 _needed = 1;
2048 break;
2049#if defined(GL_LIGHT_MODEL_AMBIENT)
2050 case GL_LIGHT_MODEL_AMBIENT:
2051#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2052 _needed = 4;
2053 break;
2054 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002055 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002056 break;
2057 }
2058 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002059 _exception = 1;
2060 _exceptionType = "java/lang/IllegalArgumentException";
2061 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002062 goto exit;
2063 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002064 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002065 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002066 params = (GLfloat *) (_paramsBase + _bufferOffset);
2067 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002068 glLightModelfv(
2069 (GLenum)pname,
2070 (GLfloat *)params
2071 );
2072
2073exit:
2074 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002075 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002076 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002077 if (_exception) {
2078 jniThrowException(_env, _exceptionType, _exceptionMessage);
2079 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002080}
2081
2082/* void glLightModelx ( GLenum pname, GLfixed param ) */
2083static void
2084android_glLightModelx__II
2085 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2086 glLightModelx(
2087 (GLenum)pname,
2088 (GLfixed)param
2089 );
2090}
2091
2092/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2093static void
2094android_glLightModelxv__I_3II
2095 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002096 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002097 const char * _exceptionType = NULL;
2098 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002099 GLfixed *params_base = (GLfixed *) 0;
2100 jint _remaining;
2101 GLfixed *params = (GLfixed *) 0;
2102
2103 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002104 _exception = 1;
2105 _exceptionType = "java/lang/IllegalArgumentException";
2106 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002107 goto exit;
2108 }
2109 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002110 _exception = 1;
2111 _exceptionType = "java/lang/IllegalArgumentException";
2112 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002113 goto exit;
2114 }
2115 _remaining = _env->GetArrayLength(params_ref) - offset;
2116 int _needed;
2117 switch (pname) {
2118#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2119 case GL_LIGHT_MODEL_TWO_SIDE:
2120#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2121 _needed = 1;
2122 break;
2123#if defined(GL_LIGHT_MODEL_AMBIENT)
2124 case GL_LIGHT_MODEL_AMBIENT:
2125#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2126 _needed = 4;
2127 break;
2128 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002129 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002130 break;
2131 }
2132 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002133 _exception = 1;
2134 _exceptionType = "java/lang/IllegalArgumentException";
2135 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002136 goto exit;
2137 }
2138 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002139 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002140 params = params_base + offset;
2141
2142 glLightModelxv(
2143 (GLenum)pname,
2144 (GLfixed *)params
2145 );
2146
2147exit:
2148 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002149 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002150 JNI_ABORT);
2151 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002152 if (_exception) {
2153 jniThrowException(_env, _exceptionType, _exceptionMessage);
2154 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002155}
2156
2157/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2158static void
2159android_glLightModelxv__ILjava_nio_IntBuffer_2
2160 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002161 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002162 const char * _exceptionType = NULL;
2163 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002164 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002165 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 jint _remaining;
2167 GLfixed *params = (GLfixed *) 0;
2168
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002169 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002170 int _needed;
2171 switch (pname) {
2172#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2173 case GL_LIGHT_MODEL_TWO_SIDE:
2174#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2175 _needed = 1;
2176 break;
2177#if defined(GL_LIGHT_MODEL_AMBIENT)
2178 case GL_LIGHT_MODEL_AMBIENT:
2179#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2180 _needed = 4;
2181 break;
2182 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002183 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002184 break;
2185 }
2186 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002187 _exception = 1;
2188 _exceptionType = "java/lang/IllegalArgumentException";
2189 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002190 goto exit;
2191 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002192 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002193 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002194 params = (GLfixed *) (_paramsBase + _bufferOffset);
2195 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002196 glLightModelxv(
2197 (GLenum)pname,
2198 (GLfixed *)params
2199 );
2200
2201exit:
2202 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002203 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002204 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002205 if (_exception) {
2206 jniThrowException(_env, _exceptionType, _exceptionMessage);
2207 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002208}
2209
2210/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2211static void
2212android_glLightf__IIF
2213 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2214 glLightf(
2215 (GLenum)light,
2216 (GLenum)pname,
2217 (GLfloat)param
2218 );
2219}
2220
2221/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2222static void
2223android_glLightfv__II_3FI
2224 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002225 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002226 const char * _exceptionType = NULL;
2227 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002228 GLfloat *params_base = (GLfloat *) 0;
2229 jint _remaining;
2230 GLfloat *params = (GLfloat *) 0;
2231
2232 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002233 _exception = 1;
2234 _exceptionType = "java/lang/IllegalArgumentException";
2235 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002236 goto exit;
2237 }
2238 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002239 _exception = 1;
2240 _exceptionType = "java/lang/IllegalArgumentException";
2241 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002242 goto exit;
2243 }
2244 _remaining = _env->GetArrayLength(params_ref) - offset;
2245 int _needed;
2246 switch (pname) {
2247#if defined(GL_SPOT_EXPONENT)
2248 case GL_SPOT_EXPONENT:
2249#endif // defined(GL_SPOT_EXPONENT)
2250#if defined(GL_SPOT_CUTOFF)
2251 case GL_SPOT_CUTOFF:
2252#endif // defined(GL_SPOT_CUTOFF)
2253#if defined(GL_CONSTANT_ATTENUATION)
2254 case GL_CONSTANT_ATTENUATION:
2255#endif // defined(GL_CONSTANT_ATTENUATION)
2256#if defined(GL_LINEAR_ATTENUATION)
2257 case GL_LINEAR_ATTENUATION:
2258#endif // defined(GL_LINEAR_ATTENUATION)
2259#if defined(GL_QUADRATIC_ATTENUATION)
2260 case GL_QUADRATIC_ATTENUATION:
2261#endif // defined(GL_QUADRATIC_ATTENUATION)
2262 _needed = 1;
2263 break;
2264#if defined(GL_SPOT_DIRECTION)
2265 case GL_SPOT_DIRECTION:
2266#endif // defined(GL_SPOT_DIRECTION)
2267 _needed = 3;
2268 break;
2269#if defined(GL_AMBIENT)
2270 case GL_AMBIENT:
2271#endif // defined(GL_AMBIENT)
2272#if defined(GL_DIFFUSE)
2273 case GL_DIFFUSE:
2274#endif // defined(GL_DIFFUSE)
2275#if defined(GL_SPECULAR)
2276 case GL_SPECULAR:
2277#endif // defined(GL_SPECULAR)
2278#if defined(GL_EMISSION)
2279 case GL_EMISSION:
2280#endif // defined(GL_EMISSION)
2281 _needed = 4;
2282 break;
2283 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002284 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002285 break;
2286 }
2287 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002288 _exception = 1;
2289 _exceptionType = "java/lang/IllegalArgumentException";
2290 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002291 goto exit;
2292 }
2293 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002294 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002295 params = params_base + offset;
2296
2297 glLightfv(
2298 (GLenum)light,
2299 (GLenum)pname,
2300 (GLfloat *)params
2301 );
2302
2303exit:
2304 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002305 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002306 JNI_ABORT);
2307 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002308 if (_exception) {
2309 jniThrowException(_env, _exceptionType, _exceptionMessage);
2310 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002311}
2312
2313/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2314static void
2315android_glLightfv__IILjava_nio_FloatBuffer_2
2316 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002317 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002318 const char * _exceptionType = NULL;
2319 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002320 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002321 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002322 jint _remaining;
2323 GLfloat *params = (GLfloat *) 0;
2324
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002325 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002326 int _needed;
2327 switch (pname) {
2328#if defined(GL_SPOT_EXPONENT)
2329 case GL_SPOT_EXPONENT:
2330#endif // defined(GL_SPOT_EXPONENT)
2331#if defined(GL_SPOT_CUTOFF)
2332 case GL_SPOT_CUTOFF:
2333#endif // defined(GL_SPOT_CUTOFF)
2334#if defined(GL_CONSTANT_ATTENUATION)
2335 case GL_CONSTANT_ATTENUATION:
2336#endif // defined(GL_CONSTANT_ATTENUATION)
2337#if defined(GL_LINEAR_ATTENUATION)
2338 case GL_LINEAR_ATTENUATION:
2339#endif // defined(GL_LINEAR_ATTENUATION)
2340#if defined(GL_QUADRATIC_ATTENUATION)
2341 case GL_QUADRATIC_ATTENUATION:
2342#endif // defined(GL_QUADRATIC_ATTENUATION)
2343 _needed = 1;
2344 break;
2345#if defined(GL_SPOT_DIRECTION)
2346 case GL_SPOT_DIRECTION:
2347#endif // defined(GL_SPOT_DIRECTION)
2348 _needed = 3;
2349 break;
2350#if defined(GL_AMBIENT)
2351 case GL_AMBIENT:
2352#endif // defined(GL_AMBIENT)
2353#if defined(GL_DIFFUSE)
2354 case GL_DIFFUSE:
2355#endif // defined(GL_DIFFUSE)
2356#if defined(GL_SPECULAR)
2357 case GL_SPECULAR:
2358#endif // defined(GL_SPECULAR)
2359#if defined(GL_EMISSION)
2360 case GL_EMISSION:
2361#endif // defined(GL_EMISSION)
2362 _needed = 4;
2363 break;
2364 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002365 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002366 break;
2367 }
2368 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002369 _exception = 1;
2370 _exceptionType = "java/lang/IllegalArgumentException";
2371 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002372 goto exit;
2373 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002374 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002375 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002376 params = (GLfloat *) (_paramsBase + _bufferOffset);
2377 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002378 glLightfv(
2379 (GLenum)light,
2380 (GLenum)pname,
2381 (GLfloat *)params
2382 );
2383
2384exit:
2385 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002386 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002387 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002388 if (_exception) {
2389 jniThrowException(_env, _exceptionType, _exceptionMessage);
2390 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002391}
2392
2393/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2394static void
2395android_glLightx__III
2396 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2397 glLightx(
2398 (GLenum)light,
2399 (GLenum)pname,
2400 (GLfixed)param
2401 );
2402}
2403
2404/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2405static void
2406android_glLightxv__II_3II
2407 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002408 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002409 const char * _exceptionType = NULL;
2410 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002411 GLfixed *params_base = (GLfixed *) 0;
2412 jint _remaining;
2413 GLfixed *params = (GLfixed *) 0;
2414
2415 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002416 _exception = 1;
2417 _exceptionType = "java/lang/IllegalArgumentException";
2418 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002419 goto exit;
2420 }
2421 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002422 _exception = 1;
2423 _exceptionType = "java/lang/IllegalArgumentException";
2424 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002425 goto exit;
2426 }
2427 _remaining = _env->GetArrayLength(params_ref) - offset;
2428 int _needed;
2429 switch (pname) {
2430#if defined(GL_SPOT_EXPONENT)
2431 case GL_SPOT_EXPONENT:
2432#endif // defined(GL_SPOT_EXPONENT)
2433#if defined(GL_SPOT_CUTOFF)
2434 case GL_SPOT_CUTOFF:
2435#endif // defined(GL_SPOT_CUTOFF)
2436#if defined(GL_CONSTANT_ATTENUATION)
2437 case GL_CONSTANT_ATTENUATION:
2438#endif // defined(GL_CONSTANT_ATTENUATION)
2439#if defined(GL_LINEAR_ATTENUATION)
2440 case GL_LINEAR_ATTENUATION:
2441#endif // defined(GL_LINEAR_ATTENUATION)
2442#if defined(GL_QUADRATIC_ATTENUATION)
2443 case GL_QUADRATIC_ATTENUATION:
2444#endif // defined(GL_QUADRATIC_ATTENUATION)
2445 _needed = 1;
2446 break;
2447#if defined(GL_SPOT_DIRECTION)
2448 case GL_SPOT_DIRECTION:
2449#endif // defined(GL_SPOT_DIRECTION)
2450 _needed = 3;
2451 break;
2452#if defined(GL_AMBIENT)
2453 case GL_AMBIENT:
2454#endif // defined(GL_AMBIENT)
2455#if defined(GL_DIFFUSE)
2456 case GL_DIFFUSE:
2457#endif // defined(GL_DIFFUSE)
2458#if defined(GL_SPECULAR)
2459 case GL_SPECULAR:
2460#endif // defined(GL_SPECULAR)
2461#if defined(GL_EMISSION)
2462 case GL_EMISSION:
2463#endif // defined(GL_EMISSION)
2464 _needed = 4;
2465 break;
2466 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002467 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002468 break;
2469 }
2470 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002471 _exception = 1;
2472 _exceptionType = "java/lang/IllegalArgumentException";
2473 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002474 goto exit;
2475 }
2476 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002477 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002478 params = params_base + offset;
2479
2480 glLightxv(
2481 (GLenum)light,
2482 (GLenum)pname,
2483 (GLfixed *)params
2484 );
2485
2486exit:
2487 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002488 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002489 JNI_ABORT);
2490 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002491 if (_exception) {
2492 jniThrowException(_env, _exceptionType, _exceptionMessage);
2493 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002494}
2495
2496/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2497static void
2498android_glLightxv__IILjava_nio_IntBuffer_2
2499 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002500 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002501 const char * _exceptionType = NULL;
2502 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002503 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002504 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505 jint _remaining;
2506 GLfixed *params = (GLfixed *) 0;
2507
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002508 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002509 int _needed;
2510 switch (pname) {
2511#if defined(GL_SPOT_EXPONENT)
2512 case GL_SPOT_EXPONENT:
2513#endif // defined(GL_SPOT_EXPONENT)
2514#if defined(GL_SPOT_CUTOFF)
2515 case GL_SPOT_CUTOFF:
2516#endif // defined(GL_SPOT_CUTOFF)
2517#if defined(GL_CONSTANT_ATTENUATION)
2518 case GL_CONSTANT_ATTENUATION:
2519#endif // defined(GL_CONSTANT_ATTENUATION)
2520#if defined(GL_LINEAR_ATTENUATION)
2521 case GL_LINEAR_ATTENUATION:
2522#endif // defined(GL_LINEAR_ATTENUATION)
2523#if defined(GL_QUADRATIC_ATTENUATION)
2524 case GL_QUADRATIC_ATTENUATION:
2525#endif // defined(GL_QUADRATIC_ATTENUATION)
2526 _needed = 1;
2527 break;
2528#if defined(GL_SPOT_DIRECTION)
2529 case GL_SPOT_DIRECTION:
2530#endif // defined(GL_SPOT_DIRECTION)
2531 _needed = 3;
2532 break;
2533#if defined(GL_AMBIENT)
2534 case GL_AMBIENT:
2535#endif // defined(GL_AMBIENT)
2536#if defined(GL_DIFFUSE)
2537 case GL_DIFFUSE:
2538#endif // defined(GL_DIFFUSE)
2539#if defined(GL_SPECULAR)
2540 case GL_SPECULAR:
2541#endif // defined(GL_SPECULAR)
2542#if defined(GL_EMISSION)
2543 case GL_EMISSION:
2544#endif // defined(GL_EMISSION)
2545 _needed = 4;
2546 break;
2547 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002548 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002549 break;
2550 }
2551 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002552 _exception = 1;
2553 _exceptionType = "java/lang/IllegalArgumentException";
2554 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 goto exit;
2556 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002557 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002558 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002559 params = (GLfixed *) (_paramsBase + _bufferOffset);
2560 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002561 glLightxv(
2562 (GLenum)light,
2563 (GLenum)pname,
2564 (GLfixed *)params
2565 );
2566
2567exit:
2568 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002569 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002570 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002571 if (_exception) {
2572 jniThrowException(_env, _exceptionType, _exceptionMessage);
2573 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002574}
2575
2576/* void glLineWidth ( GLfloat width ) */
2577static void
2578android_glLineWidth__F
2579 (JNIEnv *_env, jobject _this, jfloat width) {
2580 glLineWidth(
2581 (GLfloat)width
2582 );
2583}
2584
2585/* void glLineWidthx ( GLfixed width ) */
2586static void
2587android_glLineWidthx__I
2588 (JNIEnv *_env, jobject _this, jint width) {
2589 glLineWidthx(
2590 (GLfixed)width
2591 );
2592}
2593
2594/* void glLoadIdentity ( void ) */
2595static void
2596android_glLoadIdentity__
2597 (JNIEnv *_env, jobject _this) {
2598 glLoadIdentity();
2599}
2600
2601/* void glLoadMatrixf ( const GLfloat *m ) */
2602static void
2603android_glLoadMatrixf___3FI
2604 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002605 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002606 const char * _exceptionType = NULL;
2607 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002608 GLfloat *m_base = (GLfloat *) 0;
2609 jint _remaining;
2610 GLfloat *m = (GLfloat *) 0;
2611
2612 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002613 _exception = 1;
2614 _exceptionType = "java/lang/IllegalArgumentException";
2615 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002616 goto exit;
2617 }
2618 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002619 _exception = 1;
2620 _exceptionType = "java/lang/IllegalArgumentException";
2621 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002622 goto exit;
2623 }
2624 _remaining = _env->GetArrayLength(m_ref) - offset;
2625 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002626 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002627 m = m_base + offset;
2628
2629 glLoadMatrixf(
2630 (GLfloat *)m
2631 );
2632
2633exit:
2634 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002635 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002636 JNI_ABORT);
2637 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002638 if (_exception) {
2639 jniThrowException(_env, _exceptionType, _exceptionMessage);
2640 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002641}
2642
2643/* void glLoadMatrixf ( const GLfloat *m ) */
2644static void
2645android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2646 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002647 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002648 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002649 jint _remaining;
2650 GLfloat *m = (GLfloat *) 0;
2651
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002652 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002653 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002654 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002655 m = (GLfloat *) (_mBase + _bufferOffset);
2656 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002657 glLoadMatrixf(
2658 (GLfloat *)m
2659 );
2660 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002661 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002662 }
2663}
2664
2665/* void glLoadMatrixx ( const GLfixed *m ) */
2666static void
2667android_glLoadMatrixx___3II
2668 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002669 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002670 const char * _exceptionType = NULL;
2671 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002672 GLfixed *m_base = (GLfixed *) 0;
2673 jint _remaining;
2674 GLfixed *m = (GLfixed *) 0;
2675
2676 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002677 _exception = 1;
2678 _exceptionType = "java/lang/IllegalArgumentException";
2679 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002680 goto exit;
2681 }
2682 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002683 _exception = 1;
2684 _exceptionType = "java/lang/IllegalArgumentException";
2685 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 goto exit;
2687 }
2688 _remaining = _env->GetArrayLength(m_ref) - offset;
2689 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002690 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002691 m = m_base + offset;
2692
2693 glLoadMatrixx(
2694 (GLfixed *)m
2695 );
2696
2697exit:
2698 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002699 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002700 JNI_ABORT);
2701 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002702 if (_exception) {
2703 jniThrowException(_env, _exceptionType, _exceptionMessage);
2704 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002705}
2706
2707/* void glLoadMatrixx ( const GLfixed *m ) */
2708static void
2709android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2710 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002711 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002712 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002713 jint _remaining;
2714 GLfixed *m = (GLfixed *) 0;
2715
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002716 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002717 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002718 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002719 m = (GLfixed *) (_mBase + _bufferOffset);
2720 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721 glLoadMatrixx(
2722 (GLfixed *)m
2723 );
2724 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002725 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002726 }
2727}
2728
2729/* void glLogicOp ( GLenum opcode ) */
2730static void
2731android_glLogicOp__I
2732 (JNIEnv *_env, jobject _this, jint opcode) {
2733 glLogicOp(
2734 (GLenum)opcode
2735 );
2736}
2737
2738/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2739static void
2740android_glMaterialf__IIF
2741 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2742 glMaterialf(
2743 (GLenum)face,
2744 (GLenum)pname,
2745 (GLfloat)param
2746 );
2747}
2748
2749/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2750static void
2751android_glMaterialfv__II_3FI
2752 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002753 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002754 const char * _exceptionType = NULL;
2755 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002756 GLfloat *params_base = (GLfloat *) 0;
2757 jint _remaining;
2758 GLfloat *params = (GLfloat *) 0;
2759
2760 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002761 _exception = 1;
2762 _exceptionType = "java/lang/IllegalArgumentException";
2763 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002764 goto exit;
2765 }
2766 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002767 _exception = 1;
2768 _exceptionType = "java/lang/IllegalArgumentException";
2769 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002770 goto exit;
2771 }
2772 _remaining = _env->GetArrayLength(params_ref) - offset;
2773 int _needed;
2774 switch (pname) {
2775#if defined(GL_SHININESS)
2776 case GL_SHININESS:
2777#endif // defined(GL_SHININESS)
2778 _needed = 1;
2779 break;
2780#if defined(GL_AMBIENT)
2781 case GL_AMBIENT:
2782#endif // defined(GL_AMBIENT)
2783#if defined(GL_DIFFUSE)
2784 case GL_DIFFUSE:
2785#endif // defined(GL_DIFFUSE)
2786#if defined(GL_SPECULAR)
2787 case GL_SPECULAR:
2788#endif // defined(GL_SPECULAR)
2789#if defined(GL_EMISSION)
2790 case GL_EMISSION:
2791#endif // defined(GL_EMISSION)
2792#if defined(GL_AMBIENT_AND_DIFFUSE)
2793 case GL_AMBIENT_AND_DIFFUSE:
2794#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2795 _needed = 4;
2796 break;
2797 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002798 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002799 break;
2800 }
2801 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002802 _exception = 1;
2803 _exceptionType = "java/lang/IllegalArgumentException";
2804 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002805 goto exit;
2806 }
2807 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002808 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002809 params = params_base + offset;
2810
2811 glMaterialfv(
2812 (GLenum)face,
2813 (GLenum)pname,
2814 (GLfloat *)params
2815 );
2816
2817exit:
2818 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002819 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002820 JNI_ABORT);
2821 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002822 if (_exception) {
2823 jniThrowException(_env, _exceptionType, _exceptionMessage);
2824 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002825}
2826
2827/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2828static void
2829android_glMaterialfv__IILjava_nio_FloatBuffer_2
2830 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002831 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002832 const char * _exceptionType = NULL;
2833 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002834 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002835 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002836 jint _remaining;
2837 GLfloat *params = (GLfloat *) 0;
2838
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002839 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002840 int _needed;
2841 switch (pname) {
2842#if defined(GL_SHININESS)
2843 case GL_SHININESS:
2844#endif // defined(GL_SHININESS)
2845 _needed = 1;
2846 break;
2847#if defined(GL_AMBIENT)
2848 case GL_AMBIENT:
2849#endif // defined(GL_AMBIENT)
2850#if defined(GL_DIFFUSE)
2851 case GL_DIFFUSE:
2852#endif // defined(GL_DIFFUSE)
2853#if defined(GL_SPECULAR)
2854 case GL_SPECULAR:
2855#endif // defined(GL_SPECULAR)
2856#if defined(GL_EMISSION)
2857 case GL_EMISSION:
2858#endif // defined(GL_EMISSION)
2859#if defined(GL_AMBIENT_AND_DIFFUSE)
2860 case GL_AMBIENT_AND_DIFFUSE:
2861#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2862 _needed = 4;
2863 break;
2864 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002865 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002866 break;
2867 }
2868 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002869 _exception = 1;
2870 _exceptionType = "java/lang/IllegalArgumentException";
2871 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002872 goto exit;
2873 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002874 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002875 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002876 params = (GLfloat *) (_paramsBase + _bufferOffset);
2877 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878 glMaterialfv(
2879 (GLenum)face,
2880 (GLenum)pname,
2881 (GLfloat *)params
2882 );
2883
2884exit:
2885 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002886 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002888 if (_exception) {
2889 jniThrowException(_env, _exceptionType, _exceptionMessage);
2890 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002891}
2892
2893/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2894static void
2895android_glMaterialx__III
2896 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2897 glMaterialx(
2898 (GLenum)face,
2899 (GLenum)pname,
2900 (GLfixed)param
2901 );
2902}
2903
2904/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2905static void
2906android_glMaterialxv__II_3II
2907 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002908 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002909 const char * _exceptionType = NULL;
2910 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002911 GLfixed *params_base = (GLfixed *) 0;
2912 jint _remaining;
2913 GLfixed *params = (GLfixed *) 0;
2914
2915 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002916 _exception = 1;
2917 _exceptionType = "java/lang/IllegalArgumentException";
2918 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002919 goto exit;
2920 }
2921 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002922 _exception = 1;
2923 _exceptionType = "java/lang/IllegalArgumentException";
2924 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002925 goto exit;
2926 }
2927 _remaining = _env->GetArrayLength(params_ref) - offset;
2928 int _needed;
2929 switch (pname) {
2930#if defined(GL_SHININESS)
2931 case GL_SHININESS:
2932#endif // defined(GL_SHININESS)
2933 _needed = 1;
2934 break;
2935#if defined(GL_AMBIENT)
2936 case GL_AMBIENT:
2937#endif // defined(GL_AMBIENT)
2938#if defined(GL_DIFFUSE)
2939 case GL_DIFFUSE:
2940#endif // defined(GL_DIFFUSE)
2941#if defined(GL_SPECULAR)
2942 case GL_SPECULAR:
2943#endif // defined(GL_SPECULAR)
2944#if defined(GL_EMISSION)
2945 case GL_EMISSION:
2946#endif // defined(GL_EMISSION)
2947#if defined(GL_AMBIENT_AND_DIFFUSE)
2948 case GL_AMBIENT_AND_DIFFUSE:
2949#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2950 _needed = 4;
2951 break;
2952 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002953 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002954 break;
2955 }
2956 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002957 _exception = 1;
2958 _exceptionType = "java/lang/IllegalArgumentException";
2959 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002960 goto exit;
2961 }
2962 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002963 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002964 params = params_base + offset;
2965
2966 glMaterialxv(
2967 (GLenum)face,
2968 (GLenum)pname,
2969 (GLfixed *)params
2970 );
2971
2972exit:
2973 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002974 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002975 JNI_ABORT);
2976 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002977 if (_exception) {
2978 jniThrowException(_env, _exceptionType, _exceptionMessage);
2979 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002980}
2981
2982/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2983static void
2984android_glMaterialxv__IILjava_nio_IntBuffer_2
2985 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002986 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002987 const char * _exceptionType = NULL;
2988 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002989 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002990 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002991 jint _remaining;
2992 GLfixed *params = (GLfixed *) 0;
2993
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002994 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002995 int _needed;
2996 switch (pname) {
2997#if defined(GL_SHININESS)
2998 case GL_SHININESS:
2999#endif // defined(GL_SHININESS)
3000 _needed = 1;
3001 break;
3002#if defined(GL_AMBIENT)
3003 case GL_AMBIENT:
3004#endif // defined(GL_AMBIENT)
3005#if defined(GL_DIFFUSE)
3006 case GL_DIFFUSE:
3007#endif // defined(GL_DIFFUSE)
3008#if defined(GL_SPECULAR)
3009 case GL_SPECULAR:
3010#endif // defined(GL_SPECULAR)
3011#if defined(GL_EMISSION)
3012 case GL_EMISSION:
3013#endif // defined(GL_EMISSION)
3014#if defined(GL_AMBIENT_AND_DIFFUSE)
3015 case GL_AMBIENT_AND_DIFFUSE:
3016#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3017 _needed = 4;
3018 break;
3019 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003020 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003021 break;
3022 }
3023 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003024 _exception = 1;
3025 _exceptionType = "java/lang/IllegalArgumentException";
3026 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003027 goto exit;
3028 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003029 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003030 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003031 params = (GLfixed *) (_paramsBase + _bufferOffset);
3032 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003033 glMaterialxv(
3034 (GLenum)face,
3035 (GLenum)pname,
3036 (GLfixed *)params
3037 );
3038
3039exit:
3040 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003041 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003042 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003043 if (_exception) {
3044 jniThrowException(_env, _exceptionType, _exceptionMessage);
3045 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003046}
3047
3048/* void glMatrixMode ( GLenum mode ) */
3049static void
3050android_glMatrixMode__I
3051 (JNIEnv *_env, jobject _this, jint mode) {
3052 glMatrixMode(
3053 (GLenum)mode
3054 );
3055}
3056
3057/* void glMultMatrixf ( const GLfloat *m ) */
3058static void
3059android_glMultMatrixf___3FI
3060 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003061 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003062 const char * _exceptionType = NULL;
3063 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003064 GLfloat *m_base = (GLfloat *) 0;
3065 jint _remaining;
3066 GLfloat *m = (GLfloat *) 0;
3067
3068 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003069 _exception = 1;
3070 _exceptionType = "java/lang/IllegalArgumentException";
3071 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003072 goto exit;
3073 }
3074 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003075 _exception = 1;
3076 _exceptionType = "java/lang/IllegalArgumentException";
3077 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003078 goto exit;
3079 }
3080 _remaining = _env->GetArrayLength(m_ref) - offset;
3081 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003082 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003083 m = m_base + offset;
3084
3085 glMultMatrixf(
3086 (GLfloat *)m
3087 );
3088
3089exit:
3090 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003091 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003092 JNI_ABORT);
3093 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003094 if (_exception) {
3095 jniThrowException(_env, _exceptionType, _exceptionMessage);
3096 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003097}
3098
3099/* void glMultMatrixf ( const GLfloat *m ) */
3100static void
3101android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3102 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003103 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003104 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003105 jint _remaining;
3106 GLfloat *m = (GLfloat *) 0;
3107
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003108 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003109 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003110 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003111 m = (GLfloat *) (_mBase + _bufferOffset);
3112 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003113 glMultMatrixf(
3114 (GLfloat *)m
3115 );
3116 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003117 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003118 }
3119}
3120
3121/* void glMultMatrixx ( const GLfixed *m ) */
3122static void
3123android_glMultMatrixx___3II
3124 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003125 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003126 const char * _exceptionType = NULL;
3127 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003128 GLfixed *m_base = (GLfixed *) 0;
3129 jint _remaining;
3130 GLfixed *m = (GLfixed *) 0;
3131
3132 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003133 _exception = 1;
3134 _exceptionType = "java/lang/IllegalArgumentException";
3135 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003136 goto exit;
3137 }
3138 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003139 _exception = 1;
3140 _exceptionType = "java/lang/IllegalArgumentException";
3141 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003142 goto exit;
3143 }
3144 _remaining = _env->GetArrayLength(m_ref) - offset;
3145 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003146 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003147 m = m_base + offset;
3148
3149 glMultMatrixx(
3150 (GLfixed *)m
3151 );
3152
3153exit:
3154 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003155 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003156 JNI_ABORT);
3157 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003158 if (_exception) {
3159 jniThrowException(_env, _exceptionType, _exceptionMessage);
3160 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161}
3162
3163/* void glMultMatrixx ( const GLfixed *m ) */
3164static void
3165android_glMultMatrixx__Ljava_nio_IntBuffer_2
3166 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003167 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003168 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003169 jint _remaining;
3170 GLfixed *m = (GLfixed *) 0;
3171
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003172 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003173 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003174 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003175 m = (GLfixed *) (_mBase + _bufferOffset);
3176 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003177 glMultMatrixx(
3178 (GLfixed *)m
3179 );
3180 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003181 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003182 }
3183}
3184
3185/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3186static void
3187android_glMultiTexCoord4f__IFFFF
3188 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3189 glMultiTexCoord4f(
3190 (GLenum)target,
3191 (GLfloat)s,
3192 (GLfloat)t,
3193 (GLfloat)r,
3194 (GLfloat)q
3195 );
3196}
3197
3198/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3199static void
3200android_glMultiTexCoord4x__IIIII
3201 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3202 glMultiTexCoord4x(
3203 (GLenum)target,
3204 (GLfixed)s,
3205 (GLfixed)t,
3206 (GLfixed)r,
3207 (GLfixed)q
3208 );
3209}
3210
3211/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3212static void
3213android_glNormal3f__FFF
3214 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3215 glNormal3f(
3216 (GLfloat)nx,
3217 (GLfloat)ny,
3218 (GLfloat)nz
3219 );
3220}
3221
3222/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3223static void
3224android_glNormal3x__III
3225 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3226 glNormal3x(
3227 (GLfixed)nx,
3228 (GLfixed)ny,
3229 (GLfixed)nz
3230 );
3231}
3232
3233/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3234static void
3235android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3236 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
3237 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003238 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003239 jint _remaining;
3240 GLvoid *pointer = (GLvoid *) 0;
3241
Jack Paleviche20ea782009-05-07 18:28:29 -07003242 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003243 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003244 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003245 return;
3246 }
3247 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003248 glNormalPointerBounds(
3249 (GLenum)type,
3250 (GLsizei)stride,
3251 (GLvoid *)pointer,
3252 (GLsizei)remaining
3253 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003254}
3255
3256/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3257static void
3258android_glOrthof__FFFFFF
3259 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3260 glOrthof(
3261 (GLfloat)left,
3262 (GLfloat)right,
3263 (GLfloat)bottom,
3264 (GLfloat)top,
3265 (GLfloat)zNear,
3266 (GLfloat)zFar
3267 );
3268}
3269
3270/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3271static void
3272android_glOrthox__IIIIII
3273 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3274 glOrthox(
3275 (GLfixed)left,
3276 (GLfixed)right,
3277 (GLfixed)bottom,
3278 (GLfixed)top,
3279 (GLfixed)zNear,
3280 (GLfixed)zFar
3281 );
3282}
3283
3284/* void glPixelStorei ( GLenum pname, GLint param ) */
3285static void
3286android_glPixelStorei__II
3287 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3288 glPixelStorei(
3289 (GLenum)pname,
3290 (GLint)param
3291 );
3292}
3293
3294/* void glPointSize ( GLfloat size ) */
3295static void
3296android_glPointSize__F
3297 (JNIEnv *_env, jobject _this, jfloat size) {
3298 glPointSize(
3299 (GLfloat)size
3300 );
3301}
3302
3303/* void glPointSizex ( GLfixed size ) */
3304static void
3305android_glPointSizex__I
3306 (JNIEnv *_env, jobject _this, jint size) {
3307 glPointSizex(
3308 (GLfixed)size
3309 );
3310}
3311
3312/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3313static void
3314android_glPolygonOffset__FF
3315 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3316 glPolygonOffset(
3317 (GLfloat)factor,
3318 (GLfloat)units
3319 );
3320}
3321
3322/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3323static void
3324android_glPolygonOffsetx__II
3325 (JNIEnv *_env, jobject _this, jint factor, jint units) {
3326 glPolygonOffsetx(
3327 (GLfixed)factor,
3328 (GLfixed)units
3329 );
3330}
3331
3332/* void glPopMatrix ( void ) */
3333static void
3334android_glPopMatrix__
3335 (JNIEnv *_env, jobject _this) {
3336 glPopMatrix();
3337}
3338
3339/* void glPushMatrix ( void ) */
3340static void
3341android_glPushMatrix__
3342 (JNIEnv *_env, jobject _this) {
3343 glPushMatrix();
3344}
3345
3346/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3347static void
3348android_glReadPixels__IIIIIILjava_nio_Buffer_2
3349 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003350 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003351 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003352 jint _remaining;
3353 GLvoid *pixels = (GLvoid *) 0;
3354
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003355 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003356 if (pixels == NULL) {
3357 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3358 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3359 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003360 glReadPixels(
3361 (GLint)x,
3362 (GLint)y,
3363 (GLsizei)width,
3364 (GLsizei)height,
3365 (GLenum)format,
3366 (GLenum)type,
3367 (GLvoid *)pixels
3368 );
3369 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003370 releasePointer(_env, _array, pixels, JNI_TRUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003371 }
3372}
3373
3374/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3375static void
3376android_glRotatef__FFFF
3377 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3378 glRotatef(
3379 (GLfloat)angle,
3380 (GLfloat)x,
3381 (GLfloat)y,
3382 (GLfloat)z
3383 );
3384}
3385
3386/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3387static void
3388android_glRotatex__IIII
3389 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3390 glRotatex(
3391 (GLfixed)angle,
3392 (GLfixed)x,
3393 (GLfixed)y,
3394 (GLfixed)z
3395 );
3396}
3397
3398/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3399static void
3400android_glSampleCoverage__FZ
3401 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3402 glSampleCoverage(
3403 (GLclampf)value,
3404 (GLboolean)invert
3405 );
3406}
3407
3408/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3409static void
3410android_glSampleCoveragex__IZ
3411 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3412 glSampleCoveragex(
3413 (GLclampx)value,
3414 (GLboolean)invert
3415 );
3416}
3417
3418/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3419static void
3420android_glScalef__FFF
3421 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3422 glScalef(
3423 (GLfloat)x,
3424 (GLfloat)y,
3425 (GLfloat)z
3426 );
3427}
3428
3429/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3430static void
3431android_glScalex__III
3432 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3433 glScalex(
3434 (GLfixed)x,
3435 (GLfixed)y,
3436 (GLfixed)z
3437 );
3438}
3439
3440/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3441static void
3442android_glScissor__IIII
3443 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3444 glScissor(
3445 (GLint)x,
3446 (GLint)y,
3447 (GLsizei)width,
3448 (GLsizei)height
3449 );
3450}
3451
3452/* void glShadeModel ( GLenum mode ) */
3453static void
3454android_glShadeModel__I
3455 (JNIEnv *_env, jobject _this, jint mode) {
3456 glShadeModel(
3457 (GLenum)mode
3458 );
3459}
3460
3461/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3462static void
3463android_glStencilFunc__III
3464 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3465 glStencilFunc(
3466 (GLenum)func,
3467 (GLint)ref,
3468 (GLuint)mask
3469 );
3470}
3471
3472/* void glStencilMask ( GLuint mask ) */
3473static void
3474android_glStencilMask__I
3475 (JNIEnv *_env, jobject _this, jint mask) {
3476 glStencilMask(
3477 (GLuint)mask
3478 );
3479}
3480
3481/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3482static void
3483android_glStencilOp__III
3484 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3485 glStencilOp(
3486 (GLenum)fail,
3487 (GLenum)zfail,
3488 (GLenum)zpass
3489 );
3490}
3491
3492/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3493static void
3494android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3495 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3496 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003497 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003498 jint _remaining;
3499 GLvoid *pointer = (GLvoid *) 0;
3500
Jack Paleviche20ea782009-05-07 18:28:29 -07003501 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003502 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003503 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003504 return;
3505 }
3506 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003507 glTexCoordPointerBounds(
3508 (GLint)size,
3509 (GLenum)type,
3510 (GLsizei)stride,
3511 (GLvoid *)pointer,
3512 (GLsizei)remaining
3513 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003514}
3515
3516/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3517static void
3518android_glTexEnvf__IIF
3519 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3520 glTexEnvf(
3521 (GLenum)target,
3522 (GLenum)pname,
3523 (GLfloat)param
3524 );
3525}
3526
3527/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3528static void
3529android_glTexEnvfv__II_3FI
3530 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003531 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003532 const char * _exceptionType = NULL;
3533 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003534 GLfloat *params_base = (GLfloat *) 0;
3535 jint _remaining;
3536 GLfloat *params = (GLfloat *) 0;
3537
3538 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003539 _exception = 1;
3540 _exceptionType = "java/lang/IllegalArgumentException";
3541 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003542 goto exit;
3543 }
3544 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003545 _exception = 1;
3546 _exceptionType = "java/lang/IllegalArgumentException";
3547 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003548 goto exit;
3549 }
3550 _remaining = _env->GetArrayLength(params_ref) - offset;
3551 int _needed;
3552 switch (pname) {
3553#if defined(GL_TEXTURE_ENV_MODE)
3554 case GL_TEXTURE_ENV_MODE:
3555#endif // defined(GL_TEXTURE_ENV_MODE)
3556#if defined(GL_COMBINE_RGB)
3557 case GL_COMBINE_RGB:
3558#endif // defined(GL_COMBINE_RGB)
3559#if defined(GL_COMBINE_ALPHA)
3560 case GL_COMBINE_ALPHA:
3561#endif // defined(GL_COMBINE_ALPHA)
3562 _needed = 1;
3563 break;
3564#if defined(GL_TEXTURE_ENV_COLOR)
3565 case GL_TEXTURE_ENV_COLOR:
3566#endif // defined(GL_TEXTURE_ENV_COLOR)
3567 _needed = 4;
3568 break;
3569 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003570 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003571 break;
3572 }
3573 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003574 _exception = 1;
3575 _exceptionType = "java/lang/IllegalArgumentException";
3576 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003577 goto exit;
3578 }
3579 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003580 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003581 params = params_base + offset;
3582
3583 glTexEnvfv(
3584 (GLenum)target,
3585 (GLenum)pname,
3586 (GLfloat *)params
3587 );
3588
3589exit:
3590 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003591 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003592 JNI_ABORT);
3593 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003594 if (_exception) {
3595 jniThrowException(_env, _exceptionType, _exceptionMessage);
3596 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003597}
3598
3599/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3600static void
3601android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3602 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003603 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003604 const char * _exceptionType = NULL;
3605 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003606 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003607 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003608 jint _remaining;
3609 GLfloat *params = (GLfloat *) 0;
3610
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003611 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003612 int _needed;
3613 switch (pname) {
3614#if defined(GL_TEXTURE_ENV_MODE)
3615 case GL_TEXTURE_ENV_MODE:
3616#endif // defined(GL_TEXTURE_ENV_MODE)
3617#if defined(GL_COMBINE_RGB)
3618 case GL_COMBINE_RGB:
3619#endif // defined(GL_COMBINE_RGB)
3620#if defined(GL_COMBINE_ALPHA)
3621 case GL_COMBINE_ALPHA:
3622#endif // defined(GL_COMBINE_ALPHA)
3623 _needed = 1;
3624 break;
3625#if defined(GL_TEXTURE_ENV_COLOR)
3626 case GL_TEXTURE_ENV_COLOR:
3627#endif // defined(GL_TEXTURE_ENV_COLOR)
3628 _needed = 4;
3629 break;
3630 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003631 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003632 break;
3633 }
3634 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003635 _exception = 1;
3636 _exceptionType = "java/lang/IllegalArgumentException";
3637 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003638 goto exit;
3639 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003640 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003641 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003642 params = (GLfloat *) (_paramsBase + _bufferOffset);
3643 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003644 glTexEnvfv(
3645 (GLenum)target,
3646 (GLenum)pname,
3647 (GLfloat *)params
3648 );
3649
3650exit:
3651 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003652 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003653 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003654 if (_exception) {
3655 jniThrowException(_env, _exceptionType, _exceptionMessage);
3656 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003657}
3658
3659/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3660static void
3661android_glTexEnvx__III
3662 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3663 glTexEnvx(
3664 (GLenum)target,
3665 (GLenum)pname,
3666 (GLfixed)param
3667 );
3668}
3669
3670/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3671static void
3672android_glTexEnvxv__II_3II
3673 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003674 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003675 const char * _exceptionType = NULL;
3676 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003677 GLfixed *params_base = (GLfixed *) 0;
3678 jint _remaining;
3679 GLfixed *params = (GLfixed *) 0;
3680
3681 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003682 _exception = 1;
3683 _exceptionType = "java/lang/IllegalArgumentException";
3684 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003685 goto exit;
3686 }
3687 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003688 _exception = 1;
3689 _exceptionType = "java/lang/IllegalArgumentException";
3690 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003691 goto exit;
3692 }
3693 _remaining = _env->GetArrayLength(params_ref) - offset;
3694 int _needed;
3695 switch (pname) {
3696#if defined(GL_TEXTURE_ENV_MODE)
3697 case GL_TEXTURE_ENV_MODE:
3698#endif // defined(GL_TEXTURE_ENV_MODE)
3699#if defined(GL_COMBINE_RGB)
3700 case GL_COMBINE_RGB:
3701#endif // defined(GL_COMBINE_RGB)
3702#if defined(GL_COMBINE_ALPHA)
3703 case GL_COMBINE_ALPHA:
3704#endif // defined(GL_COMBINE_ALPHA)
3705 _needed = 1;
3706 break;
3707#if defined(GL_TEXTURE_ENV_COLOR)
3708 case GL_TEXTURE_ENV_COLOR:
3709#endif // defined(GL_TEXTURE_ENV_COLOR)
3710 _needed = 4;
3711 break;
3712 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003713 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003714 break;
3715 }
3716 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003717 _exception = 1;
3718 _exceptionType = "java/lang/IllegalArgumentException";
3719 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003720 goto exit;
3721 }
3722 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003723 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003724 params = params_base + offset;
3725
3726 glTexEnvxv(
3727 (GLenum)target,
3728 (GLenum)pname,
3729 (GLfixed *)params
3730 );
3731
3732exit:
3733 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003734 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003735 JNI_ABORT);
3736 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003737 if (_exception) {
3738 jniThrowException(_env, _exceptionType, _exceptionMessage);
3739 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003740}
3741
3742/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3743static void
3744android_glTexEnvxv__IILjava_nio_IntBuffer_2
3745 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003746 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003747 const char * _exceptionType = NULL;
3748 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003749 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003750 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003751 jint _remaining;
3752 GLfixed *params = (GLfixed *) 0;
3753
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003754 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003755 int _needed;
3756 switch (pname) {
3757#if defined(GL_TEXTURE_ENV_MODE)
3758 case GL_TEXTURE_ENV_MODE:
3759#endif // defined(GL_TEXTURE_ENV_MODE)
3760#if defined(GL_COMBINE_RGB)
3761 case GL_COMBINE_RGB:
3762#endif // defined(GL_COMBINE_RGB)
3763#if defined(GL_COMBINE_ALPHA)
3764 case GL_COMBINE_ALPHA:
3765#endif // defined(GL_COMBINE_ALPHA)
3766 _needed = 1;
3767 break;
3768#if defined(GL_TEXTURE_ENV_COLOR)
3769 case GL_TEXTURE_ENV_COLOR:
3770#endif // defined(GL_TEXTURE_ENV_COLOR)
3771 _needed = 4;
3772 break;
3773 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003774 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003775 break;
3776 }
3777 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003778 _exception = 1;
3779 _exceptionType = "java/lang/IllegalArgumentException";
3780 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003781 goto exit;
3782 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003783 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003784 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003785 params = (GLfixed *) (_paramsBase + _bufferOffset);
3786 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003787 glTexEnvxv(
3788 (GLenum)target,
3789 (GLenum)pname,
3790 (GLfixed *)params
3791 );
3792
3793exit:
3794 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003795 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003796 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003797 if (_exception) {
3798 jniThrowException(_env, _exceptionType, _exceptionMessage);
3799 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003800}
3801
3802/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3803static void
3804android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3805 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3806 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003807 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003808 jint _remaining;
3809 GLvoid *pixels = (GLvoid *) 0;
3810
3811 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003812 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003813 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003814 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003815 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3816 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003817 }
3818 glTexImage2D(
3819 (GLenum)target,
3820 (GLint)level,
3821 (GLint)internalformat,
3822 (GLsizei)width,
3823 (GLsizei)height,
3824 (GLint)border,
3825 (GLenum)format,
3826 (GLenum)type,
3827 (GLvoid *)pixels
3828 );
3829 if (_array) {
3830 releasePointer(_env, _array, pixels, JNI_FALSE);
3831 }
3832}
3833
3834/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3835static void
3836android_glTexParameterf__IIF
3837 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3838 glTexParameterf(
3839 (GLenum)target,
3840 (GLenum)pname,
3841 (GLfloat)param
3842 );
3843}
3844
3845/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3846static void
3847android_glTexParameterx__III
3848 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3849 glTexParameterx(
3850 (GLenum)target,
3851 (GLenum)pname,
3852 (GLfixed)param
3853 );
3854}
3855
3856/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3857static void
3858android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3859 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3860 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003861 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003862 jint _remaining;
3863 GLvoid *pixels = (GLvoid *) 0;
3864
3865 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003866 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003867 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003868 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003869 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3870 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003871 }
3872 glTexSubImage2D(
3873 (GLenum)target,
3874 (GLint)level,
3875 (GLint)xoffset,
3876 (GLint)yoffset,
3877 (GLsizei)width,
3878 (GLsizei)height,
3879 (GLenum)format,
3880 (GLenum)type,
3881 (GLvoid *)pixels
3882 );
3883 if (_array) {
3884 releasePointer(_env, _array, pixels, JNI_FALSE);
3885 }
3886}
3887
3888/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3889static void
3890android_glTranslatef__FFF
3891 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3892 glTranslatef(
3893 (GLfloat)x,
3894 (GLfloat)y,
3895 (GLfloat)z
3896 );
3897}
3898
3899/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3900static void
3901android_glTranslatex__III
3902 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3903 glTranslatex(
3904 (GLfixed)x,
3905 (GLfixed)y,
3906 (GLfixed)z
3907 );
3908}
3909
3910/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3911static void
3912android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3913 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3914 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003915 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003916 jint _remaining;
3917 GLvoid *pointer = (GLvoid *) 0;
3918
Jack Paleviche20ea782009-05-07 18:28:29 -07003919 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003920 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003921 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003922 return;
3923 }
3924 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003925 glVertexPointerBounds(
3926 (GLint)size,
3927 (GLenum)type,
3928 (GLsizei)stride,
3929 (GLvoid *)pointer,
3930 (GLsizei)remaining
3931 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003932}
3933
3934/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3935static void
3936android_glViewport__IIII
3937 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3938 glViewport(
3939 (GLint)x,
3940 (GLint)y,
3941 (GLsizei)width,
3942 (GLsizei)height
3943 );
3944}
3945
3946/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
3947static jint
3948android_glQueryMatrixxOES___3II_3II
3949 (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
3950 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003951 const char * _exceptionType = NULL;
3952 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003953 GLbitfield _returnValue = -1;
3954 GLfixed *mantissa_base = (GLfixed *) 0;
3955 jint _mantissaRemaining;
3956 GLfixed *mantissa = (GLfixed *) 0;
3957 GLint *exponent_base = (GLint *) 0;
3958 jint _exponentRemaining;
3959 GLint *exponent = (GLint *) 0;
3960
3961 if (!mantissa_ref) {
3962 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003963 _exceptionType = "java/lang/IllegalArgumentException";
3964 _exceptionMessage = "mantissa == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003965 goto exit;
3966 }
3967 if (mantissaOffset < 0) {
3968 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003969 _exceptionType = "java/lang/IllegalArgumentException";
3970 _exceptionMessage = "mantissaOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003971 goto exit;
3972 }
3973 _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
3974 if (_mantissaRemaining < 16) {
3975 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003976 _exceptionType = "java/lang/IllegalArgumentException";
3977 _exceptionMessage = "length - mantissaOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003978 goto exit;
3979 }
3980 mantissa_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003981 _env->GetIntArrayElements(mantissa_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003982 mantissa = mantissa_base + mantissaOffset;
3983
3984 if (!exponent_ref) {
3985 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003986 _exceptionType = "java/lang/IllegalArgumentException";
3987 _exceptionMessage = "exponent == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003988 goto exit;
3989 }
3990 if (exponentOffset < 0) {
3991 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003992 _exceptionType = "java/lang/IllegalArgumentException";
3993 _exceptionMessage = "exponentOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003994 goto exit;
3995 }
3996 _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
3997 if (_exponentRemaining < 16) {
3998 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003999 _exceptionType = "java/lang/IllegalArgumentException";
4000 _exceptionMessage = "length - exponentOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004001 goto exit;
4002 }
4003 exponent_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004004 _env->GetIntArrayElements(exponent_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004005 exponent = exponent_base + exponentOffset;
4006
4007 _returnValue = glQueryMatrixxOES(
4008 (GLfixed *)mantissa,
4009 (GLint *)exponent
4010 );
4011
4012exit:
4013 if (exponent_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004014 _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004015 _exception ? JNI_ABORT: 0);
4016 }
4017 if (mantissa_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004018 _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004019 _exception ? JNI_ABORT: 0);
4020 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004021 if (_exception) {
4022 jniThrowException(_env, _exceptionType, _exceptionMessage);
4023 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004024 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004025}
4026
4027/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4028static jint
4029android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4030 (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4031 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004032 const char * _exceptionType = NULL;
4033 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004034 jintArray _mantissaArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004035 jint _mantissaBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004036 jintArray _exponentArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004037 jint _exponentBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004038 GLbitfield _returnValue = -1;
4039 jint _mantissaRemaining;
4040 GLfixed *mantissa = (GLfixed *) 0;
4041 jint _exponentRemaining;
4042 GLint *exponent = (GLint *) 0;
4043
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004044 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004045 if (_mantissaRemaining < 16) {
4046 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004047 _exceptionType = "java/lang/IllegalArgumentException";
4048 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004049 goto exit;
4050 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004051 exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004052 if (_exponentRemaining < 16) {
4053 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004054 _exceptionType = "java/lang/IllegalArgumentException";
4055 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004056 goto exit;
4057 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004058 if (mantissa == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004059 char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004060 mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4061 }
4062 if (exponent == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004063 char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004064 exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4065 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004066 _returnValue = glQueryMatrixxOES(
4067 (GLfixed *)mantissa,
4068 (GLint *)exponent
4069 );
4070
4071exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004072 if (_exponentArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004073 _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004074 }
4075 if (_mantissaArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004076 _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004077 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004078 if (_exception) {
4079 jniThrowException(_env, _exceptionType, _exceptionMessage);
4080 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004081 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004082}
4083
4084/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4085static void
4086android_glBindBuffer__II
4087 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4088 glBindBuffer(
4089 (GLenum)target,
4090 (GLuint)buffer
4091 );
4092}
4093
4094/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4095static void
4096android_glBufferData__IILjava_nio_Buffer_2I
4097 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004098 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004099 const char * _exceptionType = NULL;
4100 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004101 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004102 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004103 jint _remaining;
4104 GLvoid *data = (GLvoid *) 0;
4105
4106 if (data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004107 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004108 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004109 _exception = 1;
4110 _exceptionType = "java/lang/IllegalArgumentException";
4111 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004112 goto exit;
4113 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004114 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004115 if (data_buf && data == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004116 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4117 data = (GLvoid *) (_dataBase + _bufferOffset);
4118 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004119 glBufferData(
4120 (GLenum)target,
4121 (GLsizeiptr)size,
4122 (GLvoid *)data,
4123 (GLenum)usage
4124 );
Jack Palevichc620a522009-10-21 11:02:44 -07004125
4126exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004127 if (_array) {
4128 releasePointer(_env, _array, data, JNI_FALSE);
4129 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004130 if (_exception) {
4131 jniThrowException(_env, _exceptionType, _exceptionMessage);
4132 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004133}
4134
4135/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4136static void
4137android_glBufferSubData__IIILjava_nio_Buffer_2
4138 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004139 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004140 const char * _exceptionType = NULL;
4141 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004142 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004143 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004144 jint _remaining;
4145 GLvoid *data = (GLvoid *) 0;
4146
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004147 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004148 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004149 _exception = 1;
4150 _exceptionType = "java/lang/IllegalArgumentException";
4151 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004152 goto exit;
4153 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004154 if (data == NULL) {
4155 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4156 data = (GLvoid *) (_dataBase + _bufferOffset);
4157 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004158 glBufferSubData(
4159 (GLenum)target,
4160 (GLintptr)offset,
4161 (GLsizeiptr)size,
4162 (GLvoid *)data
4163 );
Jack Palevichc620a522009-10-21 11:02:44 -07004164
4165exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004166 if (_array) {
4167 releasePointer(_env, _array, data, JNI_FALSE);
4168 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004169 if (_exception) {
4170 jniThrowException(_env, _exceptionType, _exceptionMessage);
4171 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004172}
4173
4174/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4175static void
4176android_glClipPlanef__I_3FI
4177 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004178 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004179 const char * _exceptionType = NULL;
4180 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004181 GLfloat *equation_base = (GLfloat *) 0;
4182 jint _remaining;
4183 GLfloat *equation = (GLfloat *) 0;
4184
4185 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004186 _exception = 1;
4187 _exceptionType = "java/lang/IllegalArgumentException";
4188 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004189 goto exit;
4190 }
4191 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004192 _exception = 1;
4193 _exceptionType = "java/lang/IllegalArgumentException";
4194 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004195 goto exit;
4196 }
4197 _remaining = _env->GetArrayLength(equation_ref) - offset;
4198 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004199 _exception = 1;
4200 _exceptionType = "java/lang/IllegalArgumentException";
4201 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004202 goto exit;
4203 }
4204 equation_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004205 _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004206 equation = equation_base + offset;
4207
4208 glClipPlanef(
4209 (GLenum)plane,
4210 (GLfloat *)equation
4211 );
4212
4213exit:
4214 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004215 _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004216 JNI_ABORT);
4217 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004218 if (_exception) {
4219 jniThrowException(_env, _exceptionType, _exceptionMessage);
4220 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004221}
4222
4223/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4224static void
4225android_glClipPlanef__ILjava_nio_FloatBuffer_2
4226 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004227 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004228 const char * _exceptionType = NULL;
4229 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004230 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004231 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004232 jint _remaining;
4233 GLfloat *equation = (GLfloat *) 0;
4234
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004235 equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004236 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004237 _exception = 1;
4238 _exceptionType = "java/lang/IllegalArgumentException";
4239 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004240 goto exit;
4241 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004242 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004243 char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004244 equation = (GLfloat *) (_equationBase + _bufferOffset);
4245 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004246 glClipPlanef(
4247 (GLenum)plane,
4248 (GLfloat *)equation
4249 );
4250
4251exit:
4252 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004253 _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004254 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004255 if (_exception) {
4256 jniThrowException(_env, _exceptionType, _exceptionMessage);
4257 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004258}
4259
4260/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4261static void
4262android_glClipPlanex__I_3II
4263 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004264 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004265 const char * _exceptionType = NULL;
4266 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004267 GLfixed *equation_base = (GLfixed *) 0;
4268 jint _remaining;
4269 GLfixed *equation = (GLfixed *) 0;
4270
4271 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004272 _exception = 1;
4273 _exceptionType = "java/lang/IllegalArgumentException";
4274 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004275 goto exit;
4276 }
4277 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004278 _exception = 1;
4279 _exceptionType = "java/lang/IllegalArgumentException";
4280 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004281 goto exit;
4282 }
4283 _remaining = _env->GetArrayLength(equation_ref) - offset;
4284 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004285 _exception = 1;
4286 _exceptionType = "java/lang/IllegalArgumentException";
4287 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004288 goto exit;
4289 }
4290 equation_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004291 _env->GetIntArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004292 equation = equation_base + offset;
4293
4294 glClipPlanex(
4295 (GLenum)plane,
4296 (GLfixed *)equation
4297 );
4298
4299exit:
4300 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004301 _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004302 JNI_ABORT);
4303 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004304 if (_exception) {
4305 jniThrowException(_env, _exceptionType, _exceptionMessage);
4306 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004307}
4308
4309/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4310static void
4311android_glClipPlanex__ILjava_nio_IntBuffer_2
4312 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004313 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004314 const char * _exceptionType = NULL;
4315 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004316 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004317 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004318 jint _remaining;
4319 GLfixed *equation = (GLfixed *) 0;
4320
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004321 equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004322 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004323 _exception = 1;
4324 _exceptionType = "java/lang/IllegalArgumentException";
4325 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004326 goto exit;
4327 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004328 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004329 char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004330 equation = (GLfixed *) (_equationBase + _bufferOffset);
4331 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004332 glClipPlanex(
4333 (GLenum)plane,
4334 (GLfixed *)equation
4335 );
4336
4337exit:
4338 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004339 _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004340 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004341 if (_exception) {
4342 jniThrowException(_env, _exceptionType, _exceptionMessage);
4343 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004344}
4345
4346/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4347static void
4348android_glColor4ub__BBBB
4349 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4350 glColor4ub(
4351 (GLubyte)red,
4352 (GLubyte)green,
4353 (GLubyte)blue,
4354 (GLubyte)alpha
4355 );
4356}
4357
4358/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4359static void
4360android_glColorPointer__IIII
4361 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4362 glColorPointer(
4363 (GLint)size,
4364 (GLenum)type,
4365 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004366 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004367 );
4368}
4369
4370/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4371static void
4372android_glDeleteBuffers__I_3II
4373 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004374 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004375 const char * _exceptionType = NULL;
4376 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004377 GLuint *buffers_base = (GLuint *) 0;
4378 jint _remaining;
4379 GLuint *buffers = (GLuint *) 0;
4380
4381 if (!buffers_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004382 _exception = 1;
4383 _exceptionType = "java/lang/IllegalArgumentException";
4384 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004385 goto exit;
4386 }
4387 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004388 _exception = 1;
4389 _exceptionType = "java/lang/IllegalArgumentException";
4390 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004391 goto exit;
4392 }
4393 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4394 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004395 _exception = 1;
4396 _exceptionType = "java/lang/IllegalArgumentException";
4397 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004398 goto exit;
4399 }
4400 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004401 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004402 buffers = buffers_base + offset;
4403
4404 glDeleteBuffers(
4405 (GLsizei)n,
4406 (GLuint *)buffers
4407 );
4408
4409exit:
4410 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004411 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004412 JNI_ABORT);
4413 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004414 if (_exception) {
4415 jniThrowException(_env, _exceptionType, _exceptionMessage);
4416 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004417}
4418
4419/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4420static void
4421android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4422 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004423 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004424 const char * _exceptionType = NULL;
4425 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004426 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004427 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004428 jint _remaining;
4429 GLuint *buffers = (GLuint *) 0;
4430
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004431 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004433 _exception = 1;
4434 _exceptionType = "java/lang/IllegalArgumentException";
4435 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004436 goto exit;
4437 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004438 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004439 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004440 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4441 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004442 glDeleteBuffers(
4443 (GLsizei)n,
4444 (GLuint *)buffers
4445 );
4446
4447exit:
4448 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004449 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004450 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004451 if (_exception) {
4452 jniThrowException(_env, _exceptionType, _exceptionMessage);
4453 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004454}
4455
4456/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4457static void
4458android_glDrawElements__IIII
4459 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004460 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004461 const char * _exceptionType = NULL;
4462 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004463 glDrawElements(
4464 (GLenum)mode,
4465 (GLsizei)count,
4466 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004467 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004468 );
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004469 if (_exception) {
4470 jniThrowException(_env, _exceptionType, _exceptionMessage);
4471 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004472}
4473
4474/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4475static void
4476android_glGenBuffers__I_3II
4477 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4478 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004479 const char * _exceptionType = NULL;
4480 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004481 GLuint *buffers_base = (GLuint *) 0;
4482 jint _remaining;
4483 GLuint *buffers = (GLuint *) 0;
4484
4485 if (!buffers_ref) {
4486 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004487 _exceptionType = "java/lang/IllegalArgumentException";
4488 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004489 goto exit;
4490 }
4491 if (offset < 0) {
4492 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004493 _exceptionType = "java/lang/IllegalArgumentException";
4494 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004495 goto exit;
4496 }
4497 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4498 if (_remaining < n) {
4499 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004500 _exceptionType = "java/lang/IllegalArgumentException";
4501 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004502 goto exit;
4503 }
4504 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004505 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004506 buffers = buffers_base + offset;
4507
4508 glGenBuffers(
4509 (GLsizei)n,
4510 (GLuint *)buffers
4511 );
4512
4513exit:
4514 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004515 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004516 _exception ? JNI_ABORT: 0);
4517 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004518 if (_exception) {
4519 jniThrowException(_env, _exceptionType, _exceptionMessage);
4520 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004521}
4522
4523/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4524static void
4525android_glGenBuffers__ILjava_nio_IntBuffer_2
4526 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4527 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004528 const char * _exceptionType = NULL;
4529 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004530 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004531 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004532 jint _remaining;
4533 GLuint *buffers = (GLuint *) 0;
4534
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004535 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536 if (_remaining < n) {
4537 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004538 _exceptionType = "java/lang/IllegalArgumentException";
4539 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004540 goto exit;
4541 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004542 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004543 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004544 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4545 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004546 glGenBuffers(
4547 (GLsizei)n,
4548 (GLuint *)buffers
4549 );
4550
4551exit:
4552 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004553 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004554 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004555 if (_exception) {
4556 jniThrowException(_env, _exceptionType, _exceptionMessage);
4557 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004558}
4559
4560/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4561static void
4562android_glGetBooleanv__I_3ZI
4563 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4564 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004565 const char * _exceptionType = NULL;
4566 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004567 GLboolean *params_base = (GLboolean *) 0;
4568 jint _remaining;
4569 GLboolean *params = (GLboolean *) 0;
4570
4571 if (!params_ref) {
4572 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004573 _exceptionType = "java/lang/IllegalArgumentException";
4574 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004575 goto exit;
4576 }
4577 if (offset < 0) {
4578 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004579 _exceptionType = "java/lang/IllegalArgumentException";
4580 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004581 goto exit;
4582 }
4583 _remaining = _env->GetArrayLength(params_ref) - offset;
4584 params_base = (GLboolean *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004585 _env->GetBooleanArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004586 params = params_base + offset;
4587
4588 glGetBooleanv(
4589 (GLenum)pname,
4590 (GLboolean *)params
4591 );
4592
4593exit:
4594 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004595 _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004596 _exception ? JNI_ABORT: 0);
4597 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004598 if (_exception) {
4599 jniThrowException(_env, _exceptionType, _exceptionMessage);
4600 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004601}
4602
4603/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4604static void
4605android_glGetBooleanv__ILjava_nio_IntBuffer_2
4606 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004607 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004608 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004609 jint _remaining;
4610 GLboolean *params = (GLboolean *) 0;
4611
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004612 params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004613 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004614 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004615 params = (GLboolean *) (_paramsBase + _bufferOffset);
4616 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004617 glGetBooleanv(
4618 (GLenum)pname,
4619 (GLboolean *)params
4620 );
4621 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004622 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004623 }
4624}
4625
4626/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4627static void
4628android_glGetBufferParameteriv__II_3II
4629 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004630 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004631 "glGetBufferParameteriv");
4632}
4633
4634/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4635static void
4636android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4637 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004638 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004639 "glGetBufferParameteriv");
4640}
4641
4642/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4643static void
4644android_glGetClipPlanef__I_3FI
4645 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4646 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004647 const char * _exceptionType = NULL;
4648 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004649 GLfloat *eqn_base = (GLfloat *) 0;
4650 jint _remaining;
4651 GLfloat *eqn = (GLfloat *) 0;
4652
4653 if (!eqn_ref) {
4654 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004655 _exceptionType = "java/lang/IllegalArgumentException";
4656 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004657 goto exit;
4658 }
4659 if (offset < 0) {
4660 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004661 _exceptionType = "java/lang/IllegalArgumentException";
4662 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004663 goto exit;
4664 }
4665 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4666 eqn_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004667 _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004668 eqn = eqn_base + offset;
4669
4670 glGetClipPlanef(
4671 (GLenum)pname,
4672 (GLfloat *)eqn
4673 );
4674
4675exit:
4676 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004677 _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004678 _exception ? JNI_ABORT: 0);
4679 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004680 if (_exception) {
4681 jniThrowException(_env, _exceptionType, _exceptionMessage);
4682 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004683}
4684
4685/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4686static void
4687android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4688 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004689 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004690 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004691 jint _remaining;
4692 GLfloat *eqn = (GLfloat *) 0;
4693
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004694 eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004695 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004696 char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004697 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4698 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004699 glGetClipPlanef(
4700 (GLenum)pname,
4701 (GLfloat *)eqn
4702 );
4703 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004704 _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004705 }
4706}
4707
4708/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4709static void
4710android_glGetClipPlanex__I_3II
4711 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
4712 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004713 const char * _exceptionType = NULL;
4714 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004715 GLfixed *eqn_base = (GLfixed *) 0;
4716 jint _remaining;
4717 GLfixed *eqn = (GLfixed *) 0;
4718
4719 if (!eqn_ref) {
4720 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004721 _exceptionType = "java/lang/IllegalArgumentException";
4722 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004723 goto exit;
4724 }
4725 if (offset < 0) {
4726 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004727 _exceptionType = "java/lang/IllegalArgumentException";
4728 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004729 goto exit;
4730 }
4731 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4732 eqn_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004733 _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004734 eqn = eqn_base + offset;
4735
4736 glGetClipPlanex(
4737 (GLenum)pname,
4738 (GLfixed *)eqn
4739 );
4740
4741exit:
4742 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004743 _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004744 _exception ? JNI_ABORT: 0);
4745 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004746 if (_exception) {
4747 jniThrowException(_env, _exceptionType, _exceptionMessage);
4748 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004749}
4750
4751/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4752static void
4753android_glGetClipPlanex__ILjava_nio_IntBuffer_2
4754 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004755 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004756 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004757 jint _remaining;
4758 GLfixed *eqn = (GLfixed *) 0;
4759
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004760 eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004761 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004762 char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004763 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
4764 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004765 glGetClipPlanex(
4766 (GLenum)pname,
4767 (GLfixed *)eqn
4768 );
4769 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004770 _env->ReleaseIntArrayElements(_array, (jint*)eqn, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004771 }
4772}
4773
4774/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
4775static void
4776android_glGetFixedv__I_3II
4777 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
4778 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004779 const char * _exceptionType = NULL;
4780 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004781 GLfixed *params_base = (GLfixed *) 0;
4782 jint _remaining;
4783 GLfixed *params = (GLfixed *) 0;
4784
4785 if (!params_ref) {
4786 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004787 _exceptionType = "java/lang/IllegalArgumentException";
4788 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004789 goto exit;
4790 }
4791 if (offset < 0) {
4792 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004793 _exceptionType = "java/lang/IllegalArgumentException";
4794 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004795 goto exit;
4796 }
4797 _remaining = _env->GetArrayLength(params_ref) - offset;
4798 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004799 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 params = params_base + offset;
4801
4802 glGetFixedv(
4803 (GLenum)pname,
4804 (GLfixed *)params
4805 );
4806
4807exit:
4808 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004809 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004810 _exception ? JNI_ABORT: 0);
4811 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004812 if (_exception) {
4813 jniThrowException(_env, _exceptionType, _exceptionMessage);
4814 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004815}
4816
4817/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
4818static void
4819android_glGetFixedv__ILjava_nio_IntBuffer_2
4820 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004821 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004822 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004823 jint _remaining;
4824 GLfixed *params = (GLfixed *) 0;
4825
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004826 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004827 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004828 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004829 params = (GLfixed *) (_paramsBase + _bufferOffset);
4830 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004831 glGetFixedv(
4832 (GLenum)pname,
4833 (GLfixed *)params
4834 );
4835 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004836 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004837 }
4838}
4839
4840/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
4841static void
4842android_glGetFloatv__I_3FI
4843 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
4844 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004845 const char * _exceptionType = NULL;
4846 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004847 GLfloat *params_base = (GLfloat *) 0;
4848 jint _remaining;
4849 GLfloat *params = (GLfloat *) 0;
4850
4851 if (!params_ref) {
4852 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004853 _exceptionType = "java/lang/IllegalArgumentException";
4854 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004855 goto exit;
4856 }
4857 if (offset < 0) {
4858 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004859 _exceptionType = "java/lang/IllegalArgumentException";
4860 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861 goto exit;
4862 }
4863 _remaining = _env->GetArrayLength(params_ref) - offset;
4864 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004865 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004866 params = params_base + offset;
4867
4868 glGetFloatv(
4869 (GLenum)pname,
4870 (GLfloat *)params
4871 );
4872
4873exit:
4874 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004875 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004876 _exception ? JNI_ABORT: 0);
4877 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004878 if (_exception) {
4879 jniThrowException(_env, _exceptionType, _exceptionMessage);
4880 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004881}
4882
4883/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
4884static void
4885android_glGetFloatv__ILjava_nio_FloatBuffer_2
4886 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004887 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004888 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004889 jint _remaining;
4890 GLfloat *params = (GLfloat *) 0;
4891
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004892 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004893 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004894 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004895 params = (GLfloat *) (_paramsBase + _bufferOffset);
4896 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004897 glGetFloatv(
4898 (GLenum)pname,
4899 (GLfloat *)params
4900 );
4901 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004902 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004903 }
4904}
4905
4906/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
4907static void
4908android_glGetLightfv__II_3FI
4909 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
4910 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004911 const char * _exceptionType = NULL;
4912 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004913 GLfloat *params_base = (GLfloat *) 0;
4914 jint _remaining;
4915 GLfloat *params = (GLfloat *) 0;
4916
4917 if (!params_ref) {
4918 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004919 _exceptionType = "java/lang/IllegalArgumentException";
4920 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004921 goto exit;
4922 }
4923 if (offset < 0) {
4924 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004925 _exceptionType = "java/lang/IllegalArgumentException";
4926 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004927 goto exit;
4928 }
4929 _remaining = _env->GetArrayLength(params_ref) - offset;
4930 int _needed;
4931 switch (pname) {
4932#if defined(GL_SPOT_EXPONENT)
4933 case GL_SPOT_EXPONENT:
4934#endif // defined(GL_SPOT_EXPONENT)
4935#if defined(GL_SPOT_CUTOFF)
4936 case GL_SPOT_CUTOFF:
4937#endif // defined(GL_SPOT_CUTOFF)
4938#if defined(GL_CONSTANT_ATTENUATION)
4939 case GL_CONSTANT_ATTENUATION:
4940#endif // defined(GL_CONSTANT_ATTENUATION)
4941#if defined(GL_LINEAR_ATTENUATION)
4942 case GL_LINEAR_ATTENUATION:
4943#endif // defined(GL_LINEAR_ATTENUATION)
4944#if defined(GL_QUADRATIC_ATTENUATION)
4945 case GL_QUADRATIC_ATTENUATION:
4946#endif // defined(GL_QUADRATIC_ATTENUATION)
4947 _needed = 1;
4948 break;
4949#if defined(GL_SPOT_DIRECTION)
4950 case GL_SPOT_DIRECTION:
4951#endif // defined(GL_SPOT_DIRECTION)
4952 _needed = 3;
4953 break;
4954#if defined(GL_AMBIENT)
4955 case GL_AMBIENT:
4956#endif // defined(GL_AMBIENT)
4957#if defined(GL_DIFFUSE)
4958 case GL_DIFFUSE:
4959#endif // defined(GL_DIFFUSE)
4960#if defined(GL_SPECULAR)
4961 case GL_SPECULAR:
4962#endif // defined(GL_SPECULAR)
4963#if defined(GL_EMISSION)
4964 case GL_EMISSION:
4965#endif // defined(GL_EMISSION)
4966 _needed = 4;
4967 break;
4968 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08004969 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004970 break;
4971 }
4972 if (_remaining < _needed) {
4973 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004974 _exceptionType = "java/lang/IllegalArgumentException";
4975 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004976 goto exit;
4977 }
4978 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004979 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004980 params = params_base + offset;
4981
4982 glGetLightfv(
4983 (GLenum)light,
4984 (GLenum)pname,
4985 (GLfloat *)params
4986 );
4987
4988exit:
4989 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004990 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004991 _exception ? JNI_ABORT: 0);
4992 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004993 if (_exception) {
4994 jniThrowException(_env, _exceptionType, _exceptionMessage);
4995 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004996}
4997
4998/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
4999static void
5000android_glGetLightfv__IILjava_nio_FloatBuffer_2
5001 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5002 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005003 const char * _exceptionType = NULL;
5004 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005005 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005006 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005007 jint _remaining;
5008 GLfloat *params = (GLfloat *) 0;
5009
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005010 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005011 int _needed;
5012 switch (pname) {
5013#if defined(GL_SPOT_EXPONENT)
5014 case GL_SPOT_EXPONENT:
5015#endif // defined(GL_SPOT_EXPONENT)
5016#if defined(GL_SPOT_CUTOFF)
5017 case GL_SPOT_CUTOFF:
5018#endif // defined(GL_SPOT_CUTOFF)
5019#if defined(GL_CONSTANT_ATTENUATION)
5020 case GL_CONSTANT_ATTENUATION:
5021#endif // defined(GL_CONSTANT_ATTENUATION)
5022#if defined(GL_LINEAR_ATTENUATION)
5023 case GL_LINEAR_ATTENUATION:
5024#endif // defined(GL_LINEAR_ATTENUATION)
5025#if defined(GL_QUADRATIC_ATTENUATION)
5026 case GL_QUADRATIC_ATTENUATION:
5027#endif // defined(GL_QUADRATIC_ATTENUATION)
5028 _needed = 1;
5029 break;
5030#if defined(GL_SPOT_DIRECTION)
5031 case GL_SPOT_DIRECTION:
5032#endif // defined(GL_SPOT_DIRECTION)
5033 _needed = 3;
5034 break;
5035#if defined(GL_AMBIENT)
5036 case GL_AMBIENT:
5037#endif // defined(GL_AMBIENT)
5038#if defined(GL_DIFFUSE)
5039 case GL_DIFFUSE:
5040#endif // defined(GL_DIFFUSE)
5041#if defined(GL_SPECULAR)
5042 case GL_SPECULAR:
5043#endif // defined(GL_SPECULAR)
5044#if defined(GL_EMISSION)
5045 case GL_EMISSION:
5046#endif // defined(GL_EMISSION)
5047 _needed = 4;
5048 break;
5049 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005050 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005051 break;
5052 }
5053 if (_remaining < _needed) {
5054 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005055 _exceptionType = "java/lang/IllegalArgumentException";
5056 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005057 goto exit;
5058 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005059 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005060 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005061 params = (GLfloat *) (_paramsBase + _bufferOffset);
5062 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005063 glGetLightfv(
5064 (GLenum)light,
5065 (GLenum)pname,
5066 (GLfloat *)params
5067 );
5068
5069exit:
5070 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005071 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005072 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005073 if (_exception) {
5074 jniThrowException(_env, _exceptionType, _exceptionMessage);
5075 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005076}
5077
5078/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5079static void
5080android_glGetLightxv__II_3II
5081 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5082 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005083 const char * _exceptionType = NULL;
5084 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005085 GLfixed *params_base = (GLfixed *) 0;
5086 jint _remaining;
5087 GLfixed *params = (GLfixed *) 0;
5088
5089 if (!params_ref) {
5090 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005091 _exceptionType = "java/lang/IllegalArgumentException";
5092 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005093 goto exit;
5094 }
5095 if (offset < 0) {
5096 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005097 _exceptionType = "java/lang/IllegalArgumentException";
5098 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005099 goto exit;
5100 }
5101 _remaining = _env->GetArrayLength(params_ref) - offset;
5102 int _needed;
5103 switch (pname) {
5104#if defined(GL_SPOT_EXPONENT)
5105 case GL_SPOT_EXPONENT:
5106#endif // defined(GL_SPOT_EXPONENT)
5107#if defined(GL_SPOT_CUTOFF)
5108 case GL_SPOT_CUTOFF:
5109#endif // defined(GL_SPOT_CUTOFF)
5110#if defined(GL_CONSTANT_ATTENUATION)
5111 case GL_CONSTANT_ATTENUATION:
5112#endif // defined(GL_CONSTANT_ATTENUATION)
5113#if defined(GL_LINEAR_ATTENUATION)
5114 case GL_LINEAR_ATTENUATION:
5115#endif // defined(GL_LINEAR_ATTENUATION)
5116#if defined(GL_QUADRATIC_ATTENUATION)
5117 case GL_QUADRATIC_ATTENUATION:
5118#endif // defined(GL_QUADRATIC_ATTENUATION)
5119 _needed = 1;
5120 break;
5121#if defined(GL_SPOT_DIRECTION)
5122 case GL_SPOT_DIRECTION:
5123#endif // defined(GL_SPOT_DIRECTION)
5124 _needed = 3;
5125 break;
5126#if defined(GL_AMBIENT)
5127 case GL_AMBIENT:
5128#endif // defined(GL_AMBIENT)
5129#if defined(GL_DIFFUSE)
5130 case GL_DIFFUSE:
5131#endif // defined(GL_DIFFUSE)
5132#if defined(GL_SPECULAR)
5133 case GL_SPECULAR:
5134#endif // defined(GL_SPECULAR)
5135#if defined(GL_EMISSION)
5136 case GL_EMISSION:
5137#endif // defined(GL_EMISSION)
5138 _needed = 4;
5139 break;
5140 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005141 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005142 break;
5143 }
5144 if (_remaining < _needed) {
5145 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005146 _exceptionType = "java/lang/IllegalArgumentException";
5147 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005148 goto exit;
5149 }
5150 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005151 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005152 params = params_base + offset;
5153
5154 glGetLightxv(
5155 (GLenum)light,
5156 (GLenum)pname,
5157 (GLfixed *)params
5158 );
5159
5160exit:
5161 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005162 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005163 _exception ? JNI_ABORT: 0);
5164 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005165 if (_exception) {
5166 jniThrowException(_env, _exceptionType, _exceptionMessage);
5167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005168}
5169
5170/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5171static void
5172android_glGetLightxv__IILjava_nio_IntBuffer_2
5173 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5174 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005175 const char * _exceptionType = NULL;
5176 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005177 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005178 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005179 jint _remaining;
5180 GLfixed *params = (GLfixed *) 0;
5181
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005182 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005183 int _needed;
5184 switch (pname) {
5185#if defined(GL_SPOT_EXPONENT)
5186 case GL_SPOT_EXPONENT:
5187#endif // defined(GL_SPOT_EXPONENT)
5188#if defined(GL_SPOT_CUTOFF)
5189 case GL_SPOT_CUTOFF:
5190#endif // defined(GL_SPOT_CUTOFF)
5191#if defined(GL_CONSTANT_ATTENUATION)
5192 case GL_CONSTANT_ATTENUATION:
5193#endif // defined(GL_CONSTANT_ATTENUATION)
5194#if defined(GL_LINEAR_ATTENUATION)
5195 case GL_LINEAR_ATTENUATION:
5196#endif // defined(GL_LINEAR_ATTENUATION)
5197#if defined(GL_QUADRATIC_ATTENUATION)
5198 case GL_QUADRATIC_ATTENUATION:
5199#endif // defined(GL_QUADRATIC_ATTENUATION)
5200 _needed = 1;
5201 break;
5202#if defined(GL_SPOT_DIRECTION)
5203 case GL_SPOT_DIRECTION:
5204#endif // defined(GL_SPOT_DIRECTION)
5205 _needed = 3;
5206 break;
5207#if defined(GL_AMBIENT)
5208 case GL_AMBIENT:
5209#endif // defined(GL_AMBIENT)
5210#if defined(GL_DIFFUSE)
5211 case GL_DIFFUSE:
5212#endif // defined(GL_DIFFUSE)
5213#if defined(GL_SPECULAR)
5214 case GL_SPECULAR:
5215#endif // defined(GL_SPECULAR)
5216#if defined(GL_EMISSION)
5217 case GL_EMISSION:
5218#endif // defined(GL_EMISSION)
5219 _needed = 4;
5220 break;
5221 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005222 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005223 break;
5224 }
5225 if (_remaining < _needed) {
5226 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005227 _exceptionType = "java/lang/IllegalArgumentException";
5228 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005229 goto exit;
5230 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005231 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005232 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005233 params = (GLfixed *) (_paramsBase + _bufferOffset);
5234 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005235 glGetLightxv(
5236 (GLenum)light,
5237 (GLenum)pname,
5238 (GLfixed *)params
5239 );
5240
5241exit:
5242 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005243 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005244 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005245 if (_exception) {
5246 jniThrowException(_env, _exceptionType, _exceptionMessage);
5247 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005248}
5249
5250/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5251static void
5252android_glGetMaterialfv__II_3FI
5253 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5254 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005255 const char * _exceptionType = NULL;
5256 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005257 GLfloat *params_base = (GLfloat *) 0;
5258 jint _remaining;
5259 GLfloat *params = (GLfloat *) 0;
5260
5261 if (!params_ref) {
5262 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005263 _exceptionType = "java/lang/IllegalArgumentException";
5264 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005265 goto exit;
5266 }
5267 if (offset < 0) {
5268 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005269 _exceptionType = "java/lang/IllegalArgumentException";
5270 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005271 goto exit;
5272 }
5273 _remaining = _env->GetArrayLength(params_ref) - offset;
5274 int _needed;
5275 switch (pname) {
5276#if defined(GL_SHININESS)
5277 case GL_SHININESS:
5278#endif // defined(GL_SHININESS)
5279 _needed = 1;
5280 break;
5281#if defined(GL_AMBIENT)
5282 case GL_AMBIENT:
5283#endif // defined(GL_AMBIENT)
5284#if defined(GL_DIFFUSE)
5285 case GL_DIFFUSE:
5286#endif // defined(GL_DIFFUSE)
5287#if defined(GL_SPECULAR)
5288 case GL_SPECULAR:
5289#endif // defined(GL_SPECULAR)
5290#if defined(GL_EMISSION)
5291 case GL_EMISSION:
5292#endif // defined(GL_EMISSION)
5293#if defined(GL_AMBIENT_AND_DIFFUSE)
5294 case GL_AMBIENT_AND_DIFFUSE:
5295#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5296 _needed = 4;
5297 break;
5298 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005299 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005300 break;
5301 }
5302 if (_remaining < _needed) {
5303 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005304 _exceptionType = "java/lang/IllegalArgumentException";
5305 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005306 goto exit;
5307 }
5308 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005309 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005310 params = params_base + offset;
5311
5312 glGetMaterialfv(
5313 (GLenum)face,
5314 (GLenum)pname,
5315 (GLfloat *)params
5316 );
5317
5318exit:
5319 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005320 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005321 _exception ? JNI_ABORT: 0);
5322 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005323 if (_exception) {
5324 jniThrowException(_env, _exceptionType, _exceptionMessage);
5325 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005326}
5327
5328/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5329static void
5330android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5331 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5332 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005333 const char * _exceptionType = NULL;
5334 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005335 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005336 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005337 jint _remaining;
5338 GLfloat *params = (GLfloat *) 0;
5339
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005340 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005341 int _needed;
5342 switch (pname) {
5343#if defined(GL_SHININESS)
5344 case GL_SHININESS:
5345#endif // defined(GL_SHININESS)
5346 _needed = 1;
5347 break;
5348#if defined(GL_AMBIENT)
5349 case GL_AMBIENT:
5350#endif // defined(GL_AMBIENT)
5351#if defined(GL_DIFFUSE)
5352 case GL_DIFFUSE:
5353#endif // defined(GL_DIFFUSE)
5354#if defined(GL_SPECULAR)
5355 case GL_SPECULAR:
5356#endif // defined(GL_SPECULAR)
5357#if defined(GL_EMISSION)
5358 case GL_EMISSION:
5359#endif // defined(GL_EMISSION)
5360#if defined(GL_AMBIENT_AND_DIFFUSE)
5361 case GL_AMBIENT_AND_DIFFUSE:
5362#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5363 _needed = 4;
5364 break;
5365 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005366 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005367 break;
5368 }
5369 if (_remaining < _needed) {
5370 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005371 _exceptionType = "java/lang/IllegalArgumentException";
5372 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005373 goto exit;
5374 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005375 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005376 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005377 params = (GLfloat *) (_paramsBase + _bufferOffset);
5378 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005379 glGetMaterialfv(
5380 (GLenum)face,
5381 (GLenum)pname,
5382 (GLfloat *)params
5383 );
5384
5385exit:
5386 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005387 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005388 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005389 if (_exception) {
5390 jniThrowException(_env, _exceptionType, _exceptionMessage);
5391 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005392}
5393
5394/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5395static void
5396android_glGetMaterialxv__II_3II
5397 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5398 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005399 const char * _exceptionType = NULL;
5400 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005401 GLfixed *params_base = (GLfixed *) 0;
5402 jint _remaining;
5403 GLfixed *params = (GLfixed *) 0;
5404
5405 if (!params_ref) {
5406 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005407 _exceptionType = "java/lang/IllegalArgumentException";
5408 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005409 goto exit;
5410 }
5411 if (offset < 0) {
5412 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005413 _exceptionType = "java/lang/IllegalArgumentException";
5414 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005415 goto exit;
5416 }
5417 _remaining = _env->GetArrayLength(params_ref) - offset;
5418 int _needed;
5419 switch (pname) {
5420#if defined(GL_SHININESS)
5421 case GL_SHININESS:
5422#endif // defined(GL_SHININESS)
5423 _needed = 1;
5424 break;
5425#if defined(GL_AMBIENT)
5426 case GL_AMBIENT:
5427#endif // defined(GL_AMBIENT)
5428#if defined(GL_DIFFUSE)
5429 case GL_DIFFUSE:
5430#endif // defined(GL_DIFFUSE)
5431#if defined(GL_SPECULAR)
5432 case GL_SPECULAR:
5433#endif // defined(GL_SPECULAR)
5434#if defined(GL_EMISSION)
5435 case GL_EMISSION:
5436#endif // defined(GL_EMISSION)
5437#if defined(GL_AMBIENT_AND_DIFFUSE)
5438 case GL_AMBIENT_AND_DIFFUSE:
5439#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5440 _needed = 4;
5441 break;
5442 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005443 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005444 break;
5445 }
5446 if (_remaining < _needed) {
5447 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005448 _exceptionType = "java/lang/IllegalArgumentException";
5449 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005450 goto exit;
5451 }
5452 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005453 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005454 params = params_base + offset;
5455
5456 glGetMaterialxv(
5457 (GLenum)face,
5458 (GLenum)pname,
5459 (GLfixed *)params
5460 );
5461
5462exit:
5463 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005464 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005465 _exception ? JNI_ABORT: 0);
5466 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005467 if (_exception) {
5468 jniThrowException(_env, _exceptionType, _exceptionMessage);
5469 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005470}
5471
5472/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5473static void
5474android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5475 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5476 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005477 const char * _exceptionType = NULL;
5478 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005479 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005480 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005481 jint _remaining;
5482 GLfixed *params = (GLfixed *) 0;
5483
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005484 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005485 int _needed;
5486 switch (pname) {
5487#if defined(GL_SHININESS)
5488 case GL_SHININESS:
5489#endif // defined(GL_SHININESS)
5490 _needed = 1;
5491 break;
5492#if defined(GL_AMBIENT)
5493 case GL_AMBIENT:
5494#endif // defined(GL_AMBIENT)
5495#if defined(GL_DIFFUSE)
5496 case GL_DIFFUSE:
5497#endif // defined(GL_DIFFUSE)
5498#if defined(GL_SPECULAR)
5499 case GL_SPECULAR:
5500#endif // defined(GL_SPECULAR)
5501#if defined(GL_EMISSION)
5502 case GL_EMISSION:
5503#endif // defined(GL_EMISSION)
5504#if defined(GL_AMBIENT_AND_DIFFUSE)
5505 case GL_AMBIENT_AND_DIFFUSE:
5506#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5507 _needed = 4;
5508 break;
5509 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005510 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005511 break;
5512 }
5513 if (_remaining < _needed) {
5514 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005515 _exceptionType = "java/lang/IllegalArgumentException";
5516 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005517 goto exit;
5518 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005519 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005520 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005521 params = (GLfixed *) (_paramsBase + _bufferOffset);
5522 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005523 glGetMaterialxv(
5524 (GLenum)face,
5525 (GLenum)pname,
5526 (GLfixed *)params
5527 );
5528
5529exit:
5530 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005531 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005532 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005533 if (_exception) {
5534 jniThrowException(_env, _exceptionType, _exceptionMessage);
5535 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005536}
5537
5538/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5539static void
5540android_glGetTexEnviv__II_3II
5541 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5542 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005543 const char * _exceptionType = NULL;
5544 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005545 GLint *params_base = (GLint *) 0;
5546 jint _remaining;
5547 GLint *params = (GLint *) 0;
5548
5549 if (!params_ref) {
5550 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005551 _exceptionType = "java/lang/IllegalArgumentException";
5552 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005553 goto exit;
5554 }
5555 if (offset < 0) {
5556 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005557 _exceptionType = "java/lang/IllegalArgumentException";
5558 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005559 goto exit;
5560 }
5561 _remaining = _env->GetArrayLength(params_ref) - offset;
5562 int _needed;
5563 switch (pname) {
5564#if defined(GL_TEXTURE_ENV_MODE)
5565 case GL_TEXTURE_ENV_MODE:
5566#endif // defined(GL_TEXTURE_ENV_MODE)
5567#if defined(GL_COMBINE_RGB)
5568 case GL_COMBINE_RGB:
5569#endif // defined(GL_COMBINE_RGB)
5570#if defined(GL_COMBINE_ALPHA)
5571 case GL_COMBINE_ALPHA:
5572#endif // defined(GL_COMBINE_ALPHA)
5573 _needed = 1;
5574 break;
5575#if defined(GL_TEXTURE_ENV_COLOR)
5576 case GL_TEXTURE_ENV_COLOR:
5577#endif // defined(GL_TEXTURE_ENV_COLOR)
5578 _needed = 4;
5579 break;
5580 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005581 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005582 break;
5583 }
5584 if (_remaining < _needed) {
5585 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005586 _exceptionType = "java/lang/IllegalArgumentException";
5587 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005588 goto exit;
5589 }
5590 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005591 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005592 params = params_base + offset;
5593
5594 glGetTexEnviv(
5595 (GLenum)env,
5596 (GLenum)pname,
5597 (GLint *)params
5598 );
5599
5600exit:
5601 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005602 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005603 _exception ? JNI_ABORT: 0);
5604 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005605 if (_exception) {
5606 jniThrowException(_env, _exceptionType, _exceptionMessage);
5607 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005608}
5609
5610/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5611static void
5612android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5613 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5614 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005615 const char * _exceptionType = NULL;
5616 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005617 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005618 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005619 jint _remaining;
5620 GLint *params = (GLint *) 0;
5621
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005622 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005623 int _needed;
5624 switch (pname) {
5625#if defined(GL_TEXTURE_ENV_MODE)
5626 case GL_TEXTURE_ENV_MODE:
5627#endif // defined(GL_TEXTURE_ENV_MODE)
5628#if defined(GL_COMBINE_RGB)
5629 case GL_COMBINE_RGB:
5630#endif // defined(GL_COMBINE_RGB)
5631#if defined(GL_COMBINE_ALPHA)
5632 case GL_COMBINE_ALPHA:
5633#endif // defined(GL_COMBINE_ALPHA)
5634 _needed = 1;
5635 break;
5636#if defined(GL_TEXTURE_ENV_COLOR)
5637 case GL_TEXTURE_ENV_COLOR:
5638#endif // defined(GL_TEXTURE_ENV_COLOR)
5639 _needed = 4;
5640 break;
5641 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005642 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005643 break;
5644 }
5645 if (_remaining < _needed) {
5646 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005647 _exceptionType = "java/lang/IllegalArgumentException";
5648 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005649 goto exit;
5650 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005651 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005652 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005653 params = (GLint *) (_paramsBase + _bufferOffset);
5654 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005655 glGetTexEnviv(
5656 (GLenum)env,
5657 (GLenum)pname,
5658 (GLint *)params
5659 );
5660
5661exit:
5662 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005663 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005664 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005665 if (_exception) {
5666 jniThrowException(_env, _exceptionType, _exceptionMessage);
5667 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005668}
5669
5670/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
5671static void
5672android_glGetTexEnvxv__II_3II
5673 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5674 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005675 const char * _exceptionType = NULL;
5676 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005677 GLfixed *params_base = (GLfixed *) 0;
5678 jint _remaining;
5679 GLfixed *params = (GLfixed *) 0;
5680
5681 if (!params_ref) {
5682 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005683 _exceptionType = "java/lang/IllegalArgumentException";
5684 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005685 goto exit;
5686 }
5687 if (offset < 0) {
5688 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005689 _exceptionType = "java/lang/IllegalArgumentException";
5690 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005691 goto exit;
5692 }
5693 _remaining = _env->GetArrayLength(params_ref) - offset;
5694 int _needed;
5695 switch (pname) {
5696#if defined(GL_TEXTURE_ENV_MODE)
5697 case GL_TEXTURE_ENV_MODE:
5698#endif // defined(GL_TEXTURE_ENV_MODE)
5699#if defined(GL_COMBINE_RGB)
5700 case GL_COMBINE_RGB:
5701#endif // defined(GL_COMBINE_RGB)
5702#if defined(GL_COMBINE_ALPHA)
5703 case GL_COMBINE_ALPHA:
5704#endif // defined(GL_COMBINE_ALPHA)
5705 _needed = 1;
5706 break;
5707#if defined(GL_TEXTURE_ENV_COLOR)
5708 case GL_TEXTURE_ENV_COLOR:
5709#endif // defined(GL_TEXTURE_ENV_COLOR)
5710 _needed = 4;
5711 break;
5712 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005713 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005714 break;
5715 }
5716 if (_remaining < _needed) {
5717 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005718 _exceptionType = "java/lang/IllegalArgumentException";
5719 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005720 goto exit;
5721 }
5722 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005723 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005724 params = params_base + offset;
5725
5726 glGetTexEnvxv(
5727 (GLenum)env,
5728 (GLenum)pname,
5729 (GLfixed *)params
5730 );
5731
5732exit:
5733 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005734 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005735 _exception ? JNI_ABORT: 0);
5736 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005737 if (_exception) {
5738 jniThrowException(_env, _exceptionType, _exceptionMessage);
5739 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005740}
5741
5742/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
5743static void
5744android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
5745 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5746 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005747 const char * _exceptionType = NULL;
5748 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005749 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005750 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005751 jint _remaining;
5752 GLfixed *params = (GLfixed *) 0;
5753
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005754 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005755 int _needed;
5756 switch (pname) {
5757#if defined(GL_TEXTURE_ENV_MODE)
5758 case GL_TEXTURE_ENV_MODE:
5759#endif // defined(GL_TEXTURE_ENV_MODE)
5760#if defined(GL_COMBINE_RGB)
5761 case GL_COMBINE_RGB:
5762#endif // defined(GL_COMBINE_RGB)
5763#if defined(GL_COMBINE_ALPHA)
5764 case GL_COMBINE_ALPHA:
5765#endif // defined(GL_COMBINE_ALPHA)
5766 _needed = 1;
5767 break;
5768#if defined(GL_TEXTURE_ENV_COLOR)
5769 case GL_TEXTURE_ENV_COLOR:
5770#endif // defined(GL_TEXTURE_ENV_COLOR)
5771 _needed = 4;
5772 break;
5773 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005774 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005775 break;
5776 }
5777 if (_remaining < _needed) {
5778 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005779 _exceptionType = "java/lang/IllegalArgumentException";
5780 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005781 goto exit;
5782 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005783 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005784 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005785 params = (GLfixed *) (_paramsBase + _bufferOffset);
5786 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005787 glGetTexEnvxv(
5788 (GLenum)env,
5789 (GLenum)pname,
5790 (GLfixed *)params
5791 );
5792
5793exit:
5794 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005795 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005796 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005797 if (_exception) {
5798 jniThrowException(_env, _exceptionType, _exceptionMessage);
5799 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005800}
5801
5802/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
5803static void
5804android_glGetTexParameterfv__II_3FI
5805 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
5806 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005807 const char * _exceptionType = NULL;
5808 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005809 GLfloat *params_base = (GLfloat *) 0;
5810 jint _remaining;
5811 GLfloat *params = (GLfloat *) 0;
5812
5813 if (!params_ref) {
5814 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005815 _exceptionType = "java/lang/IllegalArgumentException";
5816 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005817 goto exit;
5818 }
5819 if (offset < 0) {
5820 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005821 _exceptionType = "java/lang/IllegalArgumentException";
5822 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005823 goto exit;
5824 }
5825 _remaining = _env->GetArrayLength(params_ref) - offset;
5826 if (_remaining < 1) {
5827 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005828 _exceptionType = "java/lang/IllegalArgumentException";
5829 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005830 goto exit;
5831 }
5832 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005833 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005834 params = params_base + offset;
5835
5836 glGetTexParameterfv(
5837 (GLenum)target,
5838 (GLenum)pname,
5839 (GLfloat *)params
5840 );
5841
5842exit:
5843 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005844 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005845 _exception ? JNI_ABORT: 0);
5846 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005847 if (_exception) {
5848 jniThrowException(_env, _exceptionType, _exceptionMessage);
5849 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005850}
5851
5852/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
5853static void
5854android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
5855 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
5856 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005857 const char * _exceptionType = NULL;
5858 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005859 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005860 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005861 jint _remaining;
5862 GLfloat *params = (GLfloat *) 0;
5863
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005864 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005865 if (_remaining < 1) {
5866 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005867 _exceptionType = "java/lang/IllegalArgumentException";
5868 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005869 goto exit;
5870 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005871 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005872 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005873 params = (GLfloat *) (_paramsBase + _bufferOffset);
5874 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005875 glGetTexParameterfv(
5876 (GLenum)target,
5877 (GLenum)pname,
5878 (GLfloat *)params
5879 );
5880
5881exit:
5882 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005883 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005884 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005885 if (_exception) {
5886 jniThrowException(_env, _exceptionType, _exceptionMessage);
5887 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005888}
5889
5890/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
5891static void
5892android_glGetTexParameteriv__II_3II
5893 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
5894 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005895 const char * _exceptionType = NULL;
5896 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005897 GLint *params_base = (GLint *) 0;
5898 jint _remaining;
5899 GLint *params = (GLint *) 0;
5900
5901 if (!params_ref) {
5902 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005903 _exceptionType = "java/lang/IllegalArgumentException";
5904 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005905 goto exit;
5906 }
5907 if (offset < 0) {
5908 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005909 _exceptionType = "java/lang/IllegalArgumentException";
5910 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005911 goto exit;
5912 }
5913 _remaining = _env->GetArrayLength(params_ref) - offset;
5914 if (_remaining < 1) {
5915 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005916 _exceptionType = "java/lang/IllegalArgumentException";
5917 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005918 goto exit;
5919 }
5920 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005921 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005922 params = params_base + offset;
5923
5924 glGetTexParameteriv(
5925 (GLenum)target,
5926 (GLenum)pname,
5927 (GLint *)params
5928 );
5929
5930exit:
5931 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005932 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005933 _exception ? JNI_ABORT: 0);
5934 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005935 if (_exception) {
5936 jniThrowException(_env, _exceptionType, _exceptionMessage);
5937 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005938}
5939
5940/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
5941static void
5942android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
5943 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
5944 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005945 const char * _exceptionType = NULL;
5946 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005947 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005948 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005949 jint _remaining;
5950 GLint *params = (GLint *) 0;
5951
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005952 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005953 if (_remaining < 1) {
5954 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005955 _exceptionType = "java/lang/IllegalArgumentException";
5956 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005957 goto exit;
5958 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005959 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005960 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005961 params = (GLint *) (_paramsBase + _bufferOffset);
5962 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005963 glGetTexParameteriv(
5964 (GLenum)target,
5965 (GLenum)pname,
5966 (GLint *)params
5967 );
5968
5969exit:
5970 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005971 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005972 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005973 if (_exception) {
5974 jniThrowException(_env, _exceptionType, _exceptionMessage);
5975 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005976}
5977
5978/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
5979static void
5980android_glGetTexParameterxv__II_3II
5981 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
5982 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005983 const char * _exceptionType = NULL;
5984 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005985 GLfixed *params_base = (GLfixed *) 0;
5986 jint _remaining;
5987 GLfixed *params = (GLfixed *) 0;
5988
5989 if (!params_ref) {
5990 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005991 _exceptionType = "java/lang/IllegalArgumentException";
5992 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005993 goto exit;
5994 }
5995 if (offset < 0) {
5996 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005997 _exceptionType = "java/lang/IllegalArgumentException";
5998 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005999 goto exit;
6000 }
6001 _remaining = _env->GetArrayLength(params_ref) - offset;
6002 if (_remaining < 1) {
6003 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006004 _exceptionType = "java/lang/IllegalArgumentException";
6005 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006006 goto exit;
6007 }
6008 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006009 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006010 params = params_base + offset;
6011
6012 glGetTexParameterxv(
6013 (GLenum)target,
6014 (GLenum)pname,
6015 (GLfixed *)params
6016 );
6017
6018exit:
6019 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006020 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006021 _exception ? JNI_ABORT: 0);
6022 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006023 if (_exception) {
6024 jniThrowException(_env, _exceptionType, _exceptionMessage);
6025 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006026}
6027
6028/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6029static void
6030android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6031 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6032 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006033 const char * _exceptionType = NULL;
6034 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006035 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006036 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006037 jint _remaining;
6038 GLfixed *params = (GLfixed *) 0;
6039
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006040 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006041 if (_remaining < 1) {
6042 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006043 _exceptionType = "java/lang/IllegalArgumentException";
6044 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006045 goto exit;
6046 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006047 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006048 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006049 params = (GLfixed *) (_paramsBase + _bufferOffset);
6050 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006051 glGetTexParameterxv(
6052 (GLenum)target,
6053 (GLenum)pname,
6054 (GLfixed *)params
6055 );
6056
6057exit:
6058 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006059 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006060 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006061 if (_exception) {
6062 jniThrowException(_env, _exceptionType, _exceptionMessage);
6063 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006064}
6065
6066/* GLboolean glIsBuffer ( GLuint buffer ) */
6067static jboolean
6068android_glIsBuffer__I
6069 (JNIEnv *_env, jobject _this, jint buffer) {
6070 GLboolean _returnValue;
6071 _returnValue = glIsBuffer(
6072 (GLuint)buffer
6073 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006074 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006075}
6076
6077/* GLboolean glIsEnabled ( GLenum cap ) */
6078static jboolean
6079android_glIsEnabled__I
6080 (JNIEnv *_env, jobject _this, jint cap) {
6081 GLboolean _returnValue;
6082 _returnValue = glIsEnabled(
6083 (GLenum)cap
6084 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006085 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006086}
6087
6088/* GLboolean glIsTexture ( GLuint texture ) */
6089static jboolean
6090android_glIsTexture__I
6091 (JNIEnv *_env, jobject _this, jint texture) {
6092 GLboolean _returnValue;
6093 _returnValue = glIsTexture(
6094 (GLuint)texture
6095 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006096 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006097}
6098
6099/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6100static void
6101android_glNormalPointer__III
6102 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6103 glNormalPointer(
6104 (GLenum)type,
6105 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006106 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006107 );
6108}
6109
6110/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6111static void
6112android_glPointParameterf__IF
6113 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6114 glPointParameterf(
6115 (GLenum)pname,
6116 (GLfloat)param
6117 );
6118}
6119
6120/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6121static void
6122android_glPointParameterfv__I_3FI
6123 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006124 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006125 const char * _exceptionType = NULL;
6126 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006127 GLfloat *params_base = (GLfloat *) 0;
6128 jint _remaining;
6129 GLfloat *params = (GLfloat *) 0;
6130
6131 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006132 _exception = 1;
6133 _exceptionType = "java/lang/IllegalArgumentException";
6134 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006135 goto exit;
6136 }
6137 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006138 _exception = 1;
6139 _exceptionType = "java/lang/IllegalArgumentException";
6140 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006141 goto exit;
6142 }
6143 _remaining = _env->GetArrayLength(params_ref) - offset;
6144 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006145 _exception = 1;
6146 _exceptionType = "java/lang/IllegalArgumentException";
6147 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006148 goto exit;
6149 }
6150 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006151 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006152 params = params_base + offset;
6153
6154 glPointParameterfv(
6155 (GLenum)pname,
6156 (GLfloat *)params
6157 );
6158
6159exit:
6160 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006161 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006162 JNI_ABORT);
6163 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006164 if (_exception) {
6165 jniThrowException(_env, _exceptionType, _exceptionMessage);
6166 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006167}
6168
6169/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6170static void
6171android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6172 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006173 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006174 const char * _exceptionType = NULL;
6175 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006176 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006177 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006178 jint _remaining;
6179 GLfloat *params = (GLfloat *) 0;
6180
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006181 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006182 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006183 _exception = 1;
6184 _exceptionType = "java/lang/IllegalArgumentException";
6185 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006186 goto exit;
6187 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006188 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006189 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006190 params = (GLfloat *) (_paramsBase + _bufferOffset);
6191 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006192 glPointParameterfv(
6193 (GLenum)pname,
6194 (GLfloat *)params
6195 );
6196
6197exit:
6198 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006199 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006200 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006201 if (_exception) {
6202 jniThrowException(_env, _exceptionType, _exceptionMessage);
6203 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006204}
6205
6206/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6207static void
6208android_glPointParameterx__II
6209 (JNIEnv *_env, jobject _this, jint pname, jint param) {
6210 glPointParameterx(
6211 (GLenum)pname,
6212 (GLfixed)param
6213 );
6214}
6215
6216/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6217static void
6218android_glPointParameterxv__I_3II
6219 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006220 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006221 const char * _exceptionType = NULL;
6222 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006223 GLfixed *params_base = (GLfixed *) 0;
6224 jint _remaining;
6225 GLfixed *params = (GLfixed *) 0;
6226
6227 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006228 _exception = 1;
6229 _exceptionType = "java/lang/IllegalArgumentException";
6230 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006231 goto exit;
6232 }
6233 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006234 _exception = 1;
6235 _exceptionType = "java/lang/IllegalArgumentException";
6236 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006237 goto exit;
6238 }
6239 _remaining = _env->GetArrayLength(params_ref) - offset;
6240 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006241 _exception = 1;
6242 _exceptionType = "java/lang/IllegalArgumentException";
6243 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006244 goto exit;
6245 }
6246 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006247 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006248 params = params_base + offset;
6249
6250 glPointParameterxv(
6251 (GLenum)pname,
6252 (GLfixed *)params
6253 );
6254
6255exit:
6256 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006257 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006258 JNI_ABORT);
6259 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006260 if (_exception) {
6261 jniThrowException(_env, _exceptionType, _exceptionMessage);
6262 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006263}
6264
6265/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6266static void
6267android_glPointParameterxv__ILjava_nio_IntBuffer_2
6268 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006269 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006270 const char * _exceptionType = NULL;
6271 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006272 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006273 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006274 jint _remaining;
6275 GLfixed *params = (GLfixed *) 0;
6276
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006277 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006278 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006279 _exception = 1;
6280 _exceptionType = "java/lang/IllegalArgumentException";
6281 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006282 goto exit;
6283 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006284 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006285 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006286 params = (GLfixed *) (_paramsBase + _bufferOffset);
6287 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006288 glPointParameterxv(
6289 (GLenum)pname,
6290 (GLfixed *)params
6291 );
6292
6293exit:
6294 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006295 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006296 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006297 if (_exception) {
6298 jniThrowException(_env, _exceptionType, _exceptionMessage);
6299 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006300}
6301
6302/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6303static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08006304android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6305 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006306 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006307 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006308 jint _remaining;
6309 GLvoid *pointer = (GLvoid *) 0;
6310
Jack Palevichbe6eac82009-12-08 15:43:51 +08006311 if (pointer_buf) {
6312 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6313 if ( ! pointer ) {
6314 return;
6315 }
6316 }
6317 glPointSizePointerOESBounds(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006318 (GLenum)type,
6319 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08006320 (GLvoid *)pointer,
6321 (GLsizei)remaining
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006322 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006323}
6324
6325/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6326static void
6327android_glTexCoordPointer__IIII
6328 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6329 glTexCoordPointer(
6330 (GLint)size,
6331 (GLenum)type,
6332 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006333 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006334 );
6335}
6336
6337/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6338static void
6339android_glTexEnvi__III
6340 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6341 glTexEnvi(
6342 (GLenum)target,
6343 (GLenum)pname,
6344 (GLint)param
6345 );
6346}
6347
6348/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6349static void
6350android_glTexEnviv__II_3II
6351 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006352 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006353 const char * _exceptionType = NULL;
6354 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006355 GLint *params_base = (GLint *) 0;
6356 jint _remaining;
6357 GLint *params = (GLint *) 0;
6358
6359 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006360 _exception = 1;
6361 _exceptionType = "java/lang/IllegalArgumentException";
6362 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006363 goto exit;
6364 }
6365 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006366 _exception = 1;
6367 _exceptionType = "java/lang/IllegalArgumentException";
6368 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006369 goto exit;
6370 }
6371 _remaining = _env->GetArrayLength(params_ref) - offset;
6372 int _needed;
6373 switch (pname) {
6374#if defined(GL_TEXTURE_ENV_MODE)
6375 case GL_TEXTURE_ENV_MODE:
6376#endif // defined(GL_TEXTURE_ENV_MODE)
6377#if defined(GL_COMBINE_RGB)
6378 case GL_COMBINE_RGB:
6379#endif // defined(GL_COMBINE_RGB)
6380#if defined(GL_COMBINE_ALPHA)
6381 case GL_COMBINE_ALPHA:
6382#endif // defined(GL_COMBINE_ALPHA)
6383 _needed = 1;
6384 break;
6385#if defined(GL_TEXTURE_ENV_COLOR)
6386 case GL_TEXTURE_ENV_COLOR:
6387#endif // defined(GL_TEXTURE_ENV_COLOR)
6388 _needed = 4;
6389 break;
6390 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006391 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006392 break;
6393 }
6394 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006395 _exception = 1;
6396 _exceptionType = "java/lang/IllegalArgumentException";
6397 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006398 goto exit;
6399 }
6400 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006401 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006402 params = params_base + offset;
6403
6404 glTexEnviv(
6405 (GLenum)target,
6406 (GLenum)pname,
6407 (GLint *)params
6408 );
6409
6410exit:
6411 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006412 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006413 JNI_ABORT);
6414 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006415 if (_exception) {
6416 jniThrowException(_env, _exceptionType, _exceptionMessage);
6417 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006418}
6419
6420/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6421static void
6422android_glTexEnviv__IILjava_nio_IntBuffer_2
6423 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006424 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006425 const char * _exceptionType = NULL;
6426 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006427 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006428 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006429 jint _remaining;
6430 GLint *params = (GLint *) 0;
6431
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006432 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006433 int _needed;
6434 switch (pname) {
6435#if defined(GL_TEXTURE_ENV_MODE)
6436 case GL_TEXTURE_ENV_MODE:
6437#endif // defined(GL_TEXTURE_ENV_MODE)
6438#if defined(GL_COMBINE_RGB)
6439 case GL_COMBINE_RGB:
6440#endif // defined(GL_COMBINE_RGB)
6441#if defined(GL_COMBINE_ALPHA)
6442 case GL_COMBINE_ALPHA:
6443#endif // defined(GL_COMBINE_ALPHA)
6444 _needed = 1;
6445 break;
6446#if defined(GL_TEXTURE_ENV_COLOR)
6447 case GL_TEXTURE_ENV_COLOR:
6448#endif // defined(GL_TEXTURE_ENV_COLOR)
6449 _needed = 4;
6450 break;
6451 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006452 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006453 break;
6454 }
6455 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006456 _exception = 1;
6457 _exceptionType = "java/lang/IllegalArgumentException";
6458 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006459 goto exit;
6460 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006461 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006462 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006463 params = (GLint *) (_paramsBase + _bufferOffset);
6464 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006465 glTexEnviv(
6466 (GLenum)target,
6467 (GLenum)pname,
6468 (GLint *)params
6469 );
6470
6471exit:
6472 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006473 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006474 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006475 if (_exception) {
6476 jniThrowException(_env, _exceptionType, _exceptionMessage);
6477 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006478}
6479
6480/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6481static void
6482android_glTexParameterfv__II_3FI
6483 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006484 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006485 const char * _exceptionType = NULL;
6486 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006487 GLfloat *params_base = (GLfloat *) 0;
6488 jint _remaining;
6489 GLfloat *params = (GLfloat *) 0;
6490
6491 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006492 _exception = 1;
6493 _exceptionType = "java/lang/IllegalArgumentException";
6494 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006495 goto exit;
6496 }
6497 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006498 _exception = 1;
6499 _exceptionType = "java/lang/IllegalArgumentException";
6500 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006501 goto exit;
6502 }
6503 _remaining = _env->GetArrayLength(params_ref) - offset;
6504 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006505 _exception = 1;
6506 _exceptionType = "java/lang/IllegalArgumentException";
6507 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006508 goto exit;
6509 }
6510 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006511 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006512 params = params_base + offset;
6513
6514 glTexParameterfv(
6515 (GLenum)target,
6516 (GLenum)pname,
6517 (GLfloat *)params
6518 );
6519
6520exit:
6521 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006522 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006523 JNI_ABORT);
6524 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006525 if (_exception) {
6526 jniThrowException(_env, _exceptionType, _exceptionMessage);
6527 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006528}
6529
6530/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6531static void
6532android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6533 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006534 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006535 const char * _exceptionType = NULL;
6536 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006537 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006538 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006539 jint _remaining;
6540 GLfloat *params = (GLfloat *) 0;
6541
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006542 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006543 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006544 _exception = 1;
6545 _exceptionType = "java/lang/IllegalArgumentException";
6546 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006547 goto exit;
6548 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006549 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006550 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006551 params = (GLfloat *) (_paramsBase + _bufferOffset);
6552 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006553 glTexParameterfv(
6554 (GLenum)target,
6555 (GLenum)pname,
6556 (GLfloat *)params
6557 );
6558
6559exit:
6560 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006561 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006562 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006563 if (_exception) {
6564 jniThrowException(_env, _exceptionType, _exceptionMessage);
6565 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006566}
6567
6568/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6569static void
6570android_glTexParameteri__III
6571 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6572 glTexParameteri(
6573 (GLenum)target,
6574 (GLenum)pname,
6575 (GLint)param
6576 );
6577}
6578
6579/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6580static void
6581android_glTexParameteriv__II_3II
6582 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006583 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006584 const char * _exceptionType = NULL;
6585 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006586 GLint *params_base = (GLint *) 0;
6587 jint _remaining;
6588 GLint *params = (GLint *) 0;
6589
6590 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006591 _exception = 1;
6592 _exceptionType = "java/lang/IllegalArgumentException";
6593 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006594 goto exit;
6595 }
6596 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006597 _exception = 1;
6598 _exceptionType = "java/lang/IllegalArgumentException";
6599 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006600 goto exit;
6601 }
6602 _remaining = _env->GetArrayLength(params_ref) - offset;
6603 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006604 _exception = 1;
6605 _exceptionType = "java/lang/IllegalArgumentException";
6606 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006607 goto exit;
6608 }
6609 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006610 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006611 params = params_base + offset;
6612
6613 glTexParameteriv(
6614 (GLenum)target,
6615 (GLenum)pname,
6616 (GLint *)params
6617 );
6618
6619exit:
6620 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006621 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006622 JNI_ABORT);
6623 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006624 if (_exception) {
6625 jniThrowException(_env, _exceptionType, _exceptionMessage);
6626 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006627}
6628
6629/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6630static void
6631android_glTexParameteriv__IILjava_nio_IntBuffer_2
6632 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006633 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006634 const char * _exceptionType = NULL;
6635 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006636 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006637 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006638 jint _remaining;
6639 GLint *params = (GLint *) 0;
6640
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006641 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006642 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006643 _exception = 1;
6644 _exceptionType = "java/lang/IllegalArgumentException";
6645 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006646 goto exit;
6647 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006648 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006649 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006650 params = (GLint *) (_paramsBase + _bufferOffset);
6651 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006652 glTexParameteriv(
6653 (GLenum)target,
6654 (GLenum)pname,
6655 (GLint *)params
6656 );
6657
6658exit:
6659 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006660 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006661 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006662 if (_exception) {
6663 jniThrowException(_env, _exceptionType, _exceptionMessage);
6664 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006665}
6666
6667/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
6668static void
6669android_glTexParameterxv__II_3II
6670 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006671 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006672 const char * _exceptionType = NULL;
6673 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006674 GLfixed *params_base = (GLfixed *) 0;
6675 jint _remaining;
6676 GLfixed *params = (GLfixed *) 0;
6677
6678 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006679 _exception = 1;
6680 _exceptionType = "java/lang/IllegalArgumentException";
6681 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006682 goto exit;
6683 }
6684 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006685 _exception = 1;
6686 _exceptionType = "java/lang/IllegalArgumentException";
6687 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006688 goto exit;
6689 }
6690 _remaining = _env->GetArrayLength(params_ref) - offset;
6691 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006692 _exception = 1;
6693 _exceptionType = "java/lang/IllegalArgumentException";
6694 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006695 goto exit;
6696 }
6697 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006698 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006699 params = params_base + offset;
6700
6701 glTexParameterxv(
6702 (GLenum)target,
6703 (GLenum)pname,
6704 (GLfixed *)params
6705 );
6706
6707exit:
6708 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006709 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006710 JNI_ABORT);
6711 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006712 if (_exception) {
6713 jniThrowException(_env, _exceptionType, _exceptionMessage);
6714 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006715}
6716
6717/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
6718static void
6719android_glTexParameterxv__IILjava_nio_IntBuffer_2
6720 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006721 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006722 const char * _exceptionType = NULL;
6723 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006724 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006725 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006726 jint _remaining;
6727 GLfixed *params = (GLfixed *) 0;
6728
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006729 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006730 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006731 _exception = 1;
6732 _exceptionType = "java/lang/IllegalArgumentException";
6733 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006734 goto exit;
6735 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006736 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006737 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006738 params = (GLfixed *) (_paramsBase + _bufferOffset);
6739 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006740 glTexParameterxv(
6741 (GLenum)target,
6742 (GLenum)pname,
6743 (GLfixed *)params
6744 );
6745
6746exit:
6747 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006748 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006749 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006750 if (_exception) {
6751 jniThrowException(_env, _exceptionType, _exceptionMessage);
6752 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006753}
6754
6755/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6756static void
6757android_glVertexPointer__IIII
6758 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6759 glVertexPointer(
6760 (GLint)size,
6761 (GLenum)type,
6762 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006763 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006764 );
6765}
6766
6767/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
6768static void
6769android_glCurrentPaletteMatrixOES__I
6770 (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08006771 glCurrentPaletteMatrixOES(
6772 (GLuint)matrixpaletteindex
6773 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006774}
6775
6776/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
6777static void
6778android_glDrawTexfOES__FFFFF
6779 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
6780 glDrawTexfOES(
6781 (GLfloat)x,
6782 (GLfloat)y,
6783 (GLfloat)z,
6784 (GLfloat)width,
6785 (GLfloat)height
6786 );
6787}
6788
6789/* void glDrawTexfvOES ( const GLfloat *coords ) */
6790static void
6791android_glDrawTexfvOES___3FI
6792 (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006793 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006794 const char * _exceptionType = NULL;
6795 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006796 GLfloat *coords_base = (GLfloat *) 0;
6797 jint _remaining;
6798 GLfloat *coords = (GLfloat *) 0;
6799
6800 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006801 _exception = 1;
6802 _exceptionType = "java/lang/IllegalArgumentException";
6803 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006804 goto exit;
6805 }
6806 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006807 _exception = 1;
6808 _exceptionType = "java/lang/IllegalArgumentException";
6809 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006810 goto exit;
6811 }
6812 _remaining = _env->GetArrayLength(coords_ref) - offset;
6813 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006814 _exception = 1;
6815 _exceptionType = "java/lang/IllegalArgumentException";
6816 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006817 goto exit;
6818 }
6819 coords_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006820 _env->GetFloatArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006821 coords = coords_base + offset;
6822
6823 glDrawTexfvOES(
6824 (GLfloat *)coords
6825 );
6826
6827exit:
6828 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006829 _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006830 JNI_ABORT);
6831 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006832 if (_exception) {
6833 jniThrowException(_env, _exceptionType, _exceptionMessage);
6834 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006835}
6836
6837/* void glDrawTexfvOES ( const GLfloat *coords ) */
6838static void
6839android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
6840 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006841 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006842 const char * _exceptionType = NULL;
6843 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006844 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006845 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006846 jint _remaining;
6847 GLfloat *coords = (GLfloat *) 0;
6848
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006849 coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006850 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006851 _exception = 1;
6852 _exceptionType = "java/lang/IllegalArgumentException";
6853 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006854 goto exit;
6855 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006856 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006857 char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006858 coords = (GLfloat *) (_coordsBase + _bufferOffset);
6859 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006860 glDrawTexfvOES(
6861 (GLfloat *)coords
6862 );
6863
6864exit:
6865 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006866 _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006867 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006868 if (_exception) {
6869 jniThrowException(_env, _exceptionType, _exceptionMessage);
6870 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006871}
6872
6873/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
6874static void
6875android_glDrawTexiOES__IIIII
6876 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
6877 glDrawTexiOES(
6878 (GLint)x,
6879 (GLint)y,
6880 (GLint)z,
6881 (GLint)width,
6882 (GLint)height
6883 );
6884}
6885
6886/* void glDrawTexivOES ( const GLint *coords ) */
6887static void
6888android_glDrawTexivOES___3II
6889 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006890 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006891 const char * _exceptionType = NULL;
6892 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006893 GLint *coords_base = (GLint *) 0;
6894 jint _remaining;
6895 GLint *coords = (GLint *) 0;
6896
6897 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006898 _exception = 1;
6899 _exceptionType = "java/lang/IllegalArgumentException";
6900 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006901 goto exit;
6902 }
6903 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006904 _exception = 1;
6905 _exceptionType = "java/lang/IllegalArgumentException";
6906 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006907 goto exit;
6908 }
6909 _remaining = _env->GetArrayLength(coords_ref) - offset;
6910 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006911 _exception = 1;
6912 _exceptionType = "java/lang/IllegalArgumentException";
6913 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006914 goto exit;
6915 }
6916 coords_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006917 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006918 coords = coords_base + offset;
6919
6920 glDrawTexivOES(
6921 (GLint *)coords
6922 );
6923
6924exit:
6925 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006926 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006927 JNI_ABORT);
6928 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006929 if (_exception) {
6930 jniThrowException(_env, _exceptionType, _exceptionMessage);
6931 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006932}
6933
6934/* void glDrawTexivOES ( const GLint *coords ) */
6935static void
6936android_glDrawTexivOES__Ljava_nio_IntBuffer_2
6937 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006938 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006939 const char * _exceptionType = NULL;
6940 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006941 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006942 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006943 jint _remaining;
6944 GLint *coords = (GLint *) 0;
6945
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006946 coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006947 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006948 _exception = 1;
6949 _exceptionType = "java/lang/IllegalArgumentException";
6950 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006951 goto exit;
6952 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006953 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006954 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006955 coords = (GLint *) (_coordsBase + _bufferOffset);
6956 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006957 glDrawTexivOES(
6958 (GLint *)coords
6959 );
6960
6961exit:
6962 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006963 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006964 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006965 if (_exception) {
6966 jniThrowException(_env, _exceptionType, _exceptionMessage);
6967 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006968}
6969
6970/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
6971static void
6972android_glDrawTexsOES__SSSSS
6973 (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
6974 glDrawTexsOES(
6975 (GLshort)x,
6976 (GLshort)y,
6977 (GLshort)z,
6978 (GLshort)width,
6979 (GLshort)height
6980 );
6981}
6982
6983/* void glDrawTexsvOES ( const GLshort *coords ) */
6984static void
6985android_glDrawTexsvOES___3SI
6986 (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006987 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006988 const char * _exceptionType = NULL;
6989 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006990 GLshort *coords_base = (GLshort *) 0;
6991 jint _remaining;
6992 GLshort *coords = (GLshort *) 0;
6993
6994 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006995 _exception = 1;
6996 _exceptionType = "java/lang/IllegalArgumentException";
6997 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006998 goto exit;
6999 }
7000 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007001 _exception = 1;
7002 _exceptionType = "java/lang/IllegalArgumentException";
7003 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007004 goto exit;
7005 }
7006 _remaining = _env->GetArrayLength(coords_ref) - offset;
7007 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007008 _exception = 1;
7009 _exceptionType = "java/lang/IllegalArgumentException";
7010 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007011 goto exit;
7012 }
7013 coords_base = (GLshort *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007014 _env->GetShortArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007015 coords = coords_base + offset;
7016
7017 glDrawTexsvOES(
7018 (GLshort *)coords
7019 );
7020
7021exit:
7022 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007023 _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007024 JNI_ABORT);
7025 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007026 if (_exception) {
7027 jniThrowException(_env, _exceptionType, _exceptionMessage);
7028 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007029}
7030
7031/* void glDrawTexsvOES ( const GLshort *coords ) */
7032static void
7033android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7034 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007035 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007036 const char * _exceptionType = NULL;
7037 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007038 jshortArray _array = (jshortArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007039 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007040 jint _remaining;
7041 GLshort *coords = (GLshort *) 0;
7042
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007043 coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007044 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007045 _exception = 1;
7046 _exceptionType = "java/lang/IllegalArgumentException";
7047 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007048 goto exit;
7049 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007050 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007051 char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007052 coords = (GLshort *) (_coordsBase + _bufferOffset);
7053 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007054 glDrawTexsvOES(
7055 (GLshort *)coords
7056 );
7057
7058exit:
7059 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007060 _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007061 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007062 if (_exception) {
7063 jniThrowException(_env, _exceptionType, _exceptionMessage);
7064 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007065}
7066
7067/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7068static void
7069android_glDrawTexxOES__IIIII
7070 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7071 glDrawTexxOES(
7072 (GLfixed)x,
7073 (GLfixed)y,
7074 (GLfixed)z,
7075 (GLfixed)width,
7076 (GLfixed)height
7077 );
7078}
7079
7080/* void glDrawTexxvOES ( const GLfixed *coords ) */
7081static void
7082android_glDrawTexxvOES___3II
7083 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007084 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007085 const char * _exceptionType = NULL;
7086 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007087 GLfixed *coords_base = (GLfixed *) 0;
7088 jint _remaining;
7089 GLfixed *coords = (GLfixed *) 0;
7090
7091 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007092 _exception = 1;
7093 _exceptionType = "java/lang/IllegalArgumentException";
7094 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007095 goto exit;
7096 }
7097 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007098 _exception = 1;
7099 _exceptionType = "java/lang/IllegalArgumentException";
7100 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007101 goto exit;
7102 }
7103 _remaining = _env->GetArrayLength(coords_ref) - offset;
7104 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007105 _exception = 1;
7106 _exceptionType = "java/lang/IllegalArgumentException";
7107 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007108 goto exit;
7109 }
7110 coords_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007111 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007112 coords = coords_base + offset;
7113
7114 glDrawTexxvOES(
7115 (GLfixed *)coords
7116 );
7117
7118exit:
7119 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007120 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007121 JNI_ABORT);
7122 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007123 if (_exception) {
7124 jniThrowException(_env, _exceptionType, _exceptionMessage);
7125 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007126}
7127
7128/* void glDrawTexxvOES ( const GLfixed *coords ) */
7129static void
7130android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7131 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007132 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007133 const char * _exceptionType = NULL;
7134 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007135 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007136 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007137 jint _remaining;
7138 GLfixed *coords = (GLfixed *) 0;
7139
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007140 coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007141 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007142 _exception = 1;
7143 _exceptionType = "java/lang/IllegalArgumentException";
7144 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007145 goto exit;
7146 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007147 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007148 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007149 coords = (GLfixed *) (_coordsBase + _bufferOffset);
7150 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007151 glDrawTexxvOES(
7152 (GLfixed *)coords
7153 );
7154
7155exit:
7156 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007157 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007158 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007159 if (_exception) {
7160 jniThrowException(_env, _exceptionType, _exceptionMessage);
7161 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007162}
7163
7164/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7165static void
7166android_glLoadPaletteFromModelViewMatrixOES__
7167 (JNIEnv *_env, jobject _this) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007168 glLoadPaletteFromModelViewMatrixOES();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007169}
7170
7171/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7172static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007173android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7174 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7175 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007176 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007177 jint _remaining;
7178 GLvoid *pointer = (GLvoid *) 0;
7179
7180 if (pointer_buf) {
7181 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7182 if ( ! pointer ) {
7183 return;
7184 }
7185 }
7186 glMatrixIndexPointerOESBounds(
7187 (GLint)size,
7188 (GLenum)type,
7189 (GLsizei)stride,
7190 (GLvoid *)pointer,
7191 (GLsizei)remaining
7192 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007193}
7194
7195/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7196static void
7197android_glMatrixIndexPointerOES__IIII
7198 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007199 glMatrixIndexPointerOES(
7200 (GLint)size,
7201 (GLenum)type,
7202 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007203 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007204 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007205}
7206
7207/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7208static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007209android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7210 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
7211 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007212 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007213 jint _remaining;
7214 GLvoid *pointer = (GLvoid *) 0;
7215
7216 if (pointer_buf) {
7217 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7218 if ( ! pointer ) {
7219 return;
7220 }
7221 }
7222 glWeightPointerOESBounds(
7223 (GLint)size,
7224 (GLenum)type,
7225 (GLsizei)stride,
7226 (GLvoid *)pointer,
7227 (GLsizei)remaining
7228 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007229}
7230
7231/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7232static void
7233android_glWeightPointerOES__IIII
7234 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007235 glWeightPointerOES(
7236 (GLint)size,
7237 (GLenum)type,
7238 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007239 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007240 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007241}
7242
7243/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7244static void
7245android_glBindFramebufferOES__II
7246 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007247 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007248 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007249 "glBindFramebufferOES");
7250 return;
7251 }
7252 glBindFramebufferOES(
7253 (GLint)target,
7254 (GLint)framebuffer
7255 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007256}
7257
7258/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7259static void
7260android_glBindRenderbufferOES__II
7261 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007262 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007263 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007264 "glBindRenderbufferOES");
7265 return;
7266 }
7267 glBindRenderbufferOES(
7268 (GLint)target,
7269 (GLint)renderbuffer
7270 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007271}
7272
7273/* void glBlendEquation ( GLint mode ) */
7274static void
7275android_glBlendEquation__I
7276 (JNIEnv *_env, jobject _this, jint mode) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007277 if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007278 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007279 "glBlendEquation");
7280 return;
7281 }
7282 glBlendEquation(
7283 (GLint)mode
7284 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007285}
7286
7287/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7288static void
7289android_glBlendEquationSeparate__II
7290 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007291 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007292 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007293 "glBlendEquationSeparate");
7294 return;
7295 }
7296 glBlendEquationSeparate(
7297 (GLint)modeRGB,
7298 (GLint)modeAlpha
7299 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007300}
7301
7302/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7303static void
7304android_glBlendFuncSeparate__IIII
7305 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007306 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007307 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007308 "glBlendFuncSeparate");
7309 return;
7310 }
7311 glBlendFuncSeparate(
7312 (GLint)srcRGB,
7313 (GLint)dstRGB,
7314 (GLint)srcAlpha,
7315 (GLint)dstAlpha
7316 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007317}
7318
7319/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7320static jint
7321android_glCheckFramebufferStatusOES__I
7322 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007323 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007324 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007325 "glCheckFramebufferStatusOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007326 return 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007327 }
7328 GLint _returnValue = 0;
7329 _returnValue = glCheckFramebufferStatusOES(
7330 (GLint)target
7331 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07007332 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007333}
7334
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007335/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007336static void
7337android_glDeleteFramebuffersOES__I_3II
7338 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007339 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007340 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007341 "glDeleteFramebuffersOES");
7342 return;
7343 }
7344 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007345 const char * _exceptionType = NULL;
7346 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007347 GLuint *framebuffers_base = (GLuint *) 0;
7348 jint _remaining;
7349 GLuint *framebuffers = (GLuint *) 0;
7350
7351 if (!framebuffers_ref) {
7352 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007353 _exceptionType = "java/lang/IllegalArgumentException";
7354 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007355 goto exit;
7356 }
7357 if (offset < 0) {
7358 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007359 _exceptionType = "java/lang/IllegalArgumentException";
7360 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007361 goto exit;
7362 }
7363 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7364 if (_remaining < n) {
7365 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007366 _exceptionType = "java/lang/IllegalArgumentException";
7367 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007368 goto exit;
7369 }
7370 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007371 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007372 framebuffers = framebuffers_base + offset;
7373
7374 glDeleteFramebuffersOES(
7375 (GLint)n,
7376 (GLuint *)framebuffers
7377 );
7378
7379exit:
7380 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007381 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007382 _exception ? JNI_ABORT: 0);
7383 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007384 if (_exception) {
7385 jniThrowException(_env, _exceptionType, _exceptionMessage);
7386 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007387}
7388
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007389/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007390static void
7391android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7392 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007393 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007394 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007395 "glDeleteFramebuffersOES");
7396 return;
7397 }
7398 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007399 const char * _exceptionType = NULL;
7400 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007401 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007402 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007403 jint _remaining;
7404 GLuint *framebuffers = (GLuint *) 0;
7405
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007406 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007407 if (_remaining < n) {
7408 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007409 _exceptionType = "java/lang/IllegalArgumentException";
7410 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007411 goto exit;
7412 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007413 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007414 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007415 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7416 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007417 glDeleteFramebuffersOES(
7418 (GLint)n,
7419 (GLuint *)framebuffers
7420 );
7421
7422exit:
7423 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007424 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007425 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007426 if (_exception) {
7427 jniThrowException(_env, _exceptionType, _exceptionMessage);
7428 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007429}
7430
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007431/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007432static void
7433android_glDeleteRenderbuffersOES__I_3II
7434 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007435 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007436 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007437 "glDeleteRenderbuffersOES");
7438 return;
7439 }
7440 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007441 const char * _exceptionType = NULL;
7442 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007443 GLuint *renderbuffers_base = (GLuint *) 0;
7444 jint _remaining;
7445 GLuint *renderbuffers = (GLuint *) 0;
7446
7447 if (!renderbuffers_ref) {
7448 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007449 _exceptionType = "java/lang/IllegalArgumentException";
7450 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007451 goto exit;
7452 }
7453 if (offset < 0) {
7454 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007455 _exceptionType = "java/lang/IllegalArgumentException";
7456 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007457 goto exit;
7458 }
7459 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7460 if (_remaining < n) {
7461 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007462 _exceptionType = "java/lang/IllegalArgumentException";
7463 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007464 goto exit;
7465 }
7466 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007467 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007468 renderbuffers = renderbuffers_base + offset;
7469
7470 glDeleteRenderbuffersOES(
7471 (GLint)n,
7472 (GLuint *)renderbuffers
7473 );
7474
7475exit:
7476 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007477 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007478 _exception ? JNI_ABORT: 0);
7479 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007480 if (_exception) {
7481 jniThrowException(_env, _exceptionType, _exceptionMessage);
7482 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007483}
7484
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007485/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007486static void
7487android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7488 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007489 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007490 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007491 "glDeleteRenderbuffersOES");
7492 return;
7493 }
7494 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007495 const char * _exceptionType = NULL;
7496 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007497 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007498 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007499 jint _remaining;
7500 GLuint *renderbuffers = (GLuint *) 0;
7501
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007502 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007503 if (_remaining < n) {
7504 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007505 _exceptionType = "java/lang/IllegalArgumentException";
7506 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007507 goto exit;
7508 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007509 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007510 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007511 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7512 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007513 glDeleteRenderbuffersOES(
7514 (GLint)n,
7515 (GLuint *)renderbuffers
7516 );
7517
7518exit:
7519 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007520 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007521 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007522 if (_exception) {
7523 jniThrowException(_env, _exceptionType, _exceptionMessage);
7524 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007525}
7526
7527/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
7528static void
7529android_glFramebufferRenderbufferOES__IIII
7530 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007531 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007532 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007533 "glFramebufferRenderbufferOES");
7534 return;
7535 }
7536 glFramebufferRenderbufferOES(
7537 (GLint)target,
7538 (GLint)attachment,
7539 (GLint)renderbuffertarget,
7540 (GLint)renderbuffer
7541 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007542}
7543
7544/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
7545static void
7546android_glFramebufferTexture2DOES__IIIII
7547 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007548 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007549 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007550 "glFramebufferTexture2DOES");
7551 return;
7552 }
7553 glFramebufferTexture2DOES(
7554 (GLint)target,
7555 (GLint)attachment,
7556 (GLint)textarget,
7557 (GLint)texture,
7558 (GLint)level
7559 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007560}
7561
7562/* void glGenerateMipmapOES ( GLint target ) */
7563static void
7564android_glGenerateMipmapOES__I
7565 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007566 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007567 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007568 "glGenerateMipmapOES");
7569 return;
7570 }
7571 glGenerateMipmapOES(
7572 (GLint)target
7573 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007574}
7575
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007576/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007577static void
7578android_glGenFramebuffersOES__I_3II
7579 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007580 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007581 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007582 "glGenFramebuffersOES");
7583 return;
7584 }
7585 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007586 const char * _exceptionType = NULL;
7587 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007588 GLuint *framebuffers_base = (GLuint *) 0;
7589 jint _remaining;
7590 GLuint *framebuffers = (GLuint *) 0;
7591
7592 if (!framebuffers_ref) {
7593 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007594 _exceptionType = "java/lang/IllegalArgumentException";
7595 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007596 goto exit;
7597 }
7598 if (offset < 0) {
7599 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007600 _exceptionType = "java/lang/IllegalArgumentException";
7601 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007602 goto exit;
7603 }
7604 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7605 if (_remaining < n) {
7606 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007607 _exceptionType = "java/lang/IllegalArgumentException";
7608 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007609 goto exit;
7610 }
7611 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007612 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007613 framebuffers = framebuffers_base + offset;
7614
7615 glGenFramebuffersOES(
7616 (GLint)n,
7617 (GLuint *)framebuffers
7618 );
7619
7620exit:
7621 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007622 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007623 _exception ? JNI_ABORT: 0);
7624 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007625 if (_exception) {
7626 jniThrowException(_env, _exceptionType, _exceptionMessage);
7627 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007628}
7629
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007630/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007631static void
7632android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
7633 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007634 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007635 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007636 "glGenFramebuffersOES");
7637 return;
7638 }
7639 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007640 const char * _exceptionType = NULL;
7641 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007642 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007643 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007644 jint _remaining;
7645 GLuint *framebuffers = (GLuint *) 0;
7646
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007647 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007648 if (_remaining < n) {
7649 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007650 _exceptionType = "java/lang/IllegalArgumentException";
7651 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007652 goto exit;
7653 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007654 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007655 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007656 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7657 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007658 glGenFramebuffersOES(
7659 (GLint)n,
7660 (GLuint *)framebuffers
7661 );
7662
7663exit:
7664 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007665 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007666 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007667 if (_exception) {
7668 jniThrowException(_env, _exceptionType, _exceptionMessage);
7669 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007670}
7671
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007672/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007673static void
7674android_glGenRenderbuffersOES__I_3II
7675 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007676 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007677 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007678 "glGenRenderbuffersOES");
7679 return;
7680 }
7681 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007682 const char * _exceptionType = NULL;
7683 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007684 GLuint *renderbuffers_base = (GLuint *) 0;
7685 jint _remaining;
7686 GLuint *renderbuffers = (GLuint *) 0;
7687
7688 if (!renderbuffers_ref) {
7689 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007690 _exceptionType = "java/lang/IllegalArgumentException";
7691 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007692 goto exit;
7693 }
7694 if (offset < 0) {
7695 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007696 _exceptionType = "java/lang/IllegalArgumentException";
7697 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007698 goto exit;
7699 }
7700 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7701 if (_remaining < n) {
7702 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007703 _exceptionType = "java/lang/IllegalArgumentException";
7704 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007705 goto exit;
7706 }
7707 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007708 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007709 renderbuffers = renderbuffers_base + offset;
7710
7711 glGenRenderbuffersOES(
7712 (GLint)n,
7713 (GLuint *)renderbuffers
7714 );
7715
7716exit:
7717 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007718 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007719 _exception ? JNI_ABORT: 0);
7720 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007721 if (_exception) {
7722 jniThrowException(_env, _exceptionType, _exceptionMessage);
7723 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007724}
7725
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007726/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007727static void
7728android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
7729 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007730 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007731 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007732 "glGenRenderbuffersOES");
7733 return;
7734 }
7735 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007736 const char * _exceptionType = NULL;
7737 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007738 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007739 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007740 jint _remaining;
7741 GLuint *renderbuffers = (GLuint *) 0;
7742
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007743 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007744 if (_remaining < n) {
7745 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007746 _exceptionType = "java/lang/IllegalArgumentException";
7747 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007748 goto exit;
7749 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007750 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007751 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007752 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7753 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007754 glGenRenderbuffersOES(
7755 (GLint)n,
7756 (GLuint *)renderbuffers
7757 );
7758
7759exit:
7760 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007761 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007762 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007763 if (_exception) {
7764 jniThrowException(_env, _exceptionType, _exceptionMessage);
7765 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007766}
7767
7768/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
7769static void
7770android_glGetFramebufferAttachmentParameterivOES__III_3II
7771 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007772 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007773 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007774 "glGetFramebufferAttachmentParameterivOES");
7775 return;
7776 }
7777 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007778 const char * _exceptionType = NULL;
7779 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007780 GLint *params_base = (GLint *) 0;
7781 jint _remaining;
7782 GLint *params = (GLint *) 0;
7783
7784 if (!params_ref) {
7785 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007786 _exceptionType = "java/lang/IllegalArgumentException";
7787 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007788 goto exit;
7789 }
7790 if (offset < 0) {
7791 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007792 _exceptionType = "java/lang/IllegalArgumentException";
7793 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007794 goto exit;
7795 }
7796 _remaining = _env->GetArrayLength(params_ref) - offset;
7797 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007798 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007799 params = params_base + offset;
7800
7801 glGetFramebufferAttachmentParameterivOES(
7802 (GLint)target,
7803 (GLint)attachment,
7804 (GLint)pname,
7805 (GLint *)params
7806 );
7807
7808exit:
7809 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007810 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007811 _exception ? JNI_ABORT: 0);
7812 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007813 if (_exception) {
7814 jniThrowException(_env, _exceptionType, _exceptionMessage);
7815 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007816}
7817
7818/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
7819static void
7820android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
7821 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007822 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007823 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007824 "glGetFramebufferAttachmentParameterivOES");
7825 return;
7826 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007827 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007828 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007829 jint _remaining;
7830 GLint *params = (GLint *) 0;
7831
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007832 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007833 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007834 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007835 params = (GLint *) (_paramsBase + _bufferOffset);
7836 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007837 glGetFramebufferAttachmentParameterivOES(
7838 (GLint)target,
7839 (GLint)attachment,
7840 (GLint)pname,
7841 (GLint *)params
7842 );
7843 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007844 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007845 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007846}
7847
7848/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
7849static void
7850android_glGetRenderbufferParameterivOES__II_3II
7851 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007852 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007853 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007854 "glGetRenderbufferParameterivOES");
7855 return;
7856 }
7857 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007858 const char * _exceptionType = NULL;
7859 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007860 GLint *params_base = (GLint *) 0;
7861 jint _remaining;
7862 GLint *params = (GLint *) 0;
7863
7864 if (!params_ref) {
7865 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007866 _exceptionType = "java/lang/IllegalArgumentException";
7867 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007868 goto exit;
7869 }
7870 if (offset < 0) {
7871 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007872 _exceptionType = "java/lang/IllegalArgumentException";
7873 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007874 goto exit;
7875 }
7876 _remaining = _env->GetArrayLength(params_ref) - offset;
7877 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007878 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007879 params = params_base + offset;
7880
7881 glGetRenderbufferParameterivOES(
7882 (GLint)target,
7883 (GLint)pname,
7884 (GLint *)params
7885 );
7886
7887exit:
7888 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007889 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007890 _exception ? JNI_ABORT: 0);
7891 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007892 if (_exception) {
7893 jniThrowException(_env, _exceptionType, _exceptionMessage);
7894 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007895}
7896
7897/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
7898static void
7899android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
7900 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007901 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007902 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007903 "glGetRenderbufferParameterivOES");
7904 return;
7905 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007906 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007907 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007908 jint _remaining;
7909 GLint *params = (GLint *) 0;
7910
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007911 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007912 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007913 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007914 params = (GLint *) (_paramsBase + _bufferOffset);
7915 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007916 glGetRenderbufferParameterivOES(
7917 (GLint)target,
7918 (GLint)pname,
7919 (GLint *)params
7920 );
7921 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007922 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007923 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007924}
7925
7926/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
7927static void
7928android_glGetTexGenfv__II_3FI
7929 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007930 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007931 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007932 "glGetTexGenfv");
7933 return;
7934 }
7935 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007936 const char * _exceptionType = NULL;
7937 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007938 GLfloat *params_base = (GLfloat *) 0;
7939 jint _remaining;
7940 GLfloat *params = (GLfloat *) 0;
7941
7942 if (!params_ref) {
7943 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007944 _exceptionType = "java/lang/IllegalArgumentException";
7945 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007946 goto exit;
7947 }
7948 if (offset < 0) {
7949 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007950 _exceptionType = "java/lang/IllegalArgumentException";
7951 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007952 goto exit;
7953 }
7954 _remaining = _env->GetArrayLength(params_ref) - offset;
7955 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007956 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007957 params = params_base + offset;
7958
7959 glGetTexGenfv(
7960 (GLint)coord,
7961 (GLint)pname,
7962 (GLfloat *)params
7963 );
7964
7965exit:
7966 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007967 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007968 _exception ? JNI_ABORT: 0);
7969 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007970 if (_exception) {
7971 jniThrowException(_env, _exceptionType, _exceptionMessage);
7972 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007973}
7974
7975/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
7976static void
7977android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
7978 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007979 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007980 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007981 "glGetTexGenfv");
7982 return;
7983 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007984 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007985 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007986 jint _remaining;
7987 GLfloat *params = (GLfloat *) 0;
7988
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007989 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007990 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007991 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007992 params = (GLfloat *) (_paramsBase + _bufferOffset);
7993 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007994 glGetTexGenfv(
7995 (GLint)coord,
7996 (GLint)pname,
7997 (GLfloat *)params
7998 );
7999 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008000 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008001 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008002}
8003
8004/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8005static void
8006android_glGetTexGeniv__II_3II
8007 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008008 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008009 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008010 "glGetTexGeniv");
8011 return;
8012 }
8013 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008014 const char * _exceptionType = NULL;
8015 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008016 GLint *params_base = (GLint *) 0;
8017 jint _remaining;
8018 GLint *params = (GLint *) 0;
8019
8020 if (!params_ref) {
8021 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008022 _exceptionType = "java/lang/IllegalArgumentException";
8023 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008024 goto exit;
8025 }
8026 if (offset < 0) {
8027 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008028 _exceptionType = "java/lang/IllegalArgumentException";
8029 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008030 goto exit;
8031 }
8032 _remaining = _env->GetArrayLength(params_ref) - offset;
8033 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008034 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008035 params = params_base + offset;
8036
8037 glGetTexGeniv(
8038 (GLint)coord,
8039 (GLint)pname,
8040 (GLint *)params
8041 );
8042
8043exit:
8044 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008045 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008046 _exception ? JNI_ABORT: 0);
8047 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008048 if (_exception) {
8049 jniThrowException(_env, _exceptionType, _exceptionMessage);
8050 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008051}
8052
8053/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8054static void
8055android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8056 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008057 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008058 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008059 "glGetTexGeniv");
8060 return;
8061 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008062 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008063 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008064 jint _remaining;
8065 GLint *params = (GLint *) 0;
8066
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008067 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008068 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008069 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008070 params = (GLint *) (_paramsBase + _bufferOffset);
8071 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008072 glGetTexGeniv(
8073 (GLint)coord,
8074 (GLint)pname,
8075 (GLint *)params
8076 );
8077 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008078 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008079 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008080}
8081
8082/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8083static void
8084android_glGetTexGenxv__II_3II
8085 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008086 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008087 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008088 "glGetTexGenxv");
8089 return;
8090 }
8091 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008092 const char * _exceptionType = NULL;
8093 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008094 GLint *params_base = (GLint *) 0;
8095 jint _remaining;
8096 GLint *params = (GLint *) 0;
8097
8098 if (!params_ref) {
8099 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008100 _exceptionType = "java/lang/IllegalArgumentException";
8101 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008102 goto exit;
8103 }
8104 if (offset < 0) {
8105 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008106 _exceptionType = "java/lang/IllegalArgumentException";
8107 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008108 goto exit;
8109 }
8110 _remaining = _env->GetArrayLength(params_ref) - offset;
8111 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008112 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008113 params = params_base + offset;
8114
8115 glGetTexGenxv(
8116 (GLint)coord,
8117 (GLint)pname,
8118 (GLint *)params
8119 );
8120
8121exit:
8122 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008123 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008124 _exception ? JNI_ABORT: 0);
8125 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008126 if (_exception) {
8127 jniThrowException(_env, _exceptionType, _exceptionMessage);
8128 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008129}
8130
8131/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8132static void
8133android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8134 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008135 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008136 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008137 "glGetTexGenxv");
8138 return;
8139 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008140 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008141 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008142 jint _remaining;
8143 GLint *params = (GLint *) 0;
8144
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008145 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008146 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008147 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008148 params = (GLint *) (_paramsBase + _bufferOffset);
8149 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008150 glGetTexGenxv(
8151 (GLint)coord,
8152 (GLint)pname,
8153 (GLint *)params
8154 );
8155 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008156 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008157 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008158}
8159
8160/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8161static jboolean
8162android_glIsFramebufferOES__I
8163 (JNIEnv *_env, jobject _this, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008164 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008165 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008166 "glIsFramebufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008167 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008168 }
8169 GLboolean _returnValue = JNI_FALSE;
8170 _returnValue = glIsFramebufferOES(
8171 (GLint)framebuffer
8172 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008173 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008174}
8175
8176/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8177static jboolean
8178android_glIsRenderbufferOES__I
8179 (JNIEnv *_env, jobject _this, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008180 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008181 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008182 "glIsRenderbufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008183 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008184 }
8185 GLboolean _returnValue = JNI_FALSE;
8186 _returnValue = glIsRenderbufferOES(
8187 (GLint)renderbuffer
8188 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008189 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008190}
8191
8192/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8193static void
8194android_glRenderbufferStorageOES__IIII
8195 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008196 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008197 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008198 "glRenderbufferStorageOES");
8199 return;
8200 }
8201 glRenderbufferStorageOES(
8202 (GLint)target,
8203 (GLint)internalformat,
8204 (GLint)width,
8205 (GLint)height
8206 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008207}
8208
8209/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8210static void
8211android_glTexGenf__IIF
8212 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008213 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008214 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008215 "glTexGenf");
8216 return;
8217 }
8218 glTexGenf(
8219 (GLint)coord,
8220 (GLint)pname,
8221 (GLfloat)param
8222 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008223}
8224
8225/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8226static void
8227android_glTexGenfv__II_3FI
8228 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008229 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008230 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008231 "glTexGenfv");
8232 return;
8233 }
8234 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008235 const char * _exceptionType = NULL;
8236 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008237 GLfloat *params_base = (GLfloat *) 0;
8238 jint _remaining;
8239 GLfloat *params = (GLfloat *) 0;
8240
8241 if (!params_ref) {
8242 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008243 _exceptionType = "java/lang/IllegalArgumentException";
8244 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008245 goto exit;
8246 }
8247 if (offset < 0) {
8248 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008249 _exceptionType = "java/lang/IllegalArgumentException";
8250 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008251 goto exit;
8252 }
8253 _remaining = _env->GetArrayLength(params_ref) - offset;
8254 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008255 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008256 params = params_base + offset;
8257
8258 glTexGenfv(
8259 (GLint)coord,
8260 (GLint)pname,
8261 (GLfloat *)params
8262 );
8263
8264exit:
8265 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008266 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008267 _exception ? JNI_ABORT: 0);
8268 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008269 if (_exception) {
8270 jniThrowException(_env, _exceptionType, _exceptionMessage);
8271 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008272}
8273
8274/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8275static void
8276android_glTexGenfv__IILjava_nio_FloatBuffer_2
8277 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008278 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008279 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008280 "glTexGenfv");
8281 return;
8282 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008283 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008284 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008285 jint _remaining;
8286 GLfloat *params = (GLfloat *) 0;
8287
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008288 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008289 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008290 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008291 params = (GLfloat *) (_paramsBase + _bufferOffset);
8292 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008293 glTexGenfv(
8294 (GLint)coord,
8295 (GLint)pname,
8296 (GLfloat *)params
8297 );
8298 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008299 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008300 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008301}
8302
8303/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8304static void
8305android_glTexGeni__III
8306 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008307 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008308 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008309 "glTexGeni");
8310 return;
8311 }
8312 glTexGeni(
8313 (GLint)coord,
8314 (GLint)pname,
8315 (GLint)param
8316 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008317}
8318
8319/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8320static void
8321android_glTexGeniv__II_3II
8322 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008323 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008324 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008325 "glTexGeniv");
8326 return;
8327 }
8328 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008329 const char * _exceptionType = NULL;
8330 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008331 GLint *params_base = (GLint *) 0;
8332 jint _remaining;
8333 GLint *params = (GLint *) 0;
8334
8335 if (!params_ref) {
8336 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008337 _exceptionType = "java/lang/IllegalArgumentException";
8338 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008339 goto exit;
8340 }
8341 if (offset < 0) {
8342 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008343 _exceptionType = "java/lang/IllegalArgumentException";
8344 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008345 goto exit;
8346 }
8347 _remaining = _env->GetArrayLength(params_ref) - offset;
8348 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008349 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008350 params = params_base + offset;
8351
8352 glTexGeniv(
8353 (GLint)coord,
8354 (GLint)pname,
8355 (GLint *)params
8356 );
8357
8358exit:
8359 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008360 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008361 _exception ? JNI_ABORT: 0);
8362 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008363 if (_exception) {
8364 jniThrowException(_env, _exceptionType, _exceptionMessage);
8365 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008366}
8367
8368/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8369static void
8370android_glTexGeniv__IILjava_nio_IntBuffer_2
8371 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008372 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008373 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008374 "glTexGeniv");
8375 return;
8376 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008377 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008378 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008379 jint _remaining;
8380 GLint *params = (GLint *) 0;
8381
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008382 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008383 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008384 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008385 params = (GLint *) (_paramsBase + _bufferOffset);
8386 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008387 glTexGeniv(
8388 (GLint)coord,
8389 (GLint)pname,
8390 (GLint *)params
8391 );
8392 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008393 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008394 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008395}
8396
8397/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8398static void
8399android_glTexGenx__III
8400 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008401 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008402 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008403 "glTexGenx");
8404 return;
8405 }
8406 glTexGenx(
8407 (GLint)coord,
8408 (GLint)pname,
8409 (GLint)param
8410 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008411}
8412
8413/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8414static void
8415android_glTexGenxv__II_3II
8416 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008417 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008418 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008419 "glTexGenxv");
8420 return;
8421 }
8422 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008423 const char * _exceptionType = NULL;
8424 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008425 GLint *params_base = (GLint *) 0;
8426 jint _remaining;
8427 GLint *params = (GLint *) 0;
8428
8429 if (!params_ref) {
8430 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008431 _exceptionType = "java/lang/IllegalArgumentException";
8432 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008433 goto exit;
8434 }
8435 if (offset < 0) {
8436 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008437 _exceptionType = "java/lang/IllegalArgumentException";
8438 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008439 goto exit;
8440 }
8441 _remaining = _env->GetArrayLength(params_ref) - offset;
8442 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008443 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008444 params = params_base + offset;
8445
8446 glTexGenxv(
8447 (GLint)coord,
8448 (GLint)pname,
8449 (GLint *)params
8450 );
8451
8452exit:
8453 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008454 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008455 _exception ? JNI_ABORT: 0);
8456 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008457 if (_exception) {
8458 jniThrowException(_env, _exceptionType, _exceptionMessage);
8459 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008460}
8461
8462/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8463static void
8464android_glTexGenxv__IILjava_nio_IntBuffer_2
8465 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008466 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008467 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008468 "glTexGenxv");
8469 return;
8470 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008471 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008472 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008473 jint _remaining;
8474 GLint *params = (GLint *) 0;
8475
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008476 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008477 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008478 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008479 params = (GLint *) (_paramsBase + _bufferOffset);
8480 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008481 glTexGenxv(
8482 (GLint)coord,
8483 (GLint)pname,
8484 (GLint *)params
8485 );
8486 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008487 _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008488 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008489}
8490
8491static const char *classPathName = "com/google/android/gles_jni/GLImpl";
8492
Daniel Micay76f6a862015-09-19 17:31:01 -04008493static const JNINativeMethod methods[] = {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008494{"_nativeClassInit", "()V", (void*)nativeClassInit },
8495{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
8496{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
8497{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
8498{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
8499{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
8500{"glClear", "(I)V", (void *) android_glClear__I },
8501{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
8502{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
8503{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
8504{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
8505{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
8506{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
8507{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
8508{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
8509{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
8510{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
8511{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
8512{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
8513{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
8514{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
8515{"glCullFace", "(I)V", (void *) android_glCullFace__I },
8516{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
8517{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
8518{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
8519{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
8520{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
8521{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
8522{"glDisable", "(I)V", (void *) android_glDisable__I },
8523{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
8524{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
8525{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
8526{"glEnable", "(I)V", (void *) android_glEnable__I },
8527{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
8528{"glFinish", "()V", (void *) android_glFinish__ },
8529{"glFlush", "()V", (void *) android_glFlush__ },
8530{"glFogf", "(IF)V", (void *) android_glFogf__IF },
8531{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
8532{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
8533{"glFogx", "(II)V", (void *) android_glFogx__II },
8534{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
8535{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
8536{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
8537{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
8538{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
8539{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
8540{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
8541{"glGetError", "()I", (void *) android_glGetError__ },
8542{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
8543{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
8544{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
8545{"glHint", "(II)V", (void *) android_glHint__II },
8546{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
8547{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
8548{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
8549{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
8550{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
8551{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
8552{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
8553{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
8554{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
8555{"glLightx", "(III)V", (void *) android_glLightx__III },
8556{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
8557{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
8558{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
8559{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
8560{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
8561{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
8562{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
8563{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
8564{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
8565{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
8566{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
8567{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
8568{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
8569{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
8570{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
8571{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
8572{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
8573{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
8574{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
8575{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
8576{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
8577{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
8578{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
8579{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
8580{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
8581{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
8582{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
8583{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
8584{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
8585{"glPointSize", "(F)V", (void *) android_glPointSize__F },
8586{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
8587{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
8588{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
8589{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
8590{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
8591{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
8592{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
8593{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
8594{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
8595{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
8596{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
8597{"glScalex", "(III)V", (void *) android_glScalex__III },
8598{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
8599{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
8600{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
8601{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
8602{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
8603{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
8604{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
8605{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
8606{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
8607{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
8608{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
8609{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
8610{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
8611{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
8612{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
8613{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
8614{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
8615{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
8616{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
8617{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
8618{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
8619{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
8620{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
8621{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
8622{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
8623{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
8624{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
8625{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
8626{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
8627{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
8628{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
8629{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
8630{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
8631{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
8632{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
8633{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
8634{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
8635{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
8636{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
8637{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
8638{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
8639{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
8640{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
8641{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
8642{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
8643{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
8644{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
8645{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
8646{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
8647{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
8648{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
8649{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
8650{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
8651{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
8652{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
8653{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
8654{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
8655{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
8656{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
8657{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
8658{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
8659{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
8660{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
8661{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
8662{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
8663{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
8664{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
8665{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
8666{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
8667{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
8668{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
8669{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
8670{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
8671{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
8672{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
8673{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008674{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008675{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
8676{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
8677{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
8678{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
8679{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
8680{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
8681{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
8682{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
8683{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
8684{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
8685{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
8686{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
8687{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
8688{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
8689{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
8690{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
8691{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
8692{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
8693{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
8694{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
8695{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
8696{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
8697{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
8698{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
8699{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
8700{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008701{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008702{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
Jack Palevichbe6eac82009-12-08 15:43:51 +08008703{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008704{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
8705{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
8706{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
8707{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
8708{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
8709{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
8710{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
8711{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
8712{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
8713{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
8714{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
8715{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
8716{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
8717{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
8718{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
8719{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
8720{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
8721{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
8722{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
8723{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
8724{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
8725{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
8726{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
8727{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
8728{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
8729{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
8730{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
8731{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
8732{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
8733{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
8734{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
8735{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
8736{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
8737{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
8738{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
8739{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
8740{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
8741{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
8742{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
8743{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
8744};
8745
8746int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
8747{
8748 int err;
8749 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
8750 return err;
8751}