blob: bf0e9eddb3e77d067fbf021fa7b9eae7c4dedadb [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) {
Romain Guy84cac202016-12-05 12:26:02 -0800423 jint _exception = 0;
424 const char * _exceptionType = NULL;
425 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700427 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800428 jint _remaining;
429 GLvoid *pointer = (GLvoid *) 0;
430
Jack Paleviche20ea782009-05-07 18:28:29 -0700431 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700432 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700433 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700434 return;
435 }
436 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800437 glColorPointerBounds(
438 (GLint)size,
439 (GLenum)type,
440 (GLsizei)stride,
441 (GLvoid *)pointer,
442 (GLsizei)remaining
443 );
Romain Guy84cac202016-12-05 12:26:02 -0800444 if (_exception) {
445 jniThrowException(_env, _exceptionType, _exceptionMessage);
446 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800447}
448
449/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
450static void
451android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
452 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800453 jint _exception = 0;
454 const char * _exceptionType = NULL;
455 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800456 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700457 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800458 jint _remaining;
459 GLvoid *data = (GLvoid *) 0;
460
Romain Guy84cac202016-12-05 12:26:02 -0800461 if (!data_buf) {
462 _exception = 1;
463 _exceptionType = "java/lang/IllegalArgumentException";
464 _exceptionMessage = "data == null";
465 goto exit;
466 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700467 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700468 if (data == NULL) {
469 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
470 data = (GLvoid *) (_dataBase + _bufferOffset);
471 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800472 glCompressedTexImage2D(
473 (GLenum)target,
474 (GLint)level,
475 (GLenum)internalformat,
476 (GLsizei)width,
477 (GLsizei)height,
478 (GLint)border,
479 (GLsizei)imageSize,
480 (GLvoid *)data
481 );
Romain Guy84cac202016-12-05 12:26:02 -0800482
483exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800484 if (_array) {
485 releasePointer(_env, _array, data, JNI_FALSE);
486 }
Romain Guy84cac202016-12-05 12:26:02 -0800487 if (_exception) {
488 jniThrowException(_env, _exceptionType, _exceptionMessage);
489 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800490}
491
492/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
493static void
494android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
495 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800496 jint _exception = 0;
497 const char * _exceptionType = NULL;
498 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800499 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700500 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800501 jint _remaining;
502 GLvoid *data = (GLvoid *) 0;
503
Romain Guy84cac202016-12-05 12:26:02 -0800504 if (!data_buf) {
505 _exception = 1;
506 _exceptionType = "java/lang/IllegalArgumentException";
507 _exceptionMessage = "data == null";
508 goto exit;
509 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700510 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700511 if (data == NULL) {
512 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
513 data = (GLvoid *) (_dataBase + _bufferOffset);
514 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800515 glCompressedTexSubImage2D(
516 (GLenum)target,
517 (GLint)level,
518 (GLint)xoffset,
519 (GLint)yoffset,
520 (GLsizei)width,
521 (GLsizei)height,
522 (GLenum)format,
523 (GLsizei)imageSize,
524 (GLvoid *)data
525 );
Romain Guy84cac202016-12-05 12:26:02 -0800526
527exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800528 if (_array) {
529 releasePointer(_env, _array, data, JNI_FALSE);
530 }
Romain Guy84cac202016-12-05 12:26:02 -0800531 if (_exception) {
532 jniThrowException(_env, _exceptionType, _exceptionMessage);
533 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534}
535
536/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
537static void
538android_glCopyTexImage2D__IIIIIIII
539 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
540 glCopyTexImage2D(
541 (GLenum)target,
542 (GLint)level,
543 (GLenum)internalformat,
544 (GLint)x,
545 (GLint)y,
546 (GLsizei)width,
547 (GLsizei)height,
548 (GLint)border
549 );
550}
551
552/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
553static void
554android_glCopyTexSubImage2D__IIIIIIII
555 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
556 glCopyTexSubImage2D(
557 (GLenum)target,
558 (GLint)level,
559 (GLint)xoffset,
560 (GLint)yoffset,
561 (GLint)x,
562 (GLint)y,
563 (GLsizei)width,
564 (GLsizei)height
565 );
566}
567
568/* void glCullFace ( GLenum mode ) */
569static void
570android_glCullFace__I
571 (JNIEnv *_env, jobject _this, jint mode) {
572 glCullFace(
573 (GLenum)mode
574 );
575}
576
577/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
578static void
579android_glDeleteTextures__I_3II
580 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700581 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800582 const char * _exceptionType = NULL;
583 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800584 GLuint *textures_base = (GLuint *) 0;
585 jint _remaining;
586 GLuint *textures = (GLuint *) 0;
587
588 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700589 _exception = 1;
590 _exceptionType = "java/lang/IllegalArgumentException";
591 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800592 goto exit;
593 }
594 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700595 _exception = 1;
596 _exceptionType = "java/lang/IllegalArgumentException";
597 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800598 goto exit;
599 }
600 _remaining = _env->GetArrayLength(textures_ref) - offset;
601 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700602 _exception = 1;
603 _exceptionType = "java/lang/IllegalArgumentException";
604 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 goto exit;
606 }
607 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700608 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800609 textures = textures_base + offset;
610
611 glDeleteTextures(
612 (GLsizei)n,
613 (GLuint *)textures
614 );
615
616exit:
617 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700618 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800619 JNI_ABORT);
620 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700621 if (_exception) {
622 jniThrowException(_env, _exceptionType, _exceptionMessage);
623 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800624}
625
626/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
627static void
628android_glDeleteTextures__ILjava_nio_IntBuffer_2
629 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700630 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800631 const char * _exceptionType = NULL;
632 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700633 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700634 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800635 jint _remaining;
636 GLuint *textures = (GLuint *) 0;
637
Romain Guy84cac202016-12-05 12:26:02 -0800638 if (!textures_buf) {
639 _exception = 1;
640 _exceptionType = "java/lang/IllegalArgumentException";
641 _exceptionMessage = "textures == null";
642 goto exit;
643 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700644 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800645 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700646 _exception = 1;
647 _exceptionType = "java/lang/IllegalArgumentException";
648 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800649 goto exit;
650 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700651 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700652 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700653 textures = (GLuint *) (_texturesBase + _bufferOffset);
654 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800655 glDeleteTextures(
656 (GLsizei)n,
657 (GLuint *)textures
658 );
659
660exit:
661 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700662 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800663 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700664 if (_exception) {
665 jniThrowException(_env, _exceptionType, _exceptionMessage);
666 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667}
668
669/* void glDepthFunc ( GLenum func ) */
670static void
671android_glDepthFunc__I
672 (JNIEnv *_env, jobject _this, jint func) {
673 glDepthFunc(
674 (GLenum)func
675 );
676}
677
678/* void glDepthMask ( GLboolean flag ) */
679static void
680android_glDepthMask__Z
681 (JNIEnv *_env, jobject _this, jboolean flag) {
682 glDepthMask(
683 (GLboolean)flag
684 );
685}
686
687/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
688static void
689android_glDepthRangef__FF
690 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
691 glDepthRangef(
692 (GLclampf)zNear,
693 (GLclampf)zFar
694 );
695}
696
697/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
698static void
699android_glDepthRangex__II
700 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
701 glDepthRangex(
702 (GLclampx)zNear,
703 (GLclampx)zFar
704 );
705}
706
707/* void glDisable ( GLenum cap ) */
708static void
709android_glDisable__I
710 (JNIEnv *_env, jobject _this, jint cap) {
711 glDisable(
712 (GLenum)cap
713 );
714}
715
716/* void glDisableClientState ( GLenum array ) */
717static void
718android_glDisableClientState__I
719 (JNIEnv *_env, jobject _this, jint array) {
720 glDisableClientState(
721 (GLenum)array
722 );
723}
724
725/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
726static void
727android_glDrawArrays__III
728 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
729 glDrawArrays(
730 (GLenum)mode,
731 (GLint)first,
732 (GLsizei)count
733 );
734}
735
736/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
737static void
738android_glDrawElements__IIILjava_nio_Buffer_2
739 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700740 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800741 const char * _exceptionType = NULL;
742 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800743 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700744 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800745 jint _remaining;
746 GLvoid *indices = (GLvoid *) 0;
747
Romain Guy84cac202016-12-05 12:26:02 -0800748 if (!indices_buf) {
749 _exception = 1;
750 _exceptionType = "java/lang/IllegalArgumentException";
751 _exceptionMessage = "indices == null";
752 goto exit;
753 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700754 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800755 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700756 _exception = 1;
757 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
758 _exceptionMessage = "remaining() < count < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800759 goto exit;
760 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700761 if (indices == NULL) {
762 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
763 indices = (GLvoid *) (_indicesBase + _bufferOffset);
764 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800765 glDrawElements(
766 (GLenum)mode,
767 (GLsizei)count,
768 (GLenum)type,
769 (GLvoid *)indices
770 );
771
772exit:
773 if (_array) {
774 releasePointer(_env, _array, indices, JNI_FALSE);
775 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700776 if (_exception) {
777 jniThrowException(_env, _exceptionType, _exceptionMessage);
778 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800779}
780
781/* void glEnable ( GLenum cap ) */
782static void
783android_glEnable__I
784 (JNIEnv *_env, jobject _this, jint cap) {
785 glEnable(
786 (GLenum)cap
787 );
788}
789
790/* void glEnableClientState ( GLenum array ) */
791static void
792android_glEnableClientState__I
793 (JNIEnv *_env, jobject _this, jint array) {
794 glEnableClientState(
795 (GLenum)array
796 );
797}
798
799/* void glFinish ( void ) */
800static void
801android_glFinish__
802 (JNIEnv *_env, jobject _this) {
803 glFinish();
804}
805
806/* void glFlush ( void ) */
807static void
808android_glFlush__
809 (JNIEnv *_env, jobject _this) {
810 glFlush();
811}
812
813/* void glFogf ( GLenum pname, GLfloat param ) */
814static void
815android_glFogf__IF
816 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
817 glFogf(
818 (GLenum)pname,
819 (GLfloat)param
820 );
821}
822
823/* void glFogfv ( GLenum pname, const GLfloat *params ) */
824static void
825android_glFogfv__I_3FI
826 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700827 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800828 const char * _exceptionType = NULL;
829 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800830 GLfloat *params_base = (GLfloat *) 0;
831 jint _remaining;
832 GLfloat *params = (GLfloat *) 0;
833
834 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700835 _exception = 1;
836 _exceptionType = "java/lang/IllegalArgumentException";
837 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800838 goto exit;
839 }
840 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700841 _exception = 1;
842 _exceptionType = "java/lang/IllegalArgumentException";
843 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800844 goto exit;
845 }
846 _remaining = _env->GetArrayLength(params_ref) - offset;
847 int _needed;
848 switch (pname) {
849#if defined(GL_FOG_MODE)
850 case GL_FOG_MODE:
851#endif // defined(GL_FOG_MODE)
852#if defined(GL_FOG_DENSITY)
853 case GL_FOG_DENSITY:
854#endif // defined(GL_FOG_DENSITY)
855#if defined(GL_FOG_START)
856 case GL_FOG_START:
857#endif // defined(GL_FOG_START)
858#if defined(GL_FOG_END)
859 case GL_FOG_END:
860#endif // defined(GL_FOG_END)
861 _needed = 1;
862 break;
863#if defined(GL_FOG_COLOR)
864 case GL_FOG_COLOR:
865#endif // defined(GL_FOG_COLOR)
866 _needed = 4;
867 break;
868 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800869 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800870 break;
871 }
872 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700873 _exception = 1;
874 _exceptionType = "java/lang/IllegalArgumentException";
875 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800876 goto exit;
877 }
878 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700879 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800880 params = params_base + offset;
881
882 glFogfv(
883 (GLenum)pname,
884 (GLfloat *)params
885 );
886
887exit:
888 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700889 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800890 JNI_ABORT);
891 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700892 if (_exception) {
893 jniThrowException(_env, _exceptionType, _exceptionMessage);
894 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800895}
896
897/* void glFogfv ( GLenum pname, const GLfloat *params ) */
898static void
899android_glFogfv__ILjava_nio_FloatBuffer_2
900 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700901 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800902 const char * _exceptionType = NULL;
903 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700904 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700905 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800906 jint _remaining;
907 GLfloat *params = (GLfloat *) 0;
908
Romain Guy84cac202016-12-05 12:26:02 -0800909 if (!params_buf) {
910 _exception = 1;
911 _exceptionType = "java/lang/IllegalArgumentException";
912 _exceptionMessage = "params == null";
913 goto exit;
914 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700915 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800916 int _needed;
917 switch (pname) {
918#if defined(GL_FOG_MODE)
919 case GL_FOG_MODE:
920#endif // defined(GL_FOG_MODE)
921#if defined(GL_FOG_DENSITY)
922 case GL_FOG_DENSITY:
923#endif // defined(GL_FOG_DENSITY)
924#if defined(GL_FOG_START)
925 case GL_FOG_START:
926#endif // defined(GL_FOG_START)
927#if defined(GL_FOG_END)
928 case GL_FOG_END:
929#endif // defined(GL_FOG_END)
930 _needed = 1;
931 break;
932#if defined(GL_FOG_COLOR)
933 case GL_FOG_COLOR:
934#endif // defined(GL_FOG_COLOR)
935 _needed = 4;
936 break;
937 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800938 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800939 break;
940 }
941 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700942 _exception = 1;
943 _exceptionType = "java/lang/IllegalArgumentException";
944 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800945 goto exit;
946 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700947 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700948 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700949 params = (GLfloat *) (_paramsBase + _bufferOffset);
950 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800951 glFogfv(
952 (GLenum)pname,
953 (GLfloat *)params
954 );
955
956exit:
957 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700958 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800959 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700960 if (_exception) {
961 jniThrowException(_env, _exceptionType, _exceptionMessage);
962 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963}
964
965/* void glFogx ( GLenum pname, GLfixed param ) */
966static void
967android_glFogx__II
968 (JNIEnv *_env, jobject _this, jint pname, jint param) {
969 glFogx(
970 (GLenum)pname,
971 (GLfixed)param
972 );
973}
974
975/* void glFogxv ( GLenum pname, const GLfixed *params ) */
976static void
977android_glFogxv__I_3II
978 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700979 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800980 const char * _exceptionType = NULL;
981 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800982 GLfixed *params_base = (GLfixed *) 0;
983 jint _remaining;
984 GLfixed *params = (GLfixed *) 0;
985
986 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700987 _exception = 1;
988 _exceptionType = "java/lang/IllegalArgumentException";
989 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800990 goto exit;
991 }
992 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700993 _exception = 1;
994 _exceptionType = "java/lang/IllegalArgumentException";
995 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800996 goto exit;
997 }
998 _remaining = _env->GetArrayLength(params_ref) - offset;
999 int _needed;
1000 switch (pname) {
1001#if defined(GL_FOG_MODE)
1002 case GL_FOG_MODE:
1003#endif // defined(GL_FOG_MODE)
1004#if defined(GL_FOG_DENSITY)
1005 case GL_FOG_DENSITY:
1006#endif // defined(GL_FOG_DENSITY)
1007#if defined(GL_FOG_START)
1008 case GL_FOG_START:
1009#endif // defined(GL_FOG_START)
1010#if defined(GL_FOG_END)
1011 case GL_FOG_END:
1012#endif // defined(GL_FOG_END)
1013 _needed = 1;
1014 break;
1015#if defined(GL_FOG_COLOR)
1016 case GL_FOG_COLOR:
1017#endif // defined(GL_FOG_COLOR)
1018 _needed = 4;
1019 break;
1020 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001021 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001022 break;
1023 }
1024 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001025 _exception = 1;
1026 _exceptionType = "java/lang/IllegalArgumentException";
1027 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001028 goto exit;
1029 }
1030 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001031 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001032 params = params_base + offset;
1033
1034 glFogxv(
1035 (GLenum)pname,
1036 (GLfixed *)params
1037 );
1038
1039exit:
1040 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001041 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001042 JNI_ABORT);
1043 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001044 if (_exception) {
1045 jniThrowException(_env, _exceptionType, _exceptionMessage);
1046 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001047}
1048
1049/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1050static void
1051android_glFogxv__ILjava_nio_IntBuffer_2
1052 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001053 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001054 const char * _exceptionType = NULL;
1055 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001056 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001057 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001058 jint _remaining;
1059 GLfixed *params = (GLfixed *) 0;
1060
Romain Guy84cac202016-12-05 12:26:02 -08001061 if (!params_buf) {
1062 _exception = 1;
1063 _exceptionType = "java/lang/IllegalArgumentException";
1064 _exceptionMessage = "params == null";
1065 goto exit;
1066 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001067 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001068 int _needed;
1069 switch (pname) {
1070#if defined(GL_FOG_MODE)
1071 case GL_FOG_MODE:
1072#endif // defined(GL_FOG_MODE)
1073#if defined(GL_FOG_DENSITY)
1074 case GL_FOG_DENSITY:
1075#endif // defined(GL_FOG_DENSITY)
1076#if defined(GL_FOG_START)
1077 case GL_FOG_START:
1078#endif // defined(GL_FOG_START)
1079#if defined(GL_FOG_END)
1080 case GL_FOG_END:
1081#endif // defined(GL_FOG_END)
1082 _needed = 1;
1083 break;
1084#if defined(GL_FOG_COLOR)
1085 case GL_FOG_COLOR:
1086#endif // defined(GL_FOG_COLOR)
1087 _needed = 4;
1088 break;
1089 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001090 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001091 break;
1092 }
1093 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001094 _exception = 1;
1095 _exceptionType = "java/lang/IllegalArgumentException";
1096 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001097 goto exit;
1098 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001099 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001100 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001101 params = (GLfixed *) (_paramsBase + _bufferOffset);
1102 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 glFogxv(
1104 (GLenum)pname,
1105 (GLfixed *)params
1106 );
1107
1108exit:
1109 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001110 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001111 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001112 if (_exception) {
1113 jniThrowException(_env, _exceptionType, _exceptionMessage);
1114 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001115}
1116
1117/* void glFrontFace ( GLenum mode ) */
1118static void
1119android_glFrontFace__I
1120 (JNIEnv *_env, jobject _this, jint mode) {
1121 glFrontFace(
1122 (GLenum)mode
1123 );
1124}
1125
1126/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1127static void
1128android_glFrustumf__FFFFFF
1129 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1130 glFrustumf(
1131 (GLfloat)left,
1132 (GLfloat)right,
1133 (GLfloat)bottom,
1134 (GLfloat)top,
1135 (GLfloat)zNear,
1136 (GLfloat)zFar
1137 );
1138}
1139
1140/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1141static void
1142android_glFrustumx__IIIIII
1143 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1144 glFrustumx(
1145 (GLfixed)left,
1146 (GLfixed)right,
1147 (GLfixed)bottom,
1148 (GLfixed)top,
1149 (GLfixed)zNear,
1150 (GLfixed)zFar
1151 );
1152}
1153
1154/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1155static void
1156android_glGenTextures__I_3II
1157 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1158 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001159 const char * _exceptionType = NULL;
1160 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001161 GLuint *textures_base = (GLuint *) 0;
1162 jint _remaining;
1163 GLuint *textures = (GLuint *) 0;
1164
1165 if (!textures_ref) {
1166 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001167 _exceptionType = "java/lang/IllegalArgumentException";
1168 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001169 goto exit;
1170 }
1171 if (offset < 0) {
1172 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001173 _exceptionType = "java/lang/IllegalArgumentException";
1174 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001175 goto exit;
1176 }
1177 _remaining = _env->GetArrayLength(textures_ref) - offset;
1178 if (_remaining < n) {
1179 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001180 _exceptionType = "java/lang/IllegalArgumentException";
1181 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 goto exit;
1183 }
1184 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001185 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001186 textures = textures_base + offset;
1187
1188 glGenTextures(
1189 (GLsizei)n,
1190 (GLuint *)textures
1191 );
1192
1193exit:
1194 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001195 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001196 _exception ? JNI_ABORT: 0);
1197 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001198 if (_exception) {
1199 jniThrowException(_env, _exceptionType, _exceptionMessage);
1200 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001201}
1202
1203/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1204static void
1205android_glGenTextures__ILjava_nio_IntBuffer_2
1206 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1207 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001208 const char * _exceptionType = NULL;
1209 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001210 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001211 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001212 jint _remaining;
1213 GLuint *textures = (GLuint *) 0;
1214
Romain Guy84cac202016-12-05 12:26:02 -08001215 if (!textures_buf) {
1216 _exception = 1;
1217 _exceptionType = "java/lang/IllegalArgumentException";
1218 _exceptionMessage = "textures == null";
1219 goto exit;
1220 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001221 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001222 if (_remaining < n) {
1223 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001224 _exceptionType = "java/lang/IllegalArgumentException";
1225 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001226 goto exit;
1227 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001228 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001229 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001230 textures = (GLuint *) (_texturesBase + _bufferOffset);
1231 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001232 glGenTextures(
1233 (GLsizei)n,
1234 (GLuint *)textures
1235 );
1236
1237exit:
1238 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001239 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001241 if (_exception) {
1242 jniThrowException(_env, _exceptionType, _exceptionMessage);
1243 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001244}
1245
1246/* GLenum glGetError ( void ) */
1247static jint
1248android_glGetError__
1249 (JNIEnv *_env, jobject _this) {
1250 GLenum _returnValue;
1251 _returnValue = glGetError();
Elliott Hughes428d3fc2013-09-24 17:15:41 -07001252 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001253}
1254
1255/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1256static void
1257android_glGetIntegerv__I_3II
1258 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1259 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001260 const char * _exceptionType = NULL;
1261 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001262 GLint *params_base = (GLint *) 0;
1263 jint _remaining;
1264 GLint *params = (GLint *) 0;
1265
1266 if (!params_ref) {
1267 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001268 _exceptionType = "java/lang/IllegalArgumentException";
1269 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001270 goto exit;
1271 }
1272 if (offset < 0) {
1273 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001274 _exceptionType = "java/lang/IllegalArgumentException";
1275 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 goto exit;
1277 }
1278 _remaining = _env->GetArrayLength(params_ref) - offset;
1279 int _needed;
1280 switch (pname) {
1281#if defined(GL_ALPHA_BITS)
1282 case GL_ALPHA_BITS:
1283#endif // defined(GL_ALPHA_BITS)
1284#if defined(GL_ALPHA_TEST_FUNC)
1285 case GL_ALPHA_TEST_FUNC:
1286#endif // defined(GL_ALPHA_TEST_FUNC)
1287#if defined(GL_ALPHA_TEST_REF)
1288 case GL_ALPHA_TEST_REF:
1289#endif // defined(GL_ALPHA_TEST_REF)
1290#if defined(GL_BLEND_DST)
1291 case GL_BLEND_DST:
1292#endif // defined(GL_BLEND_DST)
1293#if defined(GL_BLUE_BITS)
1294 case GL_BLUE_BITS:
1295#endif // defined(GL_BLUE_BITS)
1296#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1297 case GL_COLOR_ARRAY_BUFFER_BINDING:
1298#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1299#if defined(GL_COLOR_ARRAY_SIZE)
1300 case GL_COLOR_ARRAY_SIZE:
1301#endif // defined(GL_COLOR_ARRAY_SIZE)
1302#if defined(GL_COLOR_ARRAY_STRIDE)
1303 case GL_COLOR_ARRAY_STRIDE:
1304#endif // defined(GL_COLOR_ARRAY_STRIDE)
1305#if defined(GL_COLOR_ARRAY_TYPE)
1306 case GL_COLOR_ARRAY_TYPE:
1307#endif // defined(GL_COLOR_ARRAY_TYPE)
1308#if defined(GL_CULL_FACE)
1309 case GL_CULL_FACE:
1310#endif // defined(GL_CULL_FACE)
1311#if defined(GL_DEPTH_BITS)
1312 case GL_DEPTH_BITS:
1313#endif // defined(GL_DEPTH_BITS)
1314#if defined(GL_DEPTH_CLEAR_VALUE)
1315 case GL_DEPTH_CLEAR_VALUE:
1316#endif // defined(GL_DEPTH_CLEAR_VALUE)
1317#if defined(GL_DEPTH_FUNC)
1318 case GL_DEPTH_FUNC:
1319#endif // defined(GL_DEPTH_FUNC)
1320#if defined(GL_DEPTH_WRITEMASK)
1321 case GL_DEPTH_WRITEMASK:
1322#endif // defined(GL_DEPTH_WRITEMASK)
1323#if defined(GL_FOG_DENSITY)
1324 case GL_FOG_DENSITY:
1325#endif // defined(GL_FOG_DENSITY)
1326#if defined(GL_FOG_END)
1327 case GL_FOG_END:
1328#endif // defined(GL_FOG_END)
1329#if defined(GL_FOG_MODE)
1330 case GL_FOG_MODE:
1331#endif // defined(GL_FOG_MODE)
1332#if defined(GL_FOG_START)
1333 case GL_FOG_START:
1334#endif // defined(GL_FOG_START)
1335#if defined(GL_FRONT_FACE)
1336 case GL_FRONT_FACE:
1337#endif // defined(GL_FRONT_FACE)
1338#if defined(GL_GREEN_BITS)
1339 case GL_GREEN_BITS:
1340#endif // defined(GL_GREEN_BITS)
1341#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1342 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1343#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1344#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1345 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1346#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001347#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1348 case GL_LIGHT_MODEL_COLOR_CONTROL:
1349#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1350#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1351 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1352#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001353#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1354 case GL_LIGHT_MODEL_TWO_SIDE:
1355#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1356#if defined(GL_LINE_SMOOTH_HINT)
1357 case GL_LINE_SMOOTH_HINT:
1358#endif // defined(GL_LINE_SMOOTH_HINT)
1359#if defined(GL_LINE_WIDTH)
1360 case GL_LINE_WIDTH:
1361#endif // defined(GL_LINE_WIDTH)
1362#if defined(GL_LOGIC_OP_MODE)
1363 case GL_LOGIC_OP_MODE:
1364#endif // defined(GL_LOGIC_OP_MODE)
1365#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1366 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1367#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1368#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1369 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1370#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1371#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1372 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1373#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1374#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1375 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1376#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1377#if defined(GL_MATRIX_MODE)
1378 case GL_MATRIX_MODE:
1379#endif // defined(GL_MATRIX_MODE)
1380#if defined(GL_MAX_CLIP_PLANES)
1381 case GL_MAX_CLIP_PLANES:
1382#endif // defined(GL_MAX_CLIP_PLANES)
1383#if defined(GL_MAX_ELEMENTS_INDICES)
1384 case GL_MAX_ELEMENTS_INDICES:
1385#endif // defined(GL_MAX_ELEMENTS_INDICES)
1386#if defined(GL_MAX_ELEMENTS_VERTICES)
1387 case GL_MAX_ELEMENTS_VERTICES:
1388#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1389#if defined(GL_MAX_LIGHTS)
1390 case GL_MAX_LIGHTS:
1391#endif // defined(GL_MAX_LIGHTS)
1392#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1393 case GL_MAX_MODELVIEW_STACK_DEPTH:
1394#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1395#if defined(GL_MAX_PALETTE_MATRICES_OES)
1396 case GL_MAX_PALETTE_MATRICES_OES:
1397#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1398#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1399 case GL_MAX_PROJECTION_STACK_DEPTH:
1400#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1401#if defined(GL_MAX_TEXTURE_SIZE)
1402 case GL_MAX_TEXTURE_SIZE:
1403#endif // defined(GL_MAX_TEXTURE_SIZE)
1404#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1405 case GL_MAX_TEXTURE_STACK_DEPTH:
1406#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1407#if defined(GL_MAX_TEXTURE_UNITS)
1408 case GL_MAX_TEXTURE_UNITS:
1409#endif // defined(GL_MAX_TEXTURE_UNITS)
1410#if defined(GL_MAX_VERTEX_UNITS_OES)
1411 case GL_MAX_VERTEX_UNITS_OES:
1412#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1413#if defined(GL_MODELVIEW_STACK_DEPTH)
1414 case GL_MODELVIEW_STACK_DEPTH:
1415#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1416#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1417 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1418#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1419#if defined(GL_NORMAL_ARRAY_STRIDE)
1420 case GL_NORMAL_ARRAY_STRIDE:
1421#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1422#if defined(GL_NORMAL_ARRAY_TYPE)
1423 case GL_NORMAL_ARRAY_TYPE:
1424#endif // defined(GL_NORMAL_ARRAY_TYPE)
1425#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1426 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1427#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1428#if defined(GL_PACK_ALIGNMENT)
1429 case GL_PACK_ALIGNMENT:
1430#endif // defined(GL_PACK_ALIGNMENT)
1431#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1432 case GL_PERSPECTIVE_CORRECTION_HINT:
1433#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1434#if defined(GL_POINT_SIZE)
1435 case GL_POINT_SIZE:
1436#endif // defined(GL_POINT_SIZE)
1437#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1438 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1439#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1440#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1441 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1442#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1443#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1444 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1445#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1446#if defined(GL_POINT_SMOOTH_HINT)
1447 case GL_POINT_SMOOTH_HINT:
1448#endif // defined(GL_POINT_SMOOTH_HINT)
1449#if defined(GL_POLYGON_OFFSET_FACTOR)
1450 case GL_POLYGON_OFFSET_FACTOR:
1451#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1452#if defined(GL_POLYGON_OFFSET_UNITS)
1453 case GL_POLYGON_OFFSET_UNITS:
1454#endif // defined(GL_POLYGON_OFFSET_UNITS)
1455#if defined(GL_PROJECTION_STACK_DEPTH)
1456 case GL_PROJECTION_STACK_DEPTH:
1457#endif // defined(GL_PROJECTION_STACK_DEPTH)
1458#if defined(GL_RED_BITS)
1459 case GL_RED_BITS:
1460#endif // defined(GL_RED_BITS)
1461#if defined(GL_SHADE_MODEL)
1462 case GL_SHADE_MODEL:
1463#endif // defined(GL_SHADE_MODEL)
1464#if defined(GL_STENCIL_BITS)
1465 case GL_STENCIL_BITS:
1466#endif // defined(GL_STENCIL_BITS)
1467#if defined(GL_STENCIL_CLEAR_VALUE)
1468 case GL_STENCIL_CLEAR_VALUE:
1469#endif // defined(GL_STENCIL_CLEAR_VALUE)
1470#if defined(GL_STENCIL_FAIL)
1471 case GL_STENCIL_FAIL:
1472#endif // defined(GL_STENCIL_FAIL)
1473#if defined(GL_STENCIL_FUNC)
1474 case GL_STENCIL_FUNC:
1475#endif // defined(GL_STENCIL_FUNC)
1476#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1477 case GL_STENCIL_PASS_DEPTH_FAIL:
1478#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1479#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1480 case GL_STENCIL_PASS_DEPTH_PASS:
1481#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1482#if defined(GL_STENCIL_REF)
1483 case GL_STENCIL_REF:
1484#endif // defined(GL_STENCIL_REF)
1485#if defined(GL_STENCIL_VALUE_MASK)
1486 case GL_STENCIL_VALUE_MASK:
1487#endif // defined(GL_STENCIL_VALUE_MASK)
1488#if defined(GL_STENCIL_WRITEMASK)
1489 case GL_STENCIL_WRITEMASK:
1490#endif // defined(GL_STENCIL_WRITEMASK)
1491#if defined(GL_SUBPIXEL_BITS)
1492 case GL_SUBPIXEL_BITS:
1493#endif // defined(GL_SUBPIXEL_BITS)
1494#if defined(GL_TEXTURE_BINDING_2D)
1495 case GL_TEXTURE_BINDING_2D:
1496#endif // defined(GL_TEXTURE_BINDING_2D)
1497#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1498 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1499#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1500#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1501 case GL_TEXTURE_COORD_ARRAY_SIZE:
1502#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1503#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1504 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1505#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1506#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1507 case GL_TEXTURE_COORD_ARRAY_TYPE:
1508#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1509#if defined(GL_TEXTURE_STACK_DEPTH)
1510 case GL_TEXTURE_STACK_DEPTH:
1511#endif // defined(GL_TEXTURE_STACK_DEPTH)
1512#if defined(GL_UNPACK_ALIGNMENT)
1513 case GL_UNPACK_ALIGNMENT:
1514#endif // defined(GL_UNPACK_ALIGNMENT)
1515#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1516 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1517#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1518#if defined(GL_VERTEX_ARRAY_SIZE)
1519 case GL_VERTEX_ARRAY_SIZE:
1520#endif // defined(GL_VERTEX_ARRAY_SIZE)
1521#if defined(GL_VERTEX_ARRAY_STRIDE)
1522 case GL_VERTEX_ARRAY_STRIDE:
1523#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1524#if defined(GL_VERTEX_ARRAY_TYPE)
1525 case GL_VERTEX_ARRAY_TYPE:
1526#endif // defined(GL_VERTEX_ARRAY_TYPE)
1527#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1528 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1529#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1530#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1531 case GL_WEIGHT_ARRAY_SIZE_OES:
1532#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1533#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1534 case GL_WEIGHT_ARRAY_STRIDE_OES:
1535#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1536#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1537 case GL_WEIGHT_ARRAY_TYPE_OES:
1538#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1539 _needed = 1;
1540 break;
1541#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1542 case GL_ALIASED_POINT_SIZE_RANGE:
1543#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1544#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1545 case GL_ALIASED_LINE_WIDTH_RANGE:
1546#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1547#if defined(GL_DEPTH_RANGE)
1548 case GL_DEPTH_RANGE:
1549#endif // defined(GL_DEPTH_RANGE)
1550#if defined(GL_MAX_VIEWPORT_DIMS)
1551 case GL_MAX_VIEWPORT_DIMS:
1552#endif // defined(GL_MAX_VIEWPORT_DIMS)
1553#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1554 case GL_SMOOTH_LINE_WIDTH_RANGE:
1555#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1556#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1557 case GL_SMOOTH_POINT_SIZE_RANGE:
1558#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1559 _needed = 2;
1560 break;
1561#if defined(GL_COLOR_CLEAR_VALUE)
1562 case GL_COLOR_CLEAR_VALUE:
1563#endif // defined(GL_COLOR_CLEAR_VALUE)
1564#if defined(GL_COLOR_WRITEMASK)
1565 case GL_COLOR_WRITEMASK:
1566#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001567#if defined(GL_FOG_COLOR)
1568 case GL_FOG_COLOR:
1569#endif // defined(GL_FOG_COLOR)
1570#if defined(GL_LIGHT_MODEL_AMBIENT)
1571 case GL_LIGHT_MODEL_AMBIENT:
1572#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001573#if defined(GL_SCISSOR_BOX)
1574 case GL_SCISSOR_BOX:
1575#endif // defined(GL_SCISSOR_BOX)
1576#if defined(GL_VIEWPORT)
1577 case GL_VIEWPORT:
1578#endif // defined(GL_VIEWPORT)
1579 _needed = 4;
1580 break;
1581#if defined(GL_MODELVIEW_MATRIX)
1582 case GL_MODELVIEW_MATRIX:
1583#endif // defined(GL_MODELVIEW_MATRIX)
1584#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1585 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1586#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1587#if defined(GL_PROJECTION_MATRIX)
1588 case GL_PROJECTION_MATRIX:
1589#endif // defined(GL_PROJECTION_MATRIX)
1590#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1591 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1592#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1593#if defined(GL_TEXTURE_MATRIX)
1594 case GL_TEXTURE_MATRIX:
1595#endif // defined(GL_TEXTURE_MATRIX)
1596#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1597 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1598#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1599 _needed = 16;
1600 break;
1601#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1602 case GL_COMPRESSED_TEXTURE_FORMATS:
1603#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001604 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001605 break;
1606 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001607 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001608 break;
1609 }
1610 if (_remaining < _needed) {
1611 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001612 _exceptionType = "java/lang/IllegalArgumentException";
1613 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001614 goto exit;
1615 }
1616 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001617 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001618 params = params_base + offset;
1619
1620 glGetIntegerv(
1621 (GLenum)pname,
1622 (GLint *)params
1623 );
1624
1625exit:
1626 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001627 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001628 _exception ? JNI_ABORT: 0);
1629 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001630 if (_exception) {
1631 jniThrowException(_env, _exceptionType, _exceptionMessage);
1632 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001633}
1634
1635/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1636static void
1637android_glGetIntegerv__ILjava_nio_IntBuffer_2
1638 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1639 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001640 const char * _exceptionType = NULL;
1641 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001642 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001643 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001644 jint _remaining;
1645 GLint *params = (GLint *) 0;
1646
Romain Guy84cac202016-12-05 12:26:02 -08001647 if (!params_buf) {
1648 _exception = 1;
1649 _exceptionType = "java/lang/IllegalArgumentException";
1650 _exceptionMessage = "params == null";
1651 goto exit;
1652 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001653 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001654 int _needed;
1655 switch (pname) {
1656#if defined(GL_ALPHA_BITS)
1657 case GL_ALPHA_BITS:
1658#endif // defined(GL_ALPHA_BITS)
1659#if defined(GL_ALPHA_TEST_FUNC)
1660 case GL_ALPHA_TEST_FUNC:
1661#endif // defined(GL_ALPHA_TEST_FUNC)
1662#if defined(GL_ALPHA_TEST_REF)
1663 case GL_ALPHA_TEST_REF:
1664#endif // defined(GL_ALPHA_TEST_REF)
1665#if defined(GL_BLEND_DST)
1666 case GL_BLEND_DST:
1667#endif // defined(GL_BLEND_DST)
1668#if defined(GL_BLUE_BITS)
1669 case GL_BLUE_BITS:
1670#endif // defined(GL_BLUE_BITS)
1671#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1672 case GL_COLOR_ARRAY_BUFFER_BINDING:
1673#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1674#if defined(GL_COLOR_ARRAY_SIZE)
1675 case GL_COLOR_ARRAY_SIZE:
1676#endif // defined(GL_COLOR_ARRAY_SIZE)
1677#if defined(GL_COLOR_ARRAY_STRIDE)
1678 case GL_COLOR_ARRAY_STRIDE:
1679#endif // defined(GL_COLOR_ARRAY_STRIDE)
1680#if defined(GL_COLOR_ARRAY_TYPE)
1681 case GL_COLOR_ARRAY_TYPE:
1682#endif // defined(GL_COLOR_ARRAY_TYPE)
1683#if defined(GL_CULL_FACE)
1684 case GL_CULL_FACE:
1685#endif // defined(GL_CULL_FACE)
1686#if defined(GL_DEPTH_BITS)
1687 case GL_DEPTH_BITS:
1688#endif // defined(GL_DEPTH_BITS)
1689#if defined(GL_DEPTH_CLEAR_VALUE)
1690 case GL_DEPTH_CLEAR_VALUE:
1691#endif // defined(GL_DEPTH_CLEAR_VALUE)
1692#if defined(GL_DEPTH_FUNC)
1693 case GL_DEPTH_FUNC:
1694#endif // defined(GL_DEPTH_FUNC)
1695#if defined(GL_DEPTH_WRITEMASK)
1696 case GL_DEPTH_WRITEMASK:
1697#endif // defined(GL_DEPTH_WRITEMASK)
1698#if defined(GL_FOG_DENSITY)
1699 case GL_FOG_DENSITY:
1700#endif // defined(GL_FOG_DENSITY)
1701#if defined(GL_FOG_END)
1702 case GL_FOG_END:
1703#endif // defined(GL_FOG_END)
1704#if defined(GL_FOG_MODE)
1705 case GL_FOG_MODE:
1706#endif // defined(GL_FOG_MODE)
1707#if defined(GL_FOG_START)
1708 case GL_FOG_START:
1709#endif // defined(GL_FOG_START)
1710#if defined(GL_FRONT_FACE)
1711 case GL_FRONT_FACE:
1712#endif // defined(GL_FRONT_FACE)
1713#if defined(GL_GREEN_BITS)
1714 case GL_GREEN_BITS:
1715#endif // defined(GL_GREEN_BITS)
1716#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1717 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1718#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1719#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1720 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1721#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001722#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1723 case GL_LIGHT_MODEL_COLOR_CONTROL:
1724#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1725#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1726 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1727#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001728#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1729 case GL_LIGHT_MODEL_TWO_SIDE:
1730#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1731#if defined(GL_LINE_SMOOTH_HINT)
1732 case GL_LINE_SMOOTH_HINT:
1733#endif // defined(GL_LINE_SMOOTH_HINT)
1734#if defined(GL_LINE_WIDTH)
1735 case GL_LINE_WIDTH:
1736#endif // defined(GL_LINE_WIDTH)
1737#if defined(GL_LOGIC_OP_MODE)
1738 case GL_LOGIC_OP_MODE:
1739#endif // defined(GL_LOGIC_OP_MODE)
1740#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1741 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1742#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1743#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1744 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1745#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1746#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1747 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1748#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1749#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1750 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1751#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1752#if defined(GL_MATRIX_MODE)
1753 case GL_MATRIX_MODE:
1754#endif // defined(GL_MATRIX_MODE)
1755#if defined(GL_MAX_CLIP_PLANES)
1756 case GL_MAX_CLIP_PLANES:
1757#endif // defined(GL_MAX_CLIP_PLANES)
1758#if defined(GL_MAX_ELEMENTS_INDICES)
1759 case GL_MAX_ELEMENTS_INDICES:
1760#endif // defined(GL_MAX_ELEMENTS_INDICES)
1761#if defined(GL_MAX_ELEMENTS_VERTICES)
1762 case GL_MAX_ELEMENTS_VERTICES:
1763#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1764#if defined(GL_MAX_LIGHTS)
1765 case GL_MAX_LIGHTS:
1766#endif // defined(GL_MAX_LIGHTS)
1767#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1768 case GL_MAX_MODELVIEW_STACK_DEPTH:
1769#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1770#if defined(GL_MAX_PALETTE_MATRICES_OES)
1771 case GL_MAX_PALETTE_MATRICES_OES:
1772#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1773#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1774 case GL_MAX_PROJECTION_STACK_DEPTH:
1775#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1776#if defined(GL_MAX_TEXTURE_SIZE)
1777 case GL_MAX_TEXTURE_SIZE:
1778#endif // defined(GL_MAX_TEXTURE_SIZE)
1779#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1780 case GL_MAX_TEXTURE_STACK_DEPTH:
1781#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1782#if defined(GL_MAX_TEXTURE_UNITS)
1783 case GL_MAX_TEXTURE_UNITS:
1784#endif // defined(GL_MAX_TEXTURE_UNITS)
1785#if defined(GL_MAX_VERTEX_UNITS_OES)
1786 case GL_MAX_VERTEX_UNITS_OES:
1787#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1788#if defined(GL_MODELVIEW_STACK_DEPTH)
1789 case GL_MODELVIEW_STACK_DEPTH:
1790#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1791#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1792 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1793#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1794#if defined(GL_NORMAL_ARRAY_STRIDE)
1795 case GL_NORMAL_ARRAY_STRIDE:
1796#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1797#if defined(GL_NORMAL_ARRAY_TYPE)
1798 case GL_NORMAL_ARRAY_TYPE:
1799#endif // defined(GL_NORMAL_ARRAY_TYPE)
1800#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1801 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1802#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1803#if defined(GL_PACK_ALIGNMENT)
1804 case GL_PACK_ALIGNMENT:
1805#endif // defined(GL_PACK_ALIGNMENT)
1806#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1807 case GL_PERSPECTIVE_CORRECTION_HINT:
1808#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1809#if defined(GL_POINT_SIZE)
1810 case GL_POINT_SIZE:
1811#endif // defined(GL_POINT_SIZE)
1812#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1813 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1814#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1815#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1816 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1817#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1818#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1819 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1820#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1821#if defined(GL_POINT_SMOOTH_HINT)
1822 case GL_POINT_SMOOTH_HINT:
1823#endif // defined(GL_POINT_SMOOTH_HINT)
1824#if defined(GL_POLYGON_OFFSET_FACTOR)
1825 case GL_POLYGON_OFFSET_FACTOR:
1826#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1827#if defined(GL_POLYGON_OFFSET_UNITS)
1828 case GL_POLYGON_OFFSET_UNITS:
1829#endif // defined(GL_POLYGON_OFFSET_UNITS)
1830#if defined(GL_PROJECTION_STACK_DEPTH)
1831 case GL_PROJECTION_STACK_DEPTH:
1832#endif // defined(GL_PROJECTION_STACK_DEPTH)
1833#if defined(GL_RED_BITS)
1834 case GL_RED_BITS:
1835#endif // defined(GL_RED_BITS)
1836#if defined(GL_SHADE_MODEL)
1837 case GL_SHADE_MODEL:
1838#endif // defined(GL_SHADE_MODEL)
1839#if defined(GL_STENCIL_BITS)
1840 case GL_STENCIL_BITS:
1841#endif // defined(GL_STENCIL_BITS)
1842#if defined(GL_STENCIL_CLEAR_VALUE)
1843 case GL_STENCIL_CLEAR_VALUE:
1844#endif // defined(GL_STENCIL_CLEAR_VALUE)
1845#if defined(GL_STENCIL_FAIL)
1846 case GL_STENCIL_FAIL:
1847#endif // defined(GL_STENCIL_FAIL)
1848#if defined(GL_STENCIL_FUNC)
1849 case GL_STENCIL_FUNC:
1850#endif // defined(GL_STENCIL_FUNC)
1851#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1852 case GL_STENCIL_PASS_DEPTH_FAIL:
1853#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1854#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1855 case GL_STENCIL_PASS_DEPTH_PASS:
1856#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1857#if defined(GL_STENCIL_REF)
1858 case GL_STENCIL_REF:
1859#endif // defined(GL_STENCIL_REF)
1860#if defined(GL_STENCIL_VALUE_MASK)
1861 case GL_STENCIL_VALUE_MASK:
1862#endif // defined(GL_STENCIL_VALUE_MASK)
1863#if defined(GL_STENCIL_WRITEMASK)
1864 case GL_STENCIL_WRITEMASK:
1865#endif // defined(GL_STENCIL_WRITEMASK)
1866#if defined(GL_SUBPIXEL_BITS)
1867 case GL_SUBPIXEL_BITS:
1868#endif // defined(GL_SUBPIXEL_BITS)
1869#if defined(GL_TEXTURE_BINDING_2D)
1870 case GL_TEXTURE_BINDING_2D:
1871#endif // defined(GL_TEXTURE_BINDING_2D)
1872#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1873 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1874#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1875#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1876 case GL_TEXTURE_COORD_ARRAY_SIZE:
1877#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1878#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1879 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1880#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1881#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1882 case GL_TEXTURE_COORD_ARRAY_TYPE:
1883#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1884#if defined(GL_TEXTURE_STACK_DEPTH)
1885 case GL_TEXTURE_STACK_DEPTH:
1886#endif // defined(GL_TEXTURE_STACK_DEPTH)
1887#if defined(GL_UNPACK_ALIGNMENT)
1888 case GL_UNPACK_ALIGNMENT:
1889#endif // defined(GL_UNPACK_ALIGNMENT)
1890#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1891 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1892#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1893#if defined(GL_VERTEX_ARRAY_SIZE)
1894 case GL_VERTEX_ARRAY_SIZE:
1895#endif // defined(GL_VERTEX_ARRAY_SIZE)
1896#if defined(GL_VERTEX_ARRAY_STRIDE)
1897 case GL_VERTEX_ARRAY_STRIDE:
1898#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1899#if defined(GL_VERTEX_ARRAY_TYPE)
1900 case GL_VERTEX_ARRAY_TYPE:
1901#endif // defined(GL_VERTEX_ARRAY_TYPE)
1902#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1903 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1904#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1905#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1906 case GL_WEIGHT_ARRAY_SIZE_OES:
1907#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1908#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1909 case GL_WEIGHT_ARRAY_STRIDE_OES:
1910#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1911#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1912 case GL_WEIGHT_ARRAY_TYPE_OES:
1913#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1914 _needed = 1;
1915 break;
1916#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1917 case GL_ALIASED_POINT_SIZE_RANGE:
1918#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1919#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1920 case GL_ALIASED_LINE_WIDTH_RANGE:
1921#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1922#if defined(GL_DEPTH_RANGE)
1923 case GL_DEPTH_RANGE:
1924#endif // defined(GL_DEPTH_RANGE)
1925#if defined(GL_MAX_VIEWPORT_DIMS)
1926 case GL_MAX_VIEWPORT_DIMS:
1927#endif // defined(GL_MAX_VIEWPORT_DIMS)
1928#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1929 case GL_SMOOTH_LINE_WIDTH_RANGE:
1930#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1931#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1932 case GL_SMOOTH_POINT_SIZE_RANGE:
1933#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1934 _needed = 2;
1935 break;
1936#if defined(GL_COLOR_CLEAR_VALUE)
1937 case GL_COLOR_CLEAR_VALUE:
1938#endif // defined(GL_COLOR_CLEAR_VALUE)
1939#if defined(GL_COLOR_WRITEMASK)
1940 case GL_COLOR_WRITEMASK:
1941#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001942#if defined(GL_FOG_COLOR)
1943 case GL_FOG_COLOR:
1944#endif // defined(GL_FOG_COLOR)
1945#if defined(GL_LIGHT_MODEL_AMBIENT)
1946 case GL_LIGHT_MODEL_AMBIENT:
1947#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001948#if defined(GL_SCISSOR_BOX)
1949 case GL_SCISSOR_BOX:
1950#endif // defined(GL_SCISSOR_BOX)
1951#if defined(GL_VIEWPORT)
1952 case GL_VIEWPORT:
1953#endif // defined(GL_VIEWPORT)
1954 _needed = 4;
1955 break;
1956#if defined(GL_MODELVIEW_MATRIX)
1957 case GL_MODELVIEW_MATRIX:
1958#endif // defined(GL_MODELVIEW_MATRIX)
1959#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1960 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1961#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1962#if defined(GL_PROJECTION_MATRIX)
1963 case GL_PROJECTION_MATRIX:
1964#endif // defined(GL_PROJECTION_MATRIX)
1965#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1966 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1967#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1968#if defined(GL_TEXTURE_MATRIX)
1969 case GL_TEXTURE_MATRIX:
1970#endif // defined(GL_TEXTURE_MATRIX)
1971#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1972 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1973#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1974 _needed = 16;
1975 break;
1976#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1977 case GL_COMPRESSED_TEXTURE_FORMATS:
1978#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001979 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001980 break;
1981 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001982 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001983 break;
1984 }
1985 if (_remaining < _needed) {
1986 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001987 _exceptionType = "java/lang/IllegalArgumentException";
1988 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001989 goto exit;
1990 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001991 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001992 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001993 params = (GLint *) (_paramsBase + _bufferOffset);
1994 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001995 glGetIntegerv(
1996 (GLenum)pname,
1997 (GLint *)params
1998 );
1999
2000exit:
2001 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002002 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002003 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002004 if (_exception) {
2005 jniThrowException(_env, _exceptionType, _exceptionMessage);
2006 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002007}
2008
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002009/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07002010static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
2011 const char* chars = (const char*) glGetString((GLenum) name);
2012 return _env->NewStringUTF(chars);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002013}
2014/* void glHint ( GLenum target, GLenum mode ) */
2015static void
2016android_glHint__II
2017 (JNIEnv *_env, jobject _this, jint target, jint mode) {
2018 glHint(
2019 (GLenum)target,
2020 (GLenum)mode
2021 );
2022}
2023
2024/* void glLightModelf ( GLenum pname, GLfloat param ) */
2025static void
2026android_glLightModelf__IF
2027 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
2028 glLightModelf(
2029 (GLenum)pname,
2030 (GLfloat)param
2031 );
2032}
2033
2034/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2035static void
2036android_glLightModelfv__I_3FI
2037 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002038 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002039 const char * _exceptionType = NULL;
2040 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002041 GLfloat *params_base = (GLfloat *) 0;
2042 jint _remaining;
2043 GLfloat *params = (GLfloat *) 0;
2044
2045 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002046 _exception = 1;
2047 _exceptionType = "java/lang/IllegalArgumentException";
2048 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002049 goto exit;
2050 }
2051 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002052 _exception = 1;
2053 _exceptionType = "java/lang/IllegalArgumentException";
2054 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002055 goto exit;
2056 }
2057 _remaining = _env->GetArrayLength(params_ref) - offset;
2058 int _needed;
2059 switch (pname) {
2060#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2061 case GL_LIGHT_MODEL_TWO_SIDE:
2062#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2063 _needed = 1;
2064 break;
2065#if defined(GL_LIGHT_MODEL_AMBIENT)
2066 case GL_LIGHT_MODEL_AMBIENT:
2067#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2068 _needed = 4;
2069 break;
2070 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002071 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 break;
2073 }
2074 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002075 _exception = 1;
2076 _exceptionType = "java/lang/IllegalArgumentException";
2077 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002078 goto exit;
2079 }
2080 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002081 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002082 params = params_base + offset;
2083
2084 glLightModelfv(
2085 (GLenum)pname,
2086 (GLfloat *)params
2087 );
2088
2089exit:
2090 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002091 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002092 JNI_ABORT);
2093 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002094 if (_exception) {
2095 jniThrowException(_env, _exceptionType, _exceptionMessage);
2096 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002097}
2098
2099/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2100static void
2101android_glLightModelfv__ILjava_nio_FloatBuffer_2
2102 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002103 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002104 const char * _exceptionType = NULL;
2105 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002106 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002107 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002108 jint _remaining;
2109 GLfloat *params = (GLfloat *) 0;
2110
Romain Guy84cac202016-12-05 12:26:02 -08002111 if (!params_buf) {
2112 _exception = 1;
2113 _exceptionType = "java/lang/IllegalArgumentException";
2114 _exceptionMessage = "params == null";
2115 goto exit;
2116 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002117 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002118 int _needed;
2119 switch (pname) {
2120#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2121 case GL_LIGHT_MODEL_TWO_SIDE:
2122#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2123 _needed = 1;
2124 break;
2125#if defined(GL_LIGHT_MODEL_AMBIENT)
2126 case GL_LIGHT_MODEL_AMBIENT:
2127#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2128 _needed = 4;
2129 break;
2130 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002131 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002132 break;
2133 }
2134 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002135 _exception = 1;
2136 _exceptionType = "java/lang/IllegalArgumentException";
2137 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002138 goto exit;
2139 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002140 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002141 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002142 params = (GLfloat *) (_paramsBase + _bufferOffset);
2143 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002144 glLightModelfv(
2145 (GLenum)pname,
2146 (GLfloat *)params
2147 );
2148
2149exit:
2150 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002151 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002153 if (_exception) {
2154 jniThrowException(_env, _exceptionType, _exceptionMessage);
2155 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002156}
2157
2158/* void glLightModelx ( GLenum pname, GLfixed param ) */
2159static void
2160android_glLightModelx__II
2161 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2162 glLightModelx(
2163 (GLenum)pname,
2164 (GLfixed)param
2165 );
2166}
2167
2168/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2169static void
2170android_glLightModelxv__I_3II
2171 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002172 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002173 const char * _exceptionType = NULL;
2174 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002175 GLfixed *params_base = (GLfixed *) 0;
2176 jint _remaining;
2177 GLfixed *params = (GLfixed *) 0;
2178
2179 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002180 _exception = 1;
2181 _exceptionType = "java/lang/IllegalArgumentException";
2182 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002183 goto exit;
2184 }
2185 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002186 _exception = 1;
2187 _exceptionType = "java/lang/IllegalArgumentException";
2188 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002189 goto exit;
2190 }
2191 _remaining = _env->GetArrayLength(params_ref) - offset;
2192 int _needed;
2193 switch (pname) {
2194#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2195 case GL_LIGHT_MODEL_TWO_SIDE:
2196#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2197 _needed = 1;
2198 break;
2199#if defined(GL_LIGHT_MODEL_AMBIENT)
2200 case GL_LIGHT_MODEL_AMBIENT:
2201#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2202 _needed = 4;
2203 break;
2204 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002205 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002206 break;
2207 }
2208 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002209 _exception = 1;
2210 _exceptionType = "java/lang/IllegalArgumentException";
2211 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002212 goto exit;
2213 }
2214 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002215 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002216 params = params_base + offset;
2217
2218 glLightModelxv(
2219 (GLenum)pname,
2220 (GLfixed *)params
2221 );
2222
2223exit:
2224 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002225 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002226 JNI_ABORT);
2227 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002228 if (_exception) {
2229 jniThrowException(_env, _exceptionType, _exceptionMessage);
2230 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002231}
2232
2233/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2234static void
2235android_glLightModelxv__ILjava_nio_IntBuffer_2
2236 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002237 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002238 const char * _exceptionType = NULL;
2239 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002240 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002241 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002242 jint _remaining;
2243 GLfixed *params = (GLfixed *) 0;
2244
Romain Guy84cac202016-12-05 12:26:02 -08002245 if (!params_buf) {
2246 _exception = 1;
2247 _exceptionType = "java/lang/IllegalArgumentException";
2248 _exceptionMessage = "params == null";
2249 goto exit;
2250 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002251 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002252 int _needed;
2253 switch (pname) {
2254#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2255 case GL_LIGHT_MODEL_TWO_SIDE:
2256#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2257 _needed = 1;
2258 break;
2259#if defined(GL_LIGHT_MODEL_AMBIENT)
2260 case GL_LIGHT_MODEL_AMBIENT:
2261#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2262 _needed = 4;
2263 break;
2264 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002265 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 break;
2267 }
2268 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002269 _exception = 1;
2270 _exceptionType = "java/lang/IllegalArgumentException";
2271 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002272 goto exit;
2273 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002274 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002275 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002276 params = (GLfixed *) (_paramsBase + _bufferOffset);
2277 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002278 glLightModelxv(
2279 (GLenum)pname,
2280 (GLfixed *)params
2281 );
2282
2283exit:
2284 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002285 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002286 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002287 if (_exception) {
2288 jniThrowException(_env, _exceptionType, _exceptionMessage);
2289 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002290}
2291
2292/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2293static void
2294android_glLightf__IIF
2295 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2296 glLightf(
2297 (GLenum)light,
2298 (GLenum)pname,
2299 (GLfloat)param
2300 );
2301}
2302
2303/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2304static void
2305android_glLightfv__II_3FI
2306 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002307 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002308 const char * _exceptionType = NULL;
2309 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002310 GLfloat *params_base = (GLfloat *) 0;
2311 jint _remaining;
2312 GLfloat *params = (GLfloat *) 0;
2313
2314 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002315 _exception = 1;
2316 _exceptionType = "java/lang/IllegalArgumentException";
2317 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002318 goto exit;
2319 }
2320 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002321 _exception = 1;
2322 _exceptionType = "java/lang/IllegalArgumentException";
2323 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002324 goto exit;
2325 }
2326 _remaining = _env->GetArrayLength(params_ref) - offset;
2327 int _needed;
2328 switch (pname) {
2329#if defined(GL_SPOT_EXPONENT)
2330 case GL_SPOT_EXPONENT:
2331#endif // defined(GL_SPOT_EXPONENT)
2332#if defined(GL_SPOT_CUTOFF)
2333 case GL_SPOT_CUTOFF:
2334#endif // defined(GL_SPOT_CUTOFF)
2335#if defined(GL_CONSTANT_ATTENUATION)
2336 case GL_CONSTANT_ATTENUATION:
2337#endif // defined(GL_CONSTANT_ATTENUATION)
2338#if defined(GL_LINEAR_ATTENUATION)
2339 case GL_LINEAR_ATTENUATION:
2340#endif // defined(GL_LINEAR_ATTENUATION)
2341#if defined(GL_QUADRATIC_ATTENUATION)
2342 case GL_QUADRATIC_ATTENUATION:
2343#endif // defined(GL_QUADRATIC_ATTENUATION)
2344 _needed = 1;
2345 break;
2346#if defined(GL_SPOT_DIRECTION)
2347 case GL_SPOT_DIRECTION:
2348#endif // defined(GL_SPOT_DIRECTION)
2349 _needed = 3;
2350 break;
2351#if defined(GL_AMBIENT)
2352 case GL_AMBIENT:
2353#endif // defined(GL_AMBIENT)
2354#if defined(GL_DIFFUSE)
2355 case GL_DIFFUSE:
2356#endif // defined(GL_DIFFUSE)
2357#if defined(GL_SPECULAR)
2358 case GL_SPECULAR:
2359#endif // defined(GL_SPECULAR)
2360#if defined(GL_EMISSION)
2361 case GL_EMISSION:
2362#endif // defined(GL_EMISSION)
2363 _needed = 4;
2364 break;
2365 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002366 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002367 break;
2368 }
2369 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002370 _exception = 1;
2371 _exceptionType = "java/lang/IllegalArgumentException";
2372 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002373 goto exit;
2374 }
2375 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002376 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002377 params = params_base + offset;
2378
2379 glLightfv(
2380 (GLenum)light,
2381 (GLenum)pname,
2382 (GLfloat *)params
2383 );
2384
2385exit:
2386 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002387 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002388 JNI_ABORT);
2389 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002390 if (_exception) {
2391 jniThrowException(_env, _exceptionType, _exceptionMessage);
2392 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002393}
2394
2395/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2396static void
2397android_glLightfv__IILjava_nio_FloatBuffer_2
2398 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002399 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002400 const char * _exceptionType = NULL;
2401 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002402 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002403 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002404 jint _remaining;
2405 GLfloat *params = (GLfloat *) 0;
2406
Romain Guy84cac202016-12-05 12:26:02 -08002407 if (!params_buf) {
2408 _exception = 1;
2409 _exceptionType = "java/lang/IllegalArgumentException";
2410 _exceptionMessage = "params == null";
2411 goto exit;
2412 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002413 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002414 int _needed;
2415 switch (pname) {
2416#if defined(GL_SPOT_EXPONENT)
2417 case GL_SPOT_EXPONENT:
2418#endif // defined(GL_SPOT_EXPONENT)
2419#if defined(GL_SPOT_CUTOFF)
2420 case GL_SPOT_CUTOFF:
2421#endif // defined(GL_SPOT_CUTOFF)
2422#if defined(GL_CONSTANT_ATTENUATION)
2423 case GL_CONSTANT_ATTENUATION:
2424#endif // defined(GL_CONSTANT_ATTENUATION)
2425#if defined(GL_LINEAR_ATTENUATION)
2426 case GL_LINEAR_ATTENUATION:
2427#endif // defined(GL_LINEAR_ATTENUATION)
2428#if defined(GL_QUADRATIC_ATTENUATION)
2429 case GL_QUADRATIC_ATTENUATION:
2430#endif // defined(GL_QUADRATIC_ATTENUATION)
2431 _needed = 1;
2432 break;
2433#if defined(GL_SPOT_DIRECTION)
2434 case GL_SPOT_DIRECTION:
2435#endif // defined(GL_SPOT_DIRECTION)
2436 _needed = 3;
2437 break;
2438#if defined(GL_AMBIENT)
2439 case GL_AMBIENT:
2440#endif // defined(GL_AMBIENT)
2441#if defined(GL_DIFFUSE)
2442 case GL_DIFFUSE:
2443#endif // defined(GL_DIFFUSE)
2444#if defined(GL_SPECULAR)
2445 case GL_SPECULAR:
2446#endif // defined(GL_SPECULAR)
2447#if defined(GL_EMISSION)
2448 case GL_EMISSION:
2449#endif // defined(GL_EMISSION)
2450 _needed = 4;
2451 break;
2452 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002453 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002454 break;
2455 }
2456 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002457 _exception = 1;
2458 _exceptionType = "java/lang/IllegalArgumentException";
2459 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002460 goto exit;
2461 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002462 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002463 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002464 params = (GLfloat *) (_paramsBase + _bufferOffset);
2465 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002466 glLightfv(
2467 (GLenum)light,
2468 (GLenum)pname,
2469 (GLfloat *)params
2470 );
2471
2472exit:
2473 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002474 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002476 if (_exception) {
2477 jniThrowException(_env, _exceptionType, _exceptionMessage);
2478 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002479}
2480
2481/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2482static void
2483android_glLightx__III
2484 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2485 glLightx(
2486 (GLenum)light,
2487 (GLenum)pname,
2488 (GLfixed)param
2489 );
2490}
2491
2492/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2493static void
2494android_glLightxv__II_3II
2495 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002496 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002497 const char * _exceptionType = NULL;
2498 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002499 GLfixed *params_base = (GLfixed *) 0;
2500 jint _remaining;
2501 GLfixed *params = (GLfixed *) 0;
2502
2503 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002504 _exception = 1;
2505 _exceptionType = "java/lang/IllegalArgumentException";
2506 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002507 goto exit;
2508 }
2509 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002510 _exception = 1;
2511 _exceptionType = "java/lang/IllegalArgumentException";
2512 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002513 goto exit;
2514 }
2515 _remaining = _env->GetArrayLength(params_ref) - offset;
2516 int _needed;
2517 switch (pname) {
2518#if defined(GL_SPOT_EXPONENT)
2519 case GL_SPOT_EXPONENT:
2520#endif // defined(GL_SPOT_EXPONENT)
2521#if defined(GL_SPOT_CUTOFF)
2522 case GL_SPOT_CUTOFF:
2523#endif // defined(GL_SPOT_CUTOFF)
2524#if defined(GL_CONSTANT_ATTENUATION)
2525 case GL_CONSTANT_ATTENUATION:
2526#endif // defined(GL_CONSTANT_ATTENUATION)
2527#if defined(GL_LINEAR_ATTENUATION)
2528 case GL_LINEAR_ATTENUATION:
2529#endif // defined(GL_LINEAR_ATTENUATION)
2530#if defined(GL_QUADRATIC_ATTENUATION)
2531 case GL_QUADRATIC_ATTENUATION:
2532#endif // defined(GL_QUADRATIC_ATTENUATION)
2533 _needed = 1;
2534 break;
2535#if defined(GL_SPOT_DIRECTION)
2536 case GL_SPOT_DIRECTION:
2537#endif // defined(GL_SPOT_DIRECTION)
2538 _needed = 3;
2539 break;
2540#if defined(GL_AMBIENT)
2541 case GL_AMBIENT:
2542#endif // defined(GL_AMBIENT)
2543#if defined(GL_DIFFUSE)
2544 case GL_DIFFUSE:
2545#endif // defined(GL_DIFFUSE)
2546#if defined(GL_SPECULAR)
2547 case GL_SPECULAR:
2548#endif // defined(GL_SPECULAR)
2549#if defined(GL_EMISSION)
2550 case GL_EMISSION:
2551#endif // defined(GL_EMISSION)
2552 _needed = 4;
2553 break;
2554 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002555 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002556 break;
2557 }
2558 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002559 _exception = 1;
2560 _exceptionType = "java/lang/IllegalArgumentException";
2561 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002562 goto exit;
2563 }
2564 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002565 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002566 params = params_base + offset;
2567
2568 glLightxv(
2569 (GLenum)light,
2570 (GLenum)pname,
2571 (GLfixed *)params
2572 );
2573
2574exit:
2575 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002576 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002577 JNI_ABORT);
2578 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002579 if (_exception) {
2580 jniThrowException(_env, _exceptionType, _exceptionMessage);
2581 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582}
2583
2584/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2585static void
2586android_glLightxv__IILjava_nio_IntBuffer_2
2587 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002588 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002589 const char * _exceptionType = NULL;
2590 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002591 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002592 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002593 jint _remaining;
2594 GLfixed *params = (GLfixed *) 0;
2595
Romain Guy84cac202016-12-05 12:26:02 -08002596 if (!params_buf) {
2597 _exception = 1;
2598 _exceptionType = "java/lang/IllegalArgumentException";
2599 _exceptionMessage = "params == null";
2600 goto exit;
2601 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002602 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002603 int _needed;
2604 switch (pname) {
2605#if defined(GL_SPOT_EXPONENT)
2606 case GL_SPOT_EXPONENT:
2607#endif // defined(GL_SPOT_EXPONENT)
2608#if defined(GL_SPOT_CUTOFF)
2609 case GL_SPOT_CUTOFF:
2610#endif // defined(GL_SPOT_CUTOFF)
2611#if defined(GL_CONSTANT_ATTENUATION)
2612 case GL_CONSTANT_ATTENUATION:
2613#endif // defined(GL_CONSTANT_ATTENUATION)
2614#if defined(GL_LINEAR_ATTENUATION)
2615 case GL_LINEAR_ATTENUATION:
2616#endif // defined(GL_LINEAR_ATTENUATION)
2617#if defined(GL_QUADRATIC_ATTENUATION)
2618 case GL_QUADRATIC_ATTENUATION:
2619#endif // defined(GL_QUADRATIC_ATTENUATION)
2620 _needed = 1;
2621 break;
2622#if defined(GL_SPOT_DIRECTION)
2623 case GL_SPOT_DIRECTION:
2624#endif // defined(GL_SPOT_DIRECTION)
2625 _needed = 3;
2626 break;
2627#if defined(GL_AMBIENT)
2628 case GL_AMBIENT:
2629#endif // defined(GL_AMBIENT)
2630#if defined(GL_DIFFUSE)
2631 case GL_DIFFUSE:
2632#endif // defined(GL_DIFFUSE)
2633#if defined(GL_SPECULAR)
2634 case GL_SPECULAR:
2635#endif // defined(GL_SPECULAR)
2636#if defined(GL_EMISSION)
2637 case GL_EMISSION:
2638#endif // defined(GL_EMISSION)
2639 _needed = 4;
2640 break;
2641 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002642 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002643 break;
2644 }
2645 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002646 _exception = 1;
2647 _exceptionType = "java/lang/IllegalArgumentException";
2648 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002649 goto exit;
2650 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002651 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002652 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002653 params = (GLfixed *) (_paramsBase + _bufferOffset);
2654 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002655 glLightxv(
2656 (GLenum)light,
2657 (GLenum)pname,
2658 (GLfixed *)params
2659 );
2660
2661exit:
2662 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002663 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002664 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002665 if (_exception) {
2666 jniThrowException(_env, _exceptionType, _exceptionMessage);
2667 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002668}
2669
2670/* void glLineWidth ( GLfloat width ) */
2671static void
2672android_glLineWidth__F
2673 (JNIEnv *_env, jobject _this, jfloat width) {
2674 glLineWidth(
2675 (GLfloat)width
2676 );
2677}
2678
2679/* void glLineWidthx ( GLfixed width ) */
2680static void
2681android_glLineWidthx__I
2682 (JNIEnv *_env, jobject _this, jint width) {
2683 glLineWidthx(
2684 (GLfixed)width
2685 );
2686}
2687
2688/* void glLoadIdentity ( void ) */
2689static void
2690android_glLoadIdentity__
2691 (JNIEnv *_env, jobject _this) {
2692 glLoadIdentity();
2693}
2694
2695/* void glLoadMatrixf ( const GLfloat *m ) */
2696static void
2697android_glLoadMatrixf___3FI
2698 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002699 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002700 const char * _exceptionType = NULL;
2701 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002702 GLfloat *m_base = (GLfloat *) 0;
2703 jint _remaining;
2704 GLfloat *m = (GLfloat *) 0;
2705
2706 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002707 _exception = 1;
2708 _exceptionType = "java/lang/IllegalArgumentException";
2709 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002710 goto exit;
2711 }
2712 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002713 _exception = 1;
2714 _exceptionType = "java/lang/IllegalArgumentException";
2715 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002716 goto exit;
2717 }
2718 _remaining = _env->GetArrayLength(m_ref) - offset;
2719 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002720 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002721 m = m_base + offset;
2722
2723 glLoadMatrixf(
2724 (GLfloat *)m
2725 );
2726
2727exit:
2728 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002729 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002730 JNI_ABORT);
2731 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002732 if (_exception) {
2733 jniThrowException(_env, _exceptionType, _exceptionMessage);
2734 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002735}
2736
2737/* void glLoadMatrixf ( const GLfloat *m ) */
2738static void
2739android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2740 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002741 jint _exception = 0;
2742 const char * _exceptionType = NULL;
2743 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002744 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002745 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002746 jint _remaining;
2747 GLfloat *m = (GLfloat *) 0;
2748
Romain Guy84cac202016-12-05 12:26:02 -08002749 if (!m_buf) {
2750 _exception = 1;
2751 _exceptionType = "java/lang/IllegalArgumentException";
2752 _exceptionMessage = "m == null";
2753 goto exit;
2754 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002755 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002756 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002757 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002758 m = (GLfloat *) (_mBase + _bufferOffset);
2759 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002760 glLoadMatrixf(
2761 (GLfloat *)m
2762 );
Romain Guy84cac202016-12-05 12:26:02 -08002763
2764exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002765 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002766 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002767 }
Romain Guy84cac202016-12-05 12:26:02 -08002768 if (_exception) {
2769 jniThrowException(_env, _exceptionType, _exceptionMessage);
2770 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002771}
2772
2773/* void glLoadMatrixx ( const GLfixed *m ) */
2774static void
2775android_glLoadMatrixx___3II
2776 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002777 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002778 const char * _exceptionType = NULL;
2779 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002780 GLfixed *m_base = (GLfixed *) 0;
2781 jint _remaining;
2782 GLfixed *m = (GLfixed *) 0;
2783
2784 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002785 _exception = 1;
2786 _exceptionType = "java/lang/IllegalArgumentException";
2787 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002788 goto exit;
2789 }
2790 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002791 _exception = 1;
2792 _exceptionType = "java/lang/IllegalArgumentException";
2793 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002794 goto exit;
2795 }
2796 _remaining = _env->GetArrayLength(m_ref) - offset;
2797 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002798 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002799 m = m_base + offset;
2800
2801 glLoadMatrixx(
2802 (GLfixed *)m
2803 );
2804
2805exit:
2806 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002807 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002808 JNI_ABORT);
2809 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002810 if (_exception) {
2811 jniThrowException(_env, _exceptionType, _exceptionMessage);
2812 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002813}
2814
2815/* void glLoadMatrixx ( const GLfixed *m ) */
2816static void
2817android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2818 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002819 jint _exception = 0;
2820 const char * _exceptionType = NULL;
2821 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002822 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002823 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002824 jint _remaining;
2825 GLfixed *m = (GLfixed *) 0;
2826
Romain Guy84cac202016-12-05 12:26:02 -08002827 if (!m_buf) {
2828 _exception = 1;
2829 _exceptionType = "java/lang/IllegalArgumentException";
2830 _exceptionMessage = "m == null";
2831 goto exit;
2832 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002833 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002834 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002835 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002836 m = (GLfixed *) (_mBase + _bufferOffset);
2837 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002838 glLoadMatrixx(
2839 (GLfixed *)m
2840 );
Romain Guy84cac202016-12-05 12:26:02 -08002841
2842exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002843 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002844 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002845 }
Romain Guy84cac202016-12-05 12:26:02 -08002846 if (_exception) {
2847 jniThrowException(_env, _exceptionType, _exceptionMessage);
2848 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002849}
2850
2851/* void glLogicOp ( GLenum opcode ) */
2852static void
2853android_glLogicOp__I
2854 (JNIEnv *_env, jobject _this, jint opcode) {
2855 glLogicOp(
2856 (GLenum)opcode
2857 );
2858}
2859
2860/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2861static void
2862android_glMaterialf__IIF
2863 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2864 glMaterialf(
2865 (GLenum)face,
2866 (GLenum)pname,
2867 (GLfloat)param
2868 );
2869}
2870
2871/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2872static void
2873android_glMaterialfv__II_3FI
2874 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002875 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002876 const char * _exceptionType = NULL;
2877 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878 GLfloat *params_base = (GLfloat *) 0;
2879 jint _remaining;
2880 GLfloat *params = (GLfloat *) 0;
2881
2882 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002883 _exception = 1;
2884 _exceptionType = "java/lang/IllegalArgumentException";
2885 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002886 goto exit;
2887 }
2888 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002889 _exception = 1;
2890 _exceptionType = "java/lang/IllegalArgumentException";
2891 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002892 goto exit;
2893 }
2894 _remaining = _env->GetArrayLength(params_ref) - offset;
2895 int _needed;
2896 switch (pname) {
2897#if defined(GL_SHININESS)
2898 case GL_SHININESS:
2899#endif // defined(GL_SHININESS)
2900 _needed = 1;
2901 break;
2902#if defined(GL_AMBIENT)
2903 case GL_AMBIENT:
2904#endif // defined(GL_AMBIENT)
2905#if defined(GL_DIFFUSE)
2906 case GL_DIFFUSE:
2907#endif // defined(GL_DIFFUSE)
2908#if defined(GL_SPECULAR)
2909 case GL_SPECULAR:
2910#endif // defined(GL_SPECULAR)
2911#if defined(GL_EMISSION)
2912 case GL_EMISSION:
2913#endif // defined(GL_EMISSION)
2914#if defined(GL_AMBIENT_AND_DIFFUSE)
2915 case GL_AMBIENT_AND_DIFFUSE:
2916#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2917 _needed = 4;
2918 break;
2919 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002920 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002921 break;
2922 }
2923 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002924 _exception = 1;
2925 _exceptionType = "java/lang/IllegalArgumentException";
2926 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002927 goto exit;
2928 }
2929 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002930 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002931 params = params_base + offset;
2932
2933 glMaterialfv(
2934 (GLenum)face,
2935 (GLenum)pname,
2936 (GLfloat *)params
2937 );
2938
2939exit:
2940 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002941 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002942 JNI_ABORT);
2943 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002944 if (_exception) {
2945 jniThrowException(_env, _exceptionType, _exceptionMessage);
2946 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002947}
2948
2949/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2950static void
2951android_glMaterialfv__IILjava_nio_FloatBuffer_2
2952 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002953 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002954 const char * _exceptionType = NULL;
2955 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002956 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002957 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002958 jint _remaining;
2959 GLfloat *params = (GLfloat *) 0;
2960
Romain Guy84cac202016-12-05 12:26:02 -08002961 if (!params_buf) {
2962 _exception = 1;
2963 _exceptionType = "java/lang/IllegalArgumentException";
2964 _exceptionMessage = "params == null";
2965 goto exit;
2966 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002967 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002968 int _needed;
2969 switch (pname) {
2970#if defined(GL_SHININESS)
2971 case GL_SHININESS:
2972#endif // defined(GL_SHININESS)
2973 _needed = 1;
2974 break;
2975#if defined(GL_AMBIENT)
2976 case GL_AMBIENT:
2977#endif // defined(GL_AMBIENT)
2978#if defined(GL_DIFFUSE)
2979 case GL_DIFFUSE:
2980#endif // defined(GL_DIFFUSE)
2981#if defined(GL_SPECULAR)
2982 case GL_SPECULAR:
2983#endif // defined(GL_SPECULAR)
2984#if defined(GL_EMISSION)
2985 case GL_EMISSION:
2986#endif // defined(GL_EMISSION)
2987#if defined(GL_AMBIENT_AND_DIFFUSE)
2988 case GL_AMBIENT_AND_DIFFUSE:
2989#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2990 _needed = 4;
2991 break;
2992 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002993 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002994 break;
2995 }
2996 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002997 _exception = 1;
2998 _exceptionType = "java/lang/IllegalArgumentException";
2999 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003000 goto exit;
3001 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003002 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003003 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003004 params = (GLfloat *) (_paramsBase + _bufferOffset);
3005 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003006 glMaterialfv(
3007 (GLenum)face,
3008 (GLenum)pname,
3009 (GLfloat *)params
3010 );
3011
3012exit:
3013 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003014 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003015 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003016 if (_exception) {
3017 jniThrowException(_env, _exceptionType, _exceptionMessage);
3018 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003019}
3020
3021/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
3022static void
3023android_glMaterialx__III
3024 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
3025 glMaterialx(
3026 (GLenum)face,
3027 (GLenum)pname,
3028 (GLfixed)param
3029 );
3030}
3031
3032/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3033static void
3034android_glMaterialxv__II_3II
3035 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003036 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003037 const char * _exceptionType = NULL;
3038 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003039 GLfixed *params_base = (GLfixed *) 0;
3040 jint _remaining;
3041 GLfixed *params = (GLfixed *) 0;
3042
3043 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003044 _exception = 1;
3045 _exceptionType = "java/lang/IllegalArgumentException";
3046 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003047 goto exit;
3048 }
3049 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003050 _exception = 1;
3051 _exceptionType = "java/lang/IllegalArgumentException";
3052 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003053 goto exit;
3054 }
3055 _remaining = _env->GetArrayLength(params_ref) - offset;
3056 int _needed;
3057 switch (pname) {
3058#if defined(GL_SHININESS)
3059 case GL_SHININESS:
3060#endif // defined(GL_SHININESS)
3061 _needed = 1;
3062 break;
3063#if defined(GL_AMBIENT)
3064 case GL_AMBIENT:
3065#endif // defined(GL_AMBIENT)
3066#if defined(GL_DIFFUSE)
3067 case GL_DIFFUSE:
3068#endif // defined(GL_DIFFUSE)
3069#if defined(GL_SPECULAR)
3070 case GL_SPECULAR:
3071#endif // defined(GL_SPECULAR)
3072#if defined(GL_EMISSION)
3073 case GL_EMISSION:
3074#endif // defined(GL_EMISSION)
3075#if defined(GL_AMBIENT_AND_DIFFUSE)
3076 case GL_AMBIENT_AND_DIFFUSE:
3077#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3078 _needed = 4;
3079 break;
3080 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003081 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003082 break;
3083 }
3084 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003085 _exception = 1;
3086 _exceptionType = "java/lang/IllegalArgumentException";
3087 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003088 goto exit;
3089 }
3090 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003091 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003092 params = params_base + offset;
3093
3094 glMaterialxv(
3095 (GLenum)face,
3096 (GLenum)pname,
3097 (GLfixed *)params
3098 );
3099
3100exit:
3101 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003102 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003103 JNI_ABORT);
3104 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003105 if (_exception) {
3106 jniThrowException(_env, _exceptionType, _exceptionMessage);
3107 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003108}
3109
3110/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3111static void
3112android_glMaterialxv__IILjava_nio_IntBuffer_2
3113 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003114 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003115 const char * _exceptionType = NULL;
3116 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003117 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003118 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003119 jint _remaining;
3120 GLfixed *params = (GLfixed *) 0;
3121
Romain Guy84cac202016-12-05 12:26:02 -08003122 if (!params_buf) {
3123 _exception = 1;
3124 _exceptionType = "java/lang/IllegalArgumentException";
3125 _exceptionMessage = "params == null";
3126 goto exit;
3127 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003128 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003129 int _needed;
3130 switch (pname) {
3131#if defined(GL_SHININESS)
3132 case GL_SHININESS:
3133#endif // defined(GL_SHININESS)
3134 _needed = 1;
3135 break;
3136#if defined(GL_AMBIENT)
3137 case GL_AMBIENT:
3138#endif // defined(GL_AMBIENT)
3139#if defined(GL_DIFFUSE)
3140 case GL_DIFFUSE:
3141#endif // defined(GL_DIFFUSE)
3142#if defined(GL_SPECULAR)
3143 case GL_SPECULAR:
3144#endif // defined(GL_SPECULAR)
3145#if defined(GL_EMISSION)
3146 case GL_EMISSION:
3147#endif // defined(GL_EMISSION)
3148#if defined(GL_AMBIENT_AND_DIFFUSE)
3149 case GL_AMBIENT_AND_DIFFUSE:
3150#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3151 _needed = 4;
3152 break;
3153 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003154 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003155 break;
3156 }
3157 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003158 _exception = 1;
3159 _exceptionType = "java/lang/IllegalArgumentException";
3160 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161 goto exit;
3162 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003163 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003164 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003165 params = (GLfixed *) (_paramsBase + _bufferOffset);
3166 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003167 glMaterialxv(
3168 (GLenum)face,
3169 (GLenum)pname,
3170 (GLfixed *)params
3171 );
3172
3173exit:
3174 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003175 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003176 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003177 if (_exception) {
3178 jniThrowException(_env, _exceptionType, _exceptionMessage);
3179 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003180}
3181
3182/* void glMatrixMode ( GLenum mode ) */
3183static void
3184android_glMatrixMode__I
3185 (JNIEnv *_env, jobject _this, jint mode) {
3186 glMatrixMode(
3187 (GLenum)mode
3188 );
3189}
3190
3191/* void glMultMatrixf ( const GLfloat *m ) */
3192static void
3193android_glMultMatrixf___3FI
3194 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003195 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003196 const char * _exceptionType = NULL;
3197 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003198 GLfloat *m_base = (GLfloat *) 0;
3199 jint _remaining;
3200 GLfloat *m = (GLfloat *) 0;
3201
3202 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003203 _exception = 1;
3204 _exceptionType = "java/lang/IllegalArgumentException";
3205 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003206 goto exit;
3207 }
3208 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003209 _exception = 1;
3210 _exceptionType = "java/lang/IllegalArgumentException";
3211 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003212 goto exit;
3213 }
3214 _remaining = _env->GetArrayLength(m_ref) - offset;
3215 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003216 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003217 m = m_base + offset;
3218
3219 glMultMatrixf(
3220 (GLfloat *)m
3221 );
3222
3223exit:
3224 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003225 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003226 JNI_ABORT);
3227 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003228 if (_exception) {
3229 jniThrowException(_env, _exceptionType, _exceptionMessage);
3230 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003231}
3232
3233/* void glMultMatrixf ( const GLfloat *m ) */
3234static void
3235android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3236 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003237 jint _exception = 0;
3238 const char * _exceptionType = NULL;
3239 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003240 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003241 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003242 jint _remaining;
3243 GLfloat *m = (GLfloat *) 0;
3244
Romain Guy84cac202016-12-05 12:26:02 -08003245 if (!m_buf) {
3246 _exception = 1;
3247 _exceptionType = "java/lang/IllegalArgumentException";
3248 _exceptionMessage = "m == null";
3249 goto exit;
3250 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003251 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003252 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003253 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003254 m = (GLfloat *) (_mBase + _bufferOffset);
3255 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003256 glMultMatrixf(
3257 (GLfloat *)m
3258 );
Romain Guy84cac202016-12-05 12:26:02 -08003259
3260exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003261 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003262 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003263 }
Romain Guy84cac202016-12-05 12:26:02 -08003264 if (_exception) {
3265 jniThrowException(_env, _exceptionType, _exceptionMessage);
3266 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003267}
3268
3269/* void glMultMatrixx ( const GLfixed *m ) */
3270static void
3271android_glMultMatrixx___3II
3272 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003273 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003274 const char * _exceptionType = NULL;
3275 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003276 GLfixed *m_base = (GLfixed *) 0;
3277 jint _remaining;
3278 GLfixed *m = (GLfixed *) 0;
3279
3280 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003281 _exception = 1;
3282 _exceptionType = "java/lang/IllegalArgumentException";
3283 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003284 goto exit;
3285 }
3286 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003287 _exception = 1;
3288 _exceptionType = "java/lang/IllegalArgumentException";
3289 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003290 goto exit;
3291 }
3292 _remaining = _env->GetArrayLength(m_ref) - offset;
3293 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003294 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003295 m = m_base + offset;
3296
3297 glMultMatrixx(
3298 (GLfixed *)m
3299 );
3300
3301exit:
3302 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003303 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003304 JNI_ABORT);
3305 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003306 if (_exception) {
3307 jniThrowException(_env, _exceptionType, _exceptionMessage);
3308 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003309}
3310
3311/* void glMultMatrixx ( const GLfixed *m ) */
3312static void
3313android_glMultMatrixx__Ljava_nio_IntBuffer_2
3314 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003315 jint _exception = 0;
3316 const char * _exceptionType = NULL;
3317 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003318 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003319 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003320 jint _remaining;
3321 GLfixed *m = (GLfixed *) 0;
3322
Romain Guy84cac202016-12-05 12:26:02 -08003323 if (!m_buf) {
3324 _exception = 1;
3325 _exceptionType = "java/lang/IllegalArgumentException";
3326 _exceptionMessage = "m == null";
3327 goto exit;
3328 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003329 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003330 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003331 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003332 m = (GLfixed *) (_mBase + _bufferOffset);
3333 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003334 glMultMatrixx(
3335 (GLfixed *)m
3336 );
Romain Guy84cac202016-12-05 12:26:02 -08003337
3338exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003339 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003340 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003341 }
Romain Guy84cac202016-12-05 12:26:02 -08003342 if (_exception) {
3343 jniThrowException(_env, _exceptionType, _exceptionMessage);
3344 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003345}
3346
3347/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3348static void
3349android_glMultiTexCoord4f__IFFFF
3350 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3351 glMultiTexCoord4f(
3352 (GLenum)target,
3353 (GLfloat)s,
3354 (GLfloat)t,
3355 (GLfloat)r,
3356 (GLfloat)q
3357 );
3358}
3359
3360/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3361static void
3362android_glMultiTexCoord4x__IIIII
3363 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3364 glMultiTexCoord4x(
3365 (GLenum)target,
3366 (GLfixed)s,
3367 (GLfixed)t,
3368 (GLfixed)r,
3369 (GLfixed)q
3370 );
3371}
3372
3373/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3374static void
3375android_glNormal3f__FFF
3376 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3377 glNormal3f(
3378 (GLfloat)nx,
3379 (GLfloat)ny,
3380 (GLfloat)nz
3381 );
3382}
3383
3384/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3385static void
3386android_glNormal3x__III
3387 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3388 glNormal3x(
3389 (GLfixed)nx,
3390 (GLfixed)ny,
3391 (GLfixed)nz
3392 );
3393}
3394
3395/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3396static void
3397android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3398 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003399 jint _exception = 0;
3400 const char * _exceptionType = NULL;
3401 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003402 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003403 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003404 jint _remaining;
3405 GLvoid *pointer = (GLvoid *) 0;
3406
Jack Paleviche20ea782009-05-07 18:28:29 -07003407 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003408 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003409 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003410 return;
3411 }
3412 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003413 glNormalPointerBounds(
3414 (GLenum)type,
3415 (GLsizei)stride,
3416 (GLvoid *)pointer,
3417 (GLsizei)remaining
3418 );
Romain Guy84cac202016-12-05 12:26:02 -08003419 if (_exception) {
3420 jniThrowException(_env, _exceptionType, _exceptionMessage);
3421 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003422}
3423
3424/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3425static void
3426android_glOrthof__FFFFFF
3427 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3428 glOrthof(
3429 (GLfloat)left,
3430 (GLfloat)right,
3431 (GLfloat)bottom,
3432 (GLfloat)top,
3433 (GLfloat)zNear,
3434 (GLfloat)zFar
3435 );
3436}
3437
3438/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3439static void
3440android_glOrthox__IIIIII
3441 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3442 glOrthox(
3443 (GLfixed)left,
3444 (GLfixed)right,
3445 (GLfixed)bottom,
3446 (GLfixed)top,
3447 (GLfixed)zNear,
3448 (GLfixed)zFar
3449 );
3450}
3451
3452/* void glPixelStorei ( GLenum pname, GLint param ) */
3453static void
3454android_glPixelStorei__II
3455 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3456 glPixelStorei(
3457 (GLenum)pname,
3458 (GLint)param
3459 );
3460}
3461
3462/* void glPointSize ( GLfloat size ) */
3463static void
3464android_glPointSize__F
3465 (JNIEnv *_env, jobject _this, jfloat size) {
3466 glPointSize(
3467 (GLfloat)size
3468 );
3469}
3470
3471/* void glPointSizex ( GLfixed size ) */
3472static void
3473android_glPointSizex__I
3474 (JNIEnv *_env, jobject _this, jint size) {
3475 glPointSizex(
3476 (GLfixed)size
3477 );
3478}
3479
3480/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3481static void
3482android_glPolygonOffset__FF
3483 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3484 glPolygonOffset(
3485 (GLfloat)factor,
3486 (GLfloat)units
3487 );
3488}
3489
3490/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3491static void
3492android_glPolygonOffsetx__II
3493 (JNIEnv *_env, jobject _this, jint factor, jint units) {
3494 glPolygonOffsetx(
3495 (GLfixed)factor,
3496 (GLfixed)units
3497 );
3498}
3499
3500/* void glPopMatrix ( void ) */
3501static void
3502android_glPopMatrix__
3503 (JNIEnv *_env, jobject _this) {
3504 glPopMatrix();
3505}
3506
3507/* void glPushMatrix ( void ) */
3508static void
3509android_glPushMatrix__
3510 (JNIEnv *_env, jobject _this) {
3511 glPushMatrix();
3512}
3513
3514/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3515static void
3516android_glReadPixels__IIIIIILjava_nio_Buffer_2
3517 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003518 jint _exception = 0;
3519 const char * _exceptionType = NULL;
3520 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003521 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003522 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003523 jint _remaining;
3524 GLvoid *pixels = (GLvoid *) 0;
3525
Romain Guy84cac202016-12-05 12:26:02 -08003526 if (!pixels_buf) {
3527 _exception = 1;
3528 _exceptionType = "java/lang/IllegalArgumentException";
3529 _exceptionMessage = "pixels == null";
3530 goto exit;
3531 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003532 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003533 if (pixels == NULL) {
3534 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3535 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3536 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003537 glReadPixels(
3538 (GLint)x,
3539 (GLint)y,
3540 (GLsizei)width,
3541 (GLsizei)height,
3542 (GLenum)format,
3543 (GLenum)type,
3544 (GLvoid *)pixels
3545 );
Romain Guy84cac202016-12-05 12:26:02 -08003546
3547exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003548 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08003549 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
3550 }
3551 if (_exception) {
3552 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003553 }
3554}
3555
3556/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3557static void
3558android_glRotatef__FFFF
3559 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3560 glRotatef(
3561 (GLfloat)angle,
3562 (GLfloat)x,
3563 (GLfloat)y,
3564 (GLfloat)z
3565 );
3566}
3567
3568/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3569static void
3570android_glRotatex__IIII
3571 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3572 glRotatex(
3573 (GLfixed)angle,
3574 (GLfixed)x,
3575 (GLfixed)y,
3576 (GLfixed)z
3577 );
3578}
3579
3580/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3581static void
3582android_glSampleCoverage__FZ
3583 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3584 glSampleCoverage(
3585 (GLclampf)value,
3586 (GLboolean)invert
3587 );
3588}
3589
3590/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3591static void
3592android_glSampleCoveragex__IZ
3593 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3594 glSampleCoveragex(
3595 (GLclampx)value,
3596 (GLboolean)invert
3597 );
3598}
3599
3600/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3601static void
3602android_glScalef__FFF
3603 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3604 glScalef(
3605 (GLfloat)x,
3606 (GLfloat)y,
3607 (GLfloat)z
3608 );
3609}
3610
3611/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3612static void
3613android_glScalex__III
3614 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3615 glScalex(
3616 (GLfixed)x,
3617 (GLfixed)y,
3618 (GLfixed)z
3619 );
3620}
3621
3622/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3623static void
3624android_glScissor__IIII
3625 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3626 glScissor(
3627 (GLint)x,
3628 (GLint)y,
3629 (GLsizei)width,
3630 (GLsizei)height
3631 );
3632}
3633
3634/* void glShadeModel ( GLenum mode ) */
3635static void
3636android_glShadeModel__I
3637 (JNIEnv *_env, jobject _this, jint mode) {
3638 glShadeModel(
3639 (GLenum)mode
3640 );
3641}
3642
3643/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3644static void
3645android_glStencilFunc__III
3646 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3647 glStencilFunc(
3648 (GLenum)func,
3649 (GLint)ref,
3650 (GLuint)mask
3651 );
3652}
3653
3654/* void glStencilMask ( GLuint mask ) */
3655static void
3656android_glStencilMask__I
3657 (JNIEnv *_env, jobject _this, jint mask) {
3658 glStencilMask(
3659 (GLuint)mask
3660 );
3661}
3662
3663/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3664static void
3665android_glStencilOp__III
3666 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3667 glStencilOp(
3668 (GLenum)fail,
3669 (GLenum)zfail,
3670 (GLenum)zpass
3671 );
3672}
3673
3674/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3675static void
3676android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3677 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003678 jint _exception = 0;
3679 const char * _exceptionType = NULL;
3680 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003681 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003682 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003683 jint _remaining;
3684 GLvoid *pointer = (GLvoid *) 0;
3685
Jack Paleviche20ea782009-05-07 18:28:29 -07003686 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003687 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003688 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003689 return;
3690 }
3691 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003692 glTexCoordPointerBounds(
3693 (GLint)size,
3694 (GLenum)type,
3695 (GLsizei)stride,
3696 (GLvoid *)pointer,
3697 (GLsizei)remaining
3698 );
Romain Guy84cac202016-12-05 12:26:02 -08003699 if (_exception) {
3700 jniThrowException(_env, _exceptionType, _exceptionMessage);
3701 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003702}
3703
3704/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3705static void
3706android_glTexEnvf__IIF
3707 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3708 glTexEnvf(
3709 (GLenum)target,
3710 (GLenum)pname,
3711 (GLfloat)param
3712 );
3713}
3714
3715/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3716static void
3717android_glTexEnvfv__II_3FI
3718 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003719 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003720 const char * _exceptionType = NULL;
3721 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 GLfloat *params_base = (GLfloat *) 0;
3723 jint _remaining;
3724 GLfloat *params = (GLfloat *) 0;
3725
3726 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003727 _exception = 1;
3728 _exceptionType = "java/lang/IllegalArgumentException";
3729 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003730 goto exit;
3731 }
3732 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003733 _exception = 1;
3734 _exceptionType = "java/lang/IllegalArgumentException";
3735 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003736 goto exit;
3737 }
3738 _remaining = _env->GetArrayLength(params_ref) - offset;
3739 int _needed;
3740 switch (pname) {
3741#if defined(GL_TEXTURE_ENV_MODE)
3742 case GL_TEXTURE_ENV_MODE:
3743#endif // defined(GL_TEXTURE_ENV_MODE)
3744#if defined(GL_COMBINE_RGB)
3745 case GL_COMBINE_RGB:
3746#endif // defined(GL_COMBINE_RGB)
3747#if defined(GL_COMBINE_ALPHA)
3748 case GL_COMBINE_ALPHA:
3749#endif // defined(GL_COMBINE_ALPHA)
3750 _needed = 1;
3751 break;
3752#if defined(GL_TEXTURE_ENV_COLOR)
3753 case GL_TEXTURE_ENV_COLOR:
3754#endif // defined(GL_TEXTURE_ENV_COLOR)
3755 _needed = 4;
3756 break;
3757 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003758 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003759 break;
3760 }
3761 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003762 _exception = 1;
3763 _exceptionType = "java/lang/IllegalArgumentException";
3764 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003765 goto exit;
3766 }
3767 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003768 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003769 params = params_base + offset;
3770
3771 glTexEnvfv(
3772 (GLenum)target,
3773 (GLenum)pname,
3774 (GLfloat *)params
3775 );
3776
3777exit:
3778 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003779 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003780 JNI_ABORT);
3781 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003782 if (_exception) {
3783 jniThrowException(_env, _exceptionType, _exceptionMessage);
3784 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003785}
3786
3787/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3788static void
3789android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3790 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003791 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003792 const char * _exceptionType = NULL;
3793 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003794 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003795 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003796 jint _remaining;
3797 GLfloat *params = (GLfloat *) 0;
3798
Romain Guy84cac202016-12-05 12:26:02 -08003799 if (!params_buf) {
3800 _exception = 1;
3801 _exceptionType = "java/lang/IllegalArgumentException";
3802 _exceptionMessage = "params == null";
3803 goto exit;
3804 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003805 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003806 int _needed;
3807 switch (pname) {
3808#if defined(GL_TEXTURE_ENV_MODE)
3809 case GL_TEXTURE_ENV_MODE:
3810#endif // defined(GL_TEXTURE_ENV_MODE)
3811#if defined(GL_COMBINE_RGB)
3812 case GL_COMBINE_RGB:
3813#endif // defined(GL_COMBINE_RGB)
3814#if defined(GL_COMBINE_ALPHA)
3815 case GL_COMBINE_ALPHA:
3816#endif // defined(GL_COMBINE_ALPHA)
3817 _needed = 1;
3818 break;
3819#if defined(GL_TEXTURE_ENV_COLOR)
3820 case GL_TEXTURE_ENV_COLOR:
3821#endif // defined(GL_TEXTURE_ENV_COLOR)
3822 _needed = 4;
3823 break;
3824 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003825 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003826 break;
3827 }
3828 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003829 _exception = 1;
3830 _exceptionType = "java/lang/IllegalArgumentException";
3831 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003832 goto exit;
3833 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003834 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003835 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003836 params = (GLfloat *) (_paramsBase + _bufferOffset);
3837 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003838 glTexEnvfv(
3839 (GLenum)target,
3840 (GLenum)pname,
3841 (GLfloat *)params
3842 );
3843
3844exit:
3845 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003846 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003847 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003848 if (_exception) {
3849 jniThrowException(_env, _exceptionType, _exceptionMessage);
3850 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003851}
3852
3853/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3854static void
3855android_glTexEnvx__III
3856 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3857 glTexEnvx(
3858 (GLenum)target,
3859 (GLenum)pname,
3860 (GLfixed)param
3861 );
3862}
3863
3864/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3865static void
3866android_glTexEnvxv__II_3II
3867 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003868 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003869 const char * _exceptionType = NULL;
3870 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003871 GLfixed *params_base = (GLfixed *) 0;
3872 jint _remaining;
3873 GLfixed *params = (GLfixed *) 0;
3874
3875 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003876 _exception = 1;
3877 _exceptionType = "java/lang/IllegalArgumentException";
3878 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003879 goto exit;
3880 }
3881 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003882 _exception = 1;
3883 _exceptionType = "java/lang/IllegalArgumentException";
3884 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003885 goto exit;
3886 }
3887 _remaining = _env->GetArrayLength(params_ref) - offset;
3888 int _needed;
3889 switch (pname) {
3890#if defined(GL_TEXTURE_ENV_MODE)
3891 case GL_TEXTURE_ENV_MODE:
3892#endif // defined(GL_TEXTURE_ENV_MODE)
3893#if defined(GL_COMBINE_RGB)
3894 case GL_COMBINE_RGB:
3895#endif // defined(GL_COMBINE_RGB)
3896#if defined(GL_COMBINE_ALPHA)
3897 case GL_COMBINE_ALPHA:
3898#endif // defined(GL_COMBINE_ALPHA)
3899 _needed = 1;
3900 break;
3901#if defined(GL_TEXTURE_ENV_COLOR)
3902 case GL_TEXTURE_ENV_COLOR:
3903#endif // defined(GL_TEXTURE_ENV_COLOR)
3904 _needed = 4;
3905 break;
3906 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003907 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003908 break;
3909 }
3910 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003911 _exception = 1;
3912 _exceptionType = "java/lang/IllegalArgumentException";
3913 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003914 goto exit;
3915 }
3916 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003917 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003918 params = params_base + offset;
3919
3920 glTexEnvxv(
3921 (GLenum)target,
3922 (GLenum)pname,
3923 (GLfixed *)params
3924 );
3925
3926exit:
3927 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003928 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003929 JNI_ABORT);
3930 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003931 if (_exception) {
3932 jniThrowException(_env, _exceptionType, _exceptionMessage);
3933 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003934}
3935
3936/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3937static void
3938android_glTexEnvxv__IILjava_nio_IntBuffer_2
3939 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003940 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003941 const char * _exceptionType = NULL;
3942 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003943 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003944 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003945 jint _remaining;
3946 GLfixed *params = (GLfixed *) 0;
3947
Romain Guy84cac202016-12-05 12:26:02 -08003948 if (!params_buf) {
3949 _exception = 1;
3950 _exceptionType = "java/lang/IllegalArgumentException";
3951 _exceptionMessage = "params == null";
3952 goto exit;
3953 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003954 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003955 int _needed;
3956 switch (pname) {
3957#if defined(GL_TEXTURE_ENV_MODE)
3958 case GL_TEXTURE_ENV_MODE:
3959#endif // defined(GL_TEXTURE_ENV_MODE)
3960#if defined(GL_COMBINE_RGB)
3961 case GL_COMBINE_RGB:
3962#endif // defined(GL_COMBINE_RGB)
3963#if defined(GL_COMBINE_ALPHA)
3964 case GL_COMBINE_ALPHA:
3965#endif // defined(GL_COMBINE_ALPHA)
3966 _needed = 1;
3967 break;
3968#if defined(GL_TEXTURE_ENV_COLOR)
3969 case GL_TEXTURE_ENV_COLOR:
3970#endif // defined(GL_TEXTURE_ENV_COLOR)
3971 _needed = 4;
3972 break;
3973 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003974 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003975 break;
3976 }
3977 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003978 _exception = 1;
3979 _exceptionType = "java/lang/IllegalArgumentException";
3980 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003981 goto exit;
3982 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003983 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003984 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003985 params = (GLfixed *) (_paramsBase + _bufferOffset);
3986 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003987 glTexEnvxv(
3988 (GLenum)target,
3989 (GLenum)pname,
3990 (GLfixed *)params
3991 );
3992
3993exit:
3994 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003995 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003996 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003997 if (_exception) {
3998 jniThrowException(_env, _exceptionType, _exceptionMessage);
3999 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004000}
4001
4002/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
4003static void
4004android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
4005 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004006 jint _exception = 0;
4007 const char * _exceptionType = NULL;
4008 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004009 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004010 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004011 jint _remaining;
4012 GLvoid *pixels = (GLvoid *) 0;
4013
4014 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004015 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004016 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004017 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004018 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4019 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004020 }
4021 glTexImage2D(
4022 (GLenum)target,
4023 (GLint)level,
4024 (GLint)internalformat,
4025 (GLsizei)width,
4026 (GLsizei)height,
4027 (GLint)border,
4028 (GLenum)format,
4029 (GLenum)type,
4030 (GLvoid *)pixels
4031 );
4032 if (_array) {
4033 releasePointer(_env, _array, pixels, JNI_FALSE);
4034 }
Romain Guy84cac202016-12-05 12:26:02 -08004035 if (_exception) {
4036 jniThrowException(_env, _exceptionType, _exceptionMessage);
4037 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004038}
4039
4040/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
4041static void
4042android_glTexParameterf__IIF
4043 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
4044 glTexParameterf(
4045 (GLenum)target,
4046 (GLenum)pname,
4047 (GLfloat)param
4048 );
4049}
4050
4051/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
4052static void
4053android_glTexParameterx__III
4054 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
4055 glTexParameterx(
4056 (GLenum)target,
4057 (GLenum)pname,
4058 (GLfixed)param
4059 );
4060}
4061
4062/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
4063static void
4064android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
4065 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004066 jint _exception = 0;
4067 const char * _exceptionType = NULL;
4068 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004069 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004070 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004071 jint _remaining;
4072 GLvoid *pixels = (GLvoid *) 0;
4073
4074 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004075 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004076 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004077 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004078 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4079 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004080 }
4081 glTexSubImage2D(
4082 (GLenum)target,
4083 (GLint)level,
4084 (GLint)xoffset,
4085 (GLint)yoffset,
4086 (GLsizei)width,
4087 (GLsizei)height,
4088 (GLenum)format,
4089 (GLenum)type,
4090 (GLvoid *)pixels
4091 );
4092 if (_array) {
4093 releasePointer(_env, _array, pixels, JNI_FALSE);
4094 }
Romain Guy84cac202016-12-05 12:26:02 -08004095 if (_exception) {
4096 jniThrowException(_env, _exceptionType, _exceptionMessage);
4097 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004098}
4099
4100/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
4101static void
4102android_glTranslatef__FFF
4103 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
4104 glTranslatef(
4105 (GLfloat)x,
4106 (GLfloat)y,
4107 (GLfloat)z
4108 );
4109}
4110
4111/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
4112static void
4113android_glTranslatex__III
4114 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
4115 glTranslatex(
4116 (GLfixed)x,
4117 (GLfixed)y,
4118 (GLfixed)z
4119 );
4120}
4121
4122/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
4123static void
4124android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
4125 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08004126 jint _exception = 0;
4127 const char * _exceptionType = NULL;
4128 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004129 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004130 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004131 jint _remaining;
4132 GLvoid *pointer = (GLvoid *) 0;
4133
Jack Paleviche20ea782009-05-07 18:28:29 -07004134 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07004135 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07004136 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07004137 return;
4138 }
4139 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004140 glVertexPointerBounds(
4141 (GLint)size,
4142 (GLenum)type,
4143 (GLsizei)stride,
4144 (GLvoid *)pointer,
4145 (GLsizei)remaining
4146 );
Romain Guy84cac202016-12-05 12:26:02 -08004147 if (_exception) {
4148 jniThrowException(_env, _exceptionType, _exceptionMessage);
4149 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004150}
4151
4152/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
4153static void
4154android_glViewport__IIII
4155 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
4156 glViewport(
4157 (GLint)x,
4158 (GLint)y,
4159 (GLsizei)width,
4160 (GLsizei)height
4161 );
4162}
4163
4164/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4165static jint
4166android_glQueryMatrixxOES___3II_3II
4167 (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
4168 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004169 const char * _exceptionType = NULL;
4170 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004171 GLbitfield _returnValue = -1;
4172 GLfixed *mantissa_base = (GLfixed *) 0;
4173 jint _mantissaRemaining;
4174 GLfixed *mantissa = (GLfixed *) 0;
4175 GLint *exponent_base = (GLint *) 0;
4176 jint _exponentRemaining;
4177 GLint *exponent = (GLint *) 0;
4178
4179 if (!mantissa_ref) {
4180 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004181 _exceptionType = "java/lang/IllegalArgumentException";
4182 _exceptionMessage = "mantissa == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004183 goto exit;
4184 }
4185 if (mantissaOffset < 0) {
4186 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004187 _exceptionType = "java/lang/IllegalArgumentException";
4188 _exceptionMessage = "mantissaOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004189 goto exit;
4190 }
4191 _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
4192 if (_mantissaRemaining < 16) {
4193 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004194 _exceptionType = "java/lang/IllegalArgumentException";
4195 _exceptionMessage = "length - mantissaOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004196 goto exit;
4197 }
4198 mantissa_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004199 _env->GetIntArrayElements(mantissa_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004200 mantissa = mantissa_base + mantissaOffset;
4201
4202 if (!exponent_ref) {
4203 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004204 _exceptionType = "java/lang/IllegalArgumentException";
4205 _exceptionMessage = "exponent == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004206 goto exit;
4207 }
4208 if (exponentOffset < 0) {
4209 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004210 _exceptionType = "java/lang/IllegalArgumentException";
4211 _exceptionMessage = "exponentOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004212 goto exit;
4213 }
4214 _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
4215 if (_exponentRemaining < 16) {
4216 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004217 _exceptionType = "java/lang/IllegalArgumentException";
4218 _exceptionMessage = "length - exponentOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004219 goto exit;
4220 }
4221 exponent_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004222 _env->GetIntArrayElements(exponent_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004223 exponent = exponent_base + exponentOffset;
4224
4225 _returnValue = glQueryMatrixxOES(
4226 (GLfixed *)mantissa,
4227 (GLint *)exponent
4228 );
4229
4230exit:
4231 if (exponent_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004232 _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004233 _exception ? JNI_ABORT: 0);
4234 }
4235 if (mantissa_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004236 _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004237 _exception ? JNI_ABORT: 0);
4238 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004239 if (_exception) {
4240 jniThrowException(_env, _exceptionType, _exceptionMessage);
4241 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004242 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004243}
4244
4245/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4246static jint
4247android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4248 (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4249 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004250 const char * _exceptionType = NULL;
4251 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004252 jintArray _mantissaArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004253 jint _mantissaBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004254 jintArray _exponentArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004255 jint _exponentBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004256 GLbitfield _returnValue = -1;
4257 jint _mantissaRemaining;
4258 GLfixed *mantissa = (GLfixed *) 0;
4259 jint _exponentRemaining;
4260 GLint *exponent = (GLint *) 0;
4261
Romain Guy84cac202016-12-05 12:26:02 -08004262 if (!mantissa_buf) {
4263 _exception = 1;
4264 _exceptionType = "java/lang/IllegalArgumentException";
4265 _exceptionMessage = "mantissa == null";
4266 goto exit;
4267 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004268 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004269 if (_mantissaRemaining < 16) {
4270 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004271 _exceptionType = "java/lang/IllegalArgumentException";
4272 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004273 goto exit;
4274 }
Romain Guy84cac202016-12-05 12:26:02 -08004275 if (!exponent_buf) {
4276 _exception = 1;
4277 _exceptionType = "java/lang/IllegalArgumentException";
4278 _exceptionMessage = "exponent == null";
4279 goto exit;
4280 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004281 exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004282 if (_exponentRemaining < 16) {
4283 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004284 _exceptionType = "java/lang/IllegalArgumentException";
4285 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004286 goto exit;
4287 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004288 if (mantissa == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004289 char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004290 mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4291 }
4292 if (exponent == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004293 char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004294 exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4295 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004296 _returnValue = glQueryMatrixxOES(
4297 (GLfixed *)mantissa,
4298 (GLint *)exponent
4299 );
4300
4301exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004302 if (_exponentArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004303 _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004304 }
4305 if (_mantissaArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004306 _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004307 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004308 if (_exception) {
4309 jniThrowException(_env, _exceptionType, _exceptionMessage);
4310 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004311 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004312}
4313
4314/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4315static void
4316android_glBindBuffer__II
4317 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4318 glBindBuffer(
4319 (GLenum)target,
4320 (GLuint)buffer
4321 );
4322}
4323
4324/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4325static void
4326android_glBufferData__IILjava_nio_Buffer_2I
4327 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004328 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004329 const char * _exceptionType = NULL;
4330 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004331 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004332 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004333 jint _remaining;
4334 GLvoid *data = (GLvoid *) 0;
4335
4336 if (data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004337 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004338 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004339 _exception = 1;
4340 _exceptionType = "java/lang/IllegalArgumentException";
4341 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004342 goto exit;
4343 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004344 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004345 if (data_buf && data == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004346 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4347 data = (GLvoid *) (_dataBase + _bufferOffset);
4348 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004349 glBufferData(
4350 (GLenum)target,
4351 (GLsizeiptr)size,
4352 (GLvoid *)data,
4353 (GLenum)usage
4354 );
Jack Palevichc620a522009-10-21 11:02:44 -07004355
4356exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004357 if (_array) {
4358 releasePointer(_env, _array, data, JNI_FALSE);
4359 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004360 if (_exception) {
4361 jniThrowException(_env, _exceptionType, _exceptionMessage);
4362 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004363}
4364
4365/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4366static void
4367android_glBufferSubData__IIILjava_nio_Buffer_2
4368 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004369 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004370 const char * _exceptionType = NULL;
4371 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004372 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004373 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004374 jint _remaining;
4375 GLvoid *data = (GLvoid *) 0;
4376
Romain Guy84cac202016-12-05 12:26:02 -08004377 if (!data_buf) {
4378 _exception = 1;
4379 _exceptionType = "java/lang/IllegalArgumentException";
4380 _exceptionMessage = "data == null";
4381 goto exit;
4382 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004383 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004384 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004385 _exception = 1;
4386 _exceptionType = "java/lang/IllegalArgumentException";
4387 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004388 goto exit;
4389 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004390 if (data == NULL) {
4391 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4392 data = (GLvoid *) (_dataBase + _bufferOffset);
4393 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004394 glBufferSubData(
4395 (GLenum)target,
4396 (GLintptr)offset,
4397 (GLsizeiptr)size,
4398 (GLvoid *)data
4399 );
Jack Palevichc620a522009-10-21 11:02:44 -07004400
4401exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004402 if (_array) {
4403 releasePointer(_env, _array, data, JNI_FALSE);
4404 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004405 if (_exception) {
4406 jniThrowException(_env, _exceptionType, _exceptionMessage);
4407 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004408}
4409
4410/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4411static void
4412android_glClipPlanef__I_3FI
4413 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004414 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004415 const char * _exceptionType = NULL;
4416 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004417 GLfloat *equation_base = (GLfloat *) 0;
4418 jint _remaining;
4419 GLfloat *equation = (GLfloat *) 0;
4420
4421 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004422 _exception = 1;
4423 _exceptionType = "java/lang/IllegalArgumentException";
4424 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004425 goto exit;
4426 }
4427 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004428 _exception = 1;
4429 _exceptionType = "java/lang/IllegalArgumentException";
4430 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004431 goto exit;
4432 }
4433 _remaining = _env->GetArrayLength(equation_ref) - offset;
4434 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004435 _exception = 1;
4436 _exceptionType = "java/lang/IllegalArgumentException";
4437 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004438 goto exit;
4439 }
4440 equation_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004441 _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004442 equation = equation_base + offset;
4443
4444 glClipPlanef(
4445 (GLenum)plane,
4446 (GLfloat *)equation
4447 );
4448
4449exit:
4450 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004451 _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004452 JNI_ABORT);
4453 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004454 if (_exception) {
4455 jniThrowException(_env, _exceptionType, _exceptionMessage);
4456 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004457}
4458
4459/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4460static void
4461android_glClipPlanef__ILjava_nio_FloatBuffer_2
4462 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004463 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004464 const char * _exceptionType = NULL;
4465 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004466 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004467 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004468 jint _remaining;
4469 GLfloat *equation = (GLfloat *) 0;
4470
Romain Guy84cac202016-12-05 12:26:02 -08004471 if (!equation_buf) {
4472 _exception = 1;
4473 _exceptionType = "java/lang/IllegalArgumentException";
4474 _exceptionMessage = "equation == null";
4475 goto exit;
4476 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004477 equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004478 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004479 _exception = 1;
4480 _exceptionType = "java/lang/IllegalArgumentException";
4481 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004482 goto exit;
4483 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004484 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004485 char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004486 equation = (GLfloat *) (_equationBase + _bufferOffset);
4487 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004488 glClipPlanef(
4489 (GLenum)plane,
4490 (GLfloat *)equation
4491 );
4492
4493exit:
4494 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004495 _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004496 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004497 if (_exception) {
4498 jniThrowException(_env, _exceptionType, _exceptionMessage);
4499 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004500}
4501
4502/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4503static void
4504android_glClipPlanex__I_3II
4505 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004506 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004507 const char * _exceptionType = NULL;
4508 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004509 GLfixed *equation_base = (GLfixed *) 0;
4510 jint _remaining;
4511 GLfixed *equation = (GLfixed *) 0;
4512
4513 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004514 _exception = 1;
4515 _exceptionType = "java/lang/IllegalArgumentException";
4516 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004517 goto exit;
4518 }
4519 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004520 _exception = 1;
4521 _exceptionType = "java/lang/IllegalArgumentException";
4522 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004523 goto exit;
4524 }
4525 _remaining = _env->GetArrayLength(equation_ref) - offset;
4526 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004527 _exception = 1;
4528 _exceptionType = "java/lang/IllegalArgumentException";
4529 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004530 goto exit;
4531 }
4532 equation_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004533 _env->GetIntArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004534 equation = equation_base + offset;
4535
4536 glClipPlanex(
4537 (GLenum)plane,
4538 (GLfixed *)equation
4539 );
4540
4541exit:
4542 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004543 _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004544 JNI_ABORT);
4545 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004546 if (_exception) {
4547 jniThrowException(_env, _exceptionType, _exceptionMessage);
4548 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004549}
4550
4551/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4552static void
4553android_glClipPlanex__ILjava_nio_IntBuffer_2
4554 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004555 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004556 const char * _exceptionType = NULL;
4557 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004558 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004559 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004560 jint _remaining;
4561 GLfixed *equation = (GLfixed *) 0;
4562
Romain Guy84cac202016-12-05 12:26:02 -08004563 if (!equation_buf) {
4564 _exception = 1;
4565 _exceptionType = "java/lang/IllegalArgumentException";
4566 _exceptionMessage = "equation == null";
4567 goto exit;
4568 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004569 equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004570 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004571 _exception = 1;
4572 _exceptionType = "java/lang/IllegalArgumentException";
4573 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004574 goto exit;
4575 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004576 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004577 char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004578 equation = (GLfixed *) (_equationBase + _bufferOffset);
4579 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004580 glClipPlanex(
4581 (GLenum)plane,
4582 (GLfixed *)equation
4583 );
4584
4585exit:
4586 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004587 _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004588 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004589 if (_exception) {
4590 jniThrowException(_env, _exceptionType, _exceptionMessage);
4591 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004592}
4593
4594/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4595static void
4596android_glColor4ub__BBBB
4597 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4598 glColor4ub(
4599 (GLubyte)red,
4600 (GLubyte)green,
4601 (GLubyte)blue,
4602 (GLubyte)alpha
4603 );
4604}
4605
4606/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4607static void
4608android_glColorPointer__IIII
4609 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4610 glColorPointer(
4611 (GLint)size,
4612 (GLenum)type,
4613 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004614 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004615 );
4616}
4617
4618/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4619static void
4620android_glDeleteBuffers__I_3II
4621 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004622 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004623 const char * _exceptionType = NULL;
4624 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004625 GLuint *buffers_base = (GLuint *) 0;
4626 jint _remaining;
4627 GLuint *buffers = (GLuint *) 0;
4628
4629 if (!buffers_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004630 _exception = 1;
4631 _exceptionType = "java/lang/IllegalArgumentException";
4632 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004633 goto exit;
4634 }
4635 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004636 _exception = 1;
4637 _exceptionType = "java/lang/IllegalArgumentException";
4638 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004639 goto exit;
4640 }
4641 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4642 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004643 _exception = 1;
4644 _exceptionType = "java/lang/IllegalArgumentException";
4645 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004646 goto exit;
4647 }
4648 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004649 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004650 buffers = buffers_base + offset;
4651
4652 glDeleteBuffers(
4653 (GLsizei)n,
4654 (GLuint *)buffers
4655 );
4656
4657exit:
4658 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004659 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004660 JNI_ABORT);
4661 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004662 if (_exception) {
4663 jniThrowException(_env, _exceptionType, _exceptionMessage);
4664 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004665}
4666
4667/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4668static void
4669android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4670 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004671 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004672 const char * _exceptionType = NULL;
4673 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004674 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004675 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004676 jint _remaining;
4677 GLuint *buffers = (GLuint *) 0;
4678
Romain Guy84cac202016-12-05 12:26:02 -08004679 if (!buffers_buf) {
4680 _exception = 1;
4681 _exceptionType = "java/lang/IllegalArgumentException";
4682 _exceptionMessage = "buffers == null";
4683 goto exit;
4684 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004685 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004686 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004687 _exception = 1;
4688 _exceptionType = "java/lang/IllegalArgumentException";
4689 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004690 goto exit;
4691 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004692 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004693 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004694 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4695 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004696 glDeleteBuffers(
4697 (GLsizei)n,
4698 (GLuint *)buffers
4699 );
4700
4701exit:
4702 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004703 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004704 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004705 if (_exception) {
4706 jniThrowException(_env, _exceptionType, _exceptionMessage);
4707 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004708}
4709
4710/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4711static void
4712android_glDrawElements__IIII
4713 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004714 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004715 const char * _exceptionType = NULL;
4716 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004717 glDrawElements(
4718 (GLenum)mode,
4719 (GLsizei)count,
4720 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004721 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004722 );
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004723 if (_exception) {
4724 jniThrowException(_env, _exceptionType, _exceptionMessage);
4725 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004726}
4727
4728/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4729static void
4730android_glGenBuffers__I_3II
4731 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4732 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004733 const char * _exceptionType = NULL;
4734 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004735 GLuint *buffers_base = (GLuint *) 0;
4736 jint _remaining;
4737 GLuint *buffers = (GLuint *) 0;
4738
4739 if (!buffers_ref) {
4740 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004741 _exceptionType = "java/lang/IllegalArgumentException";
4742 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004743 goto exit;
4744 }
4745 if (offset < 0) {
4746 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004747 _exceptionType = "java/lang/IllegalArgumentException";
4748 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004749 goto exit;
4750 }
4751 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4752 if (_remaining < n) {
4753 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004754 _exceptionType = "java/lang/IllegalArgumentException";
4755 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004756 goto exit;
4757 }
4758 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004759 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004760 buffers = buffers_base + offset;
4761
4762 glGenBuffers(
4763 (GLsizei)n,
4764 (GLuint *)buffers
4765 );
4766
4767exit:
4768 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004769 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004770 _exception ? JNI_ABORT: 0);
4771 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004772 if (_exception) {
4773 jniThrowException(_env, _exceptionType, _exceptionMessage);
4774 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004775}
4776
4777/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4778static void
4779android_glGenBuffers__ILjava_nio_IntBuffer_2
4780 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4781 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004782 const char * _exceptionType = NULL;
4783 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004784 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004785 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004786 jint _remaining;
4787 GLuint *buffers = (GLuint *) 0;
4788
Romain Guy84cac202016-12-05 12:26:02 -08004789 if (!buffers_buf) {
4790 _exception = 1;
4791 _exceptionType = "java/lang/IllegalArgumentException";
4792 _exceptionMessage = "buffers == null";
4793 goto exit;
4794 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004795 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004796 if (_remaining < n) {
4797 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004798 _exceptionType = "java/lang/IllegalArgumentException";
4799 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 goto exit;
4801 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004802 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004803 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004804 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4805 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004806 glGenBuffers(
4807 (GLsizei)n,
4808 (GLuint *)buffers
4809 );
4810
4811exit:
4812 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004813 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004814 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004815 if (_exception) {
4816 jniThrowException(_env, _exceptionType, _exceptionMessage);
4817 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004818}
4819
4820/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4821static void
4822android_glGetBooleanv__I_3ZI
4823 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4824 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004825 const char * _exceptionType = NULL;
4826 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004827 GLboolean *params_base = (GLboolean *) 0;
4828 jint _remaining;
4829 GLboolean *params = (GLboolean *) 0;
4830
4831 if (!params_ref) {
4832 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004833 _exceptionType = "java/lang/IllegalArgumentException";
4834 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004835 goto exit;
4836 }
4837 if (offset < 0) {
4838 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004839 _exceptionType = "java/lang/IllegalArgumentException";
4840 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004841 goto exit;
4842 }
4843 _remaining = _env->GetArrayLength(params_ref) - offset;
4844 params_base = (GLboolean *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004845 _env->GetBooleanArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004846 params = params_base + offset;
4847
4848 glGetBooleanv(
4849 (GLenum)pname,
4850 (GLboolean *)params
4851 );
4852
4853exit:
4854 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004855 _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004856 _exception ? JNI_ABORT: 0);
4857 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004858 if (_exception) {
4859 jniThrowException(_env, _exceptionType, _exceptionMessage);
4860 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004861}
4862
4863/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4864static void
4865android_glGetBooleanv__ILjava_nio_IntBuffer_2
4866 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004867 jint _exception = 0;
4868 const char * _exceptionType = NULL;
4869 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004870 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004871 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004872 jint _remaining;
4873 GLboolean *params = (GLboolean *) 0;
4874
Romain Guy84cac202016-12-05 12:26:02 -08004875 if (!params_buf) {
4876 _exception = 1;
4877 _exceptionType = "java/lang/IllegalArgumentException";
4878 _exceptionMessage = "params == null";
4879 goto exit;
4880 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004881 params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004882 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004883 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004884 params = (GLboolean *) (_paramsBase + _bufferOffset);
4885 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004886 glGetBooleanv(
4887 (GLenum)pname,
4888 (GLboolean *)params
4889 );
Romain Guy84cac202016-12-05 12:26:02 -08004890
4891exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004892 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004893 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4894 }
4895 if (_exception) {
4896 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004897 }
4898}
4899
4900/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4901static void
4902android_glGetBufferParameteriv__II_3II
4903 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004904 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004905 "glGetBufferParameteriv");
4906}
4907
4908/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4909static void
4910android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4911 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004912 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004913 "glGetBufferParameteriv");
4914}
4915
4916/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4917static void
4918android_glGetClipPlanef__I_3FI
4919 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4920 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004921 const char * _exceptionType = NULL;
4922 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004923 GLfloat *eqn_base = (GLfloat *) 0;
4924 jint _remaining;
4925 GLfloat *eqn = (GLfloat *) 0;
4926
4927 if (!eqn_ref) {
4928 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004929 _exceptionType = "java/lang/IllegalArgumentException";
4930 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004931 goto exit;
4932 }
4933 if (offset < 0) {
4934 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004935 _exceptionType = "java/lang/IllegalArgumentException";
4936 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004937 goto exit;
4938 }
4939 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4940 eqn_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004941 _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004942 eqn = eqn_base + offset;
4943
4944 glGetClipPlanef(
4945 (GLenum)pname,
4946 (GLfloat *)eqn
4947 );
4948
4949exit:
4950 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004951 _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004952 _exception ? JNI_ABORT: 0);
4953 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004954 if (_exception) {
4955 jniThrowException(_env, _exceptionType, _exceptionMessage);
4956 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004957}
4958
4959/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4960static void
4961android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4962 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004963 jint _exception = 0;
4964 const char * _exceptionType = NULL;
4965 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004966 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004967 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004968 jint _remaining;
4969 GLfloat *eqn = (GLfloat *) 0;
4970
Romain Guy84cac202016-12-05 12:26:02 -08004971 if (!eqn_buf) {
4972 _exception = 1;
4973 _exceptionType = "java/lang/IllegalArgumentException";
4974 _exceptionMessage = "eqn == null";
4975 goto exit;
4976 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004977 eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004978 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004979 char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004980 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4981 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004982 glGetClipPlanef(
4983 (GLenum)pname,
4984 (GLfloat *)eqn
4985 );
Romain Guy84cac202016-12-05 12:26:02 -08004986
4987exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004988 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004989 _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0);
4990 }
4991 if (_exception) {
4992 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004993 }
4994}
4995
4996/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4997static void
4998android_glGetClipPlanex__I_3II
4999 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
5000 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005001 const char * _exceptionType = NULL;
5002 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005003 GLfixed *eqn_base = (GLfixed *) 0;
5004 jint _remaining;
5005 GLfixed *eqn = (GLfixed *) 0;
5006
5007 if (!eqn_ref) {
5008 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005009 _exceptionType = "java/lang/IllegalArgumentException";
5010 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005011 goto exit;
5012 }
5013 if (offset < 0) {
5014 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005015 _exceptionType = "java/lang/IllegalArgumentException";
5016 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005017 goto exit;
5018 }
5019 _remaining = _env->GetArrayLength(eqn_ref) - offset;
5020 eqn_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005021 _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005022 eqn = eqn_base + offset;
5023
5024 glGetClipPlanex(
5025 (GLenum)pname,
5026 (GLfixed *)eqn
5027 );
5028
5029exit:
5030 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005031 _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005032 _exception ? JNI_ABORT: 0);
5033 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005034 if (_exception) {
5035 jniThrowException(_env, _exceptionType, _exceptionMessage);
5036 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005037}
5038
5039/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
5040static void
5041android_glGetClipPlanex__ILjava_nio_IntBuffer_2
5042 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005043 jint _exception = 0;
5044 const char * _exceptionType = NULL;
5045 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005046 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005047 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005048 jint _remaining;
5049 GLfixed *eqn = (GLfixed *) 0;
5050
Romain Guy84cac202016-12-05 12:26:02 -08005051 if (!eqn_buf) {
5052 _exception = 1;
5053 _exceptionType = "java/lang/IllegalArgumentException";
5054 _exceptionMessage = "eqn == null";
5055 goto exit;
5056 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005057 eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005058 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005059 char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005060 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
5061 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005062 glGetClipPlanex(
5063 (GLenum)pname,
5064 (GLfixed *)eqn
5065 );
Romain Guy84cac202016-12-05 12:26:02 -08005066
5067exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005068 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005069 _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0);
5070 }
5071 if (_exception) {
5072 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005073 }
5074}
5075
5076/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5077static void
5078android_glGetFixedv__I_3II
5079 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
5080 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005081 const char * _exceptionType = NULL;
5082 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005083 GLfixed *params_base = (GLfixed *) 0;
5084 jint _remaining;
5085 GLfixed *params = (GLfixed *) 0;
5086
5087 if (!params_ref) {
5088 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005089 _exceptionType = "java/lang/IllegalArgumentException";
5090 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005091 goto exit;
5092 }
5093 if (offset < 0) {
5094 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005095 _exceptionType = "java/lang/IllegalArgumentException";
5096 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005097 goto exit;
5098 }
5099 _remaining = _env->GetArrayLength(params_ref) - offset;
5100 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005101 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005102 params = params_base + offset;
5103
5104 glGetFixedv(
5105 (GLenum)pname,
5106 (GLfixed *)params
5107 );
5108
5109exit:
5110 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005111 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005112 _exception ? JNI_ABORT: 0);
5113 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005114 if (_exception) {
5115 jniThrowException(_env, _exceptionType, _exceptionMessage);
5116 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005117}
5118
5119/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5120static void
5121android_glGetFixedv__ILjava_nio_IntBuffer_2
5122 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005123 jint _exception = 0;
5124 const char * _exceptionType = NULL;
5125 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005126 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005127 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005128 jint _remaining;
5129 GLfixed *params = (GLfixed *) 0;
5130
Romain Guy84cac202016-12-05 12:26:02 -08005131 if (!params_buf) {
5132 _exception = 1;
5133 _exceptionType = "java/lang/IllegalArgumentException";
5134 _exceptionMessage = "params == null";
5135 goto exit;
5136 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005137 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005138 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005139 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005140 params = (GLfixed *) (_paramsBase + _bufferOffset);
5141 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005142 glGetFixedv(
5143 (GLenum)pname,
5144 (GLfixed *)params
5145 );
Romain Guy84cac202016-12-05 12:26:02 -08005146
5147exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005148 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005149 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5150 }
5151 if (_exception) {
5152 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005153 }
5154}
5155
5156/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5157static void
5158android_glGetFloatv__I_3FI
5159 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
5160 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005161 const char * _exceptionType = NULL;
5162 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005163 GLfloat *params_base = (GLfloat *) 0;
5164 jint _remaining;
5165 GLfloat *params = (GLfloat *) 0;
5166
5167 if (!params_ref) {
5168 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005169 _exceptionType = "java/lang/IllegalArgumentException";
5170 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005171 goto exit;
5172 }
5173 if (offset < 0) {
5174 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005175 _exceptionType = "java/lang/IllegalArgumentException";
5176 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005177 goto exit;
5178 }
5179 _remaining = _env->GetArrayLength(params_ref) - offset;
5180 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005181 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005182 params = params_base + offset;
5183
5184 glGetFloatv(
5185 (GLenum)pname,
5186 (GLfloat *)params
5187 );
5188
5189exit:
5190 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005191 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005192 _exception ? JNI_ABORT: 0);
5193 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005194 if (_exception) {
5195 jniThrowException(_env, _exceptionType, _exceptionMessage);
5196 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005197}
5198
5199/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5200static void
5201android_glGetFloatv__ILjava_nio_FloatBuffer_2
5202 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005203 jint _exception = 0;
5204 const char * _exceptionType = NULL;
5205 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005206 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005207 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005208 jint _remaining;
5209 GLfloat *params = (GLfloat *) 0;
5210
Romain Guy84cac202016-12-05 12:26:02 -08005211 if (!params_buf) {
5212 _exception = 1;
5213 _exceptionType = "java/lang/IllegalArgumentException";
5214 _exceptionMessage = "params == null";
5215 goto exit;
5216 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005217 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005218 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005219 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005220 params = (GLfloat *) (_paramsBase + _bufferOffset);
5221 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005222 glGetFloatv(
5223 (GLenum)pname,
5224 (GLfloat *)params
5225 );
Romain Guy84cac202016-12-05 12:26:02 -08005226
5227exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005228 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005229 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5230 }
5231 if (_exception) {
5232 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005233 }
5234}
5235
5236/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5237static void
5238android_glGetLightfv__II_3FI
5239 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
5240 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005241 const char * _exceptionType = NULL;
5242 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005243 GLfloat *params_base = (GLfloat *) 0;
5244 jint _remaining;
5245 GLfloat *params = (GLfloat *) 0;
5246
5247 if (!params_ref) {
5248 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005249 _exceptionType = "java/lang/IllegalArgumentException";
5250 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005251 goto exit;
5252 }
5253 if (offset < 0) {
5254 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005255 _exceptionType = "java/lang/IllegalArgumentException";
5256 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005257 goto exit;
5258 }
5259 _remaining = _env->GetArrayLength(params_ref) - offset;
5260 int _needed;
5261 switch (pname) {
5262#if defined(GL_SPOT_EXPONENT)
5263 case GL_SPOT_EXPONENT:
5264#endif // defined(GL_SPOT_EXPONENT)
5265#if defined(GL_SPOT_CUTOFF)
5266 case GL_SPOT_CUTOFF:
5267#endif // defined(GL_SPOT_CUTOFF)
5268#if defined(GL_CONSTANT_ATTENUATION)
5269 case GL_CONSTANT_ATTENUATION:
5270#endif // defined(GL_CONSTANT_ATTENUATION)
5271#if defined(GL_LINEAR_ATTENUATION)
5272 case GL_LINEAR_ATTENUATION:
5273#endif // defined(GL_LINEAR_ATTENUATION)
5274#if defined(GL_QUADRATIC_ATTENUATION)
5275 case GL_QUADRATIC_ATTENUATION:
5276#endif // defined(GL_QUADRATIC_ATTENUATION)
5277 _needed = 1;
5278 break;
5279#if defined(GL_SPOT_DIRECTION)
5280 case GL_SPOT_DIRECTION:
5281#endif // defined(GL_SPOT_DIRECTION)
5282 _needed = 3;
5283 break;
5284#if defined(GL_AMBIENT)
5285 case GL_AMBIENT:
5286#endif // defined(GL_AMBIENT)
5287#if defined(GL_DIFFUSE)
5288 case GL_DIFFUSE:
5289#endif // defined(GL_DIFFUSE)
5290#if defined(GL_SPECULAR)
5291 case GL_SPECULAR:
5292#endif // defined(GL_SPECULAR)
5293#if defined(GL_EMISSION)
5294 case GL_EMISSION:
5295#endif // defined(GL_EMISSION)
5296 _needed = 4;
5297 break;
5298 default:
Mathias 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 glGetLightfv(
5313 (GLenum)light,
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 glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5329static void
5330android_glGetLightfv__IILjava_nio_FloatBuffer_2
5331 (JNIEnv *_env, jobject _this, jint light, 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
Romain Guy84cac202016-12-05 12:26:02 -08005340 if (!params_buf) {
5341 _exception = 1;
5342 _exceptionType = "java/lang/IllegalArgumentException";
5343 _exceptionMessage = "params == null";
5344 goto exit;
5345 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005346 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005347 int _needed;
5348 switch (pname) {
5349#if defined(GL_SPOT_EXPONENT)
5350 case GL_SPOT_EXPONENT:
5351#endif // defined(GL_SPOT_EXPONENT)
5352#if defined(GL_SPOT_CUTOFF)
5353 case GL_SPOT_CUTOFF:
5354#endif // defined(GL_SPOT_CUTOFF)
5355#if defined(GL_CONSTANT_ATTENUATION)
5356 case GL_CONSTANT_ATTENUATION:
5357#endif // defined(GL_CONSTANT_ATTENUATION)
5358#if defined(GL_LINEAR_ATTENUATION)
5359 case GL_LINEAR_ATTENUATION:
5360#endif // defined(GL_LINEAR_ATTENUATION)
5361#if defined(GL_QUADRATIC_ATTENUATION)
5362 case GL_QUADRATIC_ATTENUATION:
5363#endif // defined(GL_QUADRATIC_ATTENUATION)
5364 _needed = 1;
5365 break;
5366#if defined(GL_SPOT_DIRECTION)
5367 case GL_SPOT_DIRECTION:
5368#endif // defined(GL_SPOT_DIRECTION)
5369 _needed = 3;
5370 break;
5371#if defined(GL_AMBIENT)
5372 case GL_AMBIENT:
5373#endif // defined(GL_AMBIENT)
5374#if defined(GL_DIFFUSE)
5375 case GL_DIFFUSE:
5376#endif // defined(GL_DIFFUSE)
5377#if defined(GL_SPECULAR)
5378 case GL_SPECULAR:
5379#endif // defined(GL_SPECULAR)
5380#if defined(GL_EMISSION)
5381 case GL_EMISSION:
5382#endif // defined(GL_EMISSION)
5383 _needed = 4;
5384 break;
5385 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005386 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005387 break;
5388 }
5389 if (_remaining < _needed) {
5390 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005391 _exceptionType = "java/lang/IllegalArgumentException";
5392 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005393 goto exit;
5394 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005395 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005396 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005397 params = (GLfloat *) (_paramsBase + _bufferOffset);
5398 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005399 glGetLightfv(
5400 (GLenum)light,
5401 (GLenum)pname,
5402 (GLfloat *)params
5403 );
5404
5405exit:
5406 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005407 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005408 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005409 if (_exception) {
5410 jniThrowException(_env, _exceptionType, _exceptionMessage);
5411 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005412}
5413
5414/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5415static void
5416android_glGetLightxv__II_3II
5417 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5418 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005419 const char * _exceptionType = NULL;
5420 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005421 GLfixed *params_base = (GLfixed *) 0;
5422 jint _remaining;
5423 GLfixed *params = (GLfixed *) 0;
5424
5425 if (!params_ref) {
5426 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005427 _exceptionType = "java/lang/IllegalArgumentException";
5428 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005429 goto exit;
5430 }
5431 if (offset < 0) {
5432 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005433 _exceptionType = "java/lang/IllegalArgumentException";
5434 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005435 goto exit;
5436 }
5437 _remaining = _env->GetArrayLength(params_ref) - offset;
5438 int _needed;
5439 switch (pname) {
5440#if defined(GL_SPOT_EXPONENT)
5441 case GL_SPOT_EXPONENT:
5442#endif // defined(GL_SPOT_EXPONENT)
5443#if defined(GL_SPOT_CUTOFF)
5444 case GL_SPOT_CUTOFF:
5445#endif // defined(GL_SPOT_CUTOFF)
5446#if defined(GL_CONSTANT_ATTENUATION)
5447 case GL_CONSTANT_ATTENUATION:
5448#endif // defined(GL_CONSTANT_ATTENUATION)
5449#if defined(GL_LINEAR_ATTENUATION)
5450 case GL_LINEAR_ATTENUATION:
5451#endif // defined(GL_LINEAR_ATTENUATION)
5452#if defined(GL_QUADRATIC_ATTENUATION)
5453 case GL_QUADRATIC_ATTENUATION:
5454#endif // defined(GL_QUADRATIC_ATTENUATION)
5455 _needed = 1;
5456 break;
5457#if defined(GL_SPOT_DIRECTION)
5458 case GL_SPOT_DIRECTION:
5459#endif // defined(GL_SPOT_DIRECTION)
5460 _needed = 3;
5461 break;
5462#if defined(GL_AMBIENT)
5463 case GL_AMBIENT:
5464#endif // defined(GL_AMBIENT)
5465#if defined(GL_DIFFUSE)
5466 case GL_DIFFUSE:
5467#endif // defined(GL_DIFFUSE)
5468#if defined(GL_SPECULAR)
5469 case GL_SPECULAR:
5470#endif // defined(GL_SPECULAR)
5471#if defined(GL_EMISSION)
5472 case GL_EMISSION:
5473#endif // defined(GL_EMISSION)
5474 _needed = 4;
5475 break;
5476 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005477 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005478 break;
5479 }
5480 if (_remaining < _needed) {
5481 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005482 _exceptionType = "java/lang/IllegalArgumentException";
5483 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005484 goto exit;
5485 }
5486 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005487 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005488 params = params_base + offset;
5489
5490 glGetLightxv(
5491 (GLenum)light,
5492 (GLenum)pname,
5493 (GLfixed *)params
5494 );
5495
5496exit:
5497 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005498 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005499 _exception ? JNI_ABORT: 0);
5500 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005501 if (_exception) {
5502 jniThrowException(_env, _exceptionType, _exceptionMessage);
5503 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005504}
5505
5506/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5507static void
5508android_glGetLightxv__IILjava_nio_IntBuffer_2
5509 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5510 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005511 const char * _exceptionType = NULL;
5512 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005513 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005514 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005515 jint _remaining;
5516 GLfixed *params = (GLfixed *) 0;
5517
Romain Guy84cac202016-12-05 12:26:02 -08005518 if (!params_buf) {
5519 _exception = 1;
5520 _exceptionType = "java/lang/IllegalArgumentException";
5521 _exceptionMessage = "params == null";
5522 goto exit;
5523 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005524 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005525 int _needed;
5526 switch (pname) {
5527#if defined(GL_SPOT_EXPONENT)
5528 case GL_SPOT_EXPONENT:
5529#endif // defined(GL_SPOT_EXPONENT)
5530#if defined(GL_SPOT_CUTOFF)
5531 case GL_SPOT_CUTOFF:
5532#endif // defined(GL_SPOT_CUTOFF)
5533#if defined(GL_CONSTANT_ATTENUATION)
5534 case GL_CONSTANT_ATTENUATION:
5535#endif // defined(GL_CONSTANT_ATTENUATION)
5536#if defined(GL_LINEAR_ATTENUATION)
5537 case GL_LINEAR_ATTENUATION:
5538#endif // defined(GL_LINEAR_ATTENUATION)
5539#if defined(GL_QUADRATIC_ATTENUATION)
5540 case GL_QUADRATIC_ATTENUATION:
5541#endif // defined(GL_QUADRATIC_ATTENUATION)
5542 _needed = 1;
5543 break;
5544#if defined(GL_SPOT_DIRECTION)
5545 case GL_SPOT_DIRECTION:
5546#endif // defined(GL_SPOT_DIRECTION)
5547 _needed = 3;
5548 break;
5549#if defined(GL_AMBIENT)
5550 case GL_AMBIENT:
5551#endif // defined(GL_AMBIENT)
5552#if defined(GL_DIFFUSE)
5553 case GL_DIFFUSE:
5554#endif // defined(GL_DIFFUSE)
5555#if defined(GL_SPECULAR)
5556 case GL_SPECULAR:
5557#endif // defined(GL_SPECULAR)
5558#if defined(GL_EMISSION)
5559 case GL_EMISSION:
5560#endif // defined(GL_EMISSION)
5561 _needed = 4;
5562 break;
5563 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005564 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005565 break;
5566 }
5567 if (_remaining < _needed) {
5568 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005569 _exceptionType = "java/lang/IllegalArgumentException";
5570 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005571 goto exit;
5572 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005573 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005574 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005575 params = (GLfixed *) (_paramsBase + _bufferOffset);
5576 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005577 glGetLightxv(
5578 (GLenum)light,
5579 (GLenum)pname,
5580 (GLfixed *)params
5581 );
5582
5583exit:
5584 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005585 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005586 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005587 if (_exception) {
5588 jniThrowException(_env, _exceptionType, _exceptionMessage);
5589 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005590}
5591
5592/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5593static void
5594android_glGetMaterialfv__II_3FI
5595 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5596 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005597 const char * _exceptionType = NULL;
5598 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005599 GLfloat *params_base = (GLfloat *) 0;
5600 jint _remaining;
5601 GLfloat *params = (GLfloat *) 0;
5602
5603 if (!params_ref) {
5604 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005605 _exceptionType = "java/lang/IllegalArgumentException";
5606 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005607 goto exit;
5608 }
5609 if (offset < 0) {
5610 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005611 _exceptionType = "java/lang/IllegalArgumentException";
5612 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005613 goto exit;
5614 }
5615 _remaining = _env->GetArrayLength(params_ref) - offset;
5616 int _needed;
5617 switch (pname) {
5618#if defined(GL_SHININESS)
5619 case GL_SHININESS:
5620#endif // defined(GL_SHININESS)
5621 _needed = 1;
5622 break;
5623#if defined(GL_AMBIENT)
5624 case GL_AMBIENT:
5625#endif // defined(GL_AMBIENT)
5626#if defined(GL_DIFFUSE)
5627 case GL_DIFFUSE:
5628#endif // defined(GL_DIFFUSE)
5629#if defined(GL_SPECULAR)
5630 case GL_SPECULAR:
5631#endif // defined(GL_SPECULAR)
5632#if defined(GL_EMISSION)
5633 case GL_EMISSION:
5634#endif // defined(GL_EMISSION)
5635#if defined(GL_AMBIENT_AND_DIFFUSE)
5636 case GL_AMBIENT_AND_DIFFUSE:
5637#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5638 _needed = 4;
5639 break;
5640 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005641 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005642 break;
5643 }
5644 if (_remaining < _needed) {
5645 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005646 _exceptionType = "java/lang/IllegalArgumentException";
5647 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005648 goto exit;
5649 }
5650 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005651 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005652 params = params_base + offset;
5653
5654 glGetMaterialfv(
5655 (GLenum)face,
5656 (GLenum)pname,
5657 (GLfloat *)params
5658 );
5659
5660exit:
5661 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005662 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005663 _exception ? JNI_ABORT: 0);
5664 }
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 glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5671static void
5672android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5673 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5674 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005675 const char * _exceptionType = NULL;
5676 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005677 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005678 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005679 jint _remaining;
5680 GLfloat *params = (GLfloat *) 0;
5681
Romain Guy84cac202016-12-05 12:26:02 -08005682 if (!params_buf) {
5683 _exception = 1;
5684 _exceptionType = "java/lang/IllegalArgumentException";
5685 _exceptionMessage = "params == null";
5686 goto exit;
5687 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005688 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005689 int _needed;
5690 switch (pname) {
5691#if defined(GL_SHININESS)
5692 case GL_SHININESS:
5693#endif // defined(GL_SHININESS)
5694 _needed = 1;
5695 break;
5696#if defined(GL_AMBIENT)
5697 case GL_AMBIENT:
5698#endif // defined(GL_AMBIENT)
5699#if defined(GL_DIFFUSE)
5700 case GL_DIFFUSE:
5701#endif // defined(GL_DIFFUSE)
5702#if defined(GL_SPECULAR)
5703 case GL_SPECULAR:
5704#endif // defined(GL_SPECULAR)
5705#if defined(GL_EMISSION)
5706 case GL_EMISSION:
5707#endif // defined(GL_EMISSION)
5708#if defined(GL_AMBIENT_AND_DIFFUSE)
5709 case GL_AMBIENT_AND_DIFFUSE:
5710#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5711 _needed = 4;
5712 break;
5713 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005714 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005715 break;
5716 }
5717 if (_remaining < _needed) {
5718 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005719 _exceptionType = "java/lang/IllegalArgumentException";
5720 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005721 goto exit;
5722 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005723 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005724 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005725 params = (GLfloat *) (_paramsBase + _bufferOffset);
5726 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005727 glGetMaterialfv(
5728 (GLenum)face,
5729 (GLenum)pname,
5730 (GLfloat *)params
5731 );
5732
5733exit:
5734 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005735 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005736 }
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 glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5743static void
5744android_glGetMaterialxv__II_3II
5745 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5746 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005747 const char * _exceptionType = NULL;
5748 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005749 GLfixed *params_base = (GLfixed *) 0;
5750 jint _remaining;
5751 GLfixed *params = (GLfixed *) 0;
5752
5753 if (!params_ref) {
5754 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005755 _exceptionType = "java/lang/IllegalArgumentException";
5756 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005757 goto exit;
5758 }
5759 if (offset < 0) {
5760 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005761 _exceptionType = "java/lang/IllegalArgumentException";
5762 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005763 goto exit;
5764 }
5765 _remaining = _env->GetArrayLength(params_ref) - offset;
5766 int _needed;
5767 switch (pname) {
5768#if defined(GL_SHININESS)
5769 case GL_SHININESS:
5770#endif // defined(GL_SHININESS)
5771 _needed = 1;
5772 break;
5773#if defined(GL_AMBIENT)
5774 case GL_AMBIENT:
5775#endif // defined(GL_AMBIENT)
5776#if defined(GL_DIFFUSE)
5777 case GL_DIFFUSE:
5778#endif // defined(GL_DIFFUSE)
5779#if defined(GL_SPECULAR)
5780 case GL_SPECULAR:
5781#endif // defined(GL_SPECULAR)
5782#if defined(GL_EMISSION)
5783 case GL_EMISSION:
5784#endif // defined(GL_EMISSION)
5785#if defined(GL_AMBIENT_AND_DIFFUSE)
5786 case GL_AMBIENT_AND_DIFFUSE:
5787#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5788 _needed = 4;
5789 break;
5790 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005791 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005792 break;
5793 }
5794 if (_remaining < _needed) {
5795 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005796 _exceptionType = "java/lang/IllegalArgumentException";
5797 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005798 goto exit;
5799 }
5800 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005801 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005802 params = params_base + offset;
5803
5804 glGetMaterialxv(
5805 (GLenum)face,
5806 (GLenum)pname,
5807 (GLfixed *)params
5808 );
5809
5810exit:
5811 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005812 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005813 _exception ? JNI_ABORT: 0);
5814 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005815 if (_exception) {
5816 jniThrowException(_env, _exceptionType, _exceptionMessage);
5817 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005818}
5819
5820/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5821static void
5822android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5823 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5824 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005825 const char * _exceptionType = NULL;
5826 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005827 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005828 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005829 jint _remaining;
5830 GLfixed *params = (GLfixed *) 0;
5831
Romain Guy84cac202016-12-05 12:26:02 -08005832 if (!params_buf) {
5833 _exception = 1;
5834 _exceptionType = "java/lang/IllegalArgumentException";
5835 _exceptionMessage = "params == null";
5836 goto exit;
5837 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005838 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005839 int _needed;
5840 switch (pname) {
5841#if defined(GL_SHININESS)
5842 case GL_SHININESS:
5843#endif // defined(GL_SHININESS)
5844 _needed = 1;
5845 break;
5846#if defined(GL_AMBIENT)
5847 case GL_AMBIENT:
5848#endif // defined(GL_AMBIENT)
5849#if defined(GL_DIFFUSE)
5850 case GL_DIFFUSE:
5851#endif // defined(GL_DIFFUSE)
5852#if defined(GL_SPECULAR)
5853 case GL_SPECULAR:
5854#endif // defined(GL_SPECULAR)
5855#if defined(GL_EMISSION)
5856 case GL_EMISSION:
5857#endif // defined(GL_EMISSION)
5858#if defined(GL_AMBIENT_AND_DIFFUSE)
5859 case GL_AMBIENT_AND_DIFFUSE:
5860#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5861 _needed = 4;
5862 break;
5863 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005864 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005865 break;
5866 }
5867 if (_remaining < _needed) {
5868 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005869 _exceptionType = "java/lang/IllegalArgumentException";
5870 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005871 goto exit;
5872 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005873 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005874 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005875 params = (GLfixed *) (_paramsBase + _bufferOffset);
5876 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005877 glGetMaterialxv(
5878 (GLenum)face,
5879 (GLenum)pname,
5880 (GLfixed *)params
5881 );
5882
5883exit:
5884 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005885 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005886 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005887 if (_exception) {
5888 jniThrowException(_env, _exceptionType, _exceptionMessage);
5889 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005890}
5891
5892/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5893static void
5894android_glGetTexEnviv__II_3II
5895 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5896 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005897 const char * _exceptionType = NULL;
5898 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005899 GLint *params_base = (GLint *) 0;
5900 jint _remaining;
5901 GLint *params = (GLint *) 0;
5902
5903 if (!params_ref) {
5904 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005905 _exceptionType = "java/lang/IllegalArgumentException";
5906 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005907 goto exit;
5908 }
5909 if (offset < 0) {
5910 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005911 _exceptionType = "java/lang/IllegalArgumentException";
5912 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005913 goto exit;
5914 }
5915 _remaining = _env->GetArrayLength(params_ref) - offset;
5916 int _needed;
5917 switch (pname) {
5918#if defined(GL_TEXTURE_ENV_MODE)
5919 case GL_TEXTURE_ENV_MODE:
5920#endif // defined(GL_TEXTURE_ENV_MODE)
5921#if defined(GL_COMBINE_RGB)
5922 case GL_COMBINE_RGB:
5923#endif // defined(GL_COMBINE_RGB)
5924#if defined(GL_COMBINE_ALPHA)
5925 case GL_COMBINE_ALPHA:
5926#endif // defined(GL_COMBINE_ALPHA)
5927 _needed = 1;
5928 break;
5929#if defined(GL_TEXTURE_ENV_COLOR)
5930 case GL_TEXTURE_ENV_COLOR:
5931#endif // defined(GL_TEXTURE_ENV_COLOR)
5932 _needed = 4;
5933 break;
5934 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005935 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005936 break;
5937 }
5938 if (_remaining < _needed) {
5939 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005940 _exceptionType = "java/lang/IllegalArgumentException";
5941 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005942 goto exit;
5943 }
5944 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005945 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005946 params = params_base + offset;
5947
5948 glGetTexEnviv(
5949 (GLenum)env,
5950 (GLenum)pname,
5951 (GLint *)params
5952 );
5953
5954exit:
5955 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005956 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005957 _exception ? JNI_ABORT: 0);
5958 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005959 if (_exception) {
5960 jniThrowException(_env, _exceptionType, _exceptionMessage);
5961 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005962}
5963
5964/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5965static void
5966android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5967 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5968 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005969 const char * _exceptionType = NULL;
5970 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005971 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005972 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005973 jint _remaining;
5974 GLint *params = (GLint *) 0;
5975
Romain Guy84cac202016-12-05 12:26:02 -08005976 if (!params_buf) {
5977 _exception = 1;
5978 _exceptionType = "java/lang/IllegalArgumentException";
5979 _exceptionMessage = "params == null";
5980 goto exit;
5981 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005982 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005983 int _needed;
5984 switch (pname) {
5985#if defined(GL_TEXTURE_ENV_MODE)
5986 case GL_TEXTURE_ENV_MODE:
5987#endif // defined(GL_TEXTURE_ENV_MODE)
5988#if defined(GL_COMBINE_RGB)
5989 case GL_COMBINE_RGB:
5990#endif // defined(GL_COMBINE_RGB)
5991#if defined(GL_COMBINE_ALPHA)
5992 case GL_COMBINE_ALPHA:
5993#endif // defined(GL_COMBINE_ALPHA)
5994 _needed = 1;
5995 break;
5996#if defined(GL_TEXTURE_ENV_COLOR)
5997 case GL_TEXTURE_ENV_COLOR:
5998#endif // defined(GL_TEXTURE_ENV_COLOR)
5999 _needed = 4;
6000 break;
6001 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006002 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006003 break;
6004 }
6005 if (_remaining < _needed) {
6006 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006007 _exceptionType = "java/lang/IllegalArgumentException";
6008 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006009 goto exit;
6010 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006011 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006012 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006013 params = (GLint *) (_paramsBase + _bufferOffset);
6014 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006015 glGetTexEnviv(
6016 (GLenum)env,
6017 (GLenum)pname,
6018 (GLint *)params
6019 );
6020
6021exit:
6022 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006023 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006024 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006025 if (_exception) {
6026 jniThrowException(_env, _exceptionType, _exceptionMessage);
6027 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006028}
6029
6030/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6031static void
6032android_glGetTexEnvxv__II_3II
6033 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
6034 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006035 const char * _exceptionType = NULL;
6036 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006037 GLfixed *params_base = (GLfixed *) 0;
6038 jint _remaining;
6039 GLfixed *params = (GLfixed *) 0;
6040
6041 if (!params_ref) {
6042 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006043 _exceptionType = "java/lang/IllegalArgumentException";
6044 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006045 goto exit;
6046 }
6047 if (offset < 0) {
6048 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006049 _exceptionType = "java/lang/IllegalArgumentException";
6050 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006051 goto exit;
6052 }
6053 _remaining = _env->GetArrayLength(params_ref) - offset;
6054 int _needed;
6055 switch (pname) {
6056#if defined(GL_TEXTURE_ENV_MODE)
6057 case GL_TEXTURE_ENV_MODE:
6058#endif // defined(GL_TEXTURE_ENV_MODE)
6059#if defined(GL_COMBINE_RGB)
6060 case GL_COMBINE_RGB:
6061#endif // defined(GL_COMBINE_RGB)
6062#if defined(GL_COMBINE_ALPHA)
6063 case GL_COMBINE_ALPHA:
6064#endif // defined(GL_COMBINE_ALPHA)
6065 _needed = 1;
6066 break;
6067#if defined(GL_TEXTURE_ENV_COLOR)
6068 case GL_TEXTURE_ENV_COLOR:
6069#endif // defined(GL_TEXTURE_ENV_COLOR)
6070 _needed = 4;
6071 break;
6072 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006073 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006074 break;
6075 }
6076 if (_remaining < _needed) {
6077 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006078 _exceptionType = "java/lang/IllegalArgumentException";
6079 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006080 goto exit;
6081 }
6082 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006083 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006084 params = params_base + offset;
6085
6086 glGetTexEnvxv(
6087 (GLenum)env,
6088 (GLenum)pname,
6089 (GLfixed *)params
6090 );
6091
6092exit:
6093 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006094 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006095 _exception ? JNI_ABORT: 0);
6096 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006097 if (_exception) {
6098 jniThrowException(_env, _exceptionType, _exceptionMessage);
6099 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006100}
6101
6102/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6103static void
6104android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
6105 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
6106 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006107 const char * _exceptionType = NULL;
6108 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006109 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006110 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006111 jint _remaining;
6112 GLfixed *params = (GLfixed *) 0;
6113
Romain Guy84cac202016-12-05 12:26:02 -08006114 if (!params_buf) {
6115 _exception = 1;
6116 _exceptionType = "java/lang/IllegalArgumentException";
6117 _exceptionMessage = "params == null";
6118 goto exit;
6119 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006120 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006121 int _needed;
6122 switch (pname) {
6123#if defined(GL_TEXTURE_ENV_MODE)
6124 case GL_TEXTURE_ENV_MODE:
6125#endif // defined(GL_TEXTURE_ENV_MODE)
6126#if defined(GL_COMBINE_RGB)
6127 case GL_COMBINE_RGB:
6128#endif // defined(GL_COMBINE_RGB)
6129#if defined(GL_COMBINE_ALPHA)
6130 case GL_COMBINE_ALPHA:
6131#endif // defined(GL_COMBINE_ALPHA)
6132 _needed = 1;
6133 break;
6134#if defined(GL_TEXTURE_ENV_COLOR)
6135 case GL_TEXTURE_ENV_COLOR:
6136#endif // defined(GL_TEXTURE_ENV_COLOR)
6137 _needed = 4;
6138 break;
6139 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006140 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006141 break;
6142 }
6143 if (_remaining < _needed) {
6144 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006145 _exceptionType = "java/lang/IllegalArgumentException";
6146 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006147 goto exit;
6148 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006149 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006150 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006151 params = (GLfixed *) (_paramsBase + _bufferOffset);
6152 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006153 glGetTexEnvxv(
6154 (GLenum)env,
6155 (GLenum)pname,
6156 (GLfixed *)params
6157 );
6158
6159exit:
6160 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006161 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006162 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006163 if (_exception) {
6164 jniThrowException(_env, _exceptionType, _exceptionMessage);
6165 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006166}
6167
6168/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6169static void
6170android_glGetTexParameterfv__II_3FI
6171 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
6172 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006173 const char * _exceptionType = NULL;
6174 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006175 GLfloat *params_base = (GLfloat *) 0;
6176 jint _remaining;
6177 GLfloat *params = (GLfloat *) 0;
6178
6179 if (!params_ref) {
6180 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006181 _exceptionType = "java/lang/IllegalArgumentException";
6182 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006183 goto exit;
6184 }
6185 if (offset < 0) {
6186 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006187 _exceptionType = "java/lang/IllegalArgumentException";
6188 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006189 goto exit;
6190 }
6191 _remaining = _env->GetArrayLength(params_ref) - offset;
6192 if (_remaining < 1) {
6193 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006194 _exceptionType = "java/lang/IllegalArgumentException";
6195 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006196 goto exit;
6197 }
6198 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006199 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006200 params = params_base + offset;
6201
6202 glGetTexParameterfv(
6203 (GLenum)target,
6204 (GLenum)pname,
6205 (GLfloat *)params
6206 );
6207
6208exit:
6209 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006210 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006211 _exception ? JNI_ABORT: 0);
6212 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006213 if (_exception) {
6214 jniThrowException(_env, _exceptionType, _exceptionMessage);
6215 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006216}
6217
6218/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6219static void
6220android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
6221 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6222 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006223 const char * _exceptionType = NULL;
6224 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006225 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006226 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006227 jint _remaining;
6228 GLfloat *params = (GLfloat *) 0;
6229
Romain Guy84cac202016-12-05 12:26:02 -08006230 if (!params_buf) {
6231 _exception = 1;
6232 _exceptionType = "java/lang/IllegalArgumentException";
6233 _exceptionMessage = "params == null";
6234 goto exit;
6235 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006236 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006237 if (_remaining < 1) {
6238 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006239 _exceptionType = "java/lang/IllegalArgumentException";
6240 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006241 goto exit;
6242 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006243 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006244 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006245 params = (GLfloat *) (_paramsBase + _bufferOffset);
6246 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006247 glGetTexParameterfv(
6248 (GLenum)target,
6249 (GLenum)pname,
6250 (GLfloat *)params
6251 );
6252
6253exit:
6254 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006255 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006256 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006257 if (_exception) {
6258 jniThrowException(_env, _exceptionType, _exceptionMessage);
6259 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006260}
6261
6262/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6263static void
6264android_glGetTexParameteriv__II_3II
6265 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6266 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006267 const char * _exceptionType = NULL;
6268 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006269 GLint *params_base = (GLint *) 0;
6270 jint _remaining;
6271 GLint *params = (GLint *) 0;
6272
6273 if (!params_ref) {
6274 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006275 _exceptionType = "java/lang/IllegalArgumentException";
6276 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006277 goto exit;
6278 }
6279 if (offset < 0) {
6280 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006281 _exceptionType = "java/lang/IllegalArgumentException";
6282 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006283 goto exit;
6284 }
6285 _remaining = _env->GetArrayLength(params_ref) - offset;
6286 if (_remaining < 1) {
6287 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006288 _exceptionType = "java/lang/IllegalArgumentException";
6289 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006290 goto exit;
6291 }
6292 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006293 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006294 params = params_base + offset;
6295
6296 glGetTexParameteriv(
6297 (GLenum)target,
6298 (GLenum)pname,
6299 (GLint *)params
6300 );
6301
6302exit:
6303 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006304 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006305 _exception ? JNI_ABORT: 0);
6306 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006307 if (_exception) {
6308 jniThrowException(_env, _exceptionType, _exceptionMessage);
6309 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006310}
6311
6312/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6313static void
6314android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
6315 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6316 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006317 const char * _exceptionType = NULL;
6318 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006319 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006320 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006321 jint _remaining;
6322 GLint *params = (GLint *) 0;
6323
Romain Guy84cac202016-12-05 12:26:02 -08006324 if (!params_buf) {
6325 _exception = 1;
6326 _exceptionType = "java/lang/IllegalArgumentException";
6327 _exceptionMessage = "params == null";
6328 goto exit;
6329 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006330 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006331 if (_remaining < 1) {
6332 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006333 _exceptionType = "java/lang/IllegalArgumentException";
6334 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006335 goto exit;
6336 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006337 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006338 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006339 params = (GLint *) (_paramsBase + _bufferOffset);
6340 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006341 glGetTexParameteriv(
6342 (GLenum)target,
6343 (GLenum)pname,
6344 (GLint *)params
6345 );
6346
6347exit:
6348 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006349 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006350 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006351 if (_exception) {
6352 jniThrowException(_env, _exceptionType, _exceptionMessage);
6353 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006354}
6355
6356/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6357static void
6358android_glGetTexParameterxv__II_3II
6359 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6360 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006361 const char * _exceptionType = NULL;
6362 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006363 GLfixed *params_base = (GLfixed *) 0;
6364 jint _remaining;
6365 GLfixed *params = (GLfixed *) 0;
6366
6367 if (!params_ref) {
6368 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006369 _exceptionType = "java/lang/IllegalArgumentException";
6370 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006371 goto exit;
6372 }
6373 if (offset < 0) {
6374 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006375 _exceptionType = "java/lang/IllegalArgumentException";
6376 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006377 goto exit;
6378 }
6379 _remaining = _env->GetArrayLength(params_ref) - offset;
6380 if (_remaining < 1) {
6381 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006382 _exceptionType = "java/lang/IllegalArgumentException";
6383 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006384 goto exit;
6385 }
6386 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006387 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006388 params = params_base + offset;
6389
6390 glGetTexParameterxv(
6391 (GLenum)target,
6392 (GLenum)pname,
6393 (GLfixed *)params
6394 );
6395
6396exit:
6397 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006398 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006399 _exception ? JNI_ABORT: 0);
6400 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006401 if (_exception) {
6402 jniThrowException(_env, _exceptionType, _exceptionMessage);
6403 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006404}
6405
6406/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6407static void
6408android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6409 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6410 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006411 const char * _exceptionType = NULL;
6412 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006413 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006414 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006415 jint _remaining;
6416 GLfixed *params = (GLfixed *) 0;
6417
Romain Guy84cac202016-12-05 12:26:02 -08006418 if (!params_buf) {
6419 _exception = 1;
6420 _exceptionType = "java/lang/IllegalArgumentException";
6421 _exceptionMessage = "params == null";
6422 goto exit;
6423 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006424 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006425 if (_remaining < 1) {
6426 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006427 _exceptionType = "java/lang/IllegalArgumentException";
6428 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006429 goto exit;
6430 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006431 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006432 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006433 params = (GLfixed *) (_paramsBase + _bufferOffset);
6434 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006435 glGetTexParameterxv(
6436 (GLenum)target,
6437 (GLenum)pname,
6438 (GLfixed *)params
6439 );
6440
6441exit:
6442 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006443 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006444 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006445 if (_exception) {
6446 jniThrowException(_env, _exceptionType, _exceptionMessage);
6447 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006448}
6449
6450/* GLboolean glIsBuffer ( GLuint buffer ) */
6451static jboolean
6452android_glIsBuffer__I
6453 (JNIEnv *_env, jobject _this, jint buffer) {
6454 GLboolean _returnValue;
6455 _returnValue = glIsBuffer(
6456 (GLuint)buffer
6457 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006458 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006459}
6460
6461/* GLboolean glIsEnabled ( GLenum cap ) */
6462static jboolean
6463android_glIsEnabled__I
6464 (JNIEnv *_env, jobject _this, jint cap) {
6465 GLboolean _returnValue;
6466 _returnValue = glIsEnabled(
6467 (GLenum)cap
6468 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006469 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006470}
6471
6472/* GLboolean glIsTexture ( GLuint texture ) */
6473static jboolean
6474android_glIsTexture__I
6475 (JNIEnv *_env, jobject _this, jint texture) {
6476 GLboolean _returnValue;
6477 _returnValue = glIsTexture(
6478 (GLuint)texture
6479 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006480 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006481}
6482
6483/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6484static void
6485android_glNormalPointer__III
6486 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6487 glNormalPointer(
6488 (GLenum)type,
6489 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006490 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006491 );
6492}
6493
6494/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6495static void
6496android_glPointParameterf__IF
6497 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6498 glPointParameterf(
6499 (GLenum)pname,
6500 (GLfloat)param
6501 );
6502}
6503
6504/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6505static void
6506android_glPointParameterfv__I_3FI
6507 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006508 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006509 const char * _exceptionType = NULL;
6510 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006511 GLfloat *params_base = (GLfloat *) 0;
6512 jint _remaining;
6513 GLfloat *params = (GLfloat *) 0;
6514
6515 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006516 _exception = 1;
6517 _exceptionType = "java/lang/IllegalArgumentException";
6518 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006519 goto exit;
6520 }
6521 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006522 _exception = 1;
6523 _exceptionType = "java/lang/IllegalArgumentException";
6524 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006525 goto exit;
6526 }
6527 _remaining = _env->GetArrayLength(params_ref) - offset;
6528 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006529 _exception = 1;
6530 _exceptionType = "java/lang/IllegalArgumentException";
6531 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006532 goto exit;
6533 }
6534 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006535 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006536 params = params_base + offset;
6537
6538 glPointParameterfv(
6539 (GLenum)pname,
6540 (GLfloat *)params
6541 );
6542
6543exit:
6544 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006545 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006546 JNI_ABORT);
6547 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006548 if (_exception) {
6549 jniThrowException(_env, _exceptionType, _exceptionMessage);
6550 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006551}
6552
6553/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6554static void
6555android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6556 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006557 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006558 const char * _exceptionType = NULL;
6559 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006560 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006561 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006562 jint _remaining;
6563 GLfloat *params = (GLfloat *) 0;
6564
Romain Guy84cac202016-12-05 12:26:02 -08006565 if (!params_buf) {
6566 _exception = 1;
6567 _exceptionType = "java/lang/IllegalArgumentException";
6568 _exceptionMessage = "params == null";
6569 goto exit;
6570 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006571 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006572 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006573 _exception = 1;
6574 _exceptionType = "java/lang/IllegalArgumentException";
6575 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006576 goto exit;
6577 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006578 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006579 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006580 params = (GLfloat *) (_paramsBase + _bufferOffset);
6581 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006582 glPointParameterfv(
6583 (GLenum)pname,
6584 (GLfloat *)params
6585 );
6586
6587exit:
6588 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006589 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006590 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006591 if (_exception) {
6592 jniThrowException(_env, _exceptionType, _exceptionMessage);
6593 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006594}
6595
6596/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6597static void
6598android_glPointParameterx__II
6599 (JNIEnv *_env, jobject _this, jint pname, jint param) {
6600 glPointParameterx(
6601 (GLenum)pname,
6602 (GLfixed)param
6603 );
6604}
6605
6606/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6607static void
6608android_glPointParameterxv__I_3II
6609 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006610 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006611 const char * _exceptionType = NULL;
6612 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006613 GLfixed *params_base = (GLfixed *) 0;
6614 jint _remaining;
6615 GLfixed *params = (GLfixed *) 0;
6616
6617 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006618 _exception = 1;
6619 _exceptionType = "java/lang/IllegalArgumentException";
6620 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006621 goto exit;
6622 }
6623 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006624 _exception = 1;
6625 _exceptionType = "java/lang/IllegalArgumentException";
6626 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006627 goto exit;
6628 }
6629 _remaining = _env->GetArrayLength(params_ref) - offset;
6630 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006631 _exception = 1;
6632 _exceptionType = "java/lang/IllegalArgumentException";
6633 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006634 goto exit;
6635 }
6636 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006637 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006638 params = params_base + offset;
6639
6640 glPointParameterxv(
6641 (GLenum)pname,
6642 (GLfixed *)params
6643 );
6644
6645exit:
6646 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006647 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006648 JNI_ABORT);
6649 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006650 if (_exception) {
6651 jniThrowException(_env, _exceptionType, _exceptionMessage);
6652 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006653}
6654
6655/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6656static void
6657android_glPointParameterxv__ILjava_nio_IntBuffer_2
6658 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006659 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006660 const char * _exceptionType = NULL;
6661 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006662 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006663 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006664 jint _remaining;
6665 GLfixed *params = (GLfixed *) 0;
6666
Romain Guy84cac202016-12-05 12:26:02 -08006667 if (!params_buf) {
6668 _exception = 1;
6669 _exceptionType = "java/lang/IllegalArgumentException";
6670 _exceptionMessage = "params == null";
6671 goto exit;
6672 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006673 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006674 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006675 _exception = 1;
6676 _exceptionType = "java/lang/IllegalArgumentException";
6677 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006678 goto exit;
6679 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006680 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006681 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006682 params = (GLfixed *) (_paramsBase + _bufferOffset);
6683 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006684 glPointParameterxv(
6685 (GLenum)pname,
6686 (GLfixed *)params
6687 );
6688
6689exit:
6690 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006691 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006692 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006693 if (_exception) {
6694 jniThrowException(_env, _exceptionType, _exceptionMessage);
6695 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006696}
6697
6698/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6699static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08006700android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6701 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08006702 jint _exception = 0;
6703 const char * _exceptionType = NULL;
6704 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006705 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006706 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006707 jint _remaining;
6708 GLvoid *pointer = (GLvoid *) 0;
6709
Jack Palevichbe6eac82009-12-08 15:43:51 +08006710 if (pointer_buf) {
6711 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6712 if ( ! pointer ) {
6713 return;
6714 }
6715 }
6716 glPointSizePointerOESBounds(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006717 (GLenum)type,
6718 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08006719 (GLvoid *)pointer,
6720 (GLsizei)remaining
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006721 );
Romain Guy84cac202016-12-05 12:26:02 -08006722 if (_exception) {
6723 jniThrowException(_env, _exceptionType, _exceptionMessage);
6724 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006725}
6726
6727/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6728static void
6729android_glTexCoordPointer__IIII
6730 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6731 glTexCoordPointer(
6732 (GLint)size,
6733 (GLenum)type,
6734 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006735 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006736 );
6737}
6738
6739/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6740static void
6741android_glTexEnvi__III
6742 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6743 glTexEnvi(
6744 (GLenum)target,
6745 (GLenum)pname,
6746 (GLint)param
6747 );
6748}
6749
6750/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6751static void
6752android_glTexEnviv__II_3II
6753 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006754 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006755 const char * _exceptionType = NULL;
6756 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006757 GLint *params_base = (GLint *) 0;
6758 jint _remaining;
6759 GLint *params = (GLint *) 0;
6760
6761 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006762 _exception = 1;
6763 _exceptionType = "java/lang/IllegalArgumentException";
6764 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006765 goto exit;
6766 }
6767 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006768 _exception = 1;
6769 _exceptionType = "java/lang/IllegalArgumentException";
6770 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006771 goto exit;
6772 }
6773 _remaining = _env->GetArrayLength(params_ref) - offset;
6774 int _needed;
6775 switch (pname) {
6776#if defined(GL_TEXTURE_ENV_MODE)
6777 case GL_TEXTURE_ENV_MODE:
6778#endif // defined(GL_TEXTURE_ENV_MODE)
6779#if defined(GL_COMBINE_RGB)
6780 case GL_COMBINE_RGB:
6781#endif // defined(GL_COMBINE_RGB)
6782#if defined(GL_COMBINE_ALPHA)
6783 case GL_COMBINE_ALPHA:
6784#endif // defined(GL_COMBINE_ALPHA)
6785 _needed = 1;
6786 break;
6787#if defined(GL_TEXTURE_ENV_COLOR)
6788 case GL_TEXTURE_ENV_COLOR:
6789#endif // defined(GL_TEXTURE_ENV_COLOR)
6790 _needed = 4;
6791 break;
6792 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006793 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006794 break;
6795 }
6796 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006797 _exception = 1;
6798 _exceptionType = "java/lang/IllegalArgumentException";
6799 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006800 goto exit;
6801 }
6802 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006803 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006804 params = params_base + offset;
6805
6806 glTexEnviv(
6807 (GLenum)target,
6808 (GLenum)pname,
6809 (GLint *)params
6810 );
6811
6812exit:
6813 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006814 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006815 JNI_ABORT);
6816 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006817 if (_exception) {
6818 jniThrowException(_env, _exceptionType, _exceptionMessage);
6819 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006820}
6821
6822/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6823static void
6824android_glTexEnviv__IILjava_nio_IntBuffer_2
6825 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006826 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006827 const char * _exceptionType = NULL;
6828 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006829 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006830 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006831 jint _remaining;
6832 GLint *params = (GLint *) 0;
6833
Romain Guy84cac202016-12-05 12:26:02 -08006834 if (!params_buf) {
6835 _exception = 1;
6836 _exceptionType = "java/lang/IllegalArgumentException";
6837 _exceptionMessage = "params == null";
6838 goto exit;
6839 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006840 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006841 int _needed;
6842 switch (pname) {
6843#if defined(GL_TEXTURE_ENV_MODE)
6844 case GL_TEXTURE_ENV_MODE:
6845#endif // defined(GL_TEXTURE_ENV_MODE)
6846#if defined(GL_COMBINE_RGB)
6847 case GL_COMBINE_RGB:
6848#endif // defined(GL_COMBINE_RGB)
6849#if defined(GL_COMBINE_ALPHA)
6850 case GL_COMBINE_ALPHA:
6851#endif // defined(GL_COMBINE_ALPHA)
6852 _needed = 1;
6853 break;
6854#if defined(GL_TEXTURE_ENV_COLOR)
6855 case GL_TEXTURE_ENV_COLOR:
6856#endif // defined(GL_TEXTURE_ENV_COLOR)
6857 _needed = 4;
6858 break;
6859 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006860 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006861 break;
6862 }
6863 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006864 _exception = 1;
6865 _exceptionType = "java/lang/IllegalArgumentException";
6866 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006867 goto exit;
6868 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006869 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006870 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006871 params = (GLint *) (_paramsBase + _bufferOffset);
6872 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006873 glTexEnviv(
6874 (GLenum)target,
6875 (GLenum)pname,
6876 (GLint *)params
6877 );
6878
6879exit:
6880 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006881 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006882 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006883 if (_exception) {
6884 jniThrowException(_env, _exceptionType, _exceptionMessage);
6885 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006886}
6887
6888/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6889static void
6890android_glTexParameterfv__II_3FI
6891 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006892 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006893 const char * _exceptionType = NULL;
6894 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006895 GLfloat *params_base = (GLfloat *) 0;
6896 jint _remaining;
6897 GLfloat *params = (GLfloat *) 0;
6898
6899 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006900 _exception = 1;
6901 _exceptionType = "java/lang/IllegalArgumentException";
6902 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006903 goto exit;
6904 }
6905 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006906 _exception = 1;
6907 _exceptionType = "java/lang/IllegalArgumentException";
6908 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006909 goto exit;
6910 }
6911 _remaining = _env->GetArrayLength(params_ref) - offset;
6912 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006913 _exception = 1;
6914 _exceptionType = "java/lang/IllegalArgumentException";
6915 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006916 goto exit;
6917 }
6918 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006919 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006920 params = params_base + offset;
6921
6922 glTexParameterfv(
6923 (GLenum)target,
6924 (GLenum)pname,
6925 (GLfloat *)params
6926 );
6927
6928exit:
6929 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006930 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006931 JNI_ABORT);
6932 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006933 if (_exception) {
6934 jniThrowException(_env, _exceptionType, _exceptionMessage);
6935 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006936}
6937
6938/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6939static void
6940android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6941 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006942 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006943 const char * _exceptionType = NULL;
6944 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006945 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006946 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006947 jint _remaining;
6948 GLfloat *params = (GLfloat *) 0;
6949
Romain Guy84cac202016-12-05 12:26:02 -08006950 if (!params_buf) {
6951 _exception = 1;
6952 _exceptionType = "java/lang/IllegalArgumentException";
6953 _exceptionMessage = "params == null";
6954 goto exit;
6955 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006956 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006957 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006958 _exception = 1;
6959 _exceptionType = "java/lang/IllegalArgumentException";
6960 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006961 goto exit;
6962 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006963 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006964 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006965 params = (GLfloat *) (_paramsBase + _bufferOffset);
6966 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006967 glTexParameterfv(
6968 (GLenum)target,
6969 (GLenum)pname,
6970 (GLfloat *)params
6971 );
6972
6973exit:
6974 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006975 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006976 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006977 if (_exception) {
6978 jniThrowException(_env, _exceptionType, _exceptionMessage);
6979 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006980}
6981
6982/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6983static void
6984android_glTexParameteri__III
6985 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6986 glTexParameteri(
6987 (GLenum)target,
6988 (GLenum)pname,
6989 (GLint)param
6990 );
6991}
6992
6993/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6994static void
6995android_glTexParameteriv__II_3II
6996 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006997 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006998 const char * _exceptionType = NULL;
6999 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007000 GLint *params_base = (GLint *) 0;
7001 jint _remaining;
7002 GLint *params = (GLint *) 0;
7003
7004 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007005 _exception = 1;
7006 _exceptionType = "java/lang/IllegalArgumentException";
7007 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007008 goto exit;
7009 }
7010 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007011 _exception = 1;
7012 _exceptionType = "java/lang/IllegalArgumentException";
7013 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007014 goto exit;
7015 }
7016 _remaining = _env->GetArrayLength(params_ref) - offset;
7017 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007018 _exception = 1;
7019 _exceptionType = "java/lang/IllegalArgumentException";
7020 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007021 goto exit;
7022 }
7023 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007024 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007025 params = params_base + offset;
7026
7027 glTexParameteriv(
7028 (GLenum)target,
7029 (GLenum)pname,
7030 (GLint *)params
7031 );
7032
7033exit:
7034 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007035 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007036 JNI_ABORT);
7037 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007038 if (_exception) {
7039 jniThrowException(_env, _exceptionType, _exceptionMessage);
7040 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007041}
7042
7043/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
7044static void
7045android_glTexParameteriv__IILjava_nio_IntBuffer_2
7046 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007047 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007048 const char * _exceptionType = NULL;
7049 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007050 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007051 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007052 jint _remaining;
7053 GLint *params = (GLint *) 0;
7054
Romain Guy84cac202016-12-05 12:26:02 -08007055 if (!params_buf) {
7056 _exception = 1;
7057 _exceptionType = "java/lang/IllegalArgumentException";
7058 _exceptionMessage = "params == null";
7059 goto exit;
7060 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007061 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007062 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007063 _exception = 1;
7064 _exceptionType = "java/lang/IllegalArgumentException";
7065 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007066 goto exit;
7067 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007068 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007069 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007070 params = (GLint *) (_paramsBase + _bufferOffset);
7071 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007072 glTexParameteriv(
7073 (GLenum)target,
7074 (GLenum)pname,
7075 (GLint *)params
7076 );
7077
7078exit:
7079 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007080 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007081 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007082 if (_exception) {
7083 jniThrowException(_env, _exceptionType, _exceptionMessage);
7084 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007085}
7086
7087/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7088static void
7089android_glTexParameterxv__II_3II
7090 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007091 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007092 const char * _exceptionType = NULL;
7093 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007094 GLfixed *params_base = (GLfixed *) 0;
7095 jint _remaining;
7096 GLfixed *params = (GLfixed *) 0;
7097
7098 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007099 _exception = 1;
7100 _exceptionType = "java/lang/IllegalArgumentException";
7101 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007102 goto exit;
7103 }
7104 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007105 _exception = 1;
7106 _exceptionType = "java/lang/IllegalArgumentException";
7107 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007108 goto exit;
7109 }
7110 _remaining = _env->GetArrayLength(params_ref) - offset;
7111 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007112 _exception = 1;
7113 _exceptionType = "java/lang/IllegalArgumentException";
7114 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007115 goto exit;
7116 }
7117 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007118 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007119 params = params_base + offset;
7120
7121 glTexParameterxv(
7122 (GLenum)target,
7123 (GLenum)pname,
7124 (GLfixed *)params
7125 );
7126
7127exit:
7128 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007129 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007130 JNI_ABORT);
7131 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007132 if (_exception) {
7133 jniThrowException(_env, _exceptionType, _exceptionMessage);
7134 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007135}
7136
7137/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7138static void
7139android_glTexParameterxv__IILjava_nio_IntBuffer_2
7140 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007141 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007142 const char * _exceptionType = NULL;
7143 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007144 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007145 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007146 jint _remaining;
7147 GLfixed *params = (GLfixed *) 0;
7148
Romain Guy84cac202016-12-05 12:26:02 -08007149 if (!params_buf) {
7150 _exception = 1;
7151 _exceptionType = "java/lang/IllegalArgumentException";
7152 _exceptionMessage = "params == null";
7153 goto exit;
7154 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007155 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007156 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007157 _exception = 1;
7158 _exceptionType = "java/lang/IllegalArgumentException";
7159 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007160 goto exit;
7161 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007162 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007163 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007164 params = (GLfixed *) (_paramsBase + _bufferOffset);
7165 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007166 glTexParameterxv(
7167 (GLenum)target,
7168 (GLenum)pname,
7169 (GLfixed *)params
7170 );
7171
7172exit:
7173 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007174 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007175 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007176 if (_exception) {
7177 jniThrowException(_env, _exceptionType, _exceptionMessage);
7178 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007179}
7180
7181/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7182static void
7183android_glVertexPointer__IIII
7184 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7185 glVertexPointer(
7186 (GLint)size,
7187 (GLenum)type,
7188 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007189 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007190 );
7191}
7192
7193/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
7194static void
7195android_glCurrentPaletteMatrixOES__I
7196 (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007197 glCurrentPaletteMatrixOES(
7198 (GLuint)matrixpaletteindex
7199 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007200}
7201
7202/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
7203static void
7204android_glDrawTexfOES__FFFFF
7205 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
7206 glDrawTexfOES(
7207 (GLfloat)x,
7208 (GLfloat)y,
7209 (GLfloat)z,
7210 (GLfloat)width,
7211 (GLfloat)height
7212 );
7213}
7214
7215/* void glDrawTexfvOES ( const GLfloat *coords ) */
7216static void
7217android_glDrawTexfvOES___3FI
7218 (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007219 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007220 const char * _exceptionType = NULL;
7221 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007222 GLfloat *coords_base = (GLfloat *) 0;
7223 jint _remaining;
7224 GLfloat *coords = (GLfloat *) 0;
7225
7226 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007227 _exception = 1;
7228 _exceptionType = "java/lang/IllegalArgumentException";
7229 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007230 goto exit;
7231 }
7232 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007233 _exception = 1;
7234 _exceptionType = "java/lang/IllegalArgumentException";
7235 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007236 goto exit;
7237 }
7238 _remaining = _env->GetArrayLength(coords_ref) - offset;
7239 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007240 _exception = 1;
7241 _exceptionType = "java/lang/IllegalArgumentException";
7242 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007243 goto exit;
7244 }
7245 coords_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007246 _env->GetFloatArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007247 coords = coords_base + offset;
7248
7249 glDrawTexfvOES(
7250 (GLfloat *)coords
7251 );
7252
7253exit:
7254 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007255 _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007256 JNI_ABORT);
7257 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007258 if (_exception) {
7259 jniThrowException(_env, _exceptionType, _exceptionMessage);
7260 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007261}
7262
7263/* void glDrawTexfvOES ( const GLfloat *coords ) */
7264static void
7265android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
7266 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007267 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007268 const char * _exceptionType = NULL;
7269 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007270 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007271 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007272 jint _remaining;
7273 GLfloat *coords = (GLfloat *) 0;
7274
Romain Guy84cac202016-12-05 12:26:02 -08007275 if (!coords_buf) {
7276 _exception = 1;
7277 _exceptionType = "java/lang/IllegalArgumentException";
7278 _exceptionMessage = "coords == null";
7279 goto exit;
7280 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007281 coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007282 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007283 _exception = 1;
7284 _exceptionType = "java/lang/IllegalArgumentException";
7285 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007286 goto exit;
7287 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007288 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007289 char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007290 coords = (GLfloat *) (_coordsBase + _bufferOffset);
7291 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007292 glDrawTexfvOES(
7293 (GLfloat *)coords
7294 );
7295
7296exit:
7297 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007298 _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007299 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007300 if (_exception) {
7301 jniThrowException(_env, _exceptionType, _exceptionMessage);
7302 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007303}
7304
7305/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
7306static void
7307android_glDrawTexiOES__IIIII
7308 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7309 glDrawTexiOES(
7310 (GLint)x,
7311 (GLint)y,
7312 (GLint)z,
7313 (GLint)width,
7314 (GLint)height
7315 );
7316}
7317
7318/* void glDrawTexivOES ( const GLint *coords ) */
7319static void
7320android_glDrawTexivOES___3II
7321 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007322 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007323 const char * _exceptionType = NULL;
7324 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007325 GLint *coords_base = (GLint *) 0;
7326 jint _remaining;
7327 GLint *coords = (GLint *) 0;
7328
7329 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007330 _exception = 1;
7331 _exceptionType = "java/lang/IllegalArgumentException";
7332 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007333 goto exit;
7334 }
7335 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007336 _exception = 1;
7337 _exceptionType = "java/lang/IllegalArgumentException";
7338 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007339 goto exit;
7340 }
7341 _remaining = _env->GetArrayLength(coords_ref) - offset;
7342 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007343 _exception = 1;
7344 _exceptionType = "java/lang/IllegalArgumentException";
7345 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007346 goto exit;
7347 }
7348 coords_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007349 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007350 coords = coords_base + offset;
7351
7352 glDrawTexivOES(
7353 (GLint *)coords
7354 );
7355
7356exit:
7357 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007358 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007359 JNI_ABORT);
7360 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007361 if (_exception) {
7362 jniThrowException(_env, _exceptionType, _exceptionMessage);
7363 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007364}
7365
7366/* void glDrawTexivOES ( const GLint *coords ) */
7367static void
7368android_glDrawTexivOES__Ljava_nio_IntBuffer_2
7369 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007370 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007371 const char * _exceptionType = NULL;
7372 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007373 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007374 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007375 jint _remaining;
7376 GLint *coords = (GLint *) 0;
7377
Romain Guy84cac202016-12-05 12:26:02 -08007378 if (!coords_buf) {
7379 _exception = 1;
7380 _exceptionType = "java/lang/IllegalArgumentException";
7381 _exceptionMessage = "coords == null";
7382 goto exit;
7383 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007384 coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007385 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007386 _exception = 1;
7387 _exceptionType = "java/lang/IllegalArgumentException";
7388 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007389 goto exit;
7390 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007391 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007392 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007393 coords = (GLint *) (_coordsBase + _bufferOffset);
7394 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007395 glDrawTexivOES(
7396 (GLint *)coords
7397 );
7398
7399exit:
7400 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007401 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007402 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007403 if (_exception) {
7404 jniThrowException(_env, _exceptionType, _exceptionMessage);
7405 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007406}
7407
7408/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
7409static void
7410android_glDrawTexsOES__SSSSS
7411 (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
7412 glDrawTexsOES(
7413 (GLshort)x,
7414 (GLshort)y,
7415 (GLshort)z,
7416 (GLshort)width,
7417 (GLshort)height
7418 );
7419}
7420
7421/* void glDrawTexsvOES ( const GLshort *coords ) */
7422static void
7423android_glDrawTexsvOES___3SI
7424 (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007425 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007426 const char * _exceptionType = NULL;
7427 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007428 GLshort *coords_base = (GLshort *) 0;
7429 jint _remaining;
7430 GLshort *coords = (GLshort *) 0;
7431
7432 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007433 _exception = 1;
7434 _exceptionType = "java/lang/IllegalArgumentException";
7435 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007436 goto exit;
7437 }
7438 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007439 _exception = 1;
7440 _exceptionType = "java/lang/IllegalArgumentException";
7441 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007442 goto exit;
7443 }
7444 _remaining = _env->GetArrayLength(coords_ref) - offset;
7445 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007446 _exception = 1;
7447 _exceptionType = "java/lang/IllegalArgumentException";
7448 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007449 goto exit;
7450 }
7451 coords_base = (GLshort *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007452 _env->GetShortArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007453 coords = coords_base + offset;
7454
7455 glDrawTexsvOES(
7456 (GLshort *)coords
7457 );
7458
7459exit:
7460 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007461 _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007462 JNI_ABORT);
7463 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007464 if (_exception) {
7465 jniThrowException(_env, _exceptionType, _exceptionMessage);
7466 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007467}
7468
7469/* void glDrawTexsvOES ( const GLshort *coords ) */
7470static void
7471android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7472 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007473 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007474 const char * _exceptionType = NULL;
7475 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007476 jshortArray _array = (jshortArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007477 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007478 jint _remaining;
7479 GLshort *coords = (GLshort *) 0;
7480
Romain Guy84cac202016-12-05 12:26:02 -08007481 if (!coords_buf) {
7482 _exception = 1;
7483 _exceptionType = "java/lang/IllegalArgumentException";
7484 _exceptionMessage = "coords == null";
7485 goto exit;
7486 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007487 coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007488 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007489 _exception = 1;
7490 _exceptionType = "java/lang/IllegalArgumentException";
7491 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007492 goto exit;
7493 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007494 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007495 char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007496 coords = (GLshort *) (_coordsBase + _bufferOffset);
7497 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007498 glDrawTexsvOES(
7499 (GLshort *)coords
7500 );
7501
7502exit:
7503 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007504 _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007505 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007506 if (_exception) {
7507 jniThrowException(_env, _exceptionType, _exceptionMessage);
7508 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007509}
7510
7511/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7512static void
7513android_glDrawTexxOES__IIIII
7514 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7515 glDrawTexxOES(
7516 (GLfixed)x,
7517 (GLfixed)y,
7518 (GLfixed)z,
7519 (GLfixed)width,
7520 (GLfixed)height
7521 );
7522}
7523
7524/* void glDrawTexxvOES ( const GLfixed *coords ) */
7525static void
7526android_glDrawTexxvOES___3II
7527 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007528 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007529 const char * _exceptionType = NULL;
7530 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007531 GLfixed *coords_base = (GLfixed *) 0;
7532 jint _remaining;
7533 GLfixed *coords = (GLfixed *) 0;
7534
7535 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007536 _exception = 1;
7537 _exceptionType = "java/lang/IllegalArgumentException";
7538 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007539 goto exit;
7540 }
7541 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007542 _exception = 1;
7543 _exceptionType = "java/lang/IllegalArgumentException";
7544 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007545 goto exit;
7546 }
7547 _remaining = _env->GetArrayLength(coords_ref) - offset;
7548 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007549 _exception = 1;
7550 _exceptionType = "java/lang/IllegalArgumentException";
7551 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007552 goto exit;
7553 }
7554 coords_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007555 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007556 coords = coords_base + offset;
7557
7558 glDrawTexxvOES(
7559 (GLfixed *)coords
7560 );
7561
7562exit:
7563 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007564 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007565 JNI_ABORT);
7566 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007567 if (_exception) {
7568 jniThrowException(_env, _exceptionType, _exceptionMessage);
7569 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007570}
7571
7572/* void glDrawTexxvOES ( const GLfixed *coords ) */
7573static void
7574android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7575 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007576 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007577 const char * _exceptionType = NULL;
7578 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007579 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007580 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007581 jint _remaining;
7582 GLfixed *coords = (GLfixed *) 0;
7583
Romain Guy84cac202016-12-05 12:26:02 -08007584 if (!coords_buf) {
7585 _exception = 1;
7586 _exceptionType = "java/lang/IllegalArgumentException";
7587 _exceptionMessage = "coords == null";
7588 goto exit;
7589 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007590 coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007591 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007592 _exception = 1;
7593 _exceptionType = "java/lang/IllegalArgumentException";
7594 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007595 goto exit;
7596 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007597 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007598 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007599 coords = (GLfixed *) (_coordsBase + _bufferOffset);
7600 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007601 glDrawTexxvOES(
7602 (GLfixed *)coords
7603 );
7604
7605exit:
7606 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007607 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007608 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007609 if (_exception) {
7610 jniThrowException(_env, _exceptionType, _exceptionMessage);
7611 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007612}
7613
7614/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7615static void
7616android_glLoadPaletteFromModelViewMatrixOES__
7617 (JNIEnv *_env, jobject _this) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007618 glLoadPaletteFromModelViewMatrixOES();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007619}
7620
7621/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7622static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007623android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7624 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007625 jint _exception = 0;
7626 const char * _exceptionType = NULL;
7627 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007628 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007629 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007630 jint _remaining;
7631 GLvoid *pointer = (GLvoid *) 0;
7632
7633 if (pointer_buf) {
7634 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7635 if ( ! pointer ) {
7636 return;
7637 }
7638 }
7639 glMatrixIndexPointerOESBounds(
7640 (GLint)size,
7641 (GLenum)type,
7642 (GLsizei)stride,
7643 (GLvoid *)pointer,
7644 (GLsizei)remaining
7645 );
Romain Guy84cac202016-12-05 12:26:02 -08007646 if (_exception) {
7647 jniThrowException(_env, _exceptionType, _exceptionMessage);
7648 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007649}
7650
7651/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7652static void
7653android_glMatrixIndexPointerOES__IIII
7654 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007655 glMatrixIndexPointerOES(
7656 (GLint)size,
7657 (GLenum)type,
7658 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007659 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007660 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007661}
7662
7663/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7664static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007665android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7666 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007667 jint _exception = 0;
7668 const char * _exceptionType = NULL;
7669 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007670 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007671 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007672 jint _remaining;
7673 GLvoid *pointer = (GLvoid *) 0;
7674
7675 if (pointer_buf) {
7676 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7677 if ( ! pointer ) {
7678 return;
7679 }
7680 }
7681 glWeightPointerOESBounds(
7682 (GLint)size,
7683 (GLenum)type,
7684 (GLsizei)stride,
7685 (GLvoid *)pointer,
7686 (GLsizei)remaining
7687 );
Romain Guy84cac202016-12-05 12:26:02 -08007688 if (_exception) {
7689 jniThrowException(_env, _exceptionType, _exceptionMessage);
7690 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007691}
7692
7693/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7694static void
7695android_glWeightPointerOES__IIII
7696 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007697 glWeightPointerOES(
7698 (GLint)size,
7699 (GLenum)type,
7700 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007701 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007702 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007703}
7704
7705/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7706static void
7707android_glBindFramebufferOES__II
7708 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007709 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007710 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007711 "glBindFramebufferOES");
7712 return;
7713 }
7714 glBindFramebufferOES(
7715 (GLint)target,
7716 (GLint)framebuffer
7717 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007718}
7719
7720/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7721static void
7722android_glBindRenderbufferOES__II
7723 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007724 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007725 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007726 "glBindRenderbufferOES");
7727 return;
7728 }
7729 glBindRenderbufferOES(
7730 (GLint)target,
7731 (GLint)renderbuffer
7732 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007733}
7734
7735/* void glBlendEquation ( GLint mode ) */
7736static void
7737android_glBlendEquation__I
7738 (JNIEnv *_env, jobject _this, jint mode) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007739 if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007740 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007741 "glBlendEquation");
7742 return;
7743 }
7744 glBlendEquation(
7745 (GLint)mode
7746 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007747}
7748
7749/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7750static void
7751android_glBlendEquationSeparate__II
7752 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007753 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007754 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007755 "glBlendEquationSeparate");
7756 return;
7757 }
7758 glBlendEquationSeparate(
7759 (GLint)modeRGB,
7760 (GLint)modeAlpha
7761 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007762}
7763
7764/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7765static void
7766android_glBlendFuncSeparate__IIII
7767 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007768 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007769 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007770 "glBlendFuncSeparate");
7771 return;
7772 }
7773 glBlendFuncSeparate(
7774 (GLint)srcRGB,
7775 (GLint)dstRGB,
7776 (GLint)srcAlpha,
7777 (GLint)dstAlpha
7778 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007779}
7780
7781/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7782static jint
7783android_glCheckFramebufferStatusOES__I
7784 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007785 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007786 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007787 "glCheckFramebufferStatusOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007788 return 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007789 }
7790 GLint _returnValue = 0;
7791 _returnValue = glCheckFramebufferStatusOES(
7792 (GLint)target
7793 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07007794 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007795}
7796
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007797/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007798static void
7799android_glDeleteFramebuffersOES__I_3II
7800 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007801 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007802 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007803 "glDeleteFramebuffersOES");
7804 return;
7805 }
7806 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007807 const char * _exceptionType = NULL;
7808 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007809 GLuint *framebuffers_base = (GLuint *) 0;
7810 jint _remaining;
7811 GLuint *framebuffers = (GLuint *) 0;
7812
7813 if (!framebuffers_ref) {
7814 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007815 _exceptionType = "java/lang/IllegalArgumentException";
7816 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007817 goto exit;
7818 }
7819 if (offset < 0) {
7820 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007821 _exceptionType = "java/lang/IllegalArgumentException";
7822 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007823 goto exit;
7824 }
7825 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7826 if (_remaining < n) {
7827 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007828 _exceptionType = "java/lang/IllegalArgumentException";
7829 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007830 goto exit;
7831 }
7832 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007833 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007834 framebuffers = framebuffers_base + offset;
7835
7836 glDeleteFramebuffersOES(
7837 (GLint)n,
7838 (GLuint *)framebuffers
7839 );
7840
7841exit:
7842 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007843 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007844 _exception ? JNI_ABORT: 0);
7845 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007846 if (_exception) {
7847 jniThrowException(_env, _exceptionType, _exceptionMessage);
7848 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007849}
7850
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007851/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007852static void
7853android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7854 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007855 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007856 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007857 "glDeleteFramebuffersOES");
7858 return;
7859 }
7860 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007861 const char * _exceptionType = NULL;
7862 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007863 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007864 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007865 jint _remaining;
7866 GLuint *framebuffers = (GLuint *) 0;
7867
Romain Guy84cac202016-12-05 12:26:02 -08007868 if (!framebuffers_buf) {
7869 _exception = 1;
7870 _exceptionType = "java/lang/IllegalArgumentException";
7871 _exceptionMessage = "framebuffers == null";
7872 goto exit;
7873 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007874 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007875 if (_remaining < n) {
7876 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007877 _exceptionType = "java/lang/IllegalArgumentException";
7878 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007879 goto exit;
7880 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007881 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007882 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007883 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7884 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007885 glDeleteFramebuffersOES(
7886 (GLint)n,
7887 (GLuint *)framebuffers
7888 );
7889
7890exit:
7891 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007892 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007893 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007894 if (_exception) {
7895 jniThrowException(_env, _exceptionType, _exceptionMessage);
7896 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007897}
7898
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007899/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007900static void
7901android_glDeleteRenderbuffersOES__I_3II
7902 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007903 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007904 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007905 "glDeleteRenderbuffersOES");
7906 return;
7907 }
7908 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007909 const char * _exceptionType = NULL;
7910 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007911 GLuint *renderbuffers_base = (GLuint *) 0;
7912 jint _remaining;
7913 GLuint *renderbuffers = (GLuint *) 0;
7914
7915 if (!renderbuffers_ref) {
7916 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007917 _exceptionType = "java/lang/IllegalArgumentException";
7918 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007919 goto exit;
7920 }
7921 if (offset < 0) {
7922 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007923 _exceptionType = "java/lang/IllegalArgumentException";
7924 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007925 goto exit;
7926 }
7927 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7928 if (_remaining < n) {
7929 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007930 _exceptionType = "java/lang/IllegalArgumentException";
7931 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007932 goto exit;
7933 }
7934 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007935 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007936 renderbuffers = renderbuffers_base + offset;
7937
7938 glDeleteRenderbuffersOES(
7939 (GLint)n,
7940 (GLuint *)renderbuffers
7941 );
7942
7943exit:
7944 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007945 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007946 _exception ? JNI_ABORT: 0);
7947 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007948 if (_exception) {
7949 jniThrowException(_env, _exceptionType, _exceptionMessage);
7950 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007951}
7952
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007953/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007954static void
7955android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7956 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007957 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007958 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007959 "glDeleteRenderbuffersOES");
7960 return;
7961 }
7962 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007963 const char * _exceptionType = NULL;
7964 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007965 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007966 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007967 jint _remaining;
7968 GLuint *renderbuffers = (GLuint *) 0;
7969
Romain Guy84cac202016-12-05 12:26:02 -08007970 if (!renderbuffers_buf) {
7971 _exception = 1;
7972 _exceptionType = "java/lang/IllegalArgumentException";
7973 _exceptionMessage = "renderbuffers == null";
7974 goto exit;
7975 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007976 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007977 if (_remaining < n) {
7978 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007979 _exceptionType = "java/lang/IllegalArgumentException";
7980 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007981 goto exit;
7982 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007983 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007984 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007985 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7986 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007987 glDeleteRenderbuffersOES(
7988 (GLint)n,
7989 (GLuint *)renderbuffers
7990 );
7991
7992exit:
7993 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007994 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007995 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007996 if (_exception) {
7997 jniThrowException(_env, _exceptionType, _exceptionMessage);
7998 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007999}
8000
8001/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
8002static void
8003android_glFramebufferRenderbufferOES__IIII
8004 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008005 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008006 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008007 "glFramebufferRenderbufferOES");
8008 return;
8009 }
8010 glFramebufferRenderbufferOES(
8011 (GLint)target,
8012 (GLint)attachment,
8013 (GLint)renderbuffertarget,
8014 (GLint)renderbuffer
8015 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008016}
8017
8018/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
8019static void
8020android_glFramebufferTexture2DOES__IIIII
8021 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008022 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008023 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008024 "glFramebufferTexture2DOES");
8025 return;
8026 }
8027 glFramebufferTexture2DOES(
8028 (GLint)target,
8029 (GLint)attachment,
8030 (GLint)textarget,
8031 (GLint)texture,
8032 (GLint)level
8033 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008034}
8035
8036/* void glGenerateMipmapOES ( GLint target ) */
8037static void
8038android_glGenerateMipmapOES__I
8039 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008040 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008041 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008042 "glGenerateMipmapOES");
8043 return;
8044 }
8045 glGenerateMipmapOES(
8046 (GLint)target
8047 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008048}
8049
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008050/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008051static void
8052android_glGenFramebuffersOES__I_3II
8053 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008054 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008055 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008056 "glGenFramebuffersOES");
8057 return;
8058 }
8059 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008060 const char * _exceptionType = NULL;
8061 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008062 GLuint *framebuffers_base = (GLuint *) 0;
8063 jint _remaining;
8064 GLuint *framebuffers = (GLuint *) 0;
8065
8066 if (!framebuffers_ref) {
8067 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008068 _exceptionType = "java/lang/IllegalArgumentException";
8069 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008070 goto exit;
8071 }
8072 if (offset < 0) {
8073 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008074 _exceptionType = "java/lang/IllegalArgumentException";
8075 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008076 goto exit;
8077 }
8078 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
8079 if (_remaining < n) {
8080 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008081 _exceptionType = "java/lang/IllegalArgumentException";
8082 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008083 goto exit;
8084 }
8085 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008086 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008087 framebuffers = framebuffers_base + offset;
8088
8089 glGenFramebuffersOES(
8090 (GLint)n,
8091 (GLuint *)framebuffers
8092 );
8093
8094exit:
8095 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008096 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008097 _exception ? JNI_ABORT: 0);
8098 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008099 if (_exception) {
8100 jniThrowException(_env, _exceptionType, _exceptionMessage);
8101 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008102}
8103
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008104/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008105static void
8106android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
8107 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008108 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008109 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008110 "glGenFramebuffersOES");
8111 return;
8112 }
8113 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008114 const char * _exceptionType = NULL;
8115 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008116 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008117 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008118 jint _remaining;
8119 GLuint *framebuffers = (GLuint *) 0;
8120
Romain Guy84cac202016-12-05 12:26:02 -08008121 if (!framebuffers_buf) {
8122 _exception = 1;
8123 _exceptionType = "java/lang/IllegalArgumentException";
8124 _exceptionMessage = "framebuffers == null";
8125 goto exit;
8126 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008127 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008128 if (_remaining < n) {
8129 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008130 _exceptionType = "java/lang/IllegalArgumentException";
8131 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008132 goto exit;
8133 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008134 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008135 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008136 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
8137 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008138 glGenFramebuffersOES(
8139 (GLint)n,
8140 (GLuint *)framebuffers
8141 );
8142
8143exit:
8144 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008145 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008146 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008147 if (_exception) {
8148 jniThrowException(_env, _exceptionType, _exceptionMessage);
8149 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008150}
8151
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008152/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008153static void
8154android_glGenRenderbuffersOES__I_3II
8155 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008156 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008157 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008158 "glGenRenderbuffersOES");
8159 return;
8160 }
8161 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008162 const char * _exceptionType = NULL;
8163 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008164 GLuint *renderbuffers_base = (GLuint *) 0;
8165 jint _remaining;
8166 GLuint *renderbuffers = (GLuint *) 0;
8167
8168 if (!renderbuffers_ref) {
8169 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008170 _exceptionType = "java/lang/IllegalArgumentException";
8171 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008172 goto exit;
8173 }
8174 if (offset < 0) {
8175 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008176 _exceptionType = "java/lang/IllegalArgumentException";
8177 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008178 goto exit;
8179 }
8180 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
8181 if (_remaining < n) {
8182 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008183 _exceptionType = "java/lang/IllegalArgumentException";
8184 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008185 goto exit;
8186 }
8187 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008188 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008189 renderbuffers = renderbuffers_base + offset;
8190
8191 glGenRenderbuffersOES(
8192 (GLint)n,
8193 (GLuint *)renderbuffers
8194 );
8195
8196exit:
8197 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008198 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008199 _exception ? JNI_ABORT: 0);
8200 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008201 if (_exception) {
8202 jniThrowException(_env, _exceptionType, _exceptionMessage);
8203 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008204}
8205
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008206/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008207static void
8208android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
8209 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008210 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008211 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008212 "glGenRenderbuffersOES");
8213 return;
8214 }
8215 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008216 const char * _exceptionType = NULL;
8217 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008218 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008219 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008220 jint _remaining;
8221 GLuint *renderbuffers = (GLuint *) 0;
8222
Romain Guy84cac202016-12-05 12:26:02 -08008223 if (!renderbuffers_buf) {
8224 _exception = 1;
8225 _exceptionType = "java/lang/IllegalArgumentException";
8226 _exceptionMessage = "renderbuffers == null";
8227 goto exit;
8228 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008229 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008230 if (_remaining < n) {
8231 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008232 _exceptionType = "java/lang/IllegalArgumentException";
8233 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008234 goto exit;
8235 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008236 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008237 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008238 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
8239 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008240 glGenRenderbuffersOES(
8241 (GLint)n,
8242 (GLuint *)renderbuffers
8243 );
8244
8245exit:
8246 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008247 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008248 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008249 if (_exception) {
8250 jniThrowException(_env, _exceptionType, _exceptionMessage);
8251 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008252}
8253
8254/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8255static void
8256android_glGetFramebufferAttachmentParameterivOES__III_3II
8257 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008258 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008259 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008260 "glGetFramebufferAttachmentParameterivOES");
8261 return;
8262 }
8263 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008264 const char * _exceptionType = NULL;
8265 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008266 GLint *params_base = (GLint *) 0;
8267 jint _remaining;
8268 GLint *params = (GLint *) 0;
8269
8270 if (!params_ref) {
8271 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008272 _exceptionType = "java/lang/IllegalArgumentException";
8273 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008274 goto exit;
8275 }
8276 if (offset < 0) {
8277 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008278 _exceptionType = "java/lang/IllegalArgumentException";
8279 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008280 goto exit;
8281 }
8282 _remaining = _env->GetArrayLength(params_ref) - offset;
8283 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008284 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008285 params = params_base + offset;
8286
8287 glGetFramebufferAttachmentParameterivOES(
8288 (GLint)target,
8289 (GLint)attachment,
8290 (GLint)pname,
8291 (GLint *)params
8292 );
8293
8294exit:
8295 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008296 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008297 _exception ? JNI_ABORT: 0);
8298 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008299 if (_exception) {
8300 jniThrowException(_env, _exceptionType, _exceptionMessage);
8301 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008302}
8303
8304/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8305static void
8306android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
8307 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008308 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008309 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008310 "glGetFramebufferAttachmentParameterivOES");
8311 return;
8312 }
Romain Guy84cac202016-12-05 12:26:02 -08008313 jint _exception = 0;
8314 const char * _exceptionType = NULL;
8315 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008316 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008317 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008318 jint _remaining;
8319 GLint *params = (GLint *) 0;
8320
Romain Guy84cac202016-12-05 12:26:02 -08008321 if (!params_buf) {
8322 _exception = 1;
8323 _exceptionType = "java/lang/IllegalArgumentException";
8324 _exceptionMessage = "params == null";
8325 goto exit;
8326 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008327 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008328 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008329 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008330 params = (GLint *) (_paramsBase + _bufferOffset);
8331 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008332 glGetFramebufferAttachmentParameterivOES(
8333 (GLint)target,
8334 (GLint)attachment,
8335 (GLint)pname,
8336 (GLint *)params
8337 );
Romain Guy84cac202016-12-05 12:26:02 -08008338
8339exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008340 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008341 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8342 }
8343 if (_exception) {
8344 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008345 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008346}
8347
8348/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8349static void
8350android_glGetRenderbufferParameterivOES__II_3II
8351 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008352 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008353 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008354 "glGetRenderbufferParameterivOES");
8355 return;
8356 }
8357 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008358 const char * _exceptionType = NULL;
8359 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008360 GLint *params_base = (GLint *) 0;
8361 jint _remaining;
8362 GLint *params = (GLint *) 0;
8363
8364 if (!params_ref) {
8365 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008366 _exceptionType = "java/lang/IllegalArgumentException";
8367 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008368 goto exit;
8369 }
8370 if (offset < 0) {
8371 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008372 _exceptionType = "java/lang/IllegalArgumentException";
8373 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008374 goto exit;
8375 }
8376 _remaining = _env->GetArrayLength(params_ref) - offset;
8377 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008378 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008379 params = params_base + offset;
8380
8381 glGetRenderbufferParameterivOES(
8382 (GLint)target,
8383 (GLint)pname,
8384 (GLint *)params
8385 );
8386
8387exit:
8388 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008389 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008390 _exception ? JNI_ABORT: 0);
8391 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008392 if (_exception) {
8393 jniThrowException(_env, _exceptionType, _exceptionMessage);
8394 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008395}
8396
8397/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8398static void
8399android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
8400 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008401 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008402 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008403 "glGetRenderbufferParameterivOES");
8404 return;
8405 }
Romain Guy84cac202016-12-05 12:26:02 -08008406 jint _exception = 0;
8407 const char * _exceptionType = NULL;
8408 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008409 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008410 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008411 jint _remaining;
8412 GLint *params = (GLint *) 0;
8413
Romain Guy84cac202016-12-05 12:26:02 -08008414 if (!params_buf) {
8415 _exception = 1;
8416 _exceptionType = "java/lang/IllegalArgumentException";
8417 _exceptionMessage = "params == null";
8418 goto exit;
8419 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008420 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008421 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008422 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008423 params = (GLint *) (_paramsBase + _bufferOffset);
8424 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008425 glGetRenderbufferParameterivOES(
8426 (GLint)target,
8427 (GLint)pname,
8428 (GLint *)params
8429 );
Romain Guy84cac202016-12-05 12:26:02 -08008430
8431exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008432 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008433 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8434 }
8435 if (_exception) {
8436 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008437 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008438}
8439
8440/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8441static void
8442android_glGetTexGenfv__II_3FI
8443 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008444 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008445 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008446 "glGetTexGenfv");
8447 return;
8448 }
8449 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008450 const char * _exceptionType = NULL;
8451 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008452 GLfloat *params_base = (GLfloat *) 0;
8453 jint _remaining;
8454 GLfloat *params = (GLfloat *) 0;
8455
8456 if (!params_ref) {
8457 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008458 _exceptionType = "java/lang/IllegalArgumentException";
8459 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008460 goto exit;
8461 }
8462 if (offset < 0) {
8463 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008464 _exceptionType = "java/lang/IllegalArgumentException";
8465 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008466 goto exit;
8467 }
8468 _remaining = _env->GetArrayLength(params_ref) - offset;
8469 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008470 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008471 params = params_base + offset;
8472
8473 glGetTexGenfv(
8474 (GLint)coord,
8475 (GLint)pname,
8476 (GLfloat *)params
8477 );
8478
8479exit:
8480 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008481 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008482 _exception ? JNI_ABORT: 0);
8483 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008484 if (_exception) {
8485 jniThrowException(_env, _exceptionType, _exceptionMessage);
8486 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008487}
8488
8489/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8490static void
8491android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
8492 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008493 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008494 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008495 "glGetTexGenfv");
8496 return;
8497 }
Romain Guy84cac202016-12-05 12:26:02 -08008498 jint _exception = 0;
8499 const char * _exceptionType = NULL;
8500 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008501 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008502 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008503 jint _remaining;
8504 GLfloat *params = (GLfloat *) 0;
8505
Romain Guy84cac202016-12-05 12:26:02 -08008506 if (!params_buf) {
8507 _exception = 1;
8508 _exceptionType = "java/lang/IllegalArgumentException";
8509 _exceptionMessage = "params == null";
8510 goto exit;
8511 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008512 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008513 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008514 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008515 params = (GLfloat *) (_paramsBase + _bufferOffset);
8516 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008517 glGetTexGenfv(
8518 (GLint)coord,
8519 (GLint)pname,
8520 (GLfloat *)params
8521 );
Romain Guy84cac202016-12-05 12:26:02 -08008522
8523exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008524 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008525 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8526 }
8527 if (_exception) {
8528 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008529 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008530}
8531
8532/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8533static void
8534android_glGetTexGeniv__II_3II
8535 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008536 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008537 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008538 "glGetTexGeniv");
8539 return;
8540 }
8541 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008542 const char * _exceptionType = NULL;
8543 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008544 GLint *params_base = (GLint *) 0;
8545 jint _remaining;
8546 GLint *params = (GLint *) 0;
8547
8548 if (!params_ref) {
8549 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008550 _exceptionType = "java/lang/IllegalArgumentException";
8551 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008552 goto exit;
8553 }
8554 if (offset < 0) {
8555 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008556 _exceptionType = "java/lang/IllegalArgumentException";
8557 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008558 goto exit;
8559 }
8560 _remaining = _env->GetArrayLength(params_ref) - offset;
8561 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008562 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008563 params = params_base + offset;
8564
8565 glGetTexGeniv(
8566 (GLint)coord,
8567 (GLint)pname,
8568 (GLint *)params
8569 );
8570
8571exit:
8572 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008573 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008574 _exception ? JNI_ABORT: 0);
8575 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008576 if (_exception) {
8577 jniThrowException(_env, _exceptionType, _exceptionMessage);
8578 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008579}
8580
8581/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8582static void
8583android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8584 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008585 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008586 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008587 "glGetTexGeniv");
8588 return;
8589 }
Romain Guy84cac202016-12-05 12:26:02 -08008590 jint _exception = 0;
8591 const char * _exceptionType = NULL;
8592 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008593 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008594 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008595 jint _remaining;
8596 GLint *params = (GLint *) 0;
8597
Romain Guy84cac202016-12-05 12:26:02 -08008598 if (!params_buf) {
8599 _exception = 1;
8600 _exceptionType = "java/lang/IllegalArgumentException";
8601 _exceptionMessage = "params == null";
8602 goto exit;
8603 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008604 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008605 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008606 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008607 params = (GLint *) (_paramsBase + _bufferOffset);
8608 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008609 glGetTexGeniv(
8610 (GLint)coord,
8611 (GLint)pname,
8612 (GLint *)params
8613 );
Romain Guy84cac202016-12-05 12:26:02 -08008614
8615exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008616 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008617 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8618 }
8619 if (_exception) {
8620 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008621 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008622}
8623
8624/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8625static void
8626android_glGetTexGenxv__II_3II
8627 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008628 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008629 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008630 "glGetTexGenxv");
8631 return;
8632 }
8633 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008634 const char * _exceptionType = NULL;
8635 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008636 GLint *params_base = (GLint *) 0;
8637 jint _remaining;
8638 GLint *params = (GLint *) 0;
8639
8640 if (!params_ref) {
8641 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008642 _exceptionType = "java/lang/IllegalArgumentException";
8643 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008644 goto exit;
8645 }
8646 if (offset < 0) {
8647 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008648 _exceptionType = "java/lang/IllegalArgumentException";
8649 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008650 goto exit;
8651 }
8652 _remaining = _env->GetArrayLength(params_ref) - offset;
8653 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008654 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008655 params = params_base + offset;
8656
8657 glGetTexGenxv(
8658 (GLint)coord,
8659 (GLint)pname,
8660 (GLint *)params
8661 );
8662
8663exit:
8664 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008665 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008666 _exception ? JNI_ABORT: 0);
8667 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008668 if (_exception) {
8669 jniThrowException(_env, _exceptionType, _exceptionMessage);
8670 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008671}
8672
8673/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8674static void
8675android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8676 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008677 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008678 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008679 "glGetTexGenxv");
8680 return;
8681 }
Romain Guy84cac202016-12-05 12:26:02 -08008682 jint _exception = 0;
8683 const char * _exceptionType = NULL;
8684 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008685 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008686 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008687 jint _remaining;
8688 GLint *params = (GLint *) 0;
8689
Romain Guy84cac202016-12-05 12:26:02 -08008690 if (!params_buf) {
8691 _exception = 1;
8692 _exceptionType = "java/lang/IllegalArgumentException";
8693 _exceptionMessage = "params == null";
8694 goto exit;
8695 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008696 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008697 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008698 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008699 params = (GLint *) (_paramsBase + _bufferOffset);
8700 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008701 glGetTexGenxv(
8702 (GLint)coord,
8703 (GLint)pname,
8704 (GLint *)params
8705 );
Romain Guy84cac202016-12-05 12:26:02 -08008706
8707exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008708 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008709 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8710 }
8711 if (_exception) {
8712 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008713 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008714}
8715
8716/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8717static jboolean
8718android_glIsFramebufferOES__I
8719 (JNIEnv *_env, jobject _this, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008720 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008721 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008722 "glIsFramebufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008723 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008724 }
8725 GLboolean _returnValue = JNI_FALSE;
8726 _returnValue = glIsFramebufferOES(
8727 (GLint)framebuffer
8728 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008729 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008730}
8731
8732/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8733static jboolean
8734android_glIsRenderbufferOES__I
8735 (JNIEnv *_env, jobject _this, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008736 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008737 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008738 "glIsRenderbufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008739 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008740 }
8741 GLboolean _returnValue = JNI_FALSE;
8742 _returnValue = glIsRenderbufferOES(
8743 (GLint)renderbuffer
8744 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008745 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008746}
8747
8748/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8749static void
8750android_glRenderbufferStorageOES__IIII
8751 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008752 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008753 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008754 "glRenderbufferStorageOES");
8755 return;
8756 }
8757 glRenderbufferStorageOES(
8758 (GLint)target,
8759 (GLint)internalformat,
8760 (GLint)width,
8761 (GLint)height
8762 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008763}
8764
8765/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8766static void
8767android_glTexGenf__IIF
8768 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008769 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008770 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008771 "glTexGenf");
8772 return;
8773 }
8774 glTexGenf(
8775 (GLint)coord,
8776 (GLint)pname,
8777 (GLfloat)param
8778 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008779}
8780
8781/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8782static void
8783android_glTexGenfv__II_3FI
8784 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008785 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008786 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008787 "glTexGenfv");
8788 return;
8789 }
8790 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008791 const char * _exceptionType = NULL;
8792 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008793 GLfloat *params_base = (GLfloat *) 0;
8794 jint _remaining;
8795 GLfloat *params = (GLfloat *) 0;
8796
8797 if (!params_ref) {
8798 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008799 _exceptionType = "java/lang/IllegalArgumentException";
8800 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008801 goto exit;
8802 }
8803 if (offset < 0) {
8804 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008805 _exceptionType = "java/lang/IllegalArgumentException";
8806 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008807 goto exit;
8808 }
8809 _remaining = _env->GetArrayLength(params_ref) - offset;
8810 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008811 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008812 params = params_base + offset;
8813
8814 glTexGenfv(
8815 (GLint)coord,
8816 (GLint)pname,
8817 (GLfloat *)params
8818 );
8819
8820exit:
8821 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008822 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008823 _exception ? JNI_ABORT: 0);
8824 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008825 if (_exception) {
8826 jniThrowException(_env, _exceptionType, _exceptionMessage);
8827 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008828}
8829
8830/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8831static void
8832android_glTexGenfv__IILjava_nio_FloatBuffer_2
8833 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008834 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008835 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008836 "glTexGenfv");
8837 return;
8838 }
Romain Guy84cac202016-12-05 12:26:02 -08008839 jint _exception = 0;
8840 const char * _exceptionType = NULL;
8841 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008842 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008843 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008844 jint _remaining;
8845 GLfloat *params = (GLfloat *) 0;
8846
Romain Guy84cac202016-12-05 12:26:02 -08008847 if (!params_buf) {
8848 _exception = 1;
8849 _exceptionType = "java/lang/IllegalArgumentException";
8850 _exceptionMessage = "params == null";
8851 goto exit;
8852 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008853 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008854 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008855 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008856 params = (GLfloat *) (_paramsBase + _bufferOffset);
8857 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008858 glTexGenfv(
8859 (GLint)coord,
8860 (GLint)pname,
8861 (GLfloat *)params
8862 );
Romain Guy84cac202016-12-05 12:26:02 -08008863
8864exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008865 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008866 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8867 }
8868 if (_exception) {
8869 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008870 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008871}
8872
8873/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8874static void
8875android_glTexGeni__III
8876 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008877 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008878 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008879 "glTexGeni");
8880 return;
8881 }
8882 glTexGeni(
8883 (GLint)coord,
8884 (GLint)pname,
8885 (GLint)param
8886 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008887}
8888
8889/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8890static void
8891android_glTexGeniv__II_3II
8892 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008893 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008894 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008895 "glTexGeniv");
8896 return;
8897 }
8898 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008899 const char * _exceptionType = NULL;
8900 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008901 GLint *params_base = (GLint *) 0;
8902 jint _remaining;
8903 GLint *params = (GLint *) 0;
8904
8905 if (!params_ref) {
8906 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008907 _exceptionType = "java/lang/IllegalArgumentException";
8908 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008909 goto exit;
8910 }
8911 if (offset < 0) {
8912 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008913 _exceptionType = "java/lang/IllegalArgumentException";
8914 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008915 goto exit;
8916 }
8917 _remaining = _env->GetArrayLength(params_ref) - offset;
8918 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008919 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008920 params = params_base + offset;
8921
8922 glTexGeniv(
8923 (GLint)coord,
8924 (GLint)pname,
8925 (GLint *)params
8926 );
8927
8928exit:
8929 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008930 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008931 _exception ? JNI_ABORT: 0);
8932 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008933 if (_exception) {
8934 jniThrowException(_env, _exceptionType, _exceptionMessage);
8935 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008936}
8937
8938/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8939static void
8940android_glTexGeniv__IILjava_nio_IntBuffer_2
8941 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008942 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008943 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008944 "glTexGeniv");
8945 return;
8946 }
Romain Guy84cac202016-12-05 12:26:02 -08008947 jint _exception = 0;
8948 const char * _exceptionType = NULL;
8949 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008950 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008951 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008952 jint _remaining;
8953 GLint *params = (GLint *) 0;
8954
Romain Guy84cac202016-12-05 12:26:02 -08008955 if (!params_buf) {
8956 _exception = 1;
8957 _exceptionType = "java/lang/IllegalArgumentException";
8958 _exceptionMessage = "params == null";
8959 goto exit;
8960 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008961 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008962 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008963 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008964 params = (GLint *) (_paramsBase + _bufferOffset);
8965 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008966 glTexGeniv(
8967 (GLint)coord,
8968 (GLint)pname,
8969 (GLint *)params
8970 );
Romain Guy84cac202016-12-05 12:26:02 -08008971
8972exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008973 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008974 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8975 }
8976 if (_exception) {
8977 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008978 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008979}
8980
8981/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8982static void
8983android_glTexGenx__III
8984 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008985 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008986 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008987 "glTexGenx");
8988 return;
8989 }
8990 glTexGenx(
8991 (GLint)coord,
8992 (GLint)pname,
8993 (GLint)param
8994 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008995}
8996
8997/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8998static void
8999android_glTexGenxv__II_3II
9000 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009001 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009002 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009003 "glTexGenxv");
9004 return;
9005 }
9006 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08009007 const char * _exceptionType = NULL;
9008 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009009 GLint *params_base = (GLint *) 0;
9010 jint _remaining;
9011 GLint *params = (GLint *) 0;
9012
9013 if (!params_ref) {
9014 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009015 _exceptionType = "java/lang/IllegalArgumentException";
9016 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009017 goto exit;
9018 }
9019 if (offset < 0) {
9020 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009021 _exceptionType = "java/lang/IllegalArgumentException";
9022 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009023 goto exit;
9024 }
9025 _remaining = _env->GetArrayLength(params_ref) - offset;
9026 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009027 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009028 params = params_base + offset;
9029
9030 glTexGenxv(
9031 (GLint)coord,
9032 (GLint)pname,
9033 (GLint *)params
9034 );
9035
9036exit:
9037 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009038 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009039 _exception ? JNI_ABORT: 0);
9040 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009041 if (_exception) {
9042 jniThrowException(_env, _exceptionType, _exceptionMessage);
9043 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009044}
9045
9046/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
9047static void
9048android_glTexGenxv__IILjava_nio_IntBuffer_2
9049 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009050 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009051 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009052 "glTexGenxv");
9053 return;
9054 }
Romain Guy84cac202016-12-05 12:26:02 -08009055 jint _exception = 0;
9056 const char * _exceptionType = NULL;
9057 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009058 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009059 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009060 jint _remaining;
9061 GLint *params = (GLint *) 0;
9062
Romain Guy84cac202016-12-05 12:26:02 -08009063 if (!params_buf) {
9064 _exception = 1;
9065 _exceptionType = "java/lang/IllegalArgumentException";
9066 _exceptionMessage = "params == null";
9067 goto exit;
9068 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009069 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009070 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009071 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009072 params = (GLint *) (_paramsBase + _bufferOffset);
9073 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009074 glTexGenxv(
9075 (GLint)coord,
9076 (GLint)pname,
9077 (GLint *)params
9078 );
Romain Guy84cac202016-12-05 12:26:02 -08009079
9080exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009081 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08009082 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
9083 }
9084 if (_exception) {
9085 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009086 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009087}
9088
9089static const char *classPathName = "com/google/android/gles_jni/GLImpl";
9090
Daniel Micay76f6a862015-09-19 17:31:01 -04009091static const JNINativeMethod methods[] = {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009092{"_nativeClassInit", "()V", (void*)nativeClassInit },
9093{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
9094{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
9095{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
9096{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
9097{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
9098{"glClear", "(I)V", (void *) android_glClear__I },
9099{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
9100{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
9101{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
9102{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
9103{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
9104{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
9105{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
9106{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
9107{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
9108{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
9109{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
9110{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9111{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
9112{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
9113{"glCullFace", "(I)V", (void *) android_glCullFace__I },
9114{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
9115{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
9116{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
9117{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
9118{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
9119{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
9120{"glDisable", "(I)V", (void *) android_glDisable__I },
9121{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
9122{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
9123{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
9124{"glEnable", "(I)V", (void *) android_glEnable__I },
9125{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
9126{"glFinish", "()V", (void *) android_glFinish__ },
9127{"glFlush", "()V", (void *) android_glFlush__ },
9128{"glFogf", "(IF)V", (void *) android_glFogf__IF },
9129{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
9130{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
9131{"glFogx", "(II)V", (void *) android_glFogx__II },
9132{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
9133{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
9134{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
9135{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
9136{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
9137{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
9138{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
9139{"glGetError", "()I", (void *) android_glGetError__ },
9140{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
9141{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
9142{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
9143{"glHint", "(II)V", (void *) android_glHint__II },
9144{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
9145{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
9146{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
9147{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
9148{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
9149{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
9150{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
9151{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
9152{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
9153{"glLightx", "(III)V", (void *) android_glLightx__III },
9154{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
9155{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
9156{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
9157{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
9158{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
9159{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
9160{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
9161{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
9162{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
9163{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
9164{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
9165{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
9166{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
9167{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
9168{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
9169{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
9170{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
9171{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
9172{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
9173{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
9174{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
9175{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
9176{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
9177{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
9178{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
9179{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
9180{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
9181{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
9182{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
9183{"glPointSize", "(F)V", (void *) android_glPointSize__F },
9184{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
9185{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
9186{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
9187{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
9188{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
9189{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
9190{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
9191{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
9192{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
9193{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
9194{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
9195{"glScalex", "(III)V", (void *) android_glScalex__III },
9196{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
9197{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
9198{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
9199{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
9200{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
9201{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
9202{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
9203{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
9204{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
9205{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
9206{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
9207{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
9208{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
9209{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
9210{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
9211{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9212{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
9213{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
9214{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
9215{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
9216{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
9217{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
9218{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
9219{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
9220{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
9221{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
9222{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
9223{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
9224{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
9225{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
9226{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
9227{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
9228{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
9229{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
9230{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
9231{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
9232{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
9233{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
9234{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
9235{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
9236{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
9237{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
9238{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
9239{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
9240{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
9241{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
9242{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
9243{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
9244{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
9245{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
9246{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
9247{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
9248{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
9249{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
9250{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
9251{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
9252{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
9253{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
9254{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
9255{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
9256{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
9257{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
9258{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
9259{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
9260{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
9261{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
9262{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
9263{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
9264{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
9265{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
9266{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
9267{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
9268{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
9269{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
9270{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
9271{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009272{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009273{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
9274{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
9275{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
9276{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
9277{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
9278{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
9279{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
9280{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
9281{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
9282{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
9283{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
9284{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
9285{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
9286{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
9287{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
9288{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
9289{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
9290{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
9291{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
9292{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
9293{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
9294{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
9295{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
9296{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
9297{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
9298{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009299{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009300{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009301{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009302{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
9303{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
9304{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
9305{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
9306{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
9307{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
9308{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
9309{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
9310{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
9311{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
9312{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9313{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
9314{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
9315{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
9316{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
9317{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
9318{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
9319{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9320{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
9321{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
9322{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
9323{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
9324{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
9325{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
9326{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
9327{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
9328{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
9329{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
9330{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
9331{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
9332{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
9333{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
9334{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
9335{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
9336{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
9337{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
9338{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
9339{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
9340{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
9341{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
9342};
9343
9344int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
9345{
9346 int err;
9347 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
9348 return err;
9349}